From f62f8276ff418e3b7364cd123c4f2e15f676d028 Mon Sep 17 00:00:00 2001 From: "DESKTOP-DDTRVOR\\asus" <1162187704@qq.com> Date: Mon, 23 Dec 2024 17:12:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Blacksmith/Assets/Scenes/SampleScene.unity | 227 +++++++++++++++++++++ Blacksmith/Assets/Script/GameSystem.cs | 2 + Blacksmith/Assets/Script/UI/ForgePanel.cs | 6 +- Blacksmith/Assets/Script/UI/UIMgr.cs | 7 +- 4 files changed, 239 insertions(+), 3 deletions(-) diff --git a/Blacksmith/Assets/Scenes/SampleScene.unity b/Blacksmith/Assets/Scenes/SampleScene.unity index 84e2c374..4797187f 100644 --- a/Blacksmith/Assets/Scenes/SampleScene.unity +++ b/Blacksmith/Assets/Scenes/SampleScene.unity @@ -756,6 +756,17 @@ Transform: m_Children: [] m_Father: {fileID: 899280138} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2100450367 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 9000772344992984436, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + m_PrefabInstance: {fileID: 2797205720893150715} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6b9e781533d46ea41b16c0207c7d4376, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1001 &1342676675212828798 PrefabInstance: m_ObjectHideFlags: 0 @@ -878,6 +889,114 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 0} m_Modifications: + - target: {fileID: 198369439937822240, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.x + value: 2534.0264 + objectReference: {fileID: 0} + - target: {fileID: 198369439937822240, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.y + value: -0.0000616307 + objectReference: {fileID: 0} + - target: {fileID: 650189468646652440, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.x + value: 360 + objectReference: {fileID: 0} + - target: {fileID: 650189468646652440, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.y + value: -0.0000032498758 + objectReference: {fileID: 0} + - target: {fileID: 824084434105460965, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.x + value: 360.00003 + objectReference: {fileID: 0} + - target: {fileID: 824084434105460965, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0.0000118310445 + objectReference: {fileID: 0} + - target: {fileID: 1532811897321479711, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.x + value: 360 + objectReference: {fileID: 0} + - target: {fileID: 1532811897321479711, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.y + value: -0.0000032498758 + objectReference: {fileID: 0} + - target: {fileID: 1923300188990817061, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.x + value: 359.99997 + objectReference: {fileID: 0} + - target: {fileID: 1923300188990817061, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0.0000067430556 + objectReference: {fileID: 0} + - target: {fileID: 2446255129621035987, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.x + value: 359.99997 + objectReference: {fileID: 0} + - target: {fileID: 2446255129621035987, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0.000005564288 + objectReference: {fileID: 0} + - target: {fileID: 2687063965730892539, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2687063965730892539, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_SizeDelta.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2703744668847977621, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.x + value: 360.00003 + objectReference: {fileID: 0} + - target: {fileID: 2703744668847977621, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0.0000118310445 + objectReference: {fileID: 0} + - target: {fileID: 2810660058786452663, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.x + value: 360 + objectReference: {fileID: 0} + - target: {fileID: 2810660058786452663, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0.00001183105 + objectReference: {fileID: 0} + - target: {fileID: 3005541637376198884, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3005541637376198884, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_SizeDelta.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3254490145894505257, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3254490145894505257, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3254490145894505257, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_SizeDelta.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3491874388263843074, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.x + value: 360.00003 + objectReference: {fileID: 0} + - target: {fileID: 3491874388263843074, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0.0000118310445 + objectReference: {fileID: 0} + - target: {fileID: 3924915755643395529, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.x + value: 360 + objectReference: {fileID: 0} + - target: {fileID: 3924915755643395529, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0.00001183105 + objectReference: {fileID: 0} - target: {fileID: 4086530264551283400, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} propertyPath: m_AnchorMax.x value: 0 @@ -886,6 +1005,94 @@ PrefabInstance: propertyPath: m_AnchorMax.y value: 0 objectReference: {fileID: 0} + - target: {fileID: 4202168476399996023, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4356588315664731639, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.x + value: 360.00003 + objectReference: {fileID: 0} + - target: {fileID: 4356588315664731639, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0.0000118310445 + objectReference: {fileID: 0} + - target: {fileID: 4392934527185610438, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.x + value: 31.926352 + objectReference: {fileID: 0} + - target: {fileID: 4392934527185610438, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.y + value: -358.35217 + objectReference: {fileID: 0} + - target: {fileID: 4576839497981118481, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.x + value: 360 + objectReference: {fileID: 0} + - target: {fileID: 4576839497981118481, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.y + value: -1.4701469e-12 + objectReference: {fileID: 0} + - target: {fileID: 4743637259142969288, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.x + value: 360 + objectReference: {fileID: 0} + - target: {fileID: 4743637259142969288, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.y + value: -0.000003553884 + objectReference: {fileID: 0} + - target: {fileID: 4892172892484661290, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4892172892484661290, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4892172892484661290, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_SizeDelta.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5373557834658095386, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.x + value: 2534.0264 + objectReference: {fileID: 0} + - target: {fileID: 5373557834658095386, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.y + value: -0.000037788843 + objectReference: {fileID: 0} + - target: {fileID: 6413101721776649384, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.x + value: 360.00006 + objectReference: {fileID: 0} + - target: {fileID: 6413101721776649384, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.y + value: -0.0000046014075 + objectReference: {fileID: 0} + - target: {fileID: 7828562722598263467, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.x + value: 360.00003 + objectReference: {fileID: 0} + - target: {fileID: 7828562722598263467, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0.0000118310445 + objectReference: {fileID: 0} + - target: {fileID: 8503480254810895229, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.x + value: 2534.0264 + objectReference: {fileID: 0} + - target: {fileID: 8503480254810895229, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.y + value: -0.0000616307 + objectReference: {fileID: 0} + - target: {fileID: 8630107263903414318, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.x + value: 359.99997 + objectReference: {fileID: 0} + - target: {fileID: 8630107263903414318, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.y + value: -0.000010355754 + objectReference: {fileID: 0} - target: {fileID: 8734534549119924968, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} propertyPath: m_AnchorMax.x value: 0 @@ -898,6 +1105,22 @@ PrefabInstance: propertyPath: m_Name value: Canvas objectReference: {fileID: 0} + - target: {fileID: 8849191488238675942, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.x + value: 2534.0264 + objectReference: {fileID: 0} + - target: {fileID: 8849191488238675942, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.y + value: -0.000037788843 + objectReference: {fileID: 0} + - target: {fileID: 8906768314333973591, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.x + value: 360.00003 + objectReference: {fileID: 0} + - target: {fileID: 8906768314333973591, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0.0000118310445 + objectReference: {fileID: 0} - target: {fileID: 9144618406897127126, guid: 0e52b314be6e069439c3bb54fb42807e, type: 3} propertyPath: m_Pivot.x value: 0 @@ -1088,6 +1311,10 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 3880219494830862424, guid: bacfc73082021e74fb5a3350751b6793, type: 3} + propertyPath: uiMgr + value: + objectReference: {fileID: 2100450367} - target: {fileID: 3880219494830862424, guid: bacfc73082021e74fb5a3350751b6793, type: 3} propertyPath: abManager value: diff --git a/Blacksmith/Assets/Script/GameSystem.cs b/Blacksmith/Assets/Script/GameSystem.cs index 8b61c01d..eebf9fc0 100644 --- a/Blacksmith/Assets/Script/GameSystem.cs +++ b/Blacksmith/Assets/Script/GameSystem.cs @@ -8,6 +8,7 @@ using Random = UnityEngine.Random; public class GameSystem : MonoBehaviour { public static GameSystem ins; + public UIMgr uiMgr; public JsonTab tab; public DrawingManager drawingManager; public AssetBundleManager abManager; @@ -115,6 +116,7 @@ public class GameSystem : MonoBehaviour forgePanel.ResetSlotItem(); _npcBuyDatas = new List(); getNpc = false; + uiMgr.Init(); SaveFirstID(); UIMgr.ins.OpenForgePanel(); forgePanel.ResetGold(); diff --git a/Blacksmith/Assets/Script/UI/ForgePanel.cs b/Blacksmith/Assets/Script/UI/ForgePanel.cs index 2815b9a3..430fce2a 100644 --- a/Blacksmith/Assets/Script/UI/ForgePanel.cs +++ b/Blacksmith/Assets/Script/UI/ForgePanel.cs @@ -75,6 +75,7 @@ public class ForgePanel : MonoBehaviour _npcTrigger.Close(); openParent.SetActive(true); _craftingPanel.gameObject.SetActive(false); + ResetItemData(); } public void OpenStartPanel() @@ -82,6 +83,7 @@ public class ForgePanel : MonoBehaviour openParent.SetActive(true); startAni.AnimationState.SetAnimation(0, "EnterAnim_1", false); startAni.AnimationState.Complete += StarIdle; + _settlementPanel.gameObject.SetActive(true); _settlementPanel.SettlementEvent(); } @@ -207,7 +209,7 @@ public class ForgePanel : MonoBehaviour int index = 0; for (int i = 0; i < allData.Count; i++) { - if (DataManager.GetItem(allData[i].ID)>0&&allData[i].Proptype!=0&&allData[i].Proptype==1) + if (DataManager.GetItem(allData[i].ID)>=0&&DataManager.GetItemUnLock(allData[i].ID)&&allData[i].Proptype!=0&&allData[i].Proptype==1) { if (index>=_itemButtons.Count ) { @@ -233,7 +235,7 @@ public class ForgePanel : MonoBehaviour int index = 0; for (int i = 0; i < allData.Count; i++) { - if (DataManager.GetItem(allData[i].ID)>0&&allData[i].Proptype>1) + if (DataManager.GetItem(allData[i].ID)>=0&&DataManager.GetItemUnLock(allData[i].ID)&&allData[i].Proptype>1) { if (index>=_itemWapenButtons.Count ) { diff --git a/Blacksmith/Assets/Script/UI/UIMgr.cs b/Blacksmith/Assets/Script/UI/UIMgr.cs index fdd90ef7..9503fd89 100644 --- a/Blacksmith/Assets/Script/UI/UIMgr.cs +++ b/Blacksmith/Assets/Script/UI/UIMgr.cs @@ -20,6 +20,11 @@ public class UIMgr : MonoBehaviour [SerializeField] private EndPanel endPanel; private void Awake() + { + + } + + public void Init() { ins = this; } @@ -33,7 +38,7 @@ public class UIMgr : MonoBehaviour storePanel.gameObject.SetActive(false); combatPanel.gameObject.SetActive(false); endPanel.gameObject.SetActive(false); - forgePanel.OpenStartPanel(); + forgePanel.Close(); } public void OpenBattlePanel()