备份代码

This commit is contained in:
oldpeper 2024-12-21 14:05:40 +08:00
parent b60222c66a
commit 54d365f8ac
10 changed files with 168 additions and 46 deletions

View File

@ -100,5 +100,65 @@
"ConstantValue": "120",
"ConstantString": "",
"Commant": "开店整体时间(秒)"
},
{
"ID": 18,
"ConstantValue": "1000",
"ConstantString": "",
"Commant": "默认拥有金币"
},
{
"ID": 19,
"ConstantValue": "0",
"ConstantString": "",
"Commant": "默认拥有钻石"
},
{
"ID": 20,
"ConstantValue": "71001",
"ConstantString": "",
"Commant": "默认开启关卡"
},
{
"ID": 21,
"ConstantValue": "2011",
"ConstantString": "",
"Commant": "默认解锁道具1"
},
{
"ID": 22,
"ConstantValue": "2101",
"ConstantString": "",
"Commant": "默认解锁道具2"
},
{
"ID": 23,
"ConstantValue": "2201",
"ConstantString": "",
"Commant": "默认解锁道具3"
},
{
"ID": 24,
"ConstantValue": "2301",
"ConstantString": "",
"Commant": "默认解锁道具4"
},
{
"ID": 25,
"ConstantValue": "2401",
"ConstantString": "",
"Commant": "默认解锁道具5"
},
{
"ID": 26,
"ConstantValue": "2501",
"ConstantString": "",
"Commant": "默认解锁道具6"
},
{
"ID": 27,
"ConstantValue": "2602",
"ConstantString": "",
"Commant": "默认解锁道具7"
}
]

View File

@ -4677,8 +4677,8 @@ RectTransform:
m_Children: []
m_Father: {fileID: 625197371}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchorMin: {x: 0, y: 0.54034656}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 20, y: 20}
m_Pivot: {x: 0.5, y: 0.5}
@ -9918,7 +9918,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!224 &400670381
RectTransform:
m_ObjectHideFlags: 0
@ -10037,6 +10037,7 @@ MonoBehaviour:
_settlementPanel: {fileID: 1846267102}
_npcCount: {fileID: 1621375820}
_goldNum: {fileID: 1921662075}
_diamondNum: {fileID: 463668752}
seletIcon: {fileID: 913941968}
--- !u!1 &401006246
GameObject:
@ -11643,9 +11644,9 @@ RectTransform:
m_Father: {fileID: 1613204639}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_SizeDelta: {x: -17, y: -17}
m_Pivot: {x: 0, y: 1}
--- !u!114 &469052288
MonoBehaviour:
@ -12072,7 +12073,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &479478149
RectTransform:
m_ObjectHideFlags: 0
@ -12910,7 +12911,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -0.000116895004}
m_SizeDelta: {x: 0, y: 300}
m_SizeDelta: {x: -1361.4, y: 300}
m_Pivot: {x: 0, y: 1}
--- !u!114 &496064507
MonoBehaviour:
@ -14224,9 +14225,9 @@ RectTransform:
m_Father: {fileID: 289314300}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: -17, y: -17}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 1}
--- !u!114 &534433569
MonoBehaviour:
@ -17551,7 +17552,7 @@ RectTransform:
m_Father: {fileID: 1448447463}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 20, y: 20}
m_Pivot: {x: 0.5, y: 0.5}
@ -21397,7 +21398,7 @@ RectTransform:
m_Father: {fileID: 1867364949}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 20, y: 20}
m_Pivot: {x: 0.5, y: 0.5}
@ -24535,9 +24536,9 @@ RectTransform:
m_Father: {fileID: 867237266}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 20, y: 0}
m_SizeDelta: {x: 20, y: -17}
m_Pivot: {x: 1, y: 1}
--- !u!114 &927677550
MonoBehaviour:
@ -25952,9 +25953,9 @@ RectTransform:
m_Father: {fileID: 1613204639}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 20, y: 0}
m_SizeDelta: {x: 20, y: -17}
m_Pivot: {x: 1, y: 1}
--- !u!114 &965110781
MonoBehaviour:
@ -26445,9 +26446,9 @@ RectTransform:
m_Father: {fileID: 867237266}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_SizeDelta: {x: -17, y: -17}
m_Pivot: {x: 0, y: 1}
--- !u!114 &982833228
MonoBehaviour:
@ -28204,7 +28205,7 @@ RectTransform:
m_Father: {fileID: 153639270}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 20, y: 20}
m_Pivot: {x: 0.5, y: 0.5}
@ -33670,7 +33671,7 @@ RectTransform:
m_Father: {fileID: 1876078995}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 20, y: 20}
m_Pivot: {x: 0.5, y: 0.5}
@ -33820,7 +33821,7 @@ RectTransform:
m_Father: {fileID: 327186098}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 20, y: 20}
m_Pivot: {x: 0.5, y: 0.5}
@ -34260,9 +34261,9 @@ RectTransform:
m_Father: {fileID: 289314300}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchorMax: {x: 1, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 20, y: -17}
m_SizeDelta: {x: 20, y: 0}
m_Pivot: {x: 1, y: 1}
--- !u!114 &1294039878
MonoBehaviour:
@ -37365,9 +37366,9 @@ RectTransform:
m_Father: {fileID: 1613204639}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 20}
m_SizeDelta: {x: -17, y: 20}
m_Pivot: {x: 0, y: 0}
--- !u!114 &1413278872
MonoBehaviour:
@ -42970,6 +42971,7 @@ MonoBehaviour:
openWeaponry: {fileID: 222469046}
openSoldier: {fileID: 615011292}
startButton: {fileID: 894623922}
levelID: 0
--- !u!114 &1611298783
MonoBehaviour:
m_ObjectHideFlags: 0
@ -48206,9 +48208,9 @@ RectTransform:
m_Father: {fileID: 289314300}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: -17, y: 20}
m_SizeDelta: {x: 0, y: 20}
m_Pivot: {x: 0, y: 0}
--- !u!114 &1772362612
MonoBehaviour:
@ -53072,9 +53074,9 @@ RectTransform:
m_Father: {fileID: 867237266}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 20}
m_SizeDelta: {x: -17, y: 20}
m_Pivot: {x: 0, y: 0}
--- !u!114 &1944641309
MonoBehaviour:
@ -53959,7 +53961,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: -1361.4, y: 300}
m_SizeDelta: {x: 0, y: 300}
m_Pivot: {x: 0, y: 1}
--- !u!114 &1978046476
MonoBehaviour:

