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; }
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); }
/// <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)); }
public EditorToggle(LMS_GuiConfig conf, LMS_GuiBaseCallback cb) : base(conf, cb) { }
public EditorTextField(LMS_GuiConfig conf, LMS_GuiBaseCallback cb) : base(conf, cb) { }
public EditorProgressBar(LMS_GuiConfig conf, LMS_GuiBaseCallback cb) : base(conf, cb) { }
public EditorButton(LMS_GuiConfig conf, LMS_GuiBaseCallback cb) : base(conf, cb) { }
public EditorLabel(LMS_GuiConfig conf, LMS_GuiBaseCallback cb) : base(conf, cb) { }
public EditorCallback(LMS_GuiConfig conf, LMS_GuiBaseCallback cb) { m_Config = conf; m_cb = cb; }