private void Awake() { playerCharacterController = FindObjectOfType <PlayerCharacterController>(); playerCharacter = FindObjectOfType <PlayerCharacter>(); raceGameController = FindObjectOfType <RaceGameController>(); flappyController = FindObjectOfType <GameController>(); scoreBoardController = FindObjectOfType <ScoreBoardController>(); fishFightGameController = FindObjectOfType <FishFightGameController>(); avoidObstaclesGameController = FindObjectOfType <avoidObstaclesGameController>(); ClearParametr(); }
private void Awake() { if (instance == null) { instance = this; _audioSource = GetComponent <AudioSource>(); } else if (instance != this) { Destroy(gameObject); } // debug purposes if (GameState.Instance.GetAllPlayers().Length == 0) { GameState.Instance.AddPlayers(4); } }