private IEnumerator EnemyMove() { isMove = true; while (!isDead) { if (isMove) { distanceTravelled += speed * 0.01f * Time.timeScale; transform.position = pathCreator.path.GetPointAtDistance(distanceTravelled, EndOfPathInstruction.Stop); } if (distanceTravelled > pathCreator.path.length) { int BrokeThroughEnemy = MainController.curEnemyBrokeThrough - 1; MainController.SetBrokeThroughEnemy(BrokeThroughEnemy); if (blockByOperator != null) { blockByOperator.BlockingRemove(this); } transform.position = new Vector3(9999f, 9999f, 9999f); isMove = false; isDead = true; } yield return(new WaitForSeconds(0.03f)); } yield return(null); }