Inheritance: UnityEngine.MonoBehaviour
示例#1
0
        private void InitLevelButton(LevelButton button, Level level)
        {
            button.SetLevel(level);

            var clearState = UserLevelClear.Get(World, level);

            if (clearState.HasValue)
            {
                button.SetAsClear(clearState.Value);
            }
            else
            {
                var unlocked   = UserLevelClear.Unlocked;
                var shouldLock = true;

                if (unlocked.HasValue)
                {
                    var unlockedValue     = unlocked.Value;
                    var isCurrentUnlocked = unlockedValue.World == World && unlockedValue.Level == level;
                    shouldLock = !isCurrentUnlocked;
                }

                button.SetLock(shouldLock);
                button.SetAsNotCleared();
            }
        }
示例#2
0
        public void OnLevelSelected(LevelButton button)
        {
            if (_selectedButton)
            {
                _selectedButton.Focus(false);
                _animator.SetTrigger("HideDifficulty");
            }

            _selectedButton = button;
            _selectedButton.Focus(true);

            _animator.SetTrigger("ShowDifficulty");
        }
        public void OnLevelSelected(LevelButton button)
        {
            if (_selectedButton)
            {
                _selectedButton.Focus(false);
                _animator.SetTrigger("HideDifficulty");
            }

            _selectedButton = button;
            _selectedButton.Focus(true);

            _animator.SetTrigger("ShowDifficulty");
        }
        private void InitLevelButton(LevelButton button, Level level)
        {
            button.SetLevel(level);

            var clearState = UserLevelClear.Get(World, level);
            if (clearState.HasValue)
            {
                button.SetAsClear(clearState.Value);
            }
            else
            {
                var unlocked = UserLevelClear.Unlocked;
                var shouldLock = true;

                if (unlocked.HasValue)
                {
                    var unlockedValue = unlocked.Value;
                    var isCurrentUnlocked = unlockedValue.World == World && unlockedValue.Level == level;
                    shouldLock = !isCurrentUnlocked;
                }

                button.SetLock(shouldLock);
                button.SetAsNotCleared();
            }
        }