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; } }
public void RunSwitchScript(SwitchState state) { if (SwitchEvent != null) { SwitchEvent.Invoke(state); } }
public void OnPointerDown(PointerEventData eventData) { status = !status; SetImages(); OnSwitch.Invoke(Status); }
/// <summary> /// Changed this instance. /// </summary> protected virtual void Changed() { SetMarkPosition(); SetBackgroundColor(); OnValueChanged.Invoke(IsOn); }
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(); } }
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); }