Esempio n. 1
0
 public static void Refresh(int delay = 0)
 {
     if (Proxy.IsPlaying() || AttributeManager.Get().disabled)
     {
         return;
     }
     Events.Call("On Attributes Refresh");
     AttributeManager.nextRefresh = Time.Get() + delay;
 }
Esempio n. 2
0
 //==============================
 // Main
 //==============================
 public void Setup()
 {
     this.stage                   = 1;
     this.nextIndex               = 0;
     Attribute.ready              = false;
     AttributeManager.singleton   = this;
     AttributeManager.nextRefresh = 0;
     this.SetupEvents();
     this.SetupHooks();
 }
Esempio n. 3
0
 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);
         }
     }
 }
Esempio n. 4
0
 public void OnEnable()
 {
     this.Setup();
     AttributeManager.Refresh();
     this.EditorUpdate();
 }
Esempio n. 5
0
 //==============================
 // Unity
 //==============================
 public static AttributeManager Get()
 {
     AttributeManager.singleton = AttributeManager.singleton ?? Singleton.Get <AttributeManager>();
     return(AttributeManager.singleton);
 }
Esempio n. 6
0
 public static void PerformRefresh()
 {
     AttributeManager.Refresh();
 }
Esempio n. 7
0
 public void ContextRefresh()
 {
     AttributeManager.PerformRefresh();
 }