public void SaveMatchGlobal()
    {
        Match      m1  = GetMatch("V_1", "V_1_0");
        Match      m2  = GetMatch("V_1_3", "V_1_4");
        BoardMatch bm1 = new BoardMatch();

        bm1.Matchs.Add(m1);
        bm1.Matchs.Add(m2);

        Match      m3  = GetMatch("V_2_0", "V_2_1");
        BoardMatch bm2 = new BoardMatch();

        bm2.Matchs.Add(m3);



        MatchGlobal mglobal = new MatchGlobal();

        mglobal.Matchs.Add(bm1);
        mglobal.Matchs.Add(bm2);
        string json = JsonUtility.ToJson(mglobal);

        PlayerPrefs.SetString(Key_Tourment_A, json);
        PlayerPrefs.Save();

        ///////////////

        Match      mb1  = GetMatch("B_V_1_0", "B_V_1_1");
        Match      mb2  = GetMatch("B_V_1_2", "B_V_1_3");
        BoardMatch bmb1 = new BoardMatch();

        bmb1.Matchs.Add(mb1);
        bmb1.Matchs.Add(mb2);

        Match      mb3  = GetMatch("B_V_2_0", "B_V_2_1");
        BoardMatch bmb2 = new BoardMatch();

        bmb2.Matchs.Add(mb3);



        MatchGlobal mglobalB = new MatchGlobal();

        mglobalB.Matchs.Add(bmb1);
        mglobalB.Matchs.Add(bmb2);
        string jsonb = JsonUtility.ToJson(mglobalB);

        PlayerPrefs.SetString(Key_Tourment_B, jsonb);
        PlayerPrefs.Save();
    }
 public void LoadMatch(MatchGlobal matchs)
 {
     for (int i = 0; i < matchs.Matchs.Count; i++)
     {
         Debug.Log("Start 0 : " + matchs.Matchs.Count);
         Debug.Log("Start 0 : " + matchs.Matchs[i].Matchs.Count);
         for (int j = 0; j < matchs.Matchs[i].Matchs.Count; j++)
         {
             Debug.Log(matchs.Matchs[i].Matchs + " " + "Match ");
             var a = matchs.Matchs[i].Matchs[j];
             ResultMatch(a);
         }
     }
 }
    public void LoadNewTour()
    {
        int[] SKin1 = UI_Tourment_Rivial.RandomSKin();
        int[] SKin2 = UI_Tourment_Rivial.RandomSKin();
        int[] SKin3 = UI_Tourment_Rivial.RandomSKin();
        int[] SKin4 = UI_Tourment_Rivial.RandomSKin();
        int[] SKin5 = UI_Tourment_Rivial.RandomSKin();
        int[] SKin6 = UI_Tourment_Rivial.RandomSKin();
        int[] SKin7 = UI_Tourment_Rivial.RandomSKin();
        int[] SKin8 = UI_Tourment_Rivial.RandomSKin();

        Skin Skin1 = new Skin(SKin1);
        Skin Skin2 = new Skin(SKin2);
        Skin Skin3 = new Skin(SKin3);
        Skin Skin4 = new Skin(SKin4);
        Skin Skin5 = new Skin(SKin5);
        Skin Skin6 = new Skin(SKin6);
        Skin Skin7 = new Skin(SKin7);
        Skin Skin8 = new Skin(SKin8);

        List <Skin> SKins = new List <Skin>();

        SKins.Add(Skin1);
        SKins.Add(Skin2);
        SKins.Add(Skin3);
        SKins.Add(Skin4);
        SKins.Add(Skin5);
        SKins.Add(Skin6);
        SKins.Add(Skin7);
        SKins.Add(Skin8);


        Skins ListSins = new Skins(SKins);

        string json = JsonUtility.ToJson(ListSins);

        PlayerPrefs.SetString(Key_Skins, json);
        PlayerPrefs.Save();


        PlayerPrefs.SetInt(Key_Tourment, 0);
        // A
        Match match1 = new Match("V_1", "V_1_0", 0, 0);
        Match match2 = new Match("V_1_3", "V_1_4", 0, 0);


        BoardMatch boardmatch = new BoardMatch();

        boardmatch.Matchs.Add(match1);
        boardmatch.Matchs.Add(match2);

        Match match3 = new Match("V_2_1", "V_2_0", 0, 0);

        BoardMatch boardmatch1 = new BoardMatch();

        boardmatch1.Matchs.Add(match3);

        MatchGlobal global = new MatchGlobal();

        global.Matchs.Add(boardmatch);
        global.Matchs.Add(boardmatch1);

        string json2 = JsonUtility.ToJson(global);

        PlayerPrefs.SetString(Key_Tourment_A, json2);
        PlayerPrefs.Save();

        ////////////////////////////////////

        Match      match4      = new Match("B_V_1_0", "B_V_1_1", 0, 0);
        Match      match5      = new Match("B_V_1_2", "B_V_1_3", 0, 0);
        BoardMatch boardmatch3 = new BoardMatch();

        boardmatch3.Matchs.Add(match4);
        boardmatch3.Matchs.Add(match5);


        Match      match6      = new Match("B_V_2_0", "B_V_2_1", 0, 0);
        BoardMatch boardmatch4 = new BoardMatch();

        boardmatch4.Matchs.Add(match6);

        MatchGlobal global_1 = new MatchGlobal();

        global_1.Matchs.Add(boardmatch3);
        global_1.Matchs.Add(boardmatch4);

        string json1 = JsonUtility.ToJson(global_1);

        PlayerPrefs.SetString(Key_Tourment_B, json1);
        PlayerPrefs.Save();

        LoadPlayer();
    }