Exemplo n.º 1
0
    public void OnHint()
    {
        gameObject.StopAction("hint", true);

        var zoom   = ScaleAction.ScaleTo(hintScale, 0.1f, Ease.Linear, LerpDirection.PingPong);
        var action = RepeatAction.Create(zoom, 3, false);

        gameObject.Play(action).name = "hint";
    }
Exemplo n.º 2
0
    void Start()
    {
        if (actions != null)
        {
            int count = actions.Length;

            if (count > 0)
            {
                BaseAction action;

                if (count == 1)
                {
                    action = actions[0].GetAction();
                }
                else
                {
                    BaseAction[] baseActions = new BaseAction[count];

                    for (int i = 0; i < count; i++)
                    {
                        baseActions[i] = actions[i].GetAction();
                    }

                    action = SequenceAction.Create(baseActions);
                }

                if (repeat != 0)
                {
                    if (delay > 0)
                    {
                        gameObject.Play(SequenceAction.Create(DelayAction.Create(delay), RepeatAction.Create(action, repeat)));
                    }
                    else
                    {
                        gameObject.Play(RepeatAction.Create(action, repeat));
                    }
                }
                else
                {
                    if (delay > 0)
                    {
                        gameObject.Play(SequenceAction.Create(DelayAction.Create(delay), action));
                    }
                    else
                    {
                        gameObject.Play(action);
                    }
                }
            }
        }

        Destroy(this);
    }