public virtual void Init(string windowName, XUIParamBundle paramBundle) { param = param.Trim(); if (string.IsNullOrEmpty(param)) { Controller = new XUIControllerEmpty(); return; } var variables = GetComponent <XMonoVariables>(); if (variables == null) { Debug.LogError($"xuicontroller 没有找到XMonoVariables组件 !!!"); return; } if (lua) { Controller = new XUIControllerLua(); } else { //这里暂时用反射 Controller = typeof(IXUIController).Assembly.CreateInstance(param) as IXUIController; } if (Controller == null) { Debug.LogError($"lua:{lua} param:{param} is not exist!"); return; } Controller.Init(windowName, paramBundle, variables); }
public virtual void Term() { if (m_parent != null) { XMsgManager.Remove(m_parent.MsgManager, MsgManager); m_parent = null; } }
public void SetParent(IXUIController parent) { if (m_parent == parent) { return; } if (m_parent != null) { XMsgManager.Remove(m_parent.MsgManager, MsgManager); m_parent = null; } if (parent != null) { m_parent = parent; XMsgManager.Append(m_parent.MsgManager, MsgManager); } }
public virtual void Term() { Controller?.Term(); Controller = null; }