/// <summary> /// Unity Method /// </summary> private void Awake() { TweenEntity data = new TweenEntity(); DataEntity = data; Watch(this); }
/// <summary> /// 添加动画参数到队列当中 /// </summary> public virtual void AddTweenArgs() { TweenEntity data = (TweenEntity)DataEntity; TweenArgs args; Vector3 screenZ = Camera.main.WorldToScreenPoint(transform.position); Vector3 world = Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, screenZ.z)); args.targetValue = world; args.tweenTime = 2f; args.tweenName = allTween.Count.ToString(); allTween.Add(args); }
/// <summary> /// 播放列表中的下一个动画 /// </summary> public virtual void ToNextTween() { if (allTween.Count > 0) { TweenEntity data = (TweenEntity)DataEntity; if (data.number >= allTween.Count) { return; } TweenArgs args = allTween[data.number]; data.tweenArgs = args; data.number += 1; } }