Beispiel #1
0
    public T InstantiateChild <T>(LMS_GuiConfig config, int memID) where T : LMS_GuiBaseCallback
    {
        if (Children == null)
        {
            Children       = new List <LMS_GuiBaseCallback>();
            SelectionIndex = new Dictionary <int, KeyValuePair <LMS_GuiView, LMS_GuiBaseButton> >();
            Debug.Log("Created new Collection -> 'Children'");
        }
        T local = LMS_GuiBaseUtils.InstantiateGUIElement <T>(config, memID, null, true);

        Children.Add(local);
        return(local);
    }
 void Awake()
 {
     if (Config == null)
     {
         Config   = new LMS_GuiConfig();
         needPlus = true;
     }
     RelativeFontSize = true;
     UseRelativeRect  = true;
     if (Children == null)
     {
         Children = new List <LMS_GuiBaseCallback>();
     }
     m_GUIEditorActive = FindObjectOfType <LMS_GuiEditor>() != null;
 }
Beispiel #3
0
    public static T _InstantiateGUIElement <T>(LMS_GuiConfig conf, int memoryID, GameObject g, bool hidden = false) where T : LMS_GuiBaseCallback
    {
        if (Memory.Keys.Contains(memoryID))
        {
            Debug.LogError("Attempting to create an instance of an existing memory id! " + conf.Text);
            return(null);
        }
        GameObject guiContainer = g;
        T          element      = guiContainer.AddComponent <T>();

        element.Config   = conf;
        element.Hidden   = hidden;
        Memory[memoryID] = element;
#if LMS_EDIT_MODE
#else
        UnityEngine.Object.DontDestroyOnLoad(g);
#endif
        return(element);
    }
Beispiel #4
0
    /// <summary>
    /// CALL FROM THE MAIN THREAD
    /// </summary>
    /// <typeparam name="T"></typeparam>
    /// <param name="conf"></param>
    /// <returns></returns>
    public static T InstantiateGUIElement <T>(LMS_GuiConfig conf, int memoryID, GameObject g = null, bool hidden = false) where T : LMS_GuiBaseCallback
    {
        int id = GenerateId();

        if (GuiContainer == null)
        {
            GuiContainer = new GameObject("LMS GUI Container");
            #if LMS_EDIT_MODE
#else
            UnityEngine.Object.DontDestroyOnLoad(GuiContainer);
#endif
        }
        GameObject go = new GameObject(typeof(T).Name + id);
        UnityEngine.Object.DontDestroyOnLoad(go);
        T element = go.AddComponent <T>();
        element.Config = conf;
        element.Hidden = hidden;
        Memory[id]     = element;
        return(element);
    }
 public static LMS_GuiBaseButton a(LMS_GuiConfig b, int c, UnityEngine.GameObject g, bool hidden)
 {
     return(LMS_GuiBaseUtils.InstantiateGUIElement <LMS_GuiBaseButton>(b, c, g, hidden));
 }
 T InstantiateOptionWindowChild <T>(LMS_GuiConfig c) where T : LMS_GuiBaseCallback
 {
     return(InstantiateChild <T>(c, 72));
 }
Beispiel #7
0
 public EditorToggle(LMS_GuiConfig conf, LMS_GuiBaseCallback cb) : base(conf, cb)
 {
 }
Beispiel #8
0
 public EditorTextField(LMS_GuiConfig conf, LMS_GuiBaseCallback cb) : base(conf, cb)
 {
 }
Beispiel #9
0
 public EditorProgressBar(LMS_GuiConfig conf, LMS_GuiBaseCallback cb) : base(conf, cb)
 {
 }
Beispiel #10
0
 public EditorButton(LMS_GuiConfig conf, LMS_GuiBaseCallback cb) : base(conf, cb)
 {
 }
Beispiel #11
0
 public EditorLabel(LMS_GuiConfig conf, LMS_GuiBaseCallback cb) : base(conf, cb)
 {
 }
Beispiel #12
0
 public EditorCallback(LMS_GuiConfig conf, LMS_GuiBaseCallback cb)
 {
     m_Config = conf;
     m_cb     = cb;
 }