170 lines
4.9 KiB
C#
170 lines
4.9 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using RedHotRoast;
|
|
using UnityEngine;
|
|
|
|
public class SaveingPotClass
|
|
{
|
|
|
|
public int tableId;
|
|
|
|
|
|
public int id;
|
|
|
|
|
|
public string amountStr;
|
|
|
|
|
|
public float amount;
|
|
|
|
|
|
public long makeupTime;
|
|
|
|
|
|
public int videoCount;
|
|
|
|
|
|
public int inlineInitNum;
|
|
|
|
|
|
public int inlineNum;
|
|
|
|
|
|
public string orderID;
|
|
|
|
|
|
public SaveingPotTaskStatus status;
|
|
|
|
public long order_time = 0;
|
|
public int WatchVideoSpeedNum = 0;
|
|
public int loginSpeedNum = 0;
|
|
public int activeMinute = 0;
|
|
public int activeSpeedNum = 0;
|
|
|
|
public bool needShowAni = true;
|
|
public float H5Time;
|
|
|
|
public long clear_time;
|
|
public long start_time;
|
|
public bool auto_show = false;
|
|
public void SetStatus(SaveingPotTaskStatus _status)
|
|
{
|
|
status = _status;
|
|
}
|
|
|
|
public string GetAmountStr()
|
|
{
|
|
// if (amount <= 0)
|
|
// {
|
|
// return amountStr;
|
|
// }
|
|
// else
|
|
// {
|
|
return GameHelper.ChooseCurrency() + $"{amount:N}";
|
|
//}
|
|
}
|
|
|
|
public float ch_number = 0;
|
|
}
|
|
public enum SaveingPotTaskStatus
|
|
{
|
|
None,
|
|
Task,
|
|
Inline,
|
|
}
|
|
// var makeupTaskData = new MakeupTaskData();
|
|
// makeupTaskData.tableId = makeupVo.id;
|
|
// makeupTaskData.id = DataMgr.MakeupTaskHistory.Value.Count + 1;
|
|
// makeupTaskData.amountStr = $"{GameHelper.Get102Str(makeupVo.item_need)}";
|
|
// makeupTaskData.amount = makeupVo.item_need;
|
|
// makeupTaskData.orderID = GameHelper.GetRandomNum(8);
|
|
|
|
// DataMgr.MakeupTaskHistory.Value.Add(makeupTaskData);
|
|
// Debug.Log("uuuuuuuuuuuuuuuuuuuu");
|
|
// makeupTaskData.SetStatus(MakeupTaskStatus.None);
|
|
public class SaveingPotHelper
|
|
{
|
|
|
|
public static void CheckSaveingPot()
|
|
{
|
|
Debug.Log(SaveData.GetSaveObject());
|
|
if (SaveData.GetSaveObject().saveingpot_history == null || SaveData.GetSaveObject().saveingpot_history.Count == 0)
|
|
{
|
|
CreatSaveingPotItem();
|
|
}
|
|
ResetHistory();
|
|
}
|
|
|
|
public static void CreatSaveingPotItem()
|
|
{
|
|
if (SaveData.GetSaveObject().saveingpot_history.Count >= 3)
|
|
{
|
|
SaveData.SaveDataFunc();
|
|
return;
|
|
}
|
|
int index = SaveData.GetSaveObject().saveingpot_history.Count;
|
|
if (index >= ConfigSystem.GetConfig<Makeup_2>().Count) index = ConfigSystem.GetConfig<Makeup_2>().Count - 1;
|
|
Makeup_2 config = ConfigSystem.GetConfig<Makeup_2>()[index];
|
|
SaveingPotClass saveingpot = new SaveingPotClass();
|
|
saveingpot.tableId = config.id;
|
|
saveingpot.id = SaveData.GetSaveObject().saveingpot_history.Count + 1;
|
|
saveingpot.amountStr = GameHelper.ChooseCurrency() + $"{config.item_need:N}";
|
|
saveingpot.amount = config.item_need;
|
|
saveingpot.orderID = GameHelper.GetRandomNum(8);
|
|
saveingpot.SetStatus(SaveingPotTaskStatus.None);
|
|
saveingpot.clear_time = GameHelper.GetNowTime() + config.Reset_time * 3600;
|
|
saveingpot.start_time = GameHelper.GetNowTime();
|
|
|
|
SaveData.GetSaveObject().saveingpot_history.Add(saveingpot);
|
|
SaveData.SaveDataFunc();
|
|
Debug.Log("zengjaichenggong");
|
|
}
|
|
|
|
public static bool TestingClearTime()
|
|
{
|
|
if (SaveData.GetSaveObject().saveingpot_history[SaveData.GetSaveObject().saveingpot_history.Count - 1].clear_time < GameHelper.GetNowTime() && SaveData.GetSaveObject().saveingpot_history[SaveData.GetSaveObject().saveingpot_history.Count - 1].needShowAni)
|
|
{
|
|
Debug.Log("qinglisaveingpot");
|
|
int index = SaveData.GetSaveObject().saveingpot_history.Count - 1;
|
|
Makeup_2 config = ConfigSystem.GetConfig<Makeup_2>()[index];
|
|
SaveData.GetSaveObject().saveingpot_ch = 0;
|
|
SaveData.GetSaveObject().saveingpot_history[SaveData.GetSaveObject().saveingpot_history.Count - 1].clear_time = GameHelper.GetNowTime() + config.Reset_time * 3600;
|
|
SaveData.GetSaveObject().saveingpot_history[SaveData.GetSaveObject().saveingpot_history.Count - 1].auto_show = false;
|
|
|
|
return true;
|
|
|
|
}
|
|
return false;
|
|
}
|
|
public static void ResetHistory()
|
|
{
|
|
for (int i = 0; i < SaveData.GetSaveObject().saveingpot_history.Count; i++)
|
|
{
|
|
SaveingPotClass saveingpot = SaveData.GetSaveObject().saveingpot_history[i];
|
|
Makeup_2 config = ConfigSystem.GetConfig<Makeup_2>()[i];
|
|
saveingpot.amount = config.item_need;
|
|
saveingpot.amountStr = GameHelper.ChooseCurrency() + $"{config.item_need:N}";
|
|
if (saveingpot.start_time + config.Reset_time * 3600 - saveingpot.clear_time > 100)
|
|
{
|
|
saveingpot.clear_time = saveingpot.start_time + config.Reset_time * 3600;
|
|
}
|
|
}
|
|
SaveData.SaveDataFunc();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static string getChString(float ch)
|
|
{
|
|
return GameHelper.ChooseCurrency()+$"{ch:N}";
|
|
}
|
|
public static string getChNumber(float ch)
|
|
{
|
|
return $"{ch:N}";
|
|
}
|
|
|
|
}
|
|
|