123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- using UnityEngine;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine.Events;
- public abstract class StreamRoot : TweenRoot
- {
- #region
- public bool AtOrigin;
- public bool AtDestination;
- public int Phase;
- public int TotPhase;
- public bool ActionLock;
- public bool Consecutive;
- public float TempDelay;
- public float TempDuration;
- public List<float> DelayList = new List<float>();
- public List<float> DurationList = new List<float>();
- public List<UnityAction> StartActionList = new List<UnityAction>();
- public List<UnityAction> FinishActionList = new List<UnityAction>();
- #endregion
- public StreamRoot( bool cg, Curve curve, Component comp) : base(cg, curve, comp)
- {
- }
- public override bool StartForward()
- {
- InPause = false;
- if (InForward || AtDestination)
- {
- return true;
- }
- Timer = 0;
- InForward = true;
- AtOrigin = false;
- Component.SetActive(true);
- if (InOrigin)
- {
- OnForwardStart.SafeInvoke();
- }
- if (CG)
- {
- CanvasGroup.interactable = false;
- }
- if (InBackward)
- {
- ManaAnim.MoveBacList.Remove(this);
- }
- ManaAnim.MoveForList.Add(this);
- return false;
- }
- public override bool StartBackward()
- {
- InPause = false;
- if (InBackward || AtOrigin)
- {
- return true;
- }
- Timer = 0;
- InBackward = true;
- AtDestination = false;
- Component.SetActive(true);
- OnBackwardStart.SafeInvoke();
- if (CG)
- {
- CanvasGroup.interactable = false;
- }
- if (InForward)
- {
- ManaAnim.MoveForList.Remove(this);
- }
- ManaAnim.MoveBacList.Add(this);
- return false;
- }
- public override void ForwardFinish()
- {
- base.ForwardFinish();
- AtOrigin = false;
- AtDestination = true;
- }
- public override void BackwardFinish()
- {
- base.BackwardFinish();
- AtOrigin = true;
- AtDestination = false;
- }
- }
|