public void LoadScene() { if (this.WindowManager == null) { this.WindowManager = WindowManager.Instance; } if (this.SceneManager == null) { this.SceneManager = SceneManager.Instance; } if (this.LoadAdditive) { if (this.WindowManager != null) { this.WindowManager.OpenWindow(this.SceneName); } else { Application.LoadLevelAdditive(this.SceneName); } } else { if (this.SceneManager != null) { this.SceneManager.ChangeScene(this.SceneName); } else { Application.LoadLevel(this.SceneName); } } }
protected void Awake() { if (this.WindowManager == null) { this.WindowManager = FindObjectOfType<WindowManager>(); } }
private void OnWindowOpened(WindowManager.Window window) { // Check if window has data context. var context = window.Context as Context; if (context == null) { return; } // Set context in context holder. var contextHolder = window.Root.GetComponent<ContextHolder>(); if (contextHolder != null) { contextHolder.Context = context; } // Set window reference if window context. var windowContext = context as WindowContext; if (windowContext != null) { windowContext.Window = window; } }
/// <summary> /// Unity callback. /// </summary> protected void Awake() { if (Instance == null) { Instance = this; } else { Debug.LogWarning("Multiple window manager found, please use only one.", this); } }