Quantcast
Channel: Unity Forum
Viewing all articles
Browse latest Browse all 1466670

How do I stop a Coroutine

$
0
0
So I have this Coroutine:
Code (CSharp):
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class EnemySpawner : MonoBehaviour
  6. {
  7.     [SerializeField]
  8.     private GameObject Tatar1Prefab;
  9.  
  10.     [SerializeField]
  11.     private float Tatar1Interval = 3f;
  12.  
  13.  
  14.  
  15.     // Start is called before the first frame update
  16.     void Start()
  17.     {
  18.         StartCoroutine(spawnEnemy(Tatar1Interval, Tatar1Prefab));
  19.     }
  20.    
  21.  
  22.     private IEnumerator spawnEnemy(float interval,...
How do I stop a Coroutine

Viewing all articles
Browse latest Browse all 1466670

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>