private void Awake() { if (_instance != null) { Destroy(gameObject); } else { _instance = this; } }
void Start() { player = GameObject.FindWithTag("Player"); facingRight = true; soundManager = FindObjectOfType <SoundManager>(); levelTransition = FindObjectOfType <LevelTransition>(); levelCompleted = FindObjectOfType <LevelCompleted>(); gameCompleted = FindObjectOfType <GameCompleted>(); gameOver = FindObjectOfType <GameOver>(); playerDied = FindObjectOfType <PlayerDied>(); collectiblesManager = FindObjectOfType <CollectiblesManager>(); lifeManager = FindObjectOfType <LifeManager>(); saveData = FindObjectOfType <SaveData>(); rigidBody = GetComponent <Rigidbody2D>(); animator = GetComponent <Animator>(); }
void Start() { pauseMenu.SetActive(false); collectiblesManager = FindObjectOfType <CollectiblesManager>(); }
void Start() { lifeManager = FindObjectOfType <LifeManager>(); collectiblesManager = FindObjectOfType <CollectiblesManager>(); }
void Start() { playerDied.SetActive(false); collectiblesManager = FindObjectOfType <CollectiblesManager>(); }
void Start() { gameOver.SetActive(false); lifeManager = FindObjectOfType <LifeManager>(); collectiblesManager = FindObjectOfType <CollectiblesManager>(); }