protected override void KGFAwake() { base.KGFAwake(); if (itsInstance == null) { itsInstance = this; } else { UnityEngine.Object.Destroy(this); } KGFAccessor.RegisterAddEvent <KGFICustomGUI>(OnCustomGuiChanged); KGFAccessor.RegisterRemoveEvent <KGFICustomGUI>(OnCustomGuiChanged); UpdateInternalList(); }
protected override void KGFAwake() { if (itsInstance == null) { itsInstance = this; } else { UnityEngine.Object.Destroy(this); } // Add all custom guis that are already there foreach (KGFICustomGUI aGui in KGFAccessor.GetObjects <KGFICustomGUI>()) { Add(aGui); } // Add all future custom guis KGFAccessor.RegisterAddEvent <KGFICustomGUI>(OnAddCustomGui); }
protected override void KGFAwake() { itsGUIs = KGFAccessor.GetObjects <KGFIGui2D>(); KGFAccessor.RegisterAddEvent <KGFIGui2D>(OnRegisterKGFIGui2D); KGFAccessor.RegisterRemoveEvent <KGFIGui2D>(OnUnregisterKGFIGui2D); }