private void Awake()
 {
     if (_instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         _instance = this;
     }
 }
Example #2
0
    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>();
    }
Example #3
0
 void Start()
 {
     pauseMenu.SetActive(false);
     collectiblesManager = FindObjectOfType <CollectiblesManager>();
 }
Example #4
0
 void Start()
 {
     lifeManager         = FindObjectOfType <LifeManager>();
     collectiblesManager = FindObjectOfType <CollectiblesManager>();
 }
Example #5
0
 void Start()
 {
     playerDied.SetActive(false);
     collectiblesManager = FindObjectOfType <CollectiblesManager>();
 }
Example #6
0
 void Start()
 {
     gameOver.SetActive(false);
     lifeManager         = FindObjectOfType <LifeManager>();
     collectiblesManager = FindObjectOfType <CollectiblesManager>();
 }