SetFrame() public method

Sets the current frame. The animation will wrap if the selected frame exceeds the number of frames in the clip. This variant WILL trigger an event if the current frame has a trigger defined.
public SetFrame ( int currFrame ) : void
currFrame int
return void
示例#1
0
 // Update is called once per frame
 void Update()
 {
     if (MyTransform.gameObject.active == true)
     {
         if (MyAniSprite.isPlaying() == false)
         {
             MyAniSprite.SetFrame(0);
             MyTransform.gameObject.SetActiveRecursively(false);
         }
         if (MyAniSprite.spriteId == MyAniSprite.GetSpriteIdByName("smoke4"))
         {
             MyAniSprite.SetFrame(0);
             MyTransform.gameObject.SetActiveRecursively(false);
         }
     }
 }
示例#2
0
 public void setState(int state)
 {
     animSprite.SetFrame(state);
 }