/// <summary> /// Revert all data that has been manipulated by the Cutscene. /// </summary> private void revert() { for (int i = 0; i < revertCache.Count; i++) { RevertInfo revertable = revertCache[i]; if (revertable != null) { if ((revertable.EditorRevert == RevertMode.Revert && !Application.isPlaying) || (revertable.RuntimeRevert == RevertMode.Revert && Application.isPlaying)) { revertable.Revert(); } } } }
/// <summary> /// Cache the initial state of the curve clip manipulated values. /// </summary> /// <returns>The Info necessary to revert this event.</returns> public RevertInfo[] CacheState() { List <RevertInfo> reverts = new List <RevertInfo>(); if (Actor != null) { for (int i = 0; i < CurveData.Count; i++) { Component component = Actor.GetComponent(CurveData[i].Type); if (component != null) { RevertInfo info = new RevertInfo(this, component, CurveData[i].PropertyName, CurveData[i].getCurrentValue(component)); reverts.Add(info); } } } return(reverts.ToArray()); }