Пример #1
0
    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();
    }
Пример #2
0
    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);
    }
Пример #3
0
 protected override void KGFAwake()
 {
     itsGUIs = KGFAccessor.GetObjects <KGFIGui2D>();
     KGFAccessor.RegisterAddEvent <KGFIGui2D>(OnRegisterKGFIGui2D);
     KGFAccessor.RegisterRemoveEvent <KGFIGui2D>(OnUnregisterKGFIGui2D);
 }