Ejemplo n.º 1
0
        protected override void Switch(bool turnOn)
        {
            if (m_ChildNodes.Count == 0)
            {
                mIsOpen = turnOn;
                SwitchEvent.Invoke(turnOn);
                return;
            }

            switch (SwitchTurnMode)
            {
            case TurnMode.TreeDownToTop:
            case TurnMode.TreeTopToDown:
            case TurnMode.TreeReverseTopToDown:
            case TurnMode.TreeReverseDownToTop:
                InvokeTreeMode(turnOn);
                break;

            case TurnMode.LayerTopToDown:
            case TurnMode.LayerReverseTopToDown:
                InvokeLayerTopToDown(turnOn);
                break;

            case TurnMode.LayerDownToTop:
            case TurnMode.LayerReverseDownToTop:
                InvokeLayerDownToTop(turnOn);
                break;
            }
        }
Ejemplo n.º 2
0
 public void RunSwitchScript(SwitchState state)
 {
     if (SwitchEvent != null)
     {
         SwitchEvent.Invoke(state);
     }
 }
Ejemplo n.º 3
0
    public void OnPointerDown(PointerEventData eventData)
    {
        status = !status;
        SetImages();

        OnSwitch.Invoke(Status);
    }
Ejemplo n.º 4
0
        /// <summary>
        /// Changed this instance.
        /// </summary>
        protected virtual void Changed()
        {
            SetMarkPosition();

            SetBackgroundColor();

            OnValueChanged.Invoke(IsOn);
        }
Ejemplo n.º 5
0
 protected override void ResetNodeState(bool turnOn)
 {
     if (turnOn)
     {
         OpenChildCount = m_ChildNodes.Count;
     }
     else
     {
         OpenChildCount = 0;
     }
     mIsOpen = turnOn;
     SwitchEvent.Invoke(IsOpen);
 }
    private void OnButtonClick()
    {
        _isOn = !_isOn;
        _onState.SetActive(_isOn);
        _offState.SetActive(!_isOn);

        if (_isOn && OnEvents != null)
        {
            OnEvents.Invoke();
        }
        else if (!_isOn && OffEvents != null)
        {
            OffEvents.Invoke();
        }
    }
Ejemplo n.º 7
0
 public void Select(Button button)
 {
     if (!slider)
     {
         return;
     }
     if (moveCoroutine != null)
     {
         StopCoroutine(moveCoroutine);
     }
     moveCoroutine = Move(slider.position, button.transform.position);
     StartCoroutine(moveCoroutine);
     currentIndex = button.transform.GetSiblingIndex();
     onSwitch.Invoke(currentIndex);
 }