/*
http://www.cgsoso.com/forum-211-1.html
CG搜搜 Unity3d 每日Unity3d插件免费更新 更有VIP资源!
CGSOSO 主打游戏开发,影视设计等CG资源素材。
插件如若商用,请务必官网购买!
daily assets update for try.
U should buy the asset from home store if u use it in your project!
*/
using System;
using UnityEngine;
public class LTSeq
{
public LTSeq previous;
public LTSeq current;
public LTDescr tween;
public float totalDelay;
public float timeScale;
private int debugIter;
public uint counter;
public bool toggle;
private uint _id;
public int id => (int)(_id | (counter << 16));
public void reset()
{
previous = null;
tween = null;
totalDelay = 0f;
}
public void init(uint id, uint global_counter)
{
reset();
_id = id;
counter = global_counter;
current = this;
}
private LTSeq addOn()
{
current.toggle = true;
LTSeq lTSeq = current;
current = LeanTween.sequence();
UnityEngine.Debug.Log("this.current:" + current.id + " lastCurrent:" + lTSeq.id);
current.previous = lTSeq;
lTSeq.toggle = false;
current.totalDelay = lTSeq.totalDelay;
current.debugIter = lTSeq.debugIter + 1;
return current;
}
private float addPreviousDelays()
{
LTSeq lTSeq = current.previous;
if (lTSeq != null && lTSeq.tween != null)
{
return current.totalDelay + lTSeq.tween.time;
}
return current.totalDelay;
}
public LTSeq append(float delay)
{
current.totalDelay += delay;
return current;
}
public LTSeq append(Action callback)
{
LTDescr lTDescr = LeanTween.delayedCall(0f, callback);
append(lTDescr);
return addOn();
}
public LTSeq append(Action