private void FinalizeEntryFrom(ActionEntry entry) { TraverseFromEntry(entry, (ActionEntry e) => { if (e.EntryType == ActionEntryType.Executable && e.PrimaryAction != null) { // e.PrimaryAction.Prepare(); // TweenLegacyAnimation needs to be Prepared before NormailzedTime could be set e.PrimaryAction.FinalizeAction(true); } }); }
private void TraverseFromEntry(ActionEntry entry, Action <ActionEntry> procedure) { procedure(entry); foreach (var child in entry.GetChildEntries(EntryContainer)) { var nextId = child.NextId; while (EntryContainer.GetEntry(nextId) != null) { var nextEntry = EntryContainer.GetEntry(nextId); nextId = nextEntry.NextId; TraverseFromEntry(nextEntry, procedure); } TraverseFromEntry(child, procedure); } if (entry.HasNext) { TraverseFromEntry(EntryContainer.GetEntry(entry.NextId), procedure); } }
private IEnumerator Step(ActionEntry entry) { foreach (var childEntry in entry.GetChildEntries(EntryContainer)) { StartCoroutine(Step(childEntry)); } while (entry.IsPlayable) { entry.StepAction(Time.deltaTime, Status == RunnerStatus.Pause); yield return(null); } if (entry.HasNext) { while (entry.EntryType == ActionEntryType.ParallelBlock && !entry.IsParallelBlockFinished(EntryContainer)) { yield return(null); } var nextEntry = EntryContainer.GetEntry(entry.NextId); PrepareEntry(nextEntry); StartCoroutine(Step(nextEntry)); } if (entry.EntryType == ActionEntryType.ParallelBlock && entry.EntryWrapMode == ActionEntry.ActionEntryWrapMode.Loop) { while (!entry.IsParallelBlockFinished(EntryContainer)) { yield return(null); } yield return(null); // restart on the next frame of last tweener's IsDone ResetEntryFrom(entry); PrepareEntry(entry); StartCoroutine(Step(entry)); } }
public void AppendEntryTo(ActionEntry nextEntry, ActionEntry thisEntry) { AddEntry(nextEntry); thisEntry.NextId = nextEntry.Id; nextEntry.PrevId = thisEntry.Id; }
public void AddEntry(ActionEntry entry) { entryDict.Add(LatestId, entry); entry.Id = LatestId++; }
private void ResetEntryFrom(ActionEntry entry) { TraverseFromEntry(entry, (ActionEntry e) => e.ResetAction()); }