private bool CheckChosenNum(int numToCheck) { for (int i = 0; i < chosenScenesListLength; i++) { if (numToCheck == levelTransitionManager.GetChosenScenesList()[i]) { return(false); } } return(true); }
void Update() { playerController = FindObjectOfType <PlayerController>(); characterSelector = FindObjectOfType <CharacterSelector>(); levelTransitionManager = FindObjectOfType <LevelTransitionManager>(); if (characterSelector != null) //checks if characterSelector is active/not destroyed { if (characterSelector.GetCharacterActive()) //checks if the character is active { playerHealthManager = characterSelector.GetCharacterObject().GetComponent <PlayerHealthManager>(); //gets the current player instance's health manager } } scenesListLength = levelTransitionManager.GetScenesList().Count; chosenScenesListLength = levelTransitionManager.GetChosenScenesList().Count; }