Example #1
0
    public void Load_LeaderBoards(string gameType)
    {
        ILeaderboard lb = PlayGamesPlatform.Instance.CreateLeaderboard();

        switch (gameType)
        {
        case "Wiz":
            lb.id = GPG_Ids.leaderboard_wiz_split_leaderboard;
            break;

        case "Quick":
            lb.id = GPG_Ids.leaderboard_quick_split_leaderboard;
            break;

        case "Wit":
            lb.id = GPG_Ids.leaderboard_wit_split_leaderboard;
            break;

        case "Holy":
            lb.id = GPG_Ids.leaderboard_holy_split_leaderboard;
            break;

        default:
            lb.id = GPG_Ids.leaderboard_wiz_split_leaderboard;
            break;
        }
        lb.id = "MY_LEADERBOARD_ID";
        lb.LoadScores(ok =>
        {
            if (ok)
            {
                GameObject temp = GameObject.Find("High Score Calculator");
                if (temp != null)
                {
                    High_Score_Calculator hsc = temp.GetComponent <High_Score_Calculator>();
                    hsc.LoadUsersandScores(lb);
                }
            }
            else
            {
                Debug.Log("Error retrieving leaderboardi");
                GameObject temp = GameObject.Find("High Score Calculator");
                if (temp != null)
                {
                    High_Score_Calculator hsc = temp.GetComponent <High_Score_Calculator>();
                    hsc.LoadUsersandScores(null);
                }
            }
        });
    }
Example #2
0
    // Use this for initialization
    void Start()
    {
        highScoreCalculator = GameObject.Find("High Score Calculator").GetComponent <High_Score_Calculator> ();
        //first check if they're using the most recent version of the game
        if (PlayerPrefs.GetInt("Version", 0) != versionNumber)
        {
            highScoreCalculator.Reset_All_Scores();
            foreach (High_Score_Displayer hsd in hsds)
            {
                hsd.update_scores();
            }
            PlayerPrefs.SetInt("Version", versionNumber);
        }
        achievementHandler = GameObject.Find("Achievement Handler").GetComponent <Achievement_Script> ();
        gpgNotification    = GameObject.Find("Google Play Notification").GetComponent <GPG_Notification> ();
        Goto_Game_Mode_Layer();
        shutter.Begin_Vertical_Open();

        GameObject MCobject = GameObject.FindGameObjectWithTag("Music Controller");

        mc = MCobject.GetComponent <Music_Controller> ();

        mc.Play_Music("Menu");

        //just in case this is the first time playing, set Wiz to be for sure unlocked
        PlayerPrefs.SetInt("Wiz unlocked", 1);
        //tell achievmement handler to check gamemodes that are supposed to be active
        achievementHandler.Check_Gamemode_Unlocked();

        activeMode = 0;
        prevMode   = 0;
        ScrollDown.BroadcastMessage("FadeOut", null, SendMessageOptions.DontRequireReceiver);
        for (int i = 0; i < 4; i++)
        {
            OrigButtonSprite[i] = GameButtons[i].GetComponent <Image>().sprite;
            OrigDescText[i]     = Descriptions[i].GetComponent <Text>().text;
        }
        GameMode_Unlocker();

        if (PlayerPrefs.GetInt("Played Before", 0) == 1)
        {
            Destroy(HTPEmphasizer);
        }
    }