// Use this for initialization public virtual void Start() { playerInputActions = PlayerInputHelper.LoadData(0); menuButtons.ForEach(menuButton => menuButton.AddEventListener(this.gameObject)); SelectFirstButton(); }
public virtual void SetActive() { if (playerInputActions == null) { playerInputActions = PlayerInputHelper.LoadData(0); ActivateMenu(); } else { ActivateMenu(); } }
protected virtual void Awake() { Assert.IsTrue(Owner is IPlayer); Assert.IsNotNull(PlayerInputData); Assert.IsTrue(PlayerInputData.InputBufferSize > 0); Assert.IsTrue(PlayerInputData.InputBufferTimeoutMs > 0); InputHelper = GetComponent <PlayerInputHelper>(); _moveBuffer = new CircularBuffer <Vector3>(PlayerInputData.InputBufferSize); _lookBuffer = new CircularBuffer <Vector3>(PlayerInputData.InputBufferSize); }
public static void LoadSceneQuickly(Scene scene) { PlayerInputHelper.ResetInputHelper(); PauseHelper.ResumeGame(); Time.timeScale = 1f; Loader.IS_USING_LOADER = false; Loader.HAS_DONE_FULL_RELOAD = false; loadingScene = scene; SceneManager.LoadScene(scene.ToString()); }
public static void LoadSceneAdditive(Scene scene) { PlayerInputHelper.ResetInputHelper(); if (GameObject.Find("CameraContainer")) { GameObject.Find("CameraContainer").SetActive(false); GameObject.Find("UICameraContainer").SetActive(false); } PauseHelper.ResumeGame(); Time.timeScale = 1f; Logger.Log("loading.. " + scene.ToString()); SceneManager.LoadScene(scene.ToString(), LoadSceneMode.Additive); }
public static void LoadScene(Scene scene) { PlayerInputHelper.ResetInputHelper(); PauseHelper.ResumeGame(); Time.timeScale = 1f; Loader.IS_USING_LOADER = true; Loader.HAS_USED_LOADER = true; Loader.HAS_DONE_FULL_RELOAD = true; loadingScene = scene; SceneManager.LoadScene(Scene.Empty.ToString(), LoadSceneMode.Single); SceneManager.LoadScene(Scene.Loading.ToString(), LoadSceneMode.Additive); }
public static void ReloadLevelAndStopLoading() { PlayerInputHelper.ResetInputHelper(); Destroy(SceneUtils.FindObject <Loader>().gameObject); string sceneToLoad = loadingScene.ToString(); if (!Loader.HAS_USED_LOADER) { sceneToLoad = Application.loadedLevelName; } Scene scene = (Scene)System.Enum.Parse(typeof(Scene), sceneToLoad); HAS_DONE_FULL_RELOAD = true; Loader.LoadScene(scene); }
public static void ReloadLevelWithoutLoadingScene(bool isUsingLoader = true) { PlayerInputHelper.ResetInputHelper(); PauseHelper.ResumeGame(); Time.timeScale = 1f; string sceneToLoad = loadingScene.ToString(); if (!Loader.HAS_USED_LOADER) { sceneToLoad = Application.loadedLevelName; } Loader.IS_USING_LOADER = isUsingLoader; HAS_DONE_FULL_RELOAD = false; SceneManager.LoadScene(sceneToLoad, LoadSceneMode.Single); }
protected virtual void OnActivated() { playerInputActions = PlayerInputHelper.LoadData(0); }