Ejemplo n.º 1
0
    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);
        }
    }
Ejemplo n.º 2
0
    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();
    }
Ejemplo n.º 3
0
 public void ShowMainMenu()
 {
     anim.Play("MainMenuIdle");
     player.ScreenState = PlayerScreenState.MainMenu;
     cg.interactable    = cg.blocksRaycasts = true;
     LeanTweenEx.ChangeCanvasGroupAlpha(cg, 1.0f, 0.2f);
 }
Ejemplo n.º 4
0
    public void OnOtherMenuExit()
    {
        LeanTween.cancel(gameObject, false);

        LeanTweenEx.ChangeCanvasGroupAlpha(gameObject, canvasGroup, menuDefaultAlpha, 0.33f);
        canvasGroup.interactable   = true;
        canvasGroup.blocksRaycasts = true;
    }
Ejemplo n.º 5
0
    public void OnOtherMenuEnter()
    {
        LeanTween.cancel(gameObject, false);

        LeanTweenEx.ChangeCanvasGroupAlpha(gameObject, canvasGroup, 0.0f, 0.33f);
        canvasGroup.interactable   = false;
        canvasGroup.blocksRaycasts = false;
    }
Ejemplo n.º 6
0
    private void Awake()
    {
        points.Shuffle();

        LeanTween.delayedCall(gameObject, currTime, () => {
            LeanTween.moveLocalY(cg.gameObject, 100f, 0.2f);
            LeanTweenEx.ChangeCanvasGroupAlpha(cg, 0.0f, 0.2f);
        });
    }
Ejemplo n.º 7
0
 public void OnCreditsBackClick()
 {
     if (creditscg.alpha == 0)
     {
         return;
     }
     player.ScreenState     = PlayerScreenState.MainMenu;
     creditscg.interactable = creditscg.blocksRaycasts = false;
     LeanTweenEx.ChangeCanvasGroupAlpha(creditscg, 0.0f, 0.2f);
 }
Ejemplo n.º 8
0
 void HideHelpMenu()
 {
     if (isFirstClick)
     {
         isPlaying    = true;
         isFirstClick = false;
         LeanTween.moveLocalY(helpGroup.gameObject, 100f, 0.2f);
         LeanTweenEx.ChangeCanvasGroupAlpha(helpGroup, 0.0f, 0.2f);
     }
 }
Ejemplo n.º 9
0
    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();
    }
Ejemplo n.º 10
0
    public void HideCanvas()
    {
        if (!isShowed)
        {
            return;
        }
        isShowed = false;

        canvasGroup.interactable   = false;
        canvasGroup.blocksRaycasts = false;
        LeanTweenEx.ChangeCanvasGroupAlpha(gameObject, canvasGroup, 0.0f, 0.33f);
    }
Ejemplo n.º 11
0
    public void Show()
    {
        if (isShowed)
        {
            return;
        }
        isShowed = true;

        canvasGroup.interactable   = true;
        canvasGroup.blocksRaycasts = true;
        LeanTweenEx.ChangeCanvasGroupAlpha(gameObject, canvasGroup, 1.0f, 0.33f);
        mainMenu.OnOtherMenuEnter();
    }
Ejemplo n.º 12
0
    internal virtual void Show(bool isForce)
    {
        gameObject.SetActive(true);

        if (isForce)
        {
            canvasGroup.alpha = 1.0f;
        }
        else
        {
            LeanTweenEx.ChangeCanvasGroupAlpha(canvasGroup, 1.0f, animTime);
        }
    }
Ejemplo n.º 13
0
 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);
         });
     }
 }
Ejemplo n.º 14
0
    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);
        }
    }
Ejemplo n.º 15
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();
    }
Ejemplo n.º 16
0
 public void ShowCreditsLong()
 {
     player.ScreenState     = PlayerScreenState.SubMainMenu;
     creditscg.interactable = creditscg.blocksRaycasts = true;
     LeanTweenEx.ChangeCanvasGroupAlpha(creditscg, 1.0f, 0.5f);
 }
Ejemplo n.º 17
0
 public void HideMainMenu()
 {
     cg.interactable = cg.blocksRaycasts = false;
     LeanTweenEx.ChangeCanvasGroupAlpha(cg, 0.0f, 0.2f);
 }
Ejemplo n.º 18
0
 public void NewGame()
 {
     LeanTweenEx.ChangeCanvasGroupAlpha(cg, 0.0f, 0.2f);
     cg.blocksRaycasts = cg.interactable = false;
     GameManager.Instance.player.dialog.StartDialogue(OnDialogueEnd);
 }
Ejemplo n.º 19
0
 public void Hide()
 {
     LeanTweenEx.ChangeCanvasGroupAlpha(cg, 0.0f, 0.2f);
 }
Ejemplo n.º 20
0
 public void ShowLose()
 {
     LeanTweenEx.ChangeCanvasGroupAlpha(loseGroup, 1.0f, 0.2f);
     loseGroup.interactable = loseGroup.blocksRaycasts = true;
 }
Ejemplo n.º 21
0
 public void OnPlayClick()
 {
     canvasGroup.interactable   = false;
     canvasGroup.blocksRaycasts = true;
     LeanTweenEx.ChangeCanvasGroupAlpha(canvasGroup, 0.0f, 0.25f);
 }