Ejemplo n.º 1
0
    public void Init(int idx, AnimCompletedDelegate del)
    {
        endDelegate = del;
        index       = idx;

        List <SuperSpriteAnimElement> anims = new List <SuperSpriteAnimElement>();

        for (int i = 0; i < spriteAnims.Length; ++i)
        {
            if (spriteAnims[i] != null)
            {
                if (spriteAnims[i].sprite != null)
                {
                    spriteAnims[i].Init();

                    // Only save the ones that are valid
                    // so we don't have to check them
                    // constantly later on:
                    anims.Add(spriteAnims[i]);

                    // Hide each sprite by default:
                    HideSprite(spriteAnims[i].sprite, true);
                }
            }
        }

        spriteAnims = anims.ToArray();
    }
Ejemplo n.º 2
0
	public void Init(int idx, AnimCompletedDelegate del, SpriteBase.AnimFrameDelegate frameDel)
	{
		endDelegate = del;
		index = idx;

		List<SuperSpriteAnimElement> anims = new List<SuperSpriteAnimElement>();

		for (int i = 0; i < spriteAnims.Length; ++i)
			if (spriteAnims[i] != null)
				if (spriteAnims[i].sprite != null)
				{
					spriteAnims[i].Init();

					// Only save the ones that are valid
					// so we don't have to check them
					// constantly later on:
					anims.Add(spriteAnims[i]);

					if(frameDel != null)
						spriteAnims[i].sprite.SetAnimFrameDelegate(frameDel);

					// Hide each sprite by default:
					HideSprite(spriteAnims[i].sprite, true);
				}

		spriteAnims = anims.ToArray();
	}