public void OnExit(DoButton doButton) { _isOverButton = false; _tween.Kill(); _tween = doButton.Images[0].DOColor(_originalcolor, 0.42f); }
// On up is special... We call back to doButton to check for a clickEvent // That is, if Up happened when the mouse (or finger) was over the button... That's a CLICK. // doButton will Pop() the Stack and Do() the Action public void OnUp(DoButton doButton) { _tween.Kill(); _tween = DOTween.Sequence() .Join(doButton.Images[0].transform.DOScale(Vector3.one, 0.42f)) .Join(doButton.Images[0].DOColor(DecideColor(), 0.42f)) .OnComplete(doButton.Execute); }
public void OnExit(DoButton doButton) { _isOverButton = false; _tween.Kill(); _tween = doButton.Transform.DOScale(1, 0.2f) .OnComplete(() => doButton.Transform.SetSiblingIndex(_siblingIndex)); }
public void OnDown(DoButton doButton) { var growthVector = new Vector3(1 + Growth * 0.1f, 1 + Growth * 0.1f, 1); _tween.Kill(); _tween = DOTween.Sequence() .Join(doButton.Images[0].transform.DOScale(growthVector, 0.42f)) .Join(doButton.Images[0].DOColor(HiLiteToo, 0.42f)); }
public void OnEnter(DoButton doButton) { _isOverButton = true; if (_tween != null && _tween.IsActive()) { _tween.Kill(); } doButton.Transform.SetAsLastSibling(); Pulsate(doButton); }
public void OnUp(DoButton doButton) { _tween.Kill(); _tween = doButton.Transform.DOLocalRotate(Vector3.zero, 0.2f) .OnComplete(() => { if (_isOverButton) { _tween = doButton.Transform.DOScale(Vector3.one, 0.2f) .OnComplete(() => Pulsate(doButton)); } doButton.Execute(); }); }
public void OnEnter(DoButton doButton) { _isOverButton = true; if (_originalcolor.Equals(DummyColor)) { _originalcolor = doButton.Images[0].color; } // For any other Handler to fire, OnEnter HAS to have occured, // Therefore we only need check for null here if (_tween != null && _tween.IsActive()) { _tween.Kill(); } _tween = doButton.Images[0].DOColor(HiLiteColor, 0.42f); }
public void Do(DoButton doButton) { Debug.Log(_message); }
private void Pulsate(DoButton doButton) { _tween = doButton.Transform.DOScale(1.5f, 0.3f) .SetLoops(-1, LoopType.Yoyo) .SetEase(Ease.OutCubic); }
public void OnDown(DoButton doButton) { _tween.Kill(); _tween = doButton.Transform.DOLocalRotate(new Vector3(0, 0, 180), 0.2f); }