public static void LoadMain() { ViewControllerSettingsData data = viewControllerSettings.GetDataForID("MAIN"); UnloadAllViews(); LoadView(data); }
static void Initialize() { GameObject eventSystem = new GameObject("Event System", typeof(EventSystem), typeof(StandaloneInputModule)); GameObject cameraObject = new GameObject("Background Camera"); cameraObject.AddComponent <SimpleViewControllerInput>(); Camera camera = cameraObject.AddComponent <Camera>(); camera.clearFlags = CameraClearFlags.Color; camera.backgroundColor = Color.black; viewControllerSettings = Resources.Load <ViewControllerSettings>("ViewControllerSettings") as ViewControllerSettings; ViewControllerSettingsData data = viewControllerSettings.GetStartPointData(); LoadView(data); }
public static void LoadView(ViewControllerSettingsData data, Dictionary <string, object> payload) { if (data != null) { GameObject prefab = Resources.Load <GameObject>(data.ResourcePath); if (prefab != null) { GameObject go = UnityEngineObject.Instantiate(prefab, Vector3.back * depth, Quaternion.identity); foreach (var item in go.GetComponentsInChildren <Camera>()) { item.depth = depth; } depth++; IView view = go.GetComponent <IView>(); view.Setup(payload); screens.Add(new Data(data.ID, go, payload)); } } }
public static void LoadProduct(Dictionary <string, object> payload) { ViewControllerSettingsData data = viewControllerSettings.GetDataForID("PRODUCT"); LoadView(data, payload); }
public static void LoadCompany(Dictionary <string, object> payload) { ViewControllerSettingsData data = viewControllerSettings.GetDataForID("COMPANY"); LoadView(data, payload); }
public static void LoadView(ViewControllerSettingsData data) { LoadView(data, null); }