Exemplo n.º 1
0
    public static void Save()
    {
#if UNITY_WEBGL //GameJolt
        if (SaveDatesForJolt.s != null && Manager.Instance.CurrentUser != null)
        {
            Debug.Log("salvou: " + Manager.Instance.CurrentUser.ID.ToString());
            byte[]  sb  = SaveDatesForJolt.SaveDatesForBytes();
            preJSON pre = new preJSON()
            {
                b = sb
            };

            DataStore.Set(Manager.Instance.CurrentUser.ID.ToString(),
                          JsonUtility.ToJson(pre), true,
                          Acertou);
        }
#endif
#if UNITY_N3DS
        if (SaveDatesForJolt.s != null)
        {
            byte[]  sb  = SaveDatesForJolt.SaveDatesForBytes();
            preJSON pre = new preJSON()
            {
                b = sb
            };
            UnityEngine.N3DS.FileSystemSave.Mount();

            StreamWriter sw = File.CreateText(Application.persistentDataPath + "/file1");
            sw.WriteLine(JsonUtility.ToJson(pre));
            sw.Close();
            UnityEngine.N3DS.FileSystemSave.Unmount();
        }
#endif
#if !UNITY_N3DS && !UNITY_WEBGL
        if (s != null && !GlobalController.g.EmTeste)
        {
            byte[]  sb  = SaveDatesForBytes();
            preJSON pre = new preJSON()
            {
                b = sb
            };

            PlayerPrefs.SetString("dates_RK", JsonUtility.ToJson(pre));

            PlayerPrefs.Save();
        }
#endif
    }
Exemplo n.º 2
0
    public static void Save(SaveDatesManager s)
    {
        if (GameJoltAPI.Instance != null)
        {
            if (s != null && GameJoltAPI.Instance.CurrentUser != null)
            {
                Debug.Log("salvou: " + GameJoltAPI.Instance.CurrentUser.ID.ToString());
                byte[]  sb  = SaveDatesManager.SaveDatesForBytes();
                preJSON pre = new preJSON()
                {
                    b = sb
                };

                DataStore.Set(GameJoltAPI.Instance.CurrentUser.ID.ToString(),
                              JsonUtility.ToJson(pre), true,
                              Acertou);
            }
        }
    }
Exemplo n.º 3
0
    public static void Save()
    {
#if UNITY_WEBGL //GameJolt
        if (UrlVerify.DomainsContainString("gamejolt"))
        {
            ForGameJoltDatesManager.Save(s);
        }
#endif
#if UNITY_N3DS
        if (s != null)
        {
            byte[]  sb  = SaveDatesForBytes();
            preJSON pre = new preJSON()
            {
                b = sb
            };
            UnityEngine.N3DS.FileSystemSave.Mount();

            StreamWriter sw = File.CreateText(Application.persistentDataPath + "/file1");
            sw.WriteLine(JsonUtility.ToJson(pre));
            sw.Close();
            UnityEngine.N3DS.FileSystemSave.Unmount();
        }
#endif
#if !UNITY_N3DS && !UNITY_WEBGL
        if (s != null && !GlobalController.g.EmTeste)
        {
            byte[]  sb  = SaveDatesForBytes();
            preJSON pre = new preJSON()
            {
                b = sb
            };

            PlayerPrefs.SetString("dates_RK", JsonUtility.ToJson(pre));

            PlayerPrefs.Save();
        }
#endif
    }