static int CreatGameObject(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(UnityEngine.GameObject), typeof(UnityEngine.GameObject))) { UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.ToObject(L, 1); UnityEngine.GameObject arg1 = (UnityEngine.GameObject)ToLua.ToObject(L, 2); UnityEngine.GameObject o = GameObjectManager.CreatGameObject(arg0, arg1); ToLua.Push(L, o); return(1); } else if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(string), typeof(UnityEngine.GameObject))) { string arg0 = ToLua.ToString(L, 1); UnityEngine.GameObject arg1 = (UnityEngine.GameObject)ToLua.ToObject(L, 2); UnityEngine.GameObject o = GameObjectManager.CreatGameObject(arg0, arg1); ToLua.Push(L, o); return(1); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to method: GameObjectManager.CreatGameObject")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
public void UIManagerLoadTest() { ResourcesConfigManager.Initialize(); GameObject manager = GameObjectManager.CreatGameObject("UIManager"); Assert.AreNotEqual(manager.GetComponent <UILayerManager>(), null); Assert.AreNotEqual(manager.GetComponent <UIAnimManager>(), null); Assert.AreNotEqual(manager.GetComponentInChildren <Camera>(), null); }
public static void Init() { GameObject l_instance = GameObjectManager.CreatGameObject("UIManager"); s_instance = l_instance.GetComponent <UIManager>(); s_UILayerManager = l_instance.GetComponent <UILayerManager>(); s_UIAnimManager = l_instance.GetComponent <UIAnimManager>(); s_UIcamera = l_instance.GetComponentInChildren <Camera>(); DontDestroyOnLoad(l_instance); }
void CreateCell() { for (int i = 0; i < m_length; i++) { for (int j = 0; j < m_weight; j++) { int random = RandomService.GetRand(1, 13); GameObject go = GameObjectManager.CreatGameObject(m_CellName + "_" + random); go.transform.SetParent(m_scenceParent.transform); go.transform.position = new Vector3(i * m_cellSpace, 0, j * m_cellSpace); } } }
public static UIWindowBase CreateUIWindow(string l_UIname) { GameObject l_UItmp = GameObjectManager.CreatGameObject(l_UIname, s_Instance.gameObject); UIWindowBase l_UIbase = l_UItmp.GetComponent <UIWindowBase>(); UISystemEvent.Dispatch(l_UIbase, UIEvent.OnInit); //派发OnInit事件 try{ l_UIbase.Init(); } catch (Exception e) { Debug.LogError("OnInit Exception: " + e.ToString()); } AddHideUI(l_UIbase); return(l_UIbase); }
void CreateBoundary() { for (int i = -1; i < m_length + 1; i++) { for (int j = -1; j < m_weight + 1; j++) { Debug.Log((i < 0 || i >= m_length || j < 0 || j >= m_weight) + " I:" + i + " J:" + j); if (i < 0 || i >= m_length || j < 0 || j >= m_weight) { int random = RandomService.GetRand(1, 6); GameObject go = GameObjectManager.CreatGameObject(m_BoundaryName + "_" + random); go.transform.SetParent(m_scenceParent.transform); go.transform.position = new Vector3(i * m_cellSpace, 0, j * m_cellSpace); } } } }
public static UIWindowBase CreateUIWindow(string UIName) { GameObject UItmp = GameObjectManager.CreatGameObject(UIName, s_UIManagerGo); UIWindowBase UIbase = UItmp.GetComponent <UIWindowBase>(); UISystemEvent.Dispatch(UIbase, UIEvent.OnInit); //派发OnInit事件 try{ UIbase.Init(GetUIID(UIName)); } catch (Exception e) { Debug.LogError("OnInit Exception: " + e.ToString()); } AddHideUI(UIbase); s_UILayerManager.SetLayer(UIbase); //设置层级 return(UIbase); }