/// <summary> /// 随机事件格子 呼吸动画 2 /// </summary> private void BreathingAnim2() { SpriteRenderer sprite = RandomEventGridStyle.GetComponent <SpriteRenderer>(); Color targetColor = Color.white; _runTween = DOTween.To(() => sprite.color, color => sprite.color = color, targetColor, 0.6f).SetEase(Ease.Linear).onComplete = RandomEventGridBreathingAnim; }
/// <summary> /// 通知激活随机事件 /// </summary> public void NotifyUpdateRandomEvent(bool isActive) { //更新效果 Debug.Log("更新随机事件 NotifyUpdateRandomEvent _isActiveEvent = " + isActive); _isActiveEvent = isActive; RandomEventGridStyle.SetActive(isActive); if (isActive) { RandomEventGridBreathingAnim(); } else { if (_runTween != null) { DOTween.Kill(_runTween); } } }