Пример #1
0
    private void HandleMainMenuNotifications(string sceneName)
    {
        if (sceneName == "Main Menu")
        {
            int hasSeenTutorial = PlayerPrefs.GetInt(EnumUtil.GetString(NotificationType.Tutorial), 0);
            if (hasSeenTutorial == 0)
            {
                GameObject go = GameObject.FindGameObjectWithTag("UI_GRP");
                if (go != null)
                {
                    tutorialPanel = go.GetComponent <TutorialPanel>();
                }
                else
                {
                    Debug.LogError("No UI_GRP found");
                }
                if (tutorialPanel != null)
                {
                    tutorialPanel.StartTutorial();
                }
            }

            int hasFinishedGame = PlayerPrefs.GetInt(EnumUtil.GetString(NotificationType.Finish), 0);
            if (hasFinishedGame == 1)
            {
                GameObject go = GameObject.FindGameObjectWithTag("UI_GRP");
                if (go != null)
                {
                    gameFinishPanel = go.GetComponent <GameFinishPanel>();
                }
                else
                {
                    Debug.LogError("No UI_GRP found");
                }
                if (gameFinishPanel != null)
                {
                    gameFinishPanel.StartNotification();
                    PlayerPrefs.SetInt(EnumUtil.GetString(NotificationType.Finish), 2);
                }
            }
        }
    }