diff --git a/Blacksmith/Assets/Resources/Data/blacksmithdata_main.json b/Blacksmith/Assets/Resources/Data/blacksmithdata_main.json index 859ec013..7ebba6dd 100644 --- a/Blacksmith/Assets/Resources/Data/blacksmithdata_main.json +++ b/Blacksmith/Assets/Resources/Data/blacksmithdata_main.json @@ -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" } ] \ No newline at end of file diff --git a/Blacksmith/Assets/Scenes/SampleScene.unity b/Blacksmith/Assets/Scenes/SampleScene.unity index 81b61a15..fb060068 100644 --- a/Blacksmith/Assets/Scenes/SampleScene.unity +++ b/Blacksmith/Assets/Scenes/SampleScene.unity @@ -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: diff --git a/Blacksmith/Assets/Script/Battle/BattleManager.cs b/Blacksmith/Assets/Script/Battle/BattleManager.cs index 0045e33d..c27912d0 100644 --- a/Blacksmith/Assets/Script/Battle/BattleManager.cs +++ b/Blacksmith/Assets/Script/Battle/BattleManager.cs @@ -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 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); + } /// /// 获取当前图纸等级 /// diff --git a/Blacksmith/Assets/Script/GameSystem.cs b/Blacksmith/Assets/Script/GameSystem.cs index 4a3141c9..cfb5f016 100644 --- a/Blacksmith/Assets/Script/GameSystem.cs +++ b/Blacksmith/Assets/Script/GameSystem.cs @@ -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() { diff --git a/Blacksmith/Assets/Script/UI/BattlePanel.cs b/Blacksmith/Assets/Script/UI/BattlePanel.cs index 14b0b7d4..7f80c2b0 100644 --- a/Blacksmith/Assets/Script/UI/BattlePanel.cs +++ b/Blacksmith/Assets/Script/UI/BattlePanel.cs @@ -91,6 +91,7 @@ public class BattlePanel : MonoBehaviour levelID = JsonTab.Instance.tables.Level.DataList[i].ID; } } + DataManager.SetNowLevel(levelID); } private void OpenCombatPanel() { diff --git a/Blacksmith/Assets/Script/UI/DrawingPanel.cs b/Blacksmith/Assets/Script/UI/DrawingPanel.cs index b7b3946a..829b2371 100644 --- a/Blacksmith/Assets/Script/UI/DrawingPanel.cs +++ b/Blacksmith/Assets/Script/UI/DrawingPanel.cs @@ -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 { diff --git a/Blacksmith/Assets/Script/UI/ForgePanel.cs b/Blacksmith/Assets/Script/UI/ForgePanel.cs index 8af463a3..78548c71 100644 --- a/Blacksmith/Assets/Script/UI/ForgePanel.cs +++ b/Blacksmith/Assets/Script/UI/ForgePanel.cs @@ -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(); } } diff --git a/Blacksmith/Assets/Script/UI/UIMgr.cs b/Blacksmith/Assets/Script/UI/UIMgr.cs index ca680d37..53767740 100644 --- a/Blacksmith/Assets/Script/UI/UIMgr.cs +++ b/Blacksmith/Assets/Script/UI/UIMgr.cs @@ -2,6 +2,7 @@ using System; using System.Collections; using System.Collections.Generic; using UnityEngine; +using WeChatWASM; public class UIMgr : MonoBehaviour { diff --git a/Blacksmith/MiniTemplate/Datas/常量表.xlsx b/Blacksmith/MiniTemplate/Datas/常量表.xlsx index 13374cfd..02dc750a 100644 Binary files a/Blacksmith/MiniTemplate/Datas/常量表.xlsx and b/Blacksmith/MiniTemplate/Datas/常量表.xlsx differ