public void onDispose() { managerPool = null; EnemySpawnPosition = null; PlayerSpawnPosition = null; managerCorountine = null; enemyInWave.Clear(); }
public void OnAwake() { EnemySpawnPosition = GameObject.FindGameObjectWithTag("SpawnEnemy"); PlayerSpawnPosition = GameObject.FindGameObjectWithTag("SpawnPlayer"); managerPool = ToolBox.Get <ManagerPool>(); ToolBox.Get <ManagerEvent>().Subscribe(this); LaserWall = GameObject.Instantiate(LaserWall.gameObject).transform; managerCorountine = ToolBox.Get <ManagerCorountine>().CoroutineComponent; StartGame(); }
public void OnAwake() { ToolBox.Get <ManagerEvent>().Subscribe(this); managerCorountine = ToolBox.Get <ManagerCorountine>().CoroutineComponent; var canvas = GameObject.Find("Canvas"); newWaveText = GameObject.Instantiate(newWaveTextPrefab, canvas.transform); diedMenu = GameObject.Instantiate(diedMenuPrefab, canvas.transform); diedMenu.SetActive(false); newWaveText.SetActive(false); var healthBar = GameObject.Instantiate(HealthBarBrefab, canvas.transform).GetComponent <Slider>(); healthBar.maxValue = PlayerHP.MaxHealth; healthBar.value = PlayerHP.Health; managerCorountine.StartCoroutine(HealthBarChange(healthBar)); }
public void onDispose() { CoroutineComponent.StopAllCoroutines(); Component.Destroy(CoroutineComponent); CoroutineComponent = null; }
public void OnAwake() { CoroutineComponent = GameObject.Find("[SETUP]").AddComponent <ManagerCoroutineComponent>(); }