Пример #1
0
    public void Initialize(string missionName)
    {
        this.missionName = missionName;
        name.text        = missionName;
        if (GameController.Instance.PlayerData.IsMissionAvailable(missionName) || GameController.Instance.DevModeEnabled)
        {
            button.onClick.RemoveAllListeners();
            button.onClick.AddListener(() => GameController.Instance.PlayMission(missionName));
            lockImage.gameObject.SetActive(false);

            if (PlayFabClientAPI.IsClientLoggedIn())
            {
                PF_PlayerData.GetPlayerLeaderboardPosition(this.missionName);
                PF_PlayerData.GetHighScore(this.missionName);
            }
            else
            {
                SetPlayerScore();
            }
        }
        else
        {
            lockImage.gameObject.SetActive(true);
            button.onClick.AddListener(() => DialogCanvasManager.Instance.midInfo.Show("Mission Locked!"));
        }
    }