From bf50ed51adb5a84fcf3823377e815694ab0a1918 Mon Sep 17 00:00:00 2001 From: wulongxiao <2545507770@qq.com> Date: Tue, 24 Dec 2024 12:02:32 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=8A=80=E8=83=BD=E8=AF=BB=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/scene_main/Battle_Selection.prefab | 6 ++--- .../Prefabs/ui/scene_main/card_huhuhu.prefab | 2 +- .../Prefabs/ui/scene_main/card_mkl.prefab | 2 +- .../Prefabs/ui/scene_main/card_qie.prefab | 2 +- meng_yao/Assets/Scenes/New/Scene_map_1.unity | 6 ++--- meng_yao/Assets/script/A_Fight/SkillBox.cs | 26 +++++++++++++++++-- meng_yao/Assets/script/A_Fight/cardBox.cs | 1 - meng_yao/Assets/script/A_Fight/cardContorl.cs | 2 ++ meng_yao/Assets/script/A_Fight/gameGlobal.cs | 1 + .../script/UI_prefabs/Battle_Selection.cs | 4 ++- 10 files changed, 39 insertions(+), 13 deletions(-) diff --git a/meng_yao/Assets/Prefabs/ui/scene_main/Battle_Selection.prefab b/meng_yao/Assets/Prefabs/ui/scene_main/Battle_Selection.prefab index 92532b55a..79e4a5fdb 100644 --- a/meng_yao/Assets/Prefabs/ui/scene_main/Battle_Selection.prefab +++ b/meng_yao/Assets/Prefabs/ui/scene_main/Battle_Selection.prefab @@ -603,7 +603,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c64989b3a75e1d44e8692a17ba9c22ea, type: 3} m_Name: m_EditorClassIdentifier: - mengyaoid: 3 + mengyaoid: M_H_001 --- !u!1 &4784401008393657171 GameObject: m_ObjectHideFlags: 0 @@ -816,7 +816,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c64989b3a75e1d44e8692a17ba9c22ea, type: 3} m_Name: m_EditorClassIdentifier: - mengyaoid: 1 + mengyaoid: M_M_001 --- !u!1 &6630224712762924237 GameObject: m_ObjectHideFlags: 0 @@ -1044,7 +1044,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c64989b3a75e1d44e8692a17ba9c22ea, type: 3} m_Name: m_EditorClassIdentifier: - mengyaoid: 2 + mengyaoid: M_S_001 --- !u!1 &7283252518049257111 GameObject: m_ObjectHideFlags: 0 diff --git a/meng_yao/Assets/Prefabs/ui/scene_main/card_huhuhu.prefab b/meng_yao/Assets/Prefabs/ui/scene_main/card_huhuhu.prefab index 9b70cd833..04c981012 100644 --- a/meng_yao/Assets/Prefabs/ui/scene_main/card_huhuhu.prefab +++ b/meng_yao/Assets/Prefabs/ui/scene_main/card_huhuhu.prefab @@ -358,7 +358,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c64989b3a75e1d44e8692a17ba9c22ea, type: 3} m_Name: m_EditorClassIdentifier: - mengyaoid: 3 + mengyaoid: M_H_001 --- !u!1 &1126466392997513758 GameObject: m_ObjectHideFlags: 0 diff --git a/meng_yao/Assets/Prefabs/ui/scene_main/card_mkl.prefab b/meng_yao/Assets/Prefabs/ui/scene_main/card_mkl.prefab index 383860a5b..8484a7cf7 100644 --- a/meng_yao/Assets/Prefabs/ui/scene_main/card_mkl.prefab +++ b/meng_yao/Assets/Prefabs/ui/scene_main/card_mkl.prefab @@ -450,7 +450,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c64989b3a75e1d44e8692a17ba9c22ea, type: 3} m_Name: m_EditorClassIdentifier: - mengyaoid: 1 + mengyaoid: M_M_001 --- !u!1 &6655435213110775788 GameObject: m_ObjectHideFlags: 0 diff --git a/meng_yao/Assets/Prefabs/ui/scene_main/card_qie.prefab b/meng_yao/Assets/Prefabs/ui/scene_main/card_qie.prefab index 2b6084cec..dadf5f4d4 100644 --- a/meng_yao/Assets/Prefabs/ui/scene_main/card_qie.prefab +++ b/meng_yao/Assets/Prefabs/ui/scene_main/card_qie.prefab @@ -285,7 +285,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c64989b3a75e1d44e8692a17ba9c22ea, type: 3} m_Name: m_EditorClassIdentifier: - mengyaoid: 2 + mengyaoid: M_S_001 --- !u!1 &5508436328304430213 GameObject: m_ObjectHideFlags: 0 diff --git a/meng_yao/Assets/Scenes/New/Scene_map_1.unity b/meng_yao/Assets/Scenes/New/Scene_map_1.unity index d67d79b10..7833cbca2 100644 --- a/meng_yao/Assets/Scenes/New/Scene_map_1.unity +++ b/meng_yao/Assets/Scenes/New/Scene_map_1.unity @@ -3554,11 +3554,11 @@ MonoBehaviour: btnObj: {fileID: 1942153352} IconTipObj: {fileID: 0} mengyaoCardDataList: - - cardID: 1 + - cardID: M_M_001 cardPrefab: {fileID: 6655435212987556048, guid: 383e65ed01369d345a73d626ab713888, type: 3} - - cardID: 2 + - cardID: M_S_001 cardPrefab: {fileID: 5508436327438263543, guid: 12644a2c53bfc72489ad76e8f81628f5, type: 3} - - cardID: 3 + - cardID: M_H_001 cardPrefab: {fileID: 1126466392417920613, guid: 0dd4a50e59d08e84fb1439c946c24fdc, type: 3} parentPos: {fileID: 1136445683} scaleUpDuration: 0.5 diff --git a/meng_yao/Assets/script/A_Fight/SkillBox.cs b/meng_yao/Assets/script/A_Fight/SkillBox.cs index 774552385..40e74a8fb 100644 --- a/meng_yao/Assets/script/A_Fight/SkillBox.cs +++ b/meng_yao/Assets/script/A_Fight/SkillBox.cs @@ -1,6 +1,7 @@ using DG.Tweening; using System.Collections; using System.Collections.Generic; +using Unity.VisualScripting; using UnityEngine; using UnityEngine.UI; @@ -27,6 +28,9 @@ public class SkillBox : Base public Transform SkillParent; public Image ExpFill; + + public Dictionary mengyaoRole=new Dictionary(); + public int ExpNumber { get => expNumber; @@ -85,16 +89,29 @@ public class SkillBox : Base void InitSkil() { - for (int i = 0; i < Base.GlobalObj.GetComponent().CarryCardId.Count; i++) + + + + foreach (string _mengyaoRole in mengyaoRole.Keys) + { + GameObject obj = Instantiate(Skill, SkillParent); + obj.GetComponent().infobox_skill_up = infobox_skill; + obj.GetComponent().MySkill = mengyaoRole[_mengyaoRole].Myskill; + } + + + /*for (int i = 0; i < Base.GlobalObj.GetComponent().CarryCardId.Count; i++) { + + Base.GlobalObj.GetComponent().CarryCardId[i]; for (int j = 0; j < 2; j++) { GameObject obj = Instantiate(Skill,SkillParent); obj.GetComponent().infobox_skill_up = infobox_skill; obj.GetComponent().MySkill = MengyaoInfo.Instance.m_SkillData[i].skills[j]; } - } + }*/ //Base.GlobalObj.GetComponent().CarryCardId.Clear(); } @@ -181,4 +198,9 @@ public class SkillBox : Base }); } + void OnDestroy() + { + mengyaoRole = null; + } + } diff --git a/meng_yao/Assets/script/A_Fight/cardBox.cs b/meng_yao/Assets/script/A_Fight/cardBox.cs index 6c6bd0627..dc0ecf044 100644 --- a/meng_yao/Assets/script/A_Fight/cardBox.cs +++ b/meng_yao/Assets/script/A_Fight/cardBox.cs @@ -142,7 +142,6 @@ public class cardBox : MonoBehaviour Debug.LogWarning($"未找到ID为 '{id}' 的萌妖卡预制体!"); } } - //Base.GlobalObj.GetComponent().CarryCardId.Clear(); } } diff --git a/meng_yao/Assets/script/A_Fight/cardContorl.cs b/meng_yao/Assets/script/A_Fight/cardContorl.cs index 19ac2a0d0..dcb123a5b 100644 --- a/meng_yao/Assets/script/A_Fight/cardContorl.cs +++ b/meng_yao/Assets/script/A_Fight/cardContorl.cs @@ -82,6 +82,8 @@ public class cardContorl : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndD { mY.transform.position = mY.GetComponent().tower.transform.position; + SkillBox.instance.mengyaoRole.Add(mY.GetComponent().id,mY.GetComponent()); + this.enabled = false; cardBox.instance.ChangeInPlaceNumber(1); mask.SetActive(true); diff --git a/meng_yao/Assets/script/A_Fight/gameGlobal.cs b/meng_yao/Assets/script/A_Fight/gameGlobal.cs index 70bc0f9f8..f6bda11a4 100644 --- a/meng_yao/Assets/script/A_Fight/gameGlobal.cs +++ b/meng_yao/Assets/script/A_Fight/gameGlobal.cs @@ -15,6 +15,7 @@ public class gameGlobal : Base public List CarryCardId = new List(); + /// /// 游戏初始化 /// diff --git a/meng_yao/Assets/script/UI_prefabs/Battle_Selection.cs b/meng_yao/Assets/script/UI_prefabs/Battle_Selection.cs index 6452bf828..317f124b8 100644 --- a/meng_yao/Assets/script/UI_prefabs/Battle_Selection.cs +++ b/meng_yao/Assets/script/UI_prefabs/Battle_Selection.cs @@ -38,7 +38,7 @@ public class Battle_Selection : BaseUI { - await showPanel(_panel); + await showPanel(_panel); // 初始化:将所有卡牌添加到萌妖卡列表,并设置其父节点为萌妖卡生成点 foreach (Button btn in CardBTN) { @@ -71,6 +71,8 @@ public class Battle_Selection : BaseUI foreach (Button go in CarryCard) { Debug.Log(go.gameObject.GetComponent().mengyaoid); + + Base.GlobalObj.GetComponent().CarryCardId.Add(go.gameObject.GetComponent().mengyaoid); } SceneManager.LoadScene(2); From 0b8743f9ee627e261238b116ed4369db19d3df93 Mon Sep 17 00:00:00 2001 From: GL <2365963573@qq.com> Date: Tue, 24 Dec 2024 14:10:47 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=87=8F=E9=80=9F=E3=80=81=E5=86=B0?= =?UTF-8?q?=E5=9D=97=E9=9A=8F=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- meng_yao/Assets/Prefabs/Bullet/Bing_1.prefab | 104 ++++++++++++++++++ .../Assets/Prefabs/Bullet/Bing_1.prefab.meta | 7 ++ meng_yao/Assets/Prefabs/Bullet/Bing_2.prefab | 104 ++++++++++++++++++ .../Assets/Prefabs/Bullet/Bing_2.prefab.meta | 7 ++ meng_yao/Assets/Prefabs/Bullet/Fire.prefab | 3 +- meng_yao/Assets/Prefabs/Bullet/bingqiu.prefab | 5 +- meng_yao/Assets/common | 2 +- 7 files changed, 229 insertions(+), 3 deletions(-) create mode 100644 meng_yao/Assets/Prefabs/Bullet/Bing_1.prefab create mode 100644 meng_yao/Assets/Prefabs/Bullet/Bing_1.prefab.meta create mode 100644 meng_yao/Assets/Prefabs/Bullet/Bing_2.prefab create mode 100644 meng_yao/Assets/Prefabs/Bullet/Bing_2.prefab.meta diff --git a/meng_yao/Assets/Prefabs/Bullet/Bing_1.prefab b/meng_yao/Assets/Prefabs/Bullet/Bing_1.prefab new file mode 100644 index 000000000..a7b09bf27 --- /dev/null +++ b/meng_yao/Assets/Prefabs/Bullet/Bing_1.prefab @@ -0,0 +1,104 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1091443316701177648 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 660602218193290689} + - component: {fileID: 762876158176410263} + - component: {fileID: 4303165778035962172} + m_Layer: 0 + m_Name: Bing_1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &660602218193290689 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1091443316701177648} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -2.391, y: -0.135, z: 0} + m_LocalScale: {x: 0.15529104, y: 0.15529104, z: 0.15529104} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &762876158176410263 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1091443316701177648} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 50b7ecc28d19b854a9919b19b69eac3c, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &4303165778035962172 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1091443316701177648} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a7361a599e01f924eb9bd42480cf7ade, type: 3} + m_Name: + m_EditorClassIdentifier: + Crole: {fileID: 0} + bullet: {fileID: 0} + attackTime: 0 + attackAllTime: 3 + lifeTime: 3 diff --git a/meng_yao/Assets/Prefabs/Bullet/Bing_1.prefab.meta b/meng_yao/Assets/Prefabs/Bullet/Bing_1.prefab.meta new file mode 100644 index 000000000..3adb4bd9f --- /dev/null +++ b/meng_yao/Assets/Prefabs/Bullet/Bing_1.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 65e205dfab4a6c2458647bb554b62ac2 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/meng_yao/Assets/Prefabs/Bullet/Bing_2.prefab b/meng_yao/Assets/Prefabs/Bullet/Bing_2.prefab new file mode 100644 index 000000000..446904491 --- /dev/null +++ b/meng_yao/Assets/Prefabs/Bullet/Bing_2.prefab @@ -0,0 +1,104 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1091443316701177648 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 660602218193290689} + - component: {fileID: 762876158176410263} + - component: {fileID: 4303165778035962172} + m_Layer: 0 + m_Name: Bing_2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &660602218193290689 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1091443316701177648} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -2.391, y: -0.135, z: 0} + m_LocalScale: {x: 0.15529104, y: 0.15529104, z: 0.15529104} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &762876158176410263 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1091443316701177648} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: d4af21e9302f7294eb4ef3f65f9d0c74, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &4303165778035962172 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1091443316701177648} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a7361a599e01f924eb9bd42480cf7ade, type: 3} + m_Name: + m_EditorClassIdentifier: + Crole: {fileID: 0} + bullet: {fileID: 0} + attackTime: 0 + attackAllTime: 3 + lifeTime: 3 diff --git a/meng_yao/Assets/Prefabs/Bullet/Bing_2.prefab.meta b/meng_yao/Assets/Prefabs/Bullet/Bing_2.prefab.meta new file mode 100644 index 000000000..a6d7efb96 --- /dev/null +++ b/meng_yao/Assets/Prefabs/Bullet/Bing_2.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: beeceee8fc2c8464abd22e4b3e7850f1 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/meng_yao/Assets/Prefabs/Bullet/Fire.prefab b/meng_yao/Assets/Prefabs/Bullet/Fire.prefab index 127febd1a..5f400392d 100644 --- a/meng_yao/Assets/Prefabs/Bullet/Fire.prefab +++ b/meng_yao/Assets/Prefabs/Bullet/Fire.prefab @@ -55,7 +55,8 @@ MonoBehaviour: animator: {fileID: 0} IsMove: 1 Collider2D: {fileID: 0} - effectPre: {fileID: 1487967899565519868, guid: 206f837f6265c164187718739b604743, type: 3} + effectPres: + - {fileID: 1487967899565519868, guid: 206f837f6265c164187718739b604743, type: 3} --- !u!61 &3373243311622701097 BoxCollider2D: m_ObjectHideFlags: 0 diff --git a/meng_yao/Assets/Prefabs/Bullet/bingqiu.prefab b/meng_yao/Assets/Prefabs/Bullet/bingqiu.prefab index 4e74fe96f..00a80d35e 100644 --- a/meng_yao/Assets/Prefabs/Bullet/bingqiu.prefab +++ b/meng_yao/Assets/Prefabs/Bullet/bingqiu.prefab @@ -4825,7 +4825,10 @@ MonoBehaviour: animator: {fileID: 0} IsMove: 1 Collider2D: {fileID: 0} - effectPre: {fileID: 1091443316701177648, guid: b9df638c9cb3bfe43acb042655fd517e, type: 3} + effectPres: + - {fileID: 1091443316701177648, guid: b9df638c9cb3bfe43acb042655fd517e, type: 3} + - {fileID: 1091443316701177648, guid: 65e205dfab4a6c2458647bb554b62ac2, type: 3} + - {fileID: 1091443316701177648, guid: beeceee8fc2c8464abd22e4b3e7850f1, type: 3} --- !u!210 &6519243243911487068 SortingGroup: m_ObjectHideFlags: 0 diff --git a/meng_yao/Assets/common b/meng_yao/Assets/common index 4b6941d72..4e76a2661 160000 --- a/meng_yao/Assets/common +++ b/meng_yao/Assets/common @@ -1 +1 @@ -Subproject commit 4b6941d72b172d6b248c4c3d6e0e6196375d79e4 +Subproject commit 4e76a266187677c46758ae25e9ee9d01dc3cfea8 From 9a5235d576e9829f3db500581eb242bfd9e0a6a4 Mon Sep 17 00:00:00 2001 From: wulongxiao <2545507770@qq.com> Date: Tue, 24 Dec 2024 14:12:18 +0800 Subject: [PATCH 3/5] AddExperience --- meng_yao/Assets/common | 2 +- meng_yao/Assets/script/A_Fight/SkillBox.cs | 2 +- meng_yao/Assets/script/A_Fight/json/MengyaoInfo.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/meng_yao/Assets/common b/meng_yao/Assets/common index 4b6941d72..e53cf6925 160000 --- a/meng_yao/Assets/common +++ b/meng_yao/Assets/common @@ -1 +1 @@ -Subproject commit 4b6941d72b172d6b248c4c3d6e0e6196375d79e4 +Subproject commit e53cf6925cff55d1065ceba7a120bef0959e2749 diff --git a/meng_yao/Assets/script/A_Fight/SkillBox.cs b/meng_yao/Assets/script/A_Fight/SkillBox.cs index 40e74a8fb..7294ac1bc 100644 --- a/meng_yao/Assets/script/A_Fight/SkillBox.cs +++ b/meng_yao/Assets/script/A_Fight/SkillBox.cs @@ -96,7 +96,7 @@ public class SkillBox : Base { GameObject obj = Instantiate(Skill, SkillParent); obj.GetComponent().infobox_skill_up = infobox_skill; - obj.GetComponent().MySkill = mengyaoRole[_mengyaoRole].Myskill; + //obj.GetComponent().MySkill = mengyaoRole[_mengyaoRole].Myskill; } diff --git a/meng_yao/Assets/script/A_Fight/json/MengyaoInfo.cs b/meng_yao/Assets/script/A_Fight/json/MengyaoInfo.cs index 684c83633..84ae470fd 100644 --- a/meng_yao/Assets/script/A_Fight/json/MengyaoInfo.cs +++ b/meng_yao/Assets/script/A_Fight/json/MengyaoInfo.cs @@ -32,7 +32,7 @@ public class MengyaoInfo :JsonReadBase m_SkillData = base.LoadJson(SkillAsset); // Debug.Log(m_SkillData); - //base.DisplayData(m_SkillData); + base.DisplayData(m_SkillData); } // Update is called once per frame From dc0c8b95380bd0e70ab7969687ef8e4c8552f07f Mon Sep 17 00:00:00 2001 From: wulongxiao <2545507770@qq.com> Date: Tue, 24 Dec 2024 14:35:02 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AEbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- meng_yao/Assets/script/A_Fight/SkillBox.cs | 38 ++++++++----------- meng_yao/Assets/script/A_Fight/cardContorl.cs | 2 +- .../Assets/script/A_Fight/json/MengyaoInfo.cs | 4 +- 3 files changed, 18 insertions(+), 26 deletions(-) diff --git a/meng_yao/Assets/script/A_Fight/SkillBox.cs b/meng_yao/Assets/script/A_Fight/SkillBox.cs index 7294ac1bc..b452d75bf 100644 --- a/meng_yao/Assets/script/A_Fight/SkillBox.cs +++ b/meng_yao/Assets/script/A_Fight/SkillBox.cs @@ -89,31 +89,23 @@ public class SkillBox : Base void InitSkil() { - - - - foreach (string _mengyaoRole in mengyaoRole.Keys) + foreach (string _mengyaoRoleId in mengyaoRole.Keys) { - GameObject obj = Instantiate(Skill, SkillParent); - obj.GetComponent().infobox_skill_up = infobox_skill; - //obj.GetComponent().MySkill = mengyaoRole[_mengyaoRole].Myskill; - } - - - /*for (int i = 0; i < Base.GlobalObj.GetComponent().CarryCardId.Count; i++) - { - - - Base.GlobalObj.GetComponent().CarryCardId[i]; - for (int j = 0; j < 2; j++) - { - GameObject obj = Instantiate(Skill,SkillParent); - obj.GetComponent().infobox_skill_up = infobox_skill; - obj.GetComponent().MySkill = MengyaoInfo.Instance.m_SkillData[i].skills[j]; + foreach (Monster m in MengyaoInfo.Instance.m_SkillData) + { + if (m.temp_id == _mengyaoRoleId) + { + for (int j = 0; j < 2; j++) + { + GameObject obj = Instantiate(Skill, SkillParent); + obj.GetComponent().infobox_skill_up = infobox_skill; + //obj.GetComponent().infobox_skill_up = infobox_skill; + + } + } + return; } - }*/ - - //Base.GlobalObj.GetComponent().CarryCardId.Clear(); + } } diff --git a/meng_yao/Assets/script/A_Fight/cardContorl.cs b/meng_yao/Assets/script/A_Fight/cardContorl.cs index dcb123a5b..9f324d34a 100644 --- a/meng_yao/Assets/script/A_Fight/cardContorl.cs +++ b/meng_yao/Assets/script/A_Fight/cardContorl.cs @@ -82,7 +82,7 @@ public class cardContorl : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndD { mY.transform.position = mY.GetComponent().tower.transform.position; - SkillBox.instance.mengyaoRole.Add(mY.GetComponent().id,mY.GetComponent()); + ///SkillBox.instance.mengyaoRole.Add(mY.GetComponent().id,mY.GetComponent()); this.enabled = false; cardBox.instance.ChangeInPlaceNumber(1); diff --git a/meng_yao/Assets/script/A_Fight/json/MengyaoInfo.cs b/meng_yao/Assets/script/A_Fight/json/MengyaoInfo.cs index 84ae470fd..2047e0dcb 100644 --- a/meng_yao/Assets/script/A_Fight/json/MengyaoInfo.cs +++ b/meng_yao/Assets/script/A_Fight/json/MengyaoInfo.cs @@ -22,7 +22,7 @@ public class MengyaoInfo :JsonReadBase Instance = this; m_Mengyao = base.LoadJson(NameAsset); - base.DisplayData(m_Mengyao); + //base.DisplayData(m_Mengyao); m_Level = base.LoadJson(LevelAsset); // base.DisplayData(m_Level); @@ -32,7 +32,7 @@ public class MengyaoInfo :JsonReadBase m_SkillData = base.LoadJson(SkillAsset); // Debug.Log(m_SkillData); - base.DisplayData(m_SkillData); + //base.DisplayData(m_SkillData); } // Update is called once per frame From 63134db4eb830c8065ac982be0ec48d8228cb322 Mon Sep 17 00:00:00 2001 From: wulongxiao <2545507770@qq.com> Date: Tue, 24 Dec 2024 15:38:28 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E8=90=8C=E5=A6=96=E6=8A=80=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- meng_yao/Assets/Scenes/New/Scene_map_1.unity | 68 ++++++++++++++++++- meng_yao/Assets/script/A_Fight/SkillBox.cs | 26 +++---- meng_yao/Assets/script/A_Fight/Skill_Spend.cs | 3 + meng_yao/Assets/script/A_Fight/cardBox.cs | 4 ++ meng_yao/Assets/script/A_Fight/cardContorl.cs | 3 +- .../Assets/script/A_Fight/json/MengyaoInfo.cs | 10 ++- 6 files changed, 95 insertions(+), 19 deletions(-) diff --git a/meng_yao/Assets/Scenes/New/Scene_map_1.unity b/meng_yao/Assets/Scenes/New/Scene_map_1.unity index 7833cbca2..a3366047d 100644 --- a/meng_yao/Assets/Scenes/New/Scene_map_1.unity +++ b/meng_yao/Assets/Scenes/New/Scene_map_1.unity @@ -841,7 +841,7 @@ Transform: - {fileID: 995271151} - {fileID: 1932457213} m_Father: {fileID: 0} - m_RootOrder: 6 + m_RootOrder: 8 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &284432671 MonoBehaviour: @@ -1540,6 +1540,37 @@ Transform: m_CorrespondingSourceObject: {fileID: 924676270184311531, guid: 8d398c914061e5842b409729ac3d43c1, type: 3} m_PrefabInstance: {fileID: 457244935} m_PrefabAsset: {fileID: 0} +--- !u!1 &459650024 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 459650025} + m_Layer: 0 + m_Name: ------------------------------ (3) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &459650025 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 459650024} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &530562778 GameObject: m_ObjectHideFlags: 0 @@ -4333,7 +4364,7 @@ GameObject: - component: {fileID: 1337722729} - component: {fileID: 1337722730} m_Layer: 0 - m_Name: ------------------------------ + m_Name: ReadJson m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -4352,7 +4383,7 @@ Transform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 5 + m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &1337722730 MonoBehaviour: @@ -6049,6 +6080,37 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1942153352} m_CullTransparentMesh: 1 +--- !u!1 &1993700582 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1993700584} + m_Layer: 0 + m_Name: ------------------------------ (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1993700584 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1993700582} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &2035101380 GameObject: m_ObjectHideFlags: 0 diff --git a/meng_yao/Assets/script/A_Fight/SkillBox.cs b/meng_yao/Assets/script/A_Fight/SkillBox.cs index b452d75bf..8e8223244 100644 --- a/meng_yao/Assets/script/A_Fight/SkillBox.cs +++ b/meng_yao/Assets/script/A_Fight/SkillBox.cs @@ -29,7 +29,7 @@ public class SkillBox : Base public Image ExpFill; - public Dictionary mengyaoRole=new Dictionary(); + public int ExpNumber { @@ -43,7 +43,9 @@ public class SkillBox : Base private int ExpFileObjNumber=0; [Header("战魂(经验)填充父节点")] public GameObject ExpFilePrante; - public List expList = new List(); + public List expList = new List(); + + private void Start() { ExpFill.fillAmount = 0; @@ -52,7 +54,6 @@ public class SkillBox : Base instance = this; InitSkil(); - } public void UpdataExp(int number) @@ -89,21 +90,22 @@ public class SkillBox : Base void InitSkil() { - foreach (string _mengyaoRoleId in mengyaoRole.Keys) + + foreach (string _mengyaoRoleId in Base.GlobalObj.GetComponent().CarryCardId) { - foreach (Monster m in MengyaoInfo.Instance.m_SkillData) + foreach (Monster info in MengyaoInfo.Instance.m_SkillData) { - if (m.temp_id == _mengyaoRoleId) - { + if (string.Equals(_mengyaoRoleId, info.temp_id)) + { for (int j = 0; j < 2; j++) { GameObject obj = Instantiate(Skill, SkillParent); obj.GetComponent().infobox_skill_up = infobox_skill; - //obj.GetComponent().infobox_skill_up = infobox_skill; - + obj.GetComponent().MySkill = info.skills[j]; + obj.GetComponent().mengyao = MengyaoInfo.Instance.mengyaoIdToRole[info.temp_id]; } - } - return; + break; + } } } } @@ -192,7 +194,7 @@ public class SkillBox : Base void OnDestroy() { - mengyaoRole = null; + //mengyaoRole = null; } } diff --git a/meng_yao/Assets/script/A_Fight/Skill_Spend.cs b/meng_yao/Assets/script/A_Fight/Skill_Spend.cs index aceba2511..a5d1db33c 100644 --- a/meng_yao/Assets/script/A_Fight/Skill_Spend.cs +++ b/meng_yao/Assets/script/A_Fight/Skill_Spend.cs @@ -38,6 +38,9 @@ public class Skill_Spend : MonoBehaviour public Skill MySkill = new Skill(); + //[HideInInspector] + public GameObject mengyao;//对应的role + // Start is called before the first frame update void Start() { diff --git a/meng_yao/Assets/script/A_Fight/cardBox.cs b/meng_yao/Assets/script/A_Fight/cardBox.cs index dc0ecf044..9e2c8e98a 100644 --- a/meng_yao/Assets/script/A_Fight/cardBox.cs +++ b/meng_yao/Assets/script/A_Fight/cardBox.cs @@ -33,6 +33,10 @@ public class cardBox : MonoBehaviour // ID到萌妖卡预制体的映射字典 private Dictionary IDTomangyaoPrefab = new Dictionary(); + + //public Dictionary + + [HideInInspector] public List card = new List(); private void Awake() { diff --git a/meng_yao/Assets/script/A_Fight/cardContorl.cs b/meng_yao/Assets/script/A_Fight/cardContorl.cs index 9f324d34a..c8939b8a4 100644 --- a/meng_yao/Assets/script/A_Fight/cardContorl.cs +++ b/meng_yao/Assets/script/A_Fight/cardContorl.cs @@ -81,8 +81,9 @@ public class cardContorl : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndD if (mY.GetComponent().isInTrigger) { mY.transform.position = mY.GetComponent().tower.transform.position; + - ///SkillBox.instance.mengyaoRole.Add(mY.GetComponent().id,mY.GetComponent()); + MengyaoInfo.Instance.mengyaoIdToRole.Add(mY.GetComponent().id, mY); this.enabled = false; cardBox.instance.ChangeInPlaceNumber(1); diff --git a/meng_yao/Assets/script/A_Fight/json/MengyaoInfo.cs b/meng_yao/Assets/script/A_Fight/json/MengyaoInfo.cs index 2047e0dcb..f753af459 100644 --- a/meng_yao/Assets/script/A_Fight/json/MengyaoInfo.cs +++ b/meng_yao/Assets/script/A_Fight/json/MengyaoInfo.cs @@ -2,6 +2,7 @@ using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Xml.Linq; +using Unity.VisualScripting; using UnityEngine; public class MengyaoInfo :JsonReadBase @@ -16,6 +17,9 @@ public class MengyaoInfo :JsonReadBase public List m_WaveData; public List m_SkillData; public static MengyaoInfo Instance; + + + public Dictionary mengyaoIdToRole=new Dictionary(); // Start is called before the first frame update void Awake() { @@ -35,11 +39,11 @@ public class MengyaoInfo :JsonReadBase //base.DisplayData(m_SkillData); } - // Update is called once per frame - void Update() + void OnDestroy() { - + mengyaoIdToRole=null; } + } public class Character