BB.LevelButton.Focus C# (CSharp) Method

Focus() public method

public Focus ( bool val ) : void
val bool
return void
        public void Focus(bool val)
        {
            if (mIsFocused == val)
                return;

            if (IsLocked)
            {
                Debug.LogError("locked.");
                return;
            }

            mIsFocused = val;
            _animator.SetTrigger(val ? "Focus" : "Defocus");
        }

Usage Example

Example #1
0
        public void OnLevelSelected(LevelButton button)
        {
            if (_selectedButton)
            {
                _selectedButton.Focus(false);
                _animator.SetTrigger("HideDifficulty");
            }

            _selectedButton = button;
            _selectedButton.Focus(true);

            _animator.SetTrigger("ShowDifficulty");
        }
All Usage Examples Of BB.LevelButton::Focus