OTController 是所有的Controller的基类,
private static int indexer = 0; //序号
public float speed = 1; /// this controller runs at this speed (.5f=half speed, 1=normal, 2=twice as fast).
public bool enabled = true;
public string name
public float time /// running time
public void InitCallBacks(Component target)
public OTController(object owner, string name) /// Controller constructor
public virtual void SetOwner(object owner) /// Sets the owner of this controller
public void SetName(string name)
public OTController(string name)
public void ResetTime()
然后下面才是正题的:
public class OTTweenController : OTController
public void Add(OTTween tween)
{
tweens.Add(tween);
}
protected override void Update()
{
base.Update();
int t = 0;
while (t<tweens.Count)
{
if (tweens[t].Update(deltaTime))
tweens.Remove(tweens[t]);
else
t++;
}
}
-,-之前的OTween的补全
说说两个在Free版本里面可能会用不到的东西 OTParallaxLayer 和 OTParallaxBackground
木有例子木有解释,而且这标明了是Pro版本的东西居然出现在了Free版本中-,- 暂时我不会用它,它的主要功能是对摄像机的平移做得不错。
OTParallaxLayer 有个方法是MoveObjects的方法,大意就是对层里的所有物体进行平移,是一个不错的方法
OTParallaxBackground 主要有一个SetLayers 和一个SetLayersObjects的方法,实际上相当于把物体放入一个容器而已