Пример #1
0
 public void SetAnim(TextureAnim anim, int idx)
 {
     if (anim == null)
     {
         return;
     }
     if (anim.spriteFrames == null)
     {
         return;
     }
     this.frames      = new SPRITE_FRAME[anim.spriteFrames.Length];
     this.index       = idx;
     this.name        = anim.name;
     this.loopCycles  = anim.loopCycles;
     this.loopReverse = anim.loopReverse;
     this.framerate   = anim.framerate;
     this.onAnimEnd   = anim.onAnimEnd;
     try
     {
         for (int i = 0; i < this.frames.Length; i++)
         {
             this.frames[i] = anim.spriteFrames[i].ToStruct();
         }
     }
     catch (Exception ex)
     {
         TsLog.LogError("Exception caught in UVAnimation.SetAnim(). Make sure you have re-built your atlases!\nException: " + ex.Message, new object[0]);
     }
     this.CalcLength();
 }
Пример #2
0
 public UVAnimation(UVAnimation anim)
 {
     this.frames = new SPRITE_FRAME[anim.frames.Length];
     anim.frames.CopyTo(this.frames, 0);
     this.name          = anim.name;
     this.loopCycles    = anim.loopCycles;
     this.loopReverse   = anim.loopReverse;
     this.framerate     = anim.framerate;
     this.onAnimEnd     = anim.onAnimEnd;
     this.curFrame      = anim.curFrame;
     this.stepDir       = anim.stepDir;
     this.numLoops      = anim.numLoops;
     this.playInReverse = anim.playInReverse;
     this.length        = anim.length;
     this.CalcLength();
 }
Пример #3
0
 public void Copy(TextureAnim a)
 {
     this.name        = a.name;
     this.loopCycles  = a.loopCycles;
     this.loopReverse = a.loopReverse;
     this.framerate   = a.framerate;
     this.onAnimEnd   = a.onAnimEnd;
     this.framePaths  = new string[a.framePaths.Length];
     a.framePaths.CopyTo(this.framePaths, 0);
     this.frameGUIDs = new string[a.frameGUIDs.Length];
     a.frameGUIDs.CopyTo(this.frameGUIDs, 0);
     this.spriteFrames = new CSpriteFrame[a.spriteFrames.Length];
     for (int i = 0; i < this.spriteFrames.Length; i++)
     {
         this.spriteFrames[i] = new CSpriteFrame(a.spriteFrames[i]);
     }
 }
Пример #4
0
 public UVAnimation_Multi(UVAnimation_Multi anim)
 {
     this.name        = anim.name;
     this.loopCycles  = anim.loopCycles;
     this.loopReverse = anim.loopReverse;
     this.framerate   = anim.framerate;
     this.onAnimEnd   = anim.onAnimEnd;
     this.curClip     = anim.curClip;
     this.stepDir     = anim.stepDir;
     this.numLoops    = anim.numLoops;
     this.duration    = anim.duration;
     this.clips       = new UVAnimation_Auto[anim.clips.Length];
     for (int i = 0; i < this.clips.Length; i++)
     {
         this.clips[i] = anim.clips[i].Clone();
     }
     this.CalcDuration();
 }
Пример #5
0
    // Member-wise copy:
    public void Copy(TextureAnim a)
    {
        name        = a.name;
        loopCycles  = a.loopCycles;
        loopReverse = a.loopReverse;
        framerate   = a.framerate;
        onAnimEnd   = a.onAnimEnd;

        framePaths = new string[a.framePaths.Length];
        a.framePaths.CopyTo(framePaths, 0);

        frameGUIDs = new string[a.frameGUIDs.Length];
        a.frameGUIDs.CopyTo(frameGUIDs, 0);

        spriteFrames = new CSpriteFrame[a.spriteFrames.Length];
        for (int i = 0; i < spriteFrames.Length; ++i)
        {
            spriteFrames[i] = new CSpriteFrame(a.spriteFrames[i]);
        }
    }
Пример #6
0
	// Member-wise copy:
	public void Copy(TextureAnim a)
	{
		name = a.name;
		loopCycles = a.loopCycles;
		loopReverse = a.loopReverse;
		framerate = a.framerate;
		onAnimEnd = a.onAnimEnd;

		framePaths = new string[a.framePaths.Length];
		a.framePaths.CopyTo(framePaths, 0);

		frameGUIDs = new string[a.frameGUIDs.Length];
		a.frameGUIDs.CopyTo(frameGUIDs, 0);

		spriteFrames = new CSpriteFrame[a.spriteFrames.Length];
		for (int i = 0; i < spriteFrames.Length; ++i)
			spriteFrames[i] = new CSpriteFrame(a.spriteFrames[i]);
	}
Пример #7
0
	// Copy constructor:
	public UVAnimation_Multi(UVAnimation_Multi anim)
	{
		name = anim.name;
		loopCycles = anim.loopCycles;
		loopReverse = anim.loopReverse;
		framerate = anim.framerate;
		onAnimEnd = anim.onAnimEnd;
		curClip = anim.curClip;
		stepDir = anim.stepDir;
		numLoops = anim.numLoops;
		duration = anim.duration;

		clips = new UVAnimation_Auto[anim.clips.Length];
		for (int i = 0; i < clips.Length; ++i)
			clips[i] = anim.clips[i].Clone();

		CalcDuration();
	}