private void Start() { bool isCinematicShowed = PlayerPrefs.GetInt("GameMenu.isCinematicShowed", 0) == 1; if (isCinematicShowed) { logo.interactable = logo.blocksRaycasts = false; LeanTweenEx.ChangeCanvasGroupAlpha(logo, 0.0f, 0.2f); SoundImage.sprite = SoundImageState[AudioManager.Instance.IsEnabled ? 1 : 0]; ShowMainMenu(); } else { logo.interactable = logo.blocksRaycasts = true; logo.alpha = 1.0f; LeanTween.delayedCall(logoAnim.GetDuration(), () => { logo.interactable = logo.blocksRaycasts = false; LeanTweenEx.ChangeCanvasGroupAlpha(logo, 0.0f, 0.2f); SoundImage.sprite = SoundImageState[AudioManager.Instance.IsEnabled ? 1 : 0]; ShowMainMenu(); anim.Play("IntroAnimation"); player.ScreenState = PlayerScreenState.Cinematic; }); PlayerPrefs.SetInt("GameMenu.isCinematicShowed", 1); } }
public void HideGameMenu() { LeanTween.cancel(gameObject, false); player.StopChangeLevelTextAlpha(); LeanTweenEx.InvokeNextFrame(exitButton.gameObject, () => isInMenu = false); canvasGroup.interactable = false; canvasGroup.blocksRaycasts = false; virtualCamera.Follow = player.transform; LeanTween.value(gameObject, virtualCamera.m_Lens.OrthographicSize, 5.0f, 1.0f) .setOnUpdate((float size) => { virtualCamera.m_Lens.OrthographicSize = size; }); LeanTween.value(gameObject, chromaticAberration.intensity.value, defaultChromaticAberrationIntensity, 0.33f) .setOnUpdate((float intensity) => { chromaticAberration.intensity.value = intensity; }); LeanTween.value(gameObject, grain.intensity.value, 0, 0.33f) .setOnUpdate((float intensity) => { grain.intensity.value = intensity; }); LeanTweenEx.ChangeCanvasGroupAlpha(gameObject, canvasGroup, 0.0f, 0.33f); player.ChangeLevelTextAlpha(0.33f, 1.0f, false); optionsMenu.HideCanvas(); levelsSelectionMenu.HideCanvas(); }
public void ShowMainMenu() { anim.Play("MainMenuIdle"); player.ScreenState = PlayerScreenState.MainMenu; cg.interactable = cg.blocksRaycasts = true; LeanTweenEx.ChangeCanvasGroupAlpha(cg, 1.0f, 0.2f); }
public void OnOtherMenuExit() { LeanTween.cancel(gameObject, false); LeanTweenEx.ChangeCanvasGroupAlpha(gameObject, canvasGroup, menuDefaultAlpha, 0.33f); canvasGroup.interactable = true; canvasGroup.blocksRaycasts = true; }
public void OnOtherMenuEnter() { LeanTween.cancel(gameObject, false); LeanTweenEx.ChangeCanvasGroupAlpha(gameObject, canvasGroup, 0.0f, 0.33f); canvasGroup.interactable = false; canvasGroup.blocksRaycasts = false; }
private void Awake() { points.Shuffle(); LeanTween.delayedCall(gameObject, currTime, () => { LeanTween.moveLocalY(cg.gameObject, 100f, 0.2f); LeanTweenEx.ChangeCanvasGroupAlpha(cg, 0.0f, 0.2f); }); }
public void OnCreditsBackClick() { if (creditscg.alpha == 0) { return; } player.ScreenState = PlayerScreenState.MainMenu; creditscg.interactable = creditscg.blocksRaycasts = false; LeanTweenEx.ChangeCanvasGroupAlpha(creditscg, 0.0f, 0.2f); }
void HideHelpMenu() { if (isFirstClick) { isPlaying = true; isFirstClick = false; LeanTween.moveLocalY(helpGroup.gameObject, 100f, 0.2f); LeanTweenEx.ChangeCanvasGroupAlpha(helpGroup, 0.0f, 0.2f); } }
void OnRespawnEnd() { GameManager.Instance.ambient = AudioManager.Instance.PlayLoopFaded(mainMenuAmbient, channel: AudioManager.AudioChannel.Music); LeanTweenEx.ChangeCanvasGroupAlpha(cg, 1.0f, 0.5f) .setDelay(1.0f); cg.blocksRaycasts = cg.interactable = true; firstButton.Select(); }
public void HideCanvas() { if (!isShowed) { return; } isShowed = false; canvasGroup.interactable = false; canvasGroup.blocksRaycasts = false; LeanTweenEx.ChangeCanvasGroupAlpha(gameObject, canvasGroup, 0.0f, 0.33f); }
public void Show() { if (isShowed) { return; } isShowed = true; canvasGroup.interactable = true; canvasGroup.blocksRaycasts = true; LeanTweenEx.ChangeCanvasGroupAlpha(gameObject, canvasGroup, 1.0f, 0.33f); mainMenu.OnOtherMenuEnter(); }
internal virtual void Show(bool isForce) { gameObject.SetActive(true); if (isForce) { canvasGroup.alpha = 1.0f; } else { LeanTweenEx.ChangeCanvasGroupAlpha(canvasGroup, 1.0f, animTime); } }
internal virtual void Hide(bool isForce) { if (isForce) { canvasGroup.alpha = 0.0f; gameObject.SetActive(false); } else { LeanTweenEx.ChangeCanvasGroupAlpha(canvasGroup, 0.0f, animTime) .setOnComplete(() => { gameObject.SetActive(false); }); } }
public void Show(string text, Vector3 pos) { textField.text = text; UpdatePos(pos); LeanTweenEx.ChangeCanvasGroupAlpha(cg, 1.0f, 0.2f); if (isUp) { rt.rotation = Quaternion.Euler(0, 0, 0); textField.transform.rotation = Quaternion.Euler(0, 0, 0); } else { rt.rotation = Quaternion.Euler(0, 0, 180); textField.transform.rotation = Quaternion.Euler(0, 0, 0); } }
public void ShowMainMenu(bool isForce) { LeanTween.cancel(gameObject, false); player.StopChangeLevelTextAlpha(); isInMenu = true; canvasGroup.interactable = true; canvasGroup.blocksRaycasts = true; virtualCamera.Follow = mainMenuCamereTarget; if (isForce) { grain.intensity.value = defaultGrainIntensity; chromaticAberration.intensity.value = 1.0f; canvasGroup.alpha = menuDefaultAlpha; player.ChangeLevelTextAlpha(0.0f, 0.0f, true); virtualCamera.m_Lens.OrthographicSize = 2; } else { LeanTween.value(gameObject, grain.intensity.value, defaultGrainIntensity, 0.33f) .setOnUpdate((float intensity) => { grain.intensity.value = intensity; }); LeanTween.value(gameObject, chromaticAberration.intensity.value, 1.0f, 0.33f) .setOnUpdate((float intensity) => { chromaticAberration.intensity.value = intensity; }); LeanTweenEx.ChangeCanvasGroupAlpha(gameObject, canvasGroup, menuDefaultAlpha, 0.33f); player.ChangeLevelTextAlpha(0.33f, 0.0f, false); LeanTween.value(gameObject, virtualCamera.m_Lens.OrthographicSize, 2.0f, 1.0f) .setOnUpdate((float size) => { virtualCamera.m_Lens.OrthographicSize = size; }); } playButton.gameObject.SetActive(true); //playButton.Select(); }
public void ShowCreditsLong() { player.ScreenState = PlayerScreenState.SubMainMenu; creditscg.interactable = creditscg.blocksRaycasts = true; LeanTweenEx.ChangeCanvasGroupAlpha(creditscg, 1.0f, 0.5f); }
public void HideMainMenu() { cg.interactable = cg.blocksRaycasts = false; LeanTweenEx.ChangeCanvasGroupAlpha(cg, 0.0f, 0.2f); }
public void NewGame() { LeanTweenEx.ChangeCanvasGroupAlpha(cg, 0.0f, 0.2f); cg.blocksRaycasts = cg.interactable = false; GameManager.Instance.player.dialog.StartDialogue(OnDialogueEnd); }
public void Hide() { LeanTweenEx.ChangeCanvasGroupAlpha(cg, 0.0f, 0.2f); }
public void ShowLose() { LeanTweenEx.ChangeCanvasGroupAlpha(loseGroup, 1.0f, 0.2f); loseGroup.interactable = loseGroup.blocksRaycasts = true; }
public void OnPlayClick() { canvasGroup.interactable = false; canvasGroup.blocksRaycasts = true; LeanTweenEx.ChangeCanvasGroupAlpha(canvasGroup, 0.0f, 0.25f); }