public void RewindAPI() { if (EMMotionManager.GetState("HedgehogOpenClose") == EMBaseMotion.MotionState.Open) { EMMotionManager.RewindMotion("HedgehogSimple"); } }
protected override void On_StartMotion(string id) { if (id == motionId) { if (currentProp.motionType == EMMotionProperties.MotionType.OneShot) { if (motionState != MotionState.Opening) { motionState = MotionState.Opening; onPlayStart.Invoke(motionName); if (simpleProp.sound != null) { EMMotionManager.PlaySound(simpleProp.sound, simpleProp.volume); } } } else { if (motionState != MotionState.Closing) { motionState = MotionState.Closing; onRewindStart.Invoke(motionName); if (simpleProp.sound != null && playSoundRewind) { EMMotionManager.PlaySound(simpleProp.sound, simpleProp.volume); } } } } }
protected override void On_StartMotion(string id) { if (id == motionId) { if (currentProp.motionType == EMMotionProperties.MotionType.Open) { if (motionState != MotionState.Opening) { motionState = MotionState.Opening; onOpenStart.Invoke(motionName); showUIElement(); if (openProp.sound != null) { EMMotionManager.PlaySound(openProp.sound, openProp.volume); } } } else { if (motionState != MotionState.Closing) { motionState = MotionState.Closing; onCloseStart.Invoke(motionName); if (closeProp.sound != null) { EMMotionManager.PlaySound(closeProp.sound, closeProp.volume); } } } } }
void Start() { AudioManager.instance.Play("MenuBGMusic"); Time.timeScale = 1; EMMotionManager.Open("MenuStartTitle"); StartCoroutine(OpenEMAnimationDelayBySeconds(0.5f, "MenuStartAction")); menuCamera.GetComponent <Animation>().Play("StartMenu_CameraFlyIn"); Component[] mainMenuTransform = mainMenu.GetComponentsInChildren(typeof(Transform), true); mainMenuBlur = Instantiate(originalBlur); foreach (Transform item in mainMenuTransform) { if (item.gameObject.name == "Blur") { item.GetComponent <Image>().material = mainMenuBlur; } } Component[] levelSelectTransform = levelSelectMenu.GetComponentsInChildren(typeof(Transform), true); levelSelectBlur = Instantiate(originalBlur); foreach (Transform item in levelSelectTransform) { if (item.gameObject.name == "Blur") { item.GetComponent <Image>().material = levelSelectBlur; } } }
void Update() { openCloseState.text = EMMotionManager.GetState("HedgehogOpenClose").ToString(); simpleState.text = EMMotionManager.GetState("HedgehogSimple").ToString(); if (EMMotionManager.GetState("HedgehogOpenClose") == EMBaseMotion.MotionState.Closing) { EMMotionManager.ResetSimpleMotion("HedgehogSimple"); } }
void Update() { if (hardInput.GetKeyDown("Enter") && startMenu && canStart) { mainMenuNewBlur = 250f; levelSelectMenuNewBlur = 0f; ChangeFocus(1.93f, 0.5f); EMMotionManager.Close("MenuStartAction"); EMMotionManager.Close("MenuStartTitle"); menuCamera.GetComponent <Animation>().Play("StartMenu_CameraFlyOut"); startMenu = false; AudioManager.instance.Play("MenuEnterKey"); } mainMenuBlur.SetFloat("_BlurSize", Mathf.Lerp(mainMenuBlur.GetFloat("_BlurSize"), mainMenuNewBlur, Time.deltaTime * smooth)); levelSelectBlur.SetFloat("_BlurSize", Mathf.Lerp(levelSelectBlur.GetFloat("_BlurSize"), levelSelectMenuNewBlur, Time.deltaTime * smooth)); }
public void OpenAPI() { EMMotionManager.Open("HedgehogOpenClose"); }
public void CloseAPI() { EMMotionManager.Close("HedgehogOpenClose"); }
void Update() { if (hardInput.GetKeyDown("PauseGame")) { pauseMenuActive = !pauseMenuActive; // Opens Menu if (pauseMenuActive) { this.transform.Find("Menu").Find("PauseMenu").gameObject.SetActive(true); // If player is dead keep screen blur the same if (!player.GetComponent <PlayerBehaviour>().dead) { gameMenus.transform.Find("ScreenBlur").GetComponent <Animate>().DoAnimation(); weakFrostedGlass.SetFloat("_Radius", 0f); weakFrostedGlassNew = 4f; ActivateOrDeactivatePlayer(false); } gameMenus.transform.Find("PauseMenu").GetComponent <Animate>().DoAnimation(); strongFrostedGlass.SetFloat("_Radius", 0f); strongFrostedGlassNew = 24f; Cursor.visible = true; Cursor.lockState = CursorLockMode.None; isPaused = true; } // Closes Menu else { animCloseStart = true; // If player is dead keep screen blur the same if (!player.GetComponent <PlayerBehaviour>().dead) { gameMenus.transform.Find("ScreenBlur").GetComponent <Animate>().DoAnimation(); weakFrostedGlass.SetFloat("_Radius", 4f); weakFrostedGlassNew = 0f; ActivateOrDeactivatePlayer(true); } gameMenus.transform.Find("PauseMenu").GetComponent <Animate>().DoAnimation(); strongFrostedGlass.SetFloat("_Radius", 24f); strongFrostedGlassNew = 0f; UnPauseGame(); if (!triggerManager.usingButtonPress) { Cursor.visible = false; Cursor.lockState = CursorLockMode.Locked; } isPaused = false; } } // GameOver Screen if (player.GetComponent <PlayerBehaviour>().dead&& !deadActive) { EMMotionManager.Open("GameOver"); ActivateOrDeactivatePlayer(false); gameMenus.transform.Find("ScreenBlur").GetComponent <Animate>().DoAnimation(); gameMenus.transform.Find("ScreenDarken").GetComponent <Animate>().DoAnimation(); weakFrostedGlass.SetFloat("_Radius", 0f); weakFrostedGlassNew = 4f; deadActive = true; } // Pauses Time! if (isPaused && !gameMenus.transform.Find("PauseMenu").GetComponent <Animation>().IsPlaying("PauseMenu")) { PauseGame(); } // Updates Frosted Glass strongFrostedGlass.SetFloat("_Radius", Mathf.Lerp(strongFrostedGlass.GetFloat("_Radius"), strongFrostedGlassNew, Time.deltaTime * smooth)); weakFrostedGlass.SetFloat("_Radius", Mathf.Lerp(weakFrostedGlass.GetFloat("_Radius"), weakFrostedGlassNew, Time.deltaTime * smooth)); if (animCloseStart) { if (!this.transform.Find("Menu").Find("PauseMenu").GetComponent <Animation>().isPlaying) { animCloseStart = false; this.transform.Find("Menu").Find("PauseMenu").gameObject.SetActive(false); } } }
// Delay for Close Animation (EM) private IEnumerator CloseEMAnimationDelayBySeconds(float time, string name) { yield return(new WaitForSeconds(time)); EMMotionManager.Close(name); }