Exemplo n.º 1
0
        private IEnumerator WaitForEndOfMusic()
        {
            while (_audioSource.isPlaying)
            {
                yield return(sec);
            }

            RandomShapeGenerator.StopGeneration();

            if (NetworkManager.Instance.YourID == 0)
            {
                _audioSource.clip = ScorePlayer1 > ScorePlayer2 ? _winClip : _looseClip;
            }
            else
            {
                _audioSource.clip = ScorePlayer1 > ScorePlayer2 ? _looseClip : _winClip;
            }

            _audioSource.Play();

            ScorePlayer1 = 0;
            ScorePlayer2 = 0;

            IsRunning = false;
        }
Exemplo n.º 2
0
        private void StartGame()
        {
            Debug.Log("[GameBehaviour] GameBehaviour().");

            _audioSource.clip = _musicClip;
            _audioSource.Play();

            RandomShapeGenerator.StartGeneration();
            UICentralManager.Instance.StartLookingScore();

            StartCoroutine(WaitForEndOfMusic());

            IsRunning = true;
        }
Exemplo n.º 3
0
 private void Awake()
 {
     _randomShapeShapeGenerator = FindObjectOfType <RandomShapeGenerator>();
     _audioSource = GetComponent <AudioSource>();
 }