コード例 #1
0
 private bool CheckChosenNum(int numToCheck)
 {
     for (int i = 0; i < chosenScenesListLength; i++)
     {
         if (numToCheck == levelTransitionManager.GetChosenScenesList()[i])
         {
             return(false);
         }
     }
     return(true);
 }
コード例 #2
0
    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;
    }