public virtual void Update_EDITOR() { this.animationInputParams = this.animationInputParams.Where((i) => i != null).ToList(); this.componentsToDestroy.Clear(); if (this.animation == null || this.lastAnimation != this.animation || this.animationRefresh == false) { var ps = this.GetComponents <TransitionInputParameters>(); foreach (var p in ps) { this.componentsToDestroy.Add(p); } this.animationRefresh = false; } if (this.animationRefresh == false && this.animation != null) { this.animation.ApplyInputParameters(this); this.animationRefresh = true; } this.lastAnimation = this.animation; UnityEditor.EditorApplication.delayCall = () => { foreach (var c in this.componentsToDestroy) { Component.DestroyImmediate(c); this.animationInputParams = this.animationInputParams.Where((i) => i != null).ToList(); } }; this.canvas = this.GetComponent <CanvasGroup>(); }
private void Update_EDITOR() { this.animationInputParams = this.animationInputParams.Where((i) => i != null).ToList(); //this.canvas = this.GetComponent<CanvasGroup>(); //if (ME.EditorUtilities.IsPrefab(this.gameObject) == true) return; var changed = (this.lastAnimation != this.animation); if (changed == true) { this.componentsToDestroy.Clear(); if (this.animation == null || this.lastAnimation != this.animation) { var ps = this.GetComponents <TransitionInputParameters>(); foreach (var p in ps) { this.componentsToDestroy.Add(p); } } if (this.animation != null) { this.animation.ApplyInputParameters(this); } this.lastAnimation = this.animation; this.DelayDestroy_EDITOR(); } }
public override void OnDeinit(System.Action callback) { WindowSystem.GetHistoryTracker().Add(this, HistoryTrackerEventType.Deinit); WindowSystem.GetEvents().Raise(this, WindowEventType.OnDeinit); WindowSystem.GetEvents().Clear(this); this.animation = null; WindowSystem.GetHistoryTracker().Clear(this); this.animationInputParams.Clear(); base.OnDeinit(callback); }