public static void Refresh(int delay = 0) { if (Proxy.IsPlaying() || AttributeManager.Get().disabled) { return; } Events.Call("On Attributes Refresh"); AttributeManager.nextRefresh = Time.Get() + delay; }
//============================== // Main //============================== public void Setup() { this.stage = 1; this.nextIndex = 0; Attribute.ready = false; AttributeManager.singleton = this; AttributeManager.nextRefresh = 0; this.SetupEvents(); this.SetupHooks(); }
public void EditorUpdate() { if (AttributeManager.Get().disabled) { return; } if (AttributeManager.nextRefresh > 0 && Time.Get() > AttributeManager.nextRefresh) { if (Attribute.debug.Has("ProcessRefresh")) { Log.Editor("[AttributeManager] Refreshing..."); } this.Setup(); } if (this.editorRefreshPasses < 1) { if (!Attribute.ready) { this.Setup(); this.SceneRefresh(); if (Attribute.debug.Has("ProcessStage")) { Log.Editor("[AttributeManager] Stage 1 (Awake) start..."); } Events.Call("On Attributes Setup"); this.block = Time.Get(); while (this.stage != 0) { this.Process(); } } } else if (this.stage != 0) { for (int index = 1; index <= this.editorRefreshPasses; ++index) { Call.Delay(this.Process); } } }
public void OnEnable() { this.Setup(); AttributeManager.Refresh(); this.EditorUpdate(); }
//============================== // Unity //============================== public static AttributeManager Get() { AttributeManager.singleton = AttributeManager.singleton ?? Singleton.Get <AttributeManager>(); return(AttributeManager.singleton); }
public static void PerformRefresh() { AttributeManager.Refresh(); }
public void ContextRefresh() { AttributeManager.PerformRefresh(); }