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

        if (transform.parent == null)
        {
            DontDestroyOnLoad(this);
        }
        a_s      = GetComponent <AudioSource>();
        a_s.clip = danger_music;
        if (SceneManager.GetActiveScene().buildIndex == 1)
        {
            a_s.clip = calm_music;
        }
        else
        {
            a_s.clip = danger_music;
        }
    }
Esempio n. 2
0
    // Start is called before the first frame update
    void Start()
    {
        music        = GetComponent <music_manager>();
        goalMontreal = GameObject.Find("GoalMontreal");
        goalToronto  = GameObject.Find("GoalToronto");
        pauseMenu    = GameObject.Find("Canvas");
        disk         = GameObject.Find("disk");

        montrealRenderer = montrealDefense.GetComponent <SpriteRenderer>();
        torontoRenderer  = torontoDefense.GetComponent <SpriteRenderer>();

        montrealAnimator = montrealCelebration.GetComponent <Animator>();
        torontoAnimator  = torontoCelebration.GetComponent <Animator>();
        SetDiskMontreal();
    }