Beispiel #1
0
    private void CreateBananaExplodeEffect(BBanana banana)
    {
        //we can't just get its x and y, because they might be transformed somehow
        Vector2 bananaPos = _effectHolder.LocalToLocal(banana, Vector2.zero);

        FSprite explodeSprite = new FSprite("Banana.png");

        _effectHolder.AddChild(explodeSprite);
        explodeSprite.shader   = FShader.Additive;
        explodeSprite.x        = bananaPos.x;
        explodeSprite.y        = bananaPos.y;
        explodeSprite.rotation = banana.rotation;

        Go.to(explodeSprite, 0.3f, new TweenConfig().floatProp("scale", 1.3f).floatProp("alpha", 0.0f).onComplete(HandleExplodeSpriteComplete));
    }