Exemple #1
0
    public static void PlaySpriteToFaceAnimation(tk2dSprite sprite, Color c)
    {
        tk2dSprite spriteCopy = GameObject.Instantiate(sprite) as tk2dSprite;

        spriteCopy.transform.parent        = sprite.transform.parent;
        spriteCopy.transform.localPosition = new Vector3(0, 0, -5);

        spriteCopy.transform.localScale = Vector3.one;
        spriteCopy.color = c;

        TweenScale iconTweenScale = TweenScale.SetScale(spriteCopy.gameObject, Vector3.one * 5f, 0.3f);

        iconTweenScale.BeginScale = Vector3.one;

        TweenColor iconTweenColor = TweenColor.SetColor(spriteCopy.gameObject, Color.clear, 0.3f);

        iconTweenColor.beginColor       = Color.white;
        iconTweenColor.useChanelMask[0] = iconTweenColor.useChanelMask[1] = iconTweenColor.useChanelMask[2] = false;
        iconTweenColor.SetOnFinishedDelegate(delegate
        {
            Destroy(spriteCopy.gameObject);
        });
    }