private void Show(float delay = 0, bool removeDiscrete = false) { if (IsOpen) { return; } if (_discrete) { DiscreteAnimation .SetAlpha(0.2f, 1f) .SetScale(Vector3.one * 0.8f, Vector3.one); } else { DiscreteAnimation .SetAlpha(1f, 1f) .SetScale(Vector3.one, Vector3.one); } if (removeDiscrete) { _discrete = false; } gameObject.SetActive(true); DiscreteAnimation.Play(delay); }
public void TurnDiscrete() { _discrete = true; DiscreteAnimation .SetAlpha(1f, 0.2f) .SetScale(MyTransform.localScale, Vector3.one * 0.8f); DiscreteAnimation.Play(); }
public void DiscreteButton() { if (_buttonHidden) { return; } if (_discrete) { return; } _discrete = true; DiscreteAnimation.Stop(); DiscreteAnimation.Play(); }
public void RemoveDiscreteButton() { if (_buttonHidden) { return; } if (!_discrete) { return; } _discrete = false; DiscreteAnimation.Stop(); DiscreteAnimation.Reverse(); }
private void Hide(float delay = 0) { DiscreteAnimation .SetAlpha(0f, 1f) .SetScale(Vector3.one * 0.8f, Vector3.one); float oldDelay = DiscreteAnimation.DelayToStart; DiscreteAnimation.DelayToStart = delay; DiscreteAnimation.Reverse(() => { DiscreteAnimation.DelayToStart = oldDelay; gameObject.SetActive(false); }); }