private IEnumerator StartGame_impl() { FadingManager.GetInstance().FadeToBlack(2.0f); yield return(new WaitForSeconds(2.0f)); mainMenuCameraHolder.SetActive(false); controller.gameObject.SetActive(true); controller.SetCursorLock(true); Dispatcher.GetInstance().SendEvent(new EBEvent() { type = EBEventType.GameStarted }); TextOutput textOutput = TextOutput.GetInstance(); textOutput.ShowText(TextManager.GetIntroText(), TextOutput.TextAreaSize.Big); yield return(new WaitWhile(() => textOutput.IsActive())); FadingManager.GetInstance().FadeToNormal(3.0f); yield return(new WaitForSeconds(1.0f)); ResumeGame(); isPauseAllowed = true; }
public void Init(Camera camera, FirstPersonController controller) { this.camera = camera; this.cameraFading = FadingManager.GetInstance(); this.controller = controller; roomsManager = RoomsManager.GetManager(); }
public override void Awake() { base.Awake(); Canvas c = gameObject.AddComponent <Canvas>(); c.renderMode = RenderMode.ScreenSpaceOverlay; c.sortingOrder = 10; CanvasScaler scaler = gameObject.AddComponent <CanvasScaler>(); scaler.uiScaleMode = CanvasScaler.ScaleMode.ScaleWithScreenSize; scaler.referenceResolution = new Vector2(1024f, 1080f); scaler.screenMatchMode = CanvasScaler.ScreenMatchMode.MatchWidthOrHeight; scaler.matchWidthOrHeight = 0.5f; //GraphicRaycaster gRaycaster = gameObject.AddComponent<GraphicRaycaster>(); GameObject panel = new GameObject("FadingCover"); panel.AddComponent <CanvasRenderer>(); cover = panel.AddComponent <Image>(); cover.rectTransform.anchorMin = new Vector2(0f, 0f); cover.rectTransform.anchorMax = new Vector2(1f, 1f); cover.color = Color.black; panel.transform.SetParent(transform, false); fadingManager = gameObject.AddComponent <FadingManager>(); }
private IEnumerator GameLoading_impl() { FadingManager.GetInstance().SetFadedToBlack(); PauseGame(); Time.timeScale = 1.0f; yield return(new WaitUntil(() => SceneManager.GetSceneByName("Prologue").isLoaded&& SceneManager.GetSceneByName("Hall").isLoaded)); Dispatcher.GetInstance().SendEvent(new EBEvent() { type = EBEventType.GameLoaded }); FadingManager.GetInstance().FadeToNormal(4.0f); }
private IEnumerator EndingAnimation() { controller.enabled = false; monster.GetComponent <MonsterBehaviour>().SetPatrolEnabled(false); FadingManager.GetInstance().FadeToBlack(5); yield return(FadeOutMonsterSounds(5)); TextOutput textOutput = TextOutput.GetInstance(); textOutput.ShowText(TextManager.GetBadEndingText(), TextOutput.TextAreaSize.Small); yield return(new WaitWhile(() => textOutput.IsActive())); UnityEngine.SceneManagement.SceneManager.LoadScene("Main"); }
private void Awake() { if (Instance == null) { Instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); return; } AudioManager = GetComponent <AudioManager>(); FadingManager = GetComponent <FadingManager>(); player = Camera.main.transform.parent; gvr_rp = Camera.main.transform.GetChild(0).GetComponent <GvrReticlePointer>(); }
private void Awake() { instance = this; }