public void Show(GameObject target, Vector2 pos, Vector2 offset2) { _target = target; _offset = pos; _offset2 = offset2; this.SetScaleXY(1f, 1f); this.alpha = 1; SpriteTweener.TweenScale(this, 1f, 2, 400, o => { parent?.RemoveChild(this); _target = null; }); //SpriteTweener.TweenAlpha(this, 1, 0.4f, 400); }
public static void TweenScalePingPong(Sprite sprite, float from, float to, int duration, OnTweenComplete onComplete = null, int delay = 0, Easing.Equation equation = Easing.Equation.QuadEaseOut) { if (sprite == null || sprite.Destroyed) { return; } SpriteTweener.TweenScale(sprite, from, to, duration, go => { SpriteTweener.TweenScale(sprite, to, from, duration, go1 => { TweenScalePingPong(sprite, from, to, duration, null, delay, equation); }); }); }