Example #1
0
    bool initWithTwoActions(FiniteTimeAction action1, FiniteTimeAction action2)
    {
        UnityEngine.Debug.Assert(action1 != null, "");
        UnityEngine.Debug.Assert(action2 != null, "");

        bool ret = false;

        float d1 = action1.Duration;
        float d2 = action2.Duration;

        if (base.InitWithDuration(Mathf.Max(d1, d2)))
        {
            One = action1;
            Two = action2;

            if (d1 > d2)
            {
                Two = SequenceAction.CreateWithTwoActions(action2, DelayTime.Create(d1 - d2));
            }
            else if (d1 < d2)
            {
                One = SequenceAction.CreateWithTwoActions(action1, DelayTime.Create(d2 - d1));
            }

            ret = true;
        }

        return(ret);
    }