private IEnumerator PlayFadeAnimation(bool forward, CanvasGroup target) { if (forward) { yield return(Instance.StartCoroutine(PlayFadeAnimation(0f, 1f, target))); } else { yield return(Instance.StartCoroutine(PlayFadeAnimation(1f, 0f, target))); } }
public void LoadLevelFadeInDelegate(string sceneName, bool animate = true, bool useLoadingScreen = true, bool usePlayerInput = false) { if (animate) { Instance.StartCoroutine(LoadLevelFadeIn(sceneName, false, useLoadingScreen, usePlayerInput)); } else { Instance.StartCoroutine(LoadLevelLoadScreen(sceneName, usePlayerInput)); } }
private void Start() { // If there is no instance of this class, set it. if (Instance == null) { DontDestroyOnLoad(gameObject); // Don't destroy this object Instance = this; if (SplashObj != null) { _canvasObj = Instantiate(SplashObj); _canvasObj.transform.SetParent(transform); _canvasObj.transform.position = Vector3.zero; _splashCanvasGroup = _canvasObj.GetComponent <CanvasGroup>(); _canvasObj.GetComponent <Canvas>().sortingOrder = 999; DontDestroyOnLoad(SplashObj); } BlackOverlay.GetComponent <Canvas>().sortingOrder = 998; Instance.StartCoroutine(LoadNextLevelFadeIn()); } else { Debug.LogError("There is already a SceneController in the scene."); Destroy(this); } }
private void Start() { // Initialize loader loader = new ZenjectSceneLoader(this.GetComponent <SceneContext>(), this.GetComponentInParent <ProjectKernel>()); // If there is no instance of this class, set it. if (Instance == null) { Instance = this; if (SplashObj != null) { _canvasObj = Instantiate(SplashObj); _canvasObj.transform.SetParent(transform); _canvasObj.transform.position = Vector3.zero; _splashCanvasGroup = _canvasObj.GetComponentInChildren <CanvasGroup>(); _canvasObj.GetComponent <Canvas>().sortingOrder = 999; DontDestroyOnLoad(SplashObj); } Instance.StartCoroutine(LoadLevelFadeIn(DEFAULT_SCENE.Trim(), true, false)); } else { Debug.LogError("There is already a SceneController in the scene."); Destroy(this); } }