public void RestartLevel() { isLevelOngoing = false; StopAllCoroutines(); //PlaceablePool.Instance.ReclaimAllObjects(); //EnemyPool.Instance.ReclaimAllObjects(); ResetLevel(); LevelRestarted?.Invoke(); }
public IEnumerator RestartIEnum() { player.SetActive(false); yield return(new WaitForSeconds(1)); player.transform.position = new Vector2(PlayerstartPos.position.x, PlayerstartPos.position.y); player.GetComponent <BotHealth>().Carga = player.GetComponent <BotHealth>().Carga_max; player.SetActive(true); questmanager.GenerateQuest(Currentlevel); LevelRestarted?.Invoke(); startlevel(); CanPause = true; yield return(null); yield break; }