Answer the question
In order to leave comments, you need to log in
Why doesn't the coroutine stop and why does 1 mouse click count as 2?
public void ReDeletePlatforms(InputAction.CallbackContext context)
{
Debug.Log("Нажал");
StopCoroutine(platformsCreate.Spawning());
Debug.Log("Остановил корутину");
destroyPlatforms2 = GameObject.FindGameObjectsWithTag("Platform");
for (int i3 = 0; i3 < destroyPlatforms2.Length; i3++)
{
//Thread.Sleep(1000);
Instantiate(destroyPlatforms2[i3], destroyPlatforms2[i3].transform.position, Quaternion.identity);
destroyPlatforms2[i3].gameObject.tag = "PlatfomRealy";
BoxCollider2D boxCollider2D;
boxCollider2D = destroyPlatforms2[i3].GetComponent<BoxCollider2D>();
boxCollider2D.isTrigger = false;
Destroy(destroyPlatforms2[i3]);
}
StartCoroutine(platformsCreate.Spawning());
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question