View File

@ -2,10 +2,7 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using cfg;
using cfg.BlacksmithData;
using Unity.Mathematics;
using Unity.VisualScripting;
using UnityEngine;
using Random = UnityEngine.Random;
@ -429,6 +426,21 @@ public class BattleManager : MonoBehaviour
public void BattleEnd(bool win)
{
if (win)
{
var id = DataManager.GetNowLevel();
for (int i = 0; i < JsonTab.Instance.tables.Level.DataList.Count; i++)
{
if (JsonTab.Instance.tables.Level.DataList[i].ID==id)
{
if (i+1<JsonTab.Instance.tables.Level.DataList.Count)
{
DataManager.SetLevelLock(JsonTab.Instance.tables.Level.DataList[i+1].ID,DataManager.GetLevelLock(JsonTab.Instance.tables.Level.DataList[i+1].Levelopen));
DataManager.SetNowLevel(JsonTab.Instance.tables.Level.DataList[i+1].ID);
}
}
}
}
player = false;
StartCoroutine(DistoryAllMouster());
UIMgr.ins.OpenEndPanel(win);

View File

@ -49,6 +49,14 @@ public static class DataManager
{
return;
}
if (key==1)
{
if (num > 30)
{
num = 30;
}
}
ItemDictionary[key] = num;
ItemDictionary = ItemDictionary;
}
@ -56,8 +64,6 @@ public static class DataManager
public static void SetTime(string key)
{
var ts = GetTimeStamp(DateTime.Now);
Debug.LogError(ts);
Debug.LogError(ConvertIntDatetime(ts));
SaveValue("time" + key, ts);
}
@ -136,14 +142,14 @@ public static class DataManager
public static int GetMinute(string key)
{
TimeSpan timeSpan = new TimeSpan(DateTimeOffset.UtcNow.Ticks - GetTime(key).Ticks);
TimeSpan timeSpan = new TimeSpan(DateTime.Now.Ticks - GetTime(key).Ticks);
return timeSpan.Minutes;
}
public static int GetHours(string key)
{
//计算两个时间间隔
TimeSpan timeSpan = new TimeSpan(DateTimeOffset.UtcNow.Ticks - GetTime(key).Ticks);
TimeSpan timeSpan = new TimeSpan(DateTime.Now.Ticks - GetTime(key).Ticks);
return timeSpan.Hours;
}
@ -164,13 +170,17 @@ public static class DataManager
var p = (float)GetMinute("physical")/10;
if (p>1)
{
NewPhysicalEvent();
SetPhysical((int)p);
}
}
public static void NewPhysicalEvent()
{
SetTime("physical");
}
public static void SetPhysical(int i)
{
var num = GetItem(0) + i;
var num = GetItem(1) + i;
if (num>30)
{
num = 30;
@ -178,6 +188,12 @@ public static class DataManager
SaveItem(0, num);
}
public static void RemovePhysical(int num)
{
NewPhysicalEvent();
var p = GetItem(1) - num;
SaveItem(1 ,p);
}
/// <summary>
/// 获取当前图纸等级
/// </summary>

View File

@ -39,13 +39,20 @@ public class GameSystem : MonoBehaviour
#endif
private void AddDicData()
{
var datas = JsonTab.Instance.tables.Item.DataList;
foreach (var item in datas)
{
DataManager.SaveItemUnLock(item.ID, true);
DataManager.AddItem(item.ID, 100);
}
DataManager.SetLevelLock(int.Parse(JsonTab.Instance.tables.Main.Get(20).ConstantValue),true);
DataManager.SaveItemUnLock(int.Parse(JsonTab.Instance.tables.Main.Get(21).ConstantValue), true);
DataManager.SaveItemUnLock(int.Parse(JsonTab.Instance.tables.Main.Get(22).ConstantValue), true);
DataManager.SaveItemUnLock(int.Parse(JsonTab.Instance.tables.Main.Get(23).ConstantValue), true);
DataManager.SaveItemUnLock(int.Parse(JsonTab.Instance.tables.Main.Get(24).ConstantValue), true);
DataManager.SaveItemUnLock(int.Parse(JsonTab.Instance.tables.Main.Get(25).ConstantValue), true);
DataManager.SaveItemUnLock(int.Parse(JsonTab.Instance.tables.Main.Get(26).ConstantValue), true);
DataManager.SaveItemUnLock(int.Parse(JsonTab.Instance.tables.Main.Get(27).ConstantValue), true);
DataManager.SaveItemUnLock(1, true);
DataManager.SaveItemUnLock(2, true);
DataManager.SaveItemUnLock(3, true);
DataManager.SaveItem(1,int.Parse(JsonTab.Instance.tables.Main.Get(1).ConstantValue));
DataManager.SaveItem(2,int.Parse(JsonTab.Instance.tables.Main.Get(18).ConstantValue));
DataManager.SaveItem(3,int.Parse(JsonTab.Instance.tables.Main.Get(19).ConstantValue));
DataManager.SaveDrawLevel(302011, 1);
DataManager.SaveDrawLevel(302101, 1);
DataManager.SaveDrawLevel(302201, 1);
@ -53,7 +60,6 @@ public class GameSystem : MonoBehaviour
DataManager.SaveDrawLevel(302401, 1);
DataManager.SaveDrawLevel(302501, 1);
DataManager.SaveDrawLevel(302601, 1);
DataManager.SetNowLevel(71001);
}
private void Awake()
{

View File

@ -91,6 +91,7 @@ public class BattlePanel : MonoBehaviour
levelID = JsonTab.Instance.tables.Level.DataList[i].ID;
}
}
DataManager.SetNowLevel(levelID);
}
private void OpenCombatPanel()
{

View File

@ -146,6 +146,28 @@ public class DrawingPanel : MonoBehaviour
{
DataManager.SaveDrawLevel(wData.Arms,DataManager.GetDrawLevel(wData.Arms)+1);
DataManager.RemoveItem(wData.Upgrade,wData.Upgradenumber);
var attributeData=JsonTab.Instance.attributeData(wData.Arms, DataManager.GetDrawLevel(wData.Arms));
if (attributeData.Unlock!=0)
{
var craftData = JsonTab.Instance.tables.CraftingRecipes.Get(attributeData.Unlock);
DataManager.SaveItemUnLock(craftData.ID,true);
if (craftData.Levelprops1!=0)
{
DataManager.SaveItemUnLock(craftData.Levelprops1,true);
}
if (craftData.Levelprops2!=0)
{
DataManager.SaveItemUnLock(craftData.Levelprops2,true);
}
if (craftData.Levelprops3!=0)
{
DataManager.SaveItemUnLock(craftData.Levelprops3,true);
}
if (craftData.Levelprops4!=0)
{
DataManager.SaveItemUnLock(craftData.Levelprops4,true);
}
}
}
else
{

View File

@ -29,6 +29,7 @@ public class ForgePanel : MonoBehaviour
[SerializeField] private SettlementPanel _settlementPanel;
[SerializeField] private TextMeshProUGUI _npcCount;
[SerializeField] private TextMeshProUGUI _goldNum;
[SerializeField] private TextMeshProUGUI _diamondNum;
public Transform seletIcon;
// Start is called before the first frame update
void Start()
@ -234,5 +235,6 @@ public class ForgePanel : MonoBehaviour
public void ResetGold()
{
_goldNum.text = DataManager.GetItem(2).ToString();
_diamondNum.text = DataManager.GetItem(3).ToString();
}
}

View File

@ -2,6 +2,7 @@ using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using WeChatWASM;
public class UIMgr : MonoBehaviour
{