fix:1、更换项目,使用winter来创建
This commit is contained in:
@@ -1,49 +1,48 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Newtonsoft.Json;
|
||||
using SGModule.Common.Extensions;
|
||||
using UnityEngine;
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public class SaveData
|
||||
{
|
||||
public static Saveobject saveobject;
|
||||
public static Saveobject GetSaveobject()
|
||||
public static Saveobject _saveObject;
|
||||
public static Saveobject GetSaveObject()
|
||||
{
|
||||
// if (saveobject == null)
|
||||
// {
|
||||
// if (File.Exists(jsonFilePath))
|
||||
// {
|
||||
// string jsonstr = File.ReadAllText(jsonFilePath);
|
||||
// saveobject = JsonConvert.DeserializeObject<Saveobject>(jsonstr);
|
||||
// return saveobject;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// saveobject = new Saveobject();
|
||||
// return saveobject;
|
||||
// }
|
||||
// }
|
||||
// else return saveobject;
|
||||
return PreferencesMgr.Instance.saveobject;
|
||||
if (_saveObject == null)
|
||||
{
|
||||
// if (File.Exists(jsonFilePath))
|
||||
// {
|
||||
// string jsonstr = File.ReadAllText(jsonFilePath);
|
||||
// _saveObject = JsonConvert.DeserializeObject<Saveobject>(jsonstr);
|
||||
// return _saveObject;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// _saveObject = new Saveobject();
|
||||
// return _saveObject;
|
||||
// }
|
||||
|
||||
_saveObject = DataMgr.SaveObject.Value;
|
||||
}
|
||||
|
||||
|
||||
return _saveObject;
|
||||
|
||||
}
|
||||
|
||||
private static string jsonFilePath = Path.Combine(Application.persistentDataPath, "SaveData1.json");
|
||||
|
||||
public static void saveDataFunc()
|
||||
public static void SaveDataFunc()
|
||||
{
|
||||
// if (saveobject == null) return;
|
||||
// string save = JsonConvert.SerializeObject(saveobject);
|
||||
// if (save == null || save == string.Empty) return;
|
||||
// if (File.Exists(jsonFilePath)) File.Delete(jsonFilePath);
|
||||
// File.WriteAllText(jsonFilePath, save);
|
||||
|
||||
DataMgr.SaveObject.Save();
|
||||
}
|
||||
|
||||
public static bool battlepassred()
|
||||
{
|
||||
|
||||
int pass_level = GameHelper.GetBattleLv();
|
||||
List<int> freelist = SaveData.GetSaveobject().battle_pass_freelist;
|
||||
for (int i = 1; i <= ConfigSystem.GetConfig<PassportrewardsModel>().dataList.Count; i++)
|
||||
List<int> freelist = SaveData.GetSaveObject().battle_pass_freelist;
|
||||
for (int i = 1; i <= ConfigSystem.GetConfig<Passportrewards>().Count; i++)
|
||||
{
|
||||
if (pass_level >= i)
|
||||
{
|
||||
@@ -54,10 +53,10 @@ namespace FlowerPower
|
||||
}
|
||||
|
||||
}
|
||||
if (SaveData.GetSaveobject().is_get_battlepass)
|
||||
if (SaveData.GetSaveObject().is_get_battlepass)
|
||||
{
|
||||
List<int> paylist = SaveData.GetSaveobject().battle_pass_paylist;
|
||||
for (int i = 1; i <= ConfigSystem.GetConfig<PassportrewardsModel>().dataList.Count; i++)
|
||||
List<int> paylist = SaveData.GetSaveObject().battle_pass_paylist;
|
||||
for (int i = 1; i <= ConfigSystem.GetConfig<Passportrewards>().Count; i++)
|
||||
{
|
||||
if (pass_level >= i)
|
||||
{
|
||||
@@ -73,24 +72,24 @@ namespace FlowerPower
|
||||
|
||||
public static bool passtaskred()
|
||||
{
|
||||
List<int> list = SaveData.GetSaveobject().pass_task_record;
|
||||
for (int i = 0; i < ConfigSystem.GetConfig<PassingTaskModel>().dataList.Count; i++)
|
||||
List<int> list = SaveData.GetSaveObject().pass_task_record;
|
||||
for (int i = 0; i < ConfigSystem.GetConfig<PassingTask>().Count; i++)
|
||||
{
|
||||
if (GameHelper.GetLevel() > ConfigSystem.GetConfig<PassingTaskModel>().dataList[i].tol_num)
|
||||
if (GameHelper.GetLevel() > ConfigSystem.GetConfig<PassingTask>()[i].tol_num)
|
||||
{
|
||||
if (!list.Contains(ConfigSystem.GetConfig<PassingTaskModel>().dataList[i].id)) return true;
|
||||
if (!list.Contains(ConfigSystem.GetConfig<PassingTask>()[i].id)) return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public static bool timetaskred()
|
||||
{
|
||||
List<int> list = SaveData.GetSaveobject().time_task_record;
|
||||
for (int i = 0; i < ConfigSystem.GetConfig<DurationtasksModel>().dataList.Count; i++)
|
||||
List<int> list = SaveData.GetSaveObject().time_task_record;
|
||||
for (int i = 0; i < ConfigSystem.GetConfig<Durationtasks>().Count; i++)
|
||||
{
|
||||
if (GameHelper.GetGameTime() >= ConfigSystem.GetConfig<DurationtasksModel>().dataList[i].tol_num * 60)
|
||||
if (GameHelper.GetGameTime() >= ConfigSystem.GetConfig<Durationtasks>()[i].tol_num * 60)
|
||||
{
|
||||
if (!list.Contains(ConfigSystem.GetConfig<DurationtasksModel>().dataList[i].id)) return true;
|
||||
if (!list.Contains(ConfigSystem.GetConfig<Durationtasks>()[i].id)) return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@@ -98,13 +97,13 @@ namespace FlowerPower
|
||||
|
||||
public static bool AdTaskred()
|
||||
{
|
||||
List<int> list = SaveData.GetSaveobject().ad_task_record;
|
||||
List<int> list = SaveData.GetSaveObject().ad_task_record;
|
||||
|
||||
for (int i = 0; i < ConfigSystem.GetConfig<ADTaskModel>().dataList.Count; i++)
|
||||
for (int i = 0; i < ConfigSystem.GetConfig<ADTask>().Count; i++)
|
||||
{
|
||||
if (PreferencesMgr.Instance.VideoWatchCount >= ConfigSystem.GetConfig<ADTaskModel>().dataList[i].tol_num)
|
||||
if (DataMgr.VideoWatchCount.Value >= ConfigSystem.GetConfig<ADTask>()[i].tol_num)
|
||||
{
|
||||
if (!list.Contains(ConfigSystem.GetConfig<ADTaskModel>().dataList[i].id)) return true;
|
||||
if (!list.Contains(ConfigSystem.GetConfig<ADTask>()[i].id)) return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@@ -115,7 +114,7 @@ namespace FlowerPower
|
||||
return battlepassred();
|
||||
}
|
||||
public static float pay_time = 0;
|
||||
public static float rd_time = 0;
|
||||
public static float rm_time = 0;
|
||||
|
||||
|
||||
|
||||
@@ -140,7 +139,6 @@ namespace FlowerPower
|
||||
public bool have_slot;
|
||||
public int battle_pass_time;
|
||||
public int _watch_ad_cd;
|
||||
public int add_one_watch_ad_cd;
|
||||
|
||||
|
||||
public List<int> pass_task_record = new List<int>();
|
||||
@@ -175,6 +173,7 @@ namespace FlowerPower
|
||||
|
||||
public long start_time;
|
||||
public int clear_number;
|
||||
public int remove_ad_time;
|
||||
|
||||
public int this_time_cardtype;
|
||||
|
||||
@@ -189,42 +188,13 @@ namespace FlowerPower
|
||||
public int three_gift_got_index = 1;
|
||||
public long last_got_three_gift_time = 0;
|
||||
public bool is_get_ThreeDaysGift;
|
||||
public int addview_off_time;
|
||||
public int game_fail_number;
|
||||
public int game_fail_off_number;
|
||||
|
||||
public long lastLoginTime = 0;
|
||||
public string attribution = "null";
|
||||
public int watchRewardADnumbers;
|
||||
public double watchRewardAD_value;
|
||||
public int LargeRewardNum;
|
||||
|
||||
public int InterstitialPLayNum;
|
||||
public int TurnOffNumbers;
|
||||
public int TurnOffDay;
|
||||
public long TurnOffTime;
|
||||
public int chout_lv;
|
||||
public int ExchangeModeToggle = 1;
|
||||
public int ExchangeProcessMode = 1;
|
||||
public int CHProcessMode = 1;
|
||||
public int remove_ad_time;
|
||||
public int isGetFirstGold;
|
||||
public int isGetFirstGift;
|
||||
|
||||
public long first_login_time = 0;
|
||||
public int[] TodayOpenNum = new int[2] { 0, 0 };
|
||||
|
||||
// public List<UserData> users = new List<UserData>();
|
||||
public UserData selfUser;
|
||||
// public List<RankRewardData> rankRewardData = new List<RankRewardData>();
|
||||
|
||||
public bool IsBuySpeedGift;
|
||||
//小额奖励
|
||||
public bool IsGetPettyReward;
|
||||
public int PettyState;
|
||||
public string PettyAccount;
|
||||
public string PettyFirstName;
|
||||
public string PettyLastName;
|
||||
|
||||
public int PettyAmount;
|
||||
public string PettyOrderID;
|
||||
public string PettyDateTime;
|
||||
public int PettyDataLimit;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user