예제 #1
0
 /// <summary>
 /// Changes the current ani. but does NOT play it.
 /// </summary>
 public void ChangeCurrentAni(string clipName)
 {
     if (animations.ContainsKey(clipName))
     {
         currentAni = animations[clipName];
     }
 }
예제 #2
0
 public void ClearCurrentAni()
 {
     Stop();
     //if streaming ani unload its current frame
     if (currentAni != null && currentAni.useResourcesLoad)
     {
         currentAni.UnloadResourcesCurrentFrame();
     }
     currentAni = null;
 }
예제 #3
0
        public void LoadAnimation(ZT_SpriteAnimation anim, string customName)
        {
            if (animations.ContainsKey(customName))
            {
                return;
            }

            ZT_SpriteAnimation newAni = ScriptableObject.CreateInstance <ZT_SpriteAnimation>();

            anim.Copy(newAni);
            newAni.name = customName;
            newAni.Setup(sp, ZTTimeManager.MainTimer(), this);
            newAni.SetUseUnityUiImage(useUnityUiImage);
            animations.Add(customName, newAni);
            newAni.FrameChanged += FrameChange;
        }
예제 #4
0
        //copy this animation to another object
        public void Copy(ZT_SpriteAnimation toAnim)
        {
            //Note that useUnityImage needs to be set from the animator, we are not copying that value from another animation!
            toAnim.speed            = speed;
            toAnim.loop             = loop;
            toAnim.pingPong         = pingPong;
            toAnim.useFlip          = useFlip;
            toAnim.frameGroups      = new List <DirectionGroup>();
            toAnim.useResourcesLoad = useResourcesLoad;
            toAnim.playReverse      = playReverse;

            for (int i = 0; i < frameGroups.Count; i++)
            {
                toAnim.frameGroups.Add(new DirectionGroup());
                frameGroups[i].Copy(toAnim.frameGroups[i]);
            }
        }
예제 #5
0
 /**
  * Loading Animations
  **/
 public void LoadAnimation(ZT_SpriteAnimation anim)
 {
     LoadAnimation(anim, anim.name);
 }