public bool InitWithTwoActions(FiniteTimeAction action1, FiniteTimeAction action2) { if (action1 == null || action2 == null) { this.LogError("initWithTwoActions action is null!!"); } bool ret = false; var d1 = action1.Duration; var d2 = action2.Duration; if (base.InitWithDuration(Math.Max(d1, d2))) { m_one = action1; m_two = action2; if (d1 > d2) { m_two = Sequence.CreateWithTwoActions(action2, DelayTime.Create(d1 - d2)); } else if (d1 < d2) { m_one = Sequence.CreateWithTwoActions(action1, DelayTime.Create(d2 - d1)); } ret = true; } return(ret); }
public static DelayTime Create(float d) { var action = new DelayTime(); if (action != null && action.InitWithDuration(d)) { return(action); } return(null); }