Esempio n. 1
0
        private void RevealLevels(int currentLevel)
        {
            // Instantiate adjacent levels
            var prevLevel = currentLevel <= 0 ? 0 : currentLevel - 1;
            var nextLevel = currentLevel >= _levels.Length - 1 ? _levels.Length - 1 : currentLevel + 1;

            var current = _levels[currentLevel];
            var prev    = _levels[prevLevel].GetComponent <PuzzleState>();
            var next    = _levels[nextLevel].GetComponent <PuzzleState>();

            prev.BoardEnabled = false;
            next.BoardEnabled = false;

            prev.InitSaved();
            next.InitSaved();

            var currentPuzzleInfo = current.GetComponentInChildren <PuzzleInfo>();
            var prevPuzzleInfo    = prev.GetComponentInChildren <PuzzleInfo>();
            var nextPuzzleInfo    = next.GetComponentInChildren <PuzzleInfo>();

            prevPuzzleInfo.Show();
            nextPuzzleInfo.Show();

            prevPuzzleInfo.Highlight(false);
            nextPuzzleInfo.Highlight(false);
            currentPuzzleInfo.Highlight(true);

            _gameAudio.Play(GameClip.LevelEnable);
        }
Esempio n. 2
0
        public void Play(GameClip clip, float delay = 0f, float volume = 1f, float startTime = 0f)
        {
            if (!enabled)
            {
                return;
            }

            _gameAudio.Play(clip, delay, volume, startTime);
        }