Beispiel #1
0
    /// <summary>
    /// Adds a tk2dAnimatedSprite as a component to the gameObject passed in, setting up necessary parameters and building geometry.
    /// </summary>
    public static tk2dAnimatedSprite AddComponent(GameObject go, tk2dSpriteAnimation anim, int clipId)
    {
        var clip = anim.clips[clipId];
        tk2dAnimatedSprite animSprite = go.AddComponent <tk2dAnimatedSprite>();

        animSprite.SetSprite(clip.frames[0].spriteCollection, clip.frames[0].spriteId);
        animSprite.anim = anim;
        return(animSprite);
    }
 public void SpriteHolder_Init(iGUIContainer caller)
 {
     spriteCollectionInstance = iGUICode_FractalFramework.getInstance().spriteCollectionInstance;
     spriteInstance = caller.GetComponent<tk2dAnimatedSprite>();
     spriteInstance.SetSprite(spriteCollectionInstance, ViewModel.Context.NextEnemy);
 }