Esempio n. 1
0
 private void Awake()
 {
     if (_instance != null && _instance != this)
     {
         Destroy(this.gameObject);
     }
     else
     {
         _instance = this;
     }
 }
Esempio n. 2
0
    //public void GameOver()
    //{

    //}

    //public void JumpedOverFox()
    //{

    //}



    // Start is called before the first frame update
    void Start()
    {
        chordSender  = GetComponentInChildren <ChordSender>();
        foxManager   = GetComponent <FoxManager>();
        chickenDying = GetComponent <AudioSource>();
        camPosition  = Camera.main.transform.position;
        camRotation  = Camera.main.transform.rotation;
        screenShake  = Camera.main.GetComponent <ScreenShake>();
        foxManager.SetFoxSpeed(defaultFoxSpeed);
        foxWaitTime = defaultFoxWaitTime;
        lives       = initialnumberOfLives;
        GetScores();
        gameState = GameState.begin;
    }