标签:
void Update () { frameNumber = frames.Length;//重点 if(!oneTime) { myTime += Time.deltaTime;//时间的累加 myIndex = (int)(myTime * (frameNumber - 1));//重点复习~~ index = myIndex % frameNumber; } renderer.material.mainTexture = frames[index]; if (direction) renderer.material.mainTextureScale = new Vector2(1.0f, 1); else renderer.material.mainTextureScale = new Vector2(-1.0f, 1); if (index == frameNumber - 1 && destroy) Destroy(gameObject); if (lastFrameNo != 0) { if (index == lastFrameNo - 1) oneTime = true; }标签:
原文地址:http://www.cnblogs.com/030lixia/p/4340689.html