Example #1
0
    private void Awake()
    {
        _streakCounter = FindObjectOfType <StreakCounter>();

        showStreak = streakUI.DOFade(1, .5f).From(0).Pause();

        closeStreak = streakUI.DOFade(0, .5f).OnComplete(() => streakUI.gameObject.SetActive(false)).Pause();
    }
Example #2
0
 private void Start()
 {
     _gameController  = FindObjectOfType <GameController>();
     _streakCounter   = FindObjectOfType <StreakCounter>();
     _levelController = FindObjectOfType <LevelController>();
     isAlive          = true;
     Health          += _levelController.HealthOfEnemiesMultiplication;
 }
Example #3
0
    void Awake()
    {
        _gameController = FindObjectOfType <GameController>();
        _rythmSounds    = FindObjectOfType <RythmSounds>();
        _streakCounter  = FindObjectOfType <StreakCounter>();
        Note1           = gameObject.transform.Find("Note1").gameObject;
        Note2           = gameObject.transform.Find("Note2").gameObject;
        Note3           = gameObject.transform.Find("Note3").gameObject;
        Note4           = gameObject.transform.Find("Note4").gameObject;
        Beat            = gameObject.transform.Find("Beat").gameObject;

        Note1Mat = (Material)Resources.Load("Note1Mat", typeof(Material));
        Note2Mat = (Material)Resources.Load("Note2Mat", typeof(Material));
        Note3Mat = (Material)Resources.Load("Note3Mat", typeof(Material));
        Note4Mat = (Material)Resources.Load("Note4Mat", typeof(Material));

        switch (note)
        {
        case (NoteNumbers.Note1):
            _noteSoundLoc = Note1;
            _noteMaterial = Note1Mat;
            break;

        case (NoteNumbers.Note2):
            _noteSoundLoc = Note2;
            _noteMaterial = Note2Mat;
            break;

        case (NoteNumbers.Note3):
            _noteSoundLoc = Note3;
            _noteMaterial = Note3Mat;
            break;

        case (NoteNumbers.Note4):
            _noteSoundLoc = Note4;
            _noteMaterial = Note4Mat;
            break;

        case (NoteNumbers.Beat):
            _noteSoundLoc = Beat;
            _noteMaterial = Note1Mat;
            break;
        }
        sound = _noteSoundLoc.GetComponent <AudioSource>();
        gameObject.GetComponent <MeshRenderer>().material = _noteMaterial;
    }