public GameObject LoadCanvas(string canvasPrefabPath, IElementCenter elementCenter) { var canvasUIObj = CreateGameObjectFromPrefab(canvasPrefabPath); var rootUIObj = concreteUIManager.GetRootUIObjectFromCanvasObject(canvasUIObj); elementCenter.Add(UI_ROOT_ELEMENT_ID, rootUIObj); return(rootUIObj); }
public GameObject LoadCanvas(string canvasPrefabPath, IElementCenter elementCenter) { var canvasUIObj = CreateGameObjectFromPrefab(canvasPrefabPath); var rootUIObj = concreteUIManager.GetRootUIObjectFromCanvasObject(canvasUIObj); elementCenter.Add(UI_ROOT_ELEMENT_ID, rootUIObj); return rootUIObj; }
public GameObject LoadUI(string prefabPath, IElementCenter elementCenter, GameObject parentUI = null) { if (string.IsNullOrEmpty(prefabPath)) { Debug.LogError("prefabPath is null"); return(null); } var go = CreateGameObjectFromPrefab(prefabPath); if (go == null) { Debug.LogError("UI in path:" + prefabPath + " cannot be load."); return(null); } var scanner = go.GetComponent <IElementScanner>(); if (scanner != null) { scanner.Scan(go, elementCenter); } if (parentUI == null) { parentUI = elementCenter.Get(UI_ROOT_ELEMENT_ID) as GameObject; } if (parentUI == null) { Debug.LogError("no rootUI loaded, please load rootUI first."); } else { concreteUIManager.AddChildUI(go, parentUI); } return(go); }
public GameObject LoadUI(string prefabPath, IElementCenter elementCenter, GameObject parentUI = null) { if (string.IsNullOrEmpty(prefabPath)) { Debug.LogError("prefabPath is null"); return null; } var go = CreateGameObjectFromPrefab(prefabPath); if (go == null) { Debug.LogError("UI in path:" + prefabPath + " cannot be load."); return null; } var scanner = go.GetComponent<IElementScanner>(); if (scanner != null) { scanner.Scan(go, elementCenter); } if (parentUI == null) { parentUI = elementCenter.Get(UI_ROOT_ELEMENT_ID) as GameObject; } if (parentUI == null) { Debug.LogError("no rootUI loaded, please load rootUI first."); } else { concreteUIManager.AddChildUI(go, parentUI); } return go; }
public void Init(string uiDesPath = null) { SetupModuleManager(); elementCenter = new WeakReferenceElementCenter(); OnWillRegisterDynamicModule(ModuleManager); ICollection<IDynamicModule> modules = this.ModuleManager.GetAllModules(); foreach (var m in modules) { m.Init(); } if (!string.IsNullOrEmpty(uiDesPath)) { LoadUIWithDescription(uiDesPath); } foreach (var m in modules) { m.OnAllModuleInitDone(this.ModuleManager); } }
public void Init(string uiDesPath = null) { SetupModuleManager(); elementCenter = new WeakReferenceElementCenter(); OnWillRegisterDynamicModule(ModuleManager); ICollection <IDynamicModule> modules = this.ModuleManager.GetAllModules(); foreach (var m in modules) { m.Init(); } if (!string.IsNullOrEmpty(uiDesPath)) { LoadUIWithDescription(uiDesPath); } foreach (var m in modules) { m.OnAllModuleInitDone(this.ModuleManager); } }
public virtual void Scan(GameObject go, IElementCenter eleCenter) { }
public override void Scan(GameObject uiObject, IElementCenter eleCenter) { eleCenter.Add(UIElement_Test, textObj); }