public void UpdateLifeSlider() { lifeSlider.SetMaximalValue(maxHitPoints); lifeSlider.SetCurrentValue(hitPoints); if (hitPoints < maxHitPoints) { lifeSlider.Show(); } else { lifeSlider.Hide(); } }
IEnumerator _Generate() { loadingBar.Show(); loadingBar.SetMaximalValue(9); loadingBar.SetCurrentValue(0); ClearEverything(); AddRooms(); loadingBar.SetCurrentValue(1); yield return(new WaitForSeconds(generationTime)); loadingBar.SetCurrentValue(2); FixRoomPositions(); loadingBar.SetCurrentValue(3); yield return(StartCoroutine(_FindPaths())); loadingBar.SetCurrentValue(4); yield return(StartCoroutine(_MakeCorridors())); loadingBar.SetCurrentValue(5); yield return(StartCoroutine(_FillRooms())); loadingBar.SetCurrentValue(6); ClearRooms(); loadingBar.SetCurrentValue(7); yield return(StartCoroutine(_AddWalls())); loadingBar.SetCurrentValue(8); yield return(StartCoroutine(_TriggerSpawners())); loadingBar.SetCurrentValue(9); GameController.Instance.OnLevelGenerated(); loadingBar.Hide(); }