public void Add(FreeControllerAnimationTarget target) { TargetControllers.Add(target); TargetControllers.Sort(new FreeControllerAnimationTarget.Comparer()); target.onSelectedChanged.AddListener(OnTargetSelectionChanged); target.onAnimationKeyframesModified.AddListener(OnAnimationModified); onTargetsListChanged.Invoke(); }
public void Add(FloatParamAnimationTarget target) { if (target == null) { throw new NullReferenceException(nameof(target)); } TargetFloatParams.Add(target); TargetFloatParams.Sort(new FloatParamAnimationTarget.Comparer()); target.onSelectedChanged.AddListener(OnTargetSelectionChanged); target.onAnimationKeyframesModified.AddListener(OnAnimationModified); onTargetsListChanged.Invoke(); }
private T Add <T>(AtomAnimationTargetsList <T> list, IComparer <T> comparer, T target) where T : IAtomAnimationTarget { if (target == null) { throw new NullReferenceException(nameof(target)); } list.Add(target); list.Sort(comparer); target.onSelectedChanged.AddListener(OnTargetSelectionChanged); target.onAnimationKeyframesDirty.AddListener(OnAnimationKeyframesDirty); onTargetsListChanged.Invoke(); return(target); }
private T Add <T>(AtomAnimationTargetsList <T> list, IComparer <T> comparer, T target) where T : IAtomAnimationTarget { if (target == null) { throw new NullReferenceException(nameof(target)); } if (target.clip != null) { throw new InvalidOperationException($"Target {target.name} already assigned to clip {target.clip.animationNameQualified}"); } target.clip = this; list.Add(target); list.Sort(comparer); target.onAnimationKeyframesDirty.AddListener(OnAnimationKeyframesDirty); onTargetsListChanged.Invoke(); return(target); }