public static void Save_Info()
    {
        // Write information
        string Str_Data = Data_Manager.Get_PlayerName() + "|" + Data_Manager.Get_PlayerHash() + "|" + Data_Manager.Get_HighScore();

        byte[]   Byte_Data = System.Text.Encoding.UTF8.GetBytes(Str_Data);
        string[] Data      = new string[1];
        Data[0] = System.Convert.ToBase64String(Byte_Data);

        File.WriteAllLines(File_Path, Data);
    }
Exemple #2
0
    public static void Set_GameOverMenu(bool State)
    {
        GameObject Background_Canvas = GameObject.Find("Background_Canvas");

        for (int i = 1; i < 12; i++)
        {
            Background_Canvas.transform.GetChild(i).gameObject.SetActive(State);
        }

        // Set player name (if exist)
        Background_Canvas.transform.GetChild(5).GetComponent <InputField>().text = Data_Manager.Get_PlayerName();
    }
Exemple #3
0
    public static void Set_SubmitScoreMenu(bool State)
    {
        GameObject Background_Canvas = GameObject.Find("Background_Canvas");

        for (int i = 12; i < 17; i++)
        {
            Background_Canvas.transform.GetChild(i).gameObject.SetActive(State);
        }

        // Set player name (if exist) and Input field set focus
        Background_Canvas.transform.GetChild(14).GetComponent <InputField>().text = Data_Manager.Get_PlayerName();
        Background_Canvas.transform.GetChild(14).GetComponent <InputField>().Select();
    }
    public void Post_Score(string Name, int High_Score)
    {
        if (Name != Data_Manager.Get_PlayerName())
        {
            Data_Manager.Set_PlayerName(Name);
            Data_Manager.Set_HighScore(High_Score);

            // Generate hash
            string Hash_Data = Generate_Hash("Your info");
            Data_Manager.Set_PlayerHash(Hash_Data);
        }

        SubmitInfo Info = new SubmitInfo("Your data");

        StartCoroutine(Post(Info));
    }