Beispiel #1
0
 public void ShowLeaderboardUI()
 {
     // Sign In 이 되어있지 않은 상태라면
     // Sign In 후 리더보드 UI 표시 요청할 것
     //if (Social.localUser.authenticated == false) {
     if (PlayGamesPlatform.Instance.IsAuthenticated() == false)
     {
         PlayGamesPlatform.Instance.Authenticate((bool success) => {
             //Social.localUser.Authenticate ((bool success) => {
             if (success)
             {
                 // Sign In 성공
                 // 바로 리더보드 UI 표시 요청
                 //Social.ShowLeaderboardUI (GPGSIds.leaderboard_world_ranking);
                 PlayGamesPlatform.Instance.ShowLeaderboardUI(GPGSIds.leaderboard_world_ranking);
                 return;
             }
             else
             {
                 // Sign In 실패
                 // 그에 따른 처리
                 return;
             }
         });
     }
     else
     {
             #if UNITY_ANDROID
         PlayGamesPlatform.Instance.ShowLeaderboardUI(GPGSIds.leaderboard_world_ranking);
             #elif UNITY_IOS
         GameCenterPlatform.ShowLeaderboardUI("Leaderboard_ID", UnityEngine.SocialPlatforms.TimeScope.AllTime);
             #endif
     }
 }
Beispiel #2
0
 public void ShowTop()
 {
     #if UNITY_IOS && !UNITY_EDITOR
     GameCenterPlatform.ShowLeaderboardUI(iOS_LeaderboardID, UnityEngine.SocialPlatforms.TimeScope.AllTime);
     //Social.ShowLeaderboardUI();
     #endif
 }
Beispiel #3
0
    public void ShowLeaderboardUI()
    {
        // Sign In 이 되어있지 않은 상태라면
        // Sign In 후 리더보드 UI 표시 요청할 것
        if (Social.localUser.authenticated == false)
        {
            Social.localUser.Authenticate((bool success) =>
            {
                if (success)
                {
                    // Sign In 성공
                    // 바로 리더보드 UI 표시 요청
                    Debug.Log("ShowLeaderboardUI success");
                    Social.ShowLeaderboardUI();

                    return;
                }
                else
                {
                    Debug.Log("ShowLeaderboardUI fail");
                    // Sign In 실패
                    // 그에 따른 처리
                    return;
                }
            });
        }

                #if UNITY_ANDROID
        PlayGamesPlatform.Instance.ShowLeaderboardUI();
                #elif UNITY_IOS
        GameCenterPlatform.ShowLeaderboardUI("Leaderboard_ID", UnityEngine.SocialPlatforms.TimeScope.AllTime);
                #endif
    }
Beispiel #4
0
 //Open Leaderboard UI
 public void OpenLeaderboards()
 {
     if (Social.localUser.authenticated)
     {
         GameCenterPlatform.ShowLeaderboardUI(_highScore, UnityEngine.SocialPlatforms.TimeScope.AllTime);
     }
 }
Beispiel #5
0
    public void ShowLeaderboardUI()
    {
        if (Social.localUser.authenticated == false)
        {
            Debug.Log("!!!!!! SignIn ShowLeaderboardUI");
            Social.localUser.Authenticate((bool success) =>
            {
                if (success)
                {
                    // Sign In 성공
                    // 바로 업적 UI 표시 요청
                    Debug.Log("!!!!!! SignIn Suc");
                    Social.ShowLeaderboardUI();
                    return;
                }
                else
                {
                    Debug.Log("!!!!!! SignIn Fail");
                    // Sign In 실패 처리
                    return;
                }
            });
        }

#if UNITY_ANDROID
        ((PlayGamesPlatform)Social.Active).ShowLeaderboardUI(GPGSIds.leaderboard_score);

        Debug.Log("!!!!!! ShowLeaderboardUI 2");
#elif UNITY_IOS
        GameCenterPlatform.ShowLeaderboardUI("Leaderboard_ID", UnityEngine.SocialPlatforms.TimeScope.AllTime);
#endif
    }
Beispiel #6
0
 public void ShowLeadeboard()
 {
     if (Social.localUser.authenticated)
     {
                     #if UNITY_ANDROID
         PlayGamesPlatform.Instance.ShowLeaderboardUI(GoogleLeaderboard.leaderboard_high_score);
                     #elif UNITY_IOS
         GameCenterPlatform.ShowLeaderboardUI(leaderboardID, TimeScope.AllTime);
                     #endif
     }
     else
     {
         Social.localUser.Authenticate(
             success => {
             if (success)
             {
                                             #if UNITY_ANDROID
                 PlayGamesPlatform.Instance.ShowLeaderboardUI(GoogleLeaderboard.leaderboard_high_score);
                                             #elif UNITY_IOS
                 GameCenterPlatform.ShowLeaderboardUI(leaderboardID, TimeScope.AllTime);
                                             #endif
             }
         });
     }
 }
Beispiel #7
0
        /// <summary>
        /// Shows the leaderboard UI for the given leaderboard in the specified time scope.
        /// </summary>
        /// <param name="leaderboardName">Leaderboard name.</param>
        /// <param name="timeScope">Time scope to display scores in the leaderboard.</param>
        public static void ShowLeaderboardUI(string leaderboardName, TimeScope timeScope)
        {
            if (!IsInitialized())
            {
                Debug.Log("Couldn't show leaderboard UI: user is not logged in.");
                return;
            }

            Leaderboard ldb = GetLeaderboardByName(leaderboardName);

            if (ldb == null)
            {
                Debug.Log("Couldn't show leaderboard UI: unknown leaderboard name.");
                return;
            }

#if UNITY_IOS
            GameCenterPlatform.ShowLeaderboardUI(ldb.Id, timeScope);
#elif UNITY_ANDROID && EM_GPGS
            PlayGamesPlatform.Instance.ShowLeaderboardUI(ldb.Id, ToGpgsLeaderboardTimeSpan(timeScope), null);
#else
            // Fallback
            Social.ShowLeaderboardUI();
#endif
        }
Beispiel #8
0
    void Gameover()
    {
        Debug.Log("Score is: " + Score.ToString());
        //float Best;
        //Debug.Log("GameOVER");

        //Debug.Log("LOADED");
        if (Best < Score)
        {
            Debug.Log("ENTERED IF");
            try
            {
                PlayerPrefs.SetFloat("Score", Score);
                //SavedVariables.SaveVariables();
                //Save();
                //SaveHighscore(Score);
            }
            catch (Exception ex)
            {
                Debug.Log(ex.ToString());
            }
            Debug.Log("Saved");
            Social.ReportScore(Convert.ToInt64(Score), "HIGHSCORE1.1", result => {
                if (result)
                {
                    Debug.Log("Successfully reported score progress");
                    Social.LoadScores("HIGHSCORE1.1", ProcessLoadedScores);                     // Make sure to use this.
                    GameCenterPlatform.ShowLeaderboardUI("HIGHSCORE1.1", TimeScope.AllTime);
                }
                else
                {
                    Debug.Log("Failed to report score");
                }
            });

            //	Debug.Log("SAVED");
            Best = Score;
            Kiip.saveMoment("Achieving a HIGHSCORE !!!", Best);
            //	Debug.Log("Done IF");
        }
        else
        {
            if (Score > 10)
            {
                Kiip.saveMoment("Doing Great !!!", Score);
            }
            //revMob.ShowFullscreen ();
        }
        GameOver.SetActive(true);
        outScore.text  = "Score : " + Score;
        bestScore.text = "Best : " + Best;
        if (Best == Score)
        {
            bestScore.color = Color.magenta;
        }
        InGame.gameObject.SetActive(false);
        isRunning = false;
        paused    = true;
        //Score = 0;
    }
Beispiel #9
0
 public void leaderboardButtonOnClick()
 {
     if (Social.localUser.authenticated)
     {
         GameCenterPlatform.ShowLeaderboardUI("Total_Experience_Leaderboard", TimeScope.AllTime);
     }
 }
Beispiel #10
0
        /// <summary>
        /// Shows the native achievement user interface, allowing the player to browse achievements.
        /// </summary>
        /// <param name="id">Current platform's ID for the leaderboard.</param>
        /// <param name="internalID">Internal CloudOnce ID, if available.</param>
        public void ShowOverlay(string id = "", string internalID = "")
        {
            if (!Social.localUser.authenticated)
            {
#if CLOUDONCE_DEBUG
                Debug.LogWarning("ShowOverlay can only be called after authentication.");
#endif
                return;
            }

            if (string.IsNullOrEmpty(id))
            {
#if CLOUDONCE_DEBUG
                Debug.Log("Showing leaderboards overlay.");
#endif
                Social.ShowLeaderboardUI();
            }
            else
            {
#if CLOUDONCE_DEBUG
                Debug.Log(string.Format("Showing {0} ({1}) leaderboard overlay.", internalID, id));
#endif
                GameCenterPlatform.ShowLeaderboardUI(id, TimeScope.AllTime);
            }
        }
Beispiel #11
0
        //------------------------------------------------------------------------------------------------
        public static void ShowLeaderboardUI(int levelId)
        {
                                                #if UNITY_ANDROID
            //		if (!GoogleGPGS.Instance().IsUserLoggedIn())
            //		{
            //			GoogleGPGS.Instance().Login();
            //		}
            //
            //
//						string thisLeaderboardCode = GameCenterWrapper.GetGoogleLevelCode(Globals.g_gameGUI.selectedLevel);
            //		GoogleGPGS.Instance().ShowLeaderboard(thisLeaderboardCode);

//						if (Globals.g_mainLoop.state == MainLoop.State.kStartScreen)
//						Social.ShowLeaderboardUI();
//						else
//						GooglePlayGames.PlayGamesPlatform.Instance.ShowLeaderboardUI(thisLeaderboardCode);

            //		Social.ShowLeaderboardUI();
                                                #else
            if (levelId == -1)
            {
                Social.ShowLeaderboardUI();
            }
            else
            {
//								string leaderboardString =
                string leaderboardString = ((Globals.g_world.frontEnd).profile).GetLeaderboardId(levelId);

                GameCenterPlatform.ShowLeaderboardUI(leaderboardString, TimeScope.AllTime);
                Social.ShowLeaderboardUI();
            }
                                                #endif
        }
Beispiel #12
0
 public void onClick()
 {
     if (Social.localUser.authenticated)
     {
         GameCenterPlatform.ShowLeaderboardUI("topscores4", UnityEngine.SocialPlatforms.TimeScope.AllTime);
     }
 }
    public void ShowLeaderboards()
    {
#if (PLATFORM_IOS == true)
        GameCenterPlatform.ShowLeaderboardUI(grassChapterLeaderboard, TimeScope.AllTime);
#elif (PLATFORM_ANDROID == true)
        Social.ShowLeaderboardUI();
#endif
    }
Beispiel #14
0
 public void ShowLeaderboardUI()
 {
     if (IsUserAuthenticated())
     {
         //Social.ShowLeaderboardUI();
         GameCenterPlatform.ShowLeaderboardUI("com.unit9.swip3wear.leaderboard", TimeScope.AllTime);
     }
 }
Beispiel #15
0
    public void LeaderboardButton()
    {
#if UNITY_IOS
        GameCenterPlatform.ShowLeaderboardUI("Daily_Leaderboard", TimeScope.Today);
        GameCenterPlatform.ShowLeaderboardUI("Weekly_Leaderboard", TimeScope.Week);
        GameCenterPlatform.ShowLeaderboardUI("All_Time_Leaderboard", TimeScope.AllTime);
#endif
    }
Beispiel #16
0
 public void ShowLeaderBoard()
 {
     if (!_didInit)
     {
         return;
     }
     Debug.Log("GameCenter: Show Leaderboard: " + _config.GameCenter.LeaderboardIds.First().Value);
     GameCenterPlatform.ShowLeaderboardUI(_config.GameCenter.LeaderboardIds.First().Value, TimeScope.AllTime);
 }
Beispiel #17
0
    public void showLeaderboard()
    {
#if UNITY_ANDROID
        PlayGamesPlatform.Instance.ShowLeaderboardUI(leaderboardIdToUse);
#endif

#if UNITY_IOS
        GameCenterPlatform.ShowLeaderboardUI(leaderboardIdToUse, 0);
#endif
    }
Beispiel #18
0
        public static void ShowLeaderboardUI()
        {
            //how to do in android?
#if UNITY_IPHONE
            GameCenterPlatform.ShowLeaderboardUI(Constants.gamecenterLeaderBoradScoreId, TimeScope.AllTime);
#endif
            // #if UNITY_ANDROID
            //             ((PlayGamesPlatform)Social.Active).ShowLeaderboardUI(Constants.gamecenterLeaderBoradScoreId);
            // #endif
        }
    void LeaderboardButtonClick()
    {
#if UNITY_ANDROID
#elif UNITY_IPHONE
        GameCenterPlatform.ShowLeaderboardUI("com.ArjunDureja.Basketball2D", UnityEngine.SocialPlatforms.TimeScope.AllTime);
        ReportScore(PlayerPrefs.GetInt("Highscore"), "com.ArjunDureja.Basketball2D");
        ReportScore(PlayerPrefs.GetInt("TimeChallengeScore"), "time_challenge_score");
        ReportScore(PlayerPrefs.GetInt("HardModeScore"), "hard_mode_score");
#endif
    }
Beispiel #20
0
 public void OnClick()
 {
     if (Social.localUser.authenticated)
     {
         GameCenterPlatform.ShowLeaderboardUI(leaderboard, UnityEngine.SocialPlatforms.TimeScope.AllTime);
     }
     else
     {
         print("Player not authenticated");
     }
 }
    public void PressedLeaderboard()
    {
        Debug.Log("leaderboard");
        if (!Social.localUser.authenticated)
        {
            Social.localUser.Authenticate(ProcessAuthentication);
        }
        string leaderboardID = PlayerPrefs.GetString("leaderboardid");

        GameCenterPlatform.ShowLeaderboardUI(leaderboardID, TimeScope.AllTime);
    }
Beispiel #22
0
    public void ShowLeaderboard()
    {
        GetComponent <AudioManager>().ButtonSound();
#if UNITY_ANDROID
        if (PlayGamesPlatform.Instance.localUser.authenticated)
        {
            PlayGamesPlatform.Instance.ShowLeaderboardUI();
        }
#elif UNITY_IPHONE
        GameCenterPlatform.ShowLeaderboardUI(leaderBoardId, UnityEngine.SocialPlatforms.TimeScope.AllTime);
#endif
    }
Beispiel #23
0
    public void OnShowLeaderboard()
    {
        if (Social.localUser.authenticated)
        {
#if UNITY_ANDROID
            string id = GPGS_LEADERBOARD_ID;
            ((PlayGamesPlatform)Social.Active).ShowLeaderboardUI(id); // Show current (Active) leaderboard
#elif UNITY_IOS
            string id = IOS_LEADERBOARD_ID;
            GameCenterPlatform.ShowLeaderboardUI(id, TimeScope.AllTime);
#endif
        }
    }
Beispiel #24
0
 public void ShowLeaderBoard(string key)
 {
     if (!_didInit)
     {
         return;
     }
     if (!_config.GameCenter.LeaderboardIds.ContainsKey(key))
     {
         HDDebug.Log("GameCenterMgr: " + key + " not exist in plist");
         return;
     }
     Debug.Log("GameCenter: Show Leaderboard: " + _config.GameCenter.LeaderboardIds[key]);
     GameCenterPlatform.ShowLeaderboardUI(_config.GameCenter.LeaderboardIds[key], TimeScope.AllTime);
 }
    // Use this for initialization
    void Start()
    {
        string LEADERBOARD_ID = PlayerPrefs.GetString("leaderboardid");

        Social.localUser.Authenticate(success => {
            if (success)
            {
                Debug.Log("Authentication successful");
                GameCenterPlatform.ShowLeaderboardUI(LEADERBOARD_ID, TimeScope.AllTime);
                //Social.ShowLeaderboardUI();
            }
            else
            {
                Debug.Log("Social: Authentication failed");
            }
        });
    }
 public void DisplayLeaderboard()
 {
     //Social.ShowLeaderboardUI();
     SetHighScore(NewDataPersistence.data.GetValue("High Score", false));
     if (m_loginSuccessful)
     {
         GameCenterPlatform.ShowLeaderboardUI(LEADERBOARD_ID, TimeScope.AllTime);
     }
     else
     {
         Social.localUser.Authenticate(ProcessAuthentication);
         if (m_loginSuccessful)
         {
             GameCenterPlatform.ShowLeaderboardUI(LEADERBOARD_ID, TimeScope.AllTime);
         }
     }
 }
Beispiel #27
0
        public void OnRank()
        {
#if UNITY_ANDROID
            if (!Social.localUser.authenticated)
            {
                goolgePlay.LoginWithInit();
                return;
            }
            Scene scene = SceneManager.GetActiveScene();
            if (gameaudio != null)
            {
                gameaudio.ButtonBeepPop();
            }
            if (scene.name == "Game")
            {
                PlayGamesPlatform.Instance.ShowLeaderboardUI("CgkIyIDh6tIfEAIQAA");
            }
            else if (scene.name == "GameSpin")
            {
                PlayGamesPlatform.Instance.ShowLeaderboardUI("CgkIyIDh6tIfEAIQBw");
            }
            else if (scene.name == "TimingGame")
            {
                PlayGamesPlatform.Instance.ShowLeaderboardUI("CgkIyIDh6tIfEAIQCA");
            }
#elif (UNITY_IPHONE || UNITY_IOS)
            if (!Social.localUser.authenticated)
            {
                goolgePlay.LoginWithInit();
                return;
            }
            Scene scene = SceneManager.GetActiveScene();
            if (scene.name == "Game")
            {
                GameCenterPlatform.ShowLeaderboardUI("timedspin", UnityEngine.SocialPlatforms.TimeScope.AllTime);
            }
            else if (scene.name == "GameSpin")
            {
                GameCenterPlatform.ShowLeaderboardUI("gamespinrank", UnityEngine.SocialPlatforms.TimeScope.AllTime);
            }
            else if (scene.name == "TimingGame")
            {
                GameCenterPlatform.ShowLeaderboardUI("timingspinrank", UnityEngine.SocialPlatforms.TimeScope.AllTime);
            }
#endif
        }
Beispiel #28
0
 void OnAuthenticate(bool wasSuccessful)
 {
     if (wasSuccessful && Social.localUser.authenticated)
     {
         leaderboardAuthenticationHasSucceeded = true;
         Modal.MaybeHideModal();
         GameCenterPlatform.ShowLeaderboardUI(
             "flannelflow_main",
             UnityEngine.SocialPlatforms.TimeScope.AllTime
             );
     }
     else
     {
         leaderboardAuthenticationHasSucceeded = false;
         ShowFailureLeaderboard();
     }
 }
Beispiel #29
0
    public void ShowLeaderboardUI()
    {
        Debug.Log("### ShowLeaderboardUI");

        // Sign In 이 되어있지 않은 상태라면
        // Sign In 후 리더보드 UI 표시 요청할 것
        if (!Social.localUser.authenticated)
        {
            Debug.Log("로그인 되어있지 않음");
            androidSet.ShowToast("로그인 후 확인할 수 있습니다.", false);
            return;
        }

#if UNITY_ANDROID
        PlayGamesPlatform.Instance.ShowLeaderboardUI();
#elif UNITY_IOS
        GameCenterPlatform.ShowLeaderboardUI("Leaderboard_ID", UnityEngine.SocialPlatforms.TimeScope.AllTime);
#endif
    }
Beispiel #30
0
        public static void ShowLeaderboards2()
        {
#if UNITY_IOS
            _platform.ShowLeaderboardUI();
#endif
        }