private void _DestroyUI(BaseUIObject ui, string uiName) { if (ui.IsOpen()) { ui.Close(); } ui.Destroy(); GameObject.Destroy(ui.GameObject); m_UIObjectDict.Remove(uiName); }
private void _CloseUI(BaseUIObject ui) { if (!ui.IsOpen()) { return; } ui.Close(); ui.GameObject.SetActive(false); }
static int Destroy(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); ANFramework.BaseUIObject obj = (ANFramework.BaseUIObject)ToLua.CheckObject <ANFramework.BaseUIObject>(L, 1); obj.Destroy(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int AddSubUI(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); ANFramework.BaseUIObject obj = (ANFramework.BaseUIObject)ToLua.CheckObject <ANFramework.BaseUIObject>(L, 1); string arg0 = ToLua.CheckString(L, 2); obj.AddSubUI(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int IsOpen(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); ANFramework.BaseUIObject obj = (ANFramework.BaseUIObject)ToLua.CheckObject <ANFramework.BaseUIObject>(L, 1); bool o = obj.IsOpen(); LuaDLL.lua_pushboolean(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int GetSubUI(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); ANFramework.BaseUIObject obj = (ANFramework.BaseUIObject)ToLua.CheckObject <ANFramework.BaseUIObject>(L, 1); System.Collections.Generic.List <string> o = obj.GetSubUI(); ToLua.PushSealed(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int SetRoot(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); ANFramework.BaseUIObject obj = (ANFramework.BaseUIObject)ToLua.CheckObject <ANFramework.BaseUIObject>(L, 1); UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.CheckObject(L, 2, typeof(UnityEngine.GameObject)); obj.SetRoot(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int GetUI(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); ANFramework.UIManager obj = (ANFramework.UIManager)ToLua.CheckObject <ANFramework.UIManager>(L, 1); string arg0 = ToLua.CheckString(L, 2); ANFramework.BaseUIObject o = obj.GetUI(arg0); ToLua.PushObject(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int set_Transform(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); ANFramework.BaseUIObject obj = (ANFramework.BaseUIObject)o; UnityEngine.Transform arg0 = (UnityEngine.Transform)ToLua.CheckObject <UnityEngine.Transform>(L, 2); obj.Transform = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index Transform on a nil value")); } }
static int set_GameObject(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); ANFramework.BaseUIObject obj = (ANFramework.BaseUIObject)o; UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.CheckObject(L, 2, typeof(UnityEngine.GameObject)); obj.GameObject = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index GameObject on a nil value")); } }
static int set_ResourceName(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); ANFramework.BaseUIObject obj = (ANFramework.BaseUIObject)o; string arg0 = ToLua.CheckString(L, 2); obj.ResourceName = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index ResourceName on a nil value")); } }
static int get_GameObject(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); ANFramework.BaseUIObject obj = (ANFramework.BaseUIObject)o; UnityEngine.GameObject ret = obj.GameObject; ToLua.PushSealed(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index GameObject on a nil value")); } }
static int get_ResourceName(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); ANFramework.BaseUIObject obj = (ANFramework.BaseUIObject)o; string ret = obj.ResourceName; LuaDLL.lua_pushstring(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index ResourceName on a nil value")); } }
static int get_Transform(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); ANFramework.BaseUIObject obj = (ANFramework.BaseUIObject)o; UnityEngine.Transform ret = obj.Transform; ToLua.Push(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index Transform on a nil value")); } }
public void OpenSubUI(string parentName, string uiName, Transform parent) { BaseUIObject parentUI; if (!m_UIObjectDict.TryGetValue(parentName, out parentUI)) { Debug.LogError(string.Format("【UI】打开子界面({0})失败,主界面({1})并未打开。", uiName, parentName)); return; } if (parent == null) { parent = parentUI.Transform; } BaseUIObject ui = _OpenUI(uiName, parent); parentUI.AddSubUI(uiName); }
private BaseUIObject _CreateUI(string resourceName, Transform parent) { string path = string.Format("{0}/{1}", UIFolderPath, resourceName); GameObject gameObject = ANF.Core.Mgr.Resource.Instance(path); if (gameObject == null) { return(null); } Transform transform = gameObject.transform; transform.SetParent(parent); if (transform as RectTransform) { ((RectTransform)transform).sizeDelta = Vector3.zero; } transform.localPosition = Vector3.zero; transform.localScale = Vector3.one; gameObject.name = resourceName; string uiName = resourceName; if (m_UINameDict.ContainsKey(uiName)) { m_UINameDict[uiName] += 1; uiName += m_UINameDict[uiName]; } BaseUIObject ui = new BaseUIObject(uiName, resourceName); ui.SetRoot(gameObject); m_UIObjectDict.Add(uiName, ui); ANF.Core.Mgr.Lua.CallTableFunc("ANF.UIMgr:__CreateUIFromCS", ui); return(ui); }
static int _CreateANFramework_BaseUIObject(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 2) { string arg0 = ToLua.CheckString(L, 1); string arg1 = ToLua.CheckString(L, 2); ANFramework.BaseUIObject obj = new ANFramework.BaseUIObject(arg0, arg1); ToLua.PushObject(L, obj); return(1); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: ANFramework.BaseUIObject.New")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }