From a8a4f944b790cd9b8a9decbc98503a5d6dbf8a39 Mon Sep 17 00:00:00 2001 From: wulongxiao <2545507770@qq.com> Date: Thu, 9 Jan 2025 13:33:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E6=89=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- meng_yao/Assets/Config/enemytest.json | 17 --- meng_yao/Assets/Config/enemytest.json.meta | 7 -- .../Prefabs/charatar/enemy/wood_Big.prefab | 4 +- .../Prefabs/charatar/enemy/wood_min.prefab | 4 +- .../ui/scene_main/Battle_Selection.prefab | 110 +++++++++--------- .../Wood monsters are big_1/big1.png.meta | 2 +- .../Wood monsters are big_2/big2.png.meta | 2 +- .../Wood monsters are big_3/big3.png.meta | 2 +- meng_yao/Assets/Scenes/New/Scene_map_1.unity | 10 +- meng_yao/Assets/common | 2 +- .../Assets/script/A_Fight/Monster_Infos.cs | 41 ------- .../script/A_Fight/Monster_Infos.cs.meta | 11 -- .../Assets/script/A_Fight/SpawnMonster.cs | 31 ++++- 13 files changed, 96 insertions(+), 147 deletions(-) delete mode 100644 meng_yao/Assets/Config/enemytest.json delete mode 100644 meng_yao/Assets/Config/enemytest.json.meta delete mode 100644 meng_yao/Assets/script/A_Fight/Monster_Infos.cs delete mode 100644 meng_yao/Assets/script/A_Fight/Monster_Infos.cs.meta diff --git a/meng_yao/Assets/Config/enemytest.json b/meng_yao/Assets/Config/enemytest.json deleted file mode 100644 index 4176e148c..000000000 --- a/meng_yao/Assets/Config/enemytest.json +++ /dev/null @@ -1,17 +0,0 @@ -[ - { - "Id": 1001, - "Name": "小哥布林", - "info": "第一关", - "AllEnemyNumber": 20, - "WaveNumber": 4, - "OneWaveEnemyNumber": [5, 5, 5, 5], - "LevelRewards": [ - { - "RewardId": 1001, - "RewardName": "战魂", - "RewardNumber": 50 - } - ] - } -] \ No newline at end of file diff --git a/meng_yao/Assets/Config/enemytest.json.meta b/meng_yao/Assets/Config/enemytest.json.meta deleted file mode 100644 index fac58fc10..000000000 --- a/meng_yao/Assets/Config/enemytest.json.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 89bbacca41b409b4dbf238a43bbb2e4b -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/meng_yao/Assets/Prefabs/charatar/enemy/wood_Big.prefab b/meng_yao/Assets/Prefabs/charatar/enemy/wood_Big.prefab index e12f485db..83bdfa6a8 100644 --- a/meng_yao/Assets/Prefabs/charatar/enemy/wood_Big.prefab +++ b/meng_yao/Assets/Prefabs/charatar/enemy/wood_Big.prefab @@ -623,7 +623,7 @@ SpriteRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 - m_Sprite: {fileID: -1998329281, guid: bf6f58d03f45c8047a372a454d7c6fc1, type: 3} + m_Sprite: {fileID: 551125730, guid: bf6f58d03f45c8047a372a454d7c6fc1, type: 3} m_Color: {r: 1, g: 1, b: 1, a: 1} m_FlipX: 0 m_FlipY: 0 @@ -653,7 +653,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!224 &5609612011295970173 RectTransform: m_ObjectHideFlags: 0 diff --git a/meng_yao/Assets/Prefabs/charatar/enemy/wood_min.prefab b/meng_yao/Assets/Prefabs/charatar/enemy/wood_min.prefab index e1f5309d6..c339e820d 100644 --- a/meng_yao/Assets/Prefabs/charatar/enemy/wood_min.prefab +++ b/meng_yao/Assets/Prefabs/charatar/enemy/wood_min.prefab @@ -637,7 +637,7 @@ SpriteRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 - m_Sprite: {fileID: 21300000, guid: 57d35e7424996004e851d5648c055617, type: 3} + m_Sprite: {fileID: 21300000, guid: 839012168e591124c8be757f8e9e94e4, type: 3} m_Color: {r: 1, g: 1, b: 1, a: 1} m_FlipX: 0 m_FlipY: 0 @@ -667,7 +667,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!224 &5609612011295970173 RectTransform: m_ObjectHideFlags: 0 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 aa43addb9..70a79b7f4 100644 --- a/meng_yao/Assets/Prefabs/ui/scene_main/Battle_Selection.prefab +++ b/meng_yao/Assets/Prefabs/ui/scene_main/Battle_Selection.prefab @@ -949,8 +949,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -9, y: 95} - m_SizeDelta: {x: 867.1201, y: 803.3915} + m_AnchoredPosition: {x: 9, y: 65} + m_SizeDelta: {x: 669.3708, y: 620.1757} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &7203221707284526699 CanvasRenderer: @@ -980,7 +980,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_Sprite: {fileID: 21300000, guid: a53299c1bc14a204dad89ef1a0701f53, type: 3} + m_Sprite: {fileID: -1998329281, guid: bf6f58d03f45c8047a372a454d7c6fc1, type: 3} m_Type: 0 m_PreserveAspect: 0 m_FillCenter: 1 @@ -1027,10 +1027,10 @@ RectTransform: m_Father: {fileID: 8646173537342263721} m_RootOrder: 7 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 1870.38, y: -174.5} + m_SizeDelta: {x: 264, y: 349} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &1384521942092389828 CanvasRenderer: @@ -2574,10 +2574,10 @@ RectTransform: m_Father: {fileID: 8646173537015180660} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 380.34, y: -174.5} + m_SizeDelta: {x: 264, y: 349} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &7609212775189386514 CanvasRenderer: @@ -2796,10 +2796,10 @@ RectTransform: m_Father: {fileID: 8646173537342263721} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 628.68, y: -174.5} + m_SizeDelta: {x: 264, y: 349} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &514399549474802177 CanvasRenderer: @@ -3495,10 +3495,10 @@ RectTransform: m_Father: {fileID: 8646173537342263721} m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 877.02, y: -174.5} + m_SizeDelta: {x: 264, y: 349} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &1697601538235407773 CanvasRenderer: @@ -4189,10 +4189,10 @@ RectTransform: m_Father: {fileID: 8646173537342263721} m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 1125.36, y: -174.5} + m_SizeDelta: {x: 264, y: 349} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &7365051608687316327 CanvasRenderer: @@ -4708,10 +4708,10 @@ RectTransform: m_Father: {fileID: 8646173537342263721} m_RootOrder: 8 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 2118.72, y: -174.5} + m_SizeDelta: {x: 264, y: 349} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &4664660864740528634 CanvasRenderer: @@ -5273,10 +5273,10 @@ RectTransform: m_Father: {fileID: 8646173537342263721} m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 1622.04, y: -174.5} + m_SizeDelta: {x: 264, y: 349} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &5149107496789374916 CanvasRenderer: @@ -5858,10 +5858,10 @@ RectTransform: m_Father: {fileID: 8646173537342263721} m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 1373.7, y: -174.5} + m_SizeDelta: {x: 264, y: 349} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &3385889476137030960 CanvasRenderer: @@ -6215,10 +6215,10 @@ RectTransform: m_Father: {fileID: 8646173537342263721} m_RootOrder: 10 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 2615.4, y: -174.5} + m_SizeDelta: {x: 264, y: 349} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &5429751683088901057 CanvasRenderer: @@ -6429,10 +6429,10 @@ RectTransform: m_Father: {fileID: 8646173537342263721} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 132, y: -174.5} + m_SizeDelta: {x: 264, y: 349} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &1106133910927903845 CanvasRenderer: @@ -6643,10 +6643,10 @@ RectTransform: m_Father: {fileID: 8646173537342263721} m_RootOrder: 9 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 2367.06, y: -174.5} + m_SizeDelta: {x: 264, y: 349} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &8283226131301192430 CanvasRenderer: @@ -7258,10 +7258,10 @@ RectTransform: m_Father: {fileID: 8646173537342263721} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 380.34, y: -174.5} + m_SizeDelta: {x: 264, y: 349} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &6130671505914922423 CanvasRenderer: @@ -12120,10 +12120,10 @@ RectTransform: m_Father: {fileID: 8646173537015180660} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 132, y: -174.5} + m_SizeDelta: {x: 264, y: 349} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &8646173537325353418 CanvasRenderer: diff --git a/meng_yao/Assets/Resources/animation/A_fightin/Wood monsters are big_1/big1.png.meta b/meng_yao/Assets/Resources/animation/A_fightin/Wood monsters are big_1/big1.png.meta index ab7020a3f..9c89342dd 100644 --- a/meng_yao/Assets/Resources/animation/A_fightin/Wood monsters are big_1/big1.png.meta +++ b/meng_yao/Assets/Resources/animation/A_fightin/Wood monsters are big_1/big1.png.meta @@ -67,7 +67,7 @@ TextureImporter: platformSettings: - serializedVersion: 3 buildTarget: DefaultTexturePlatform - maxTextureSize: 512 + maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 textureCompression: 1 diff --git a/meng_yao/Assets/Resources/animation/A_fightin/Wood monsters are big_2/big2.png.meta b/meng_yao/Assets/Resources/animation/A_fightin/Wood monsters are big_2/big2.png.meta index 19ba65c88..cec7e776c 100644 --- a/meng_yao/Assets/Resources/animation/A_fightin/Wood monsters are big_2/big2.png.meta +++ b/meng_yao/Assets/Resources/animation/A_fightin/Wood monsters are big_2/big2.png.meta @@ -67,7 +67,7 @@ TextureImporter: platformSettings: - serializedVersion: 3 buildTarget: DefaultTexturePlatform - maxTextureSize: 512 + maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 textureCompression: 1 diff --git a/meng_yao/Assets/Resources/animation/A_fightin/Wood monsters are big_3/big3.png.meta b/meng_yao/Assets/Resources/animation/A_fightin/Wood monsters are big_3/big3.png.meta index 51d4e46c9..ccf203eef 100644 --- a/meng_yao/Assets/Resources/animation/A_fightin/Wood monsters are big_3/big3.png.meta +++ b/meng_yao/Assets/Resources/animation/A_fightin/Wood monsters are big_3/big3.png.meta @@ -67,7 +67,7 @@ TextureImporter: platformSettings: - serializedVersion: 3 buildTarget: DefaultTexturePlatform - maxTextureSize: 512 + maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 textureCompression: 1 diff --git a/meng_yao/Assets/Scenes/New/Scene_map_1.unity b/meng_yao/Assets/Scenes/New/Scene_map_1.unity index b8491fef8..f5ac6205f 100644 --- a/meng_yao/Assets/Scenes/New/Scene_map_1.unity +++ b/meng_yao/Assets/Scenes/New/Scene_map_1.unity @@ -5910,6 +5910,11 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: description: + monsters: + - id: Enemy_002 + prefab: {fileID: 4703411402065954783, guid: 6e6ba8758b8dcd743bb59f49094f13a6, type: 3} + - id: Enemy_001 + prefab: {fileID: 4703411402065954783, guid: aac4ad2c72526a54691494dd54e115a6, type: 3} SpawnLocations: - {fileID: 734893407} enemysList: [] @@ -6003,11 +6008,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 3ee6cb1a8b4020040bddd9c037e404b4, type: 3} m_Name: m_EditorClassIdentifier: - monsters: - - id: - prefab: {fileID: 4703411402065954783, guid: aac4ad2c72526a54691494dd54e115a6, type: 3} - - id: Enemy_001 - prefab: {fileID: 4703411402065954783, guid: 6e6ba8758b8dcd743bb59f49094f13a6, type: 3} --- !u!1 &1932457212 GameObject: m_ObjectHideFlags: 0 diff --git a/meng_yao/Assets/common b/meng_yao/Assets/common index a187c6ecc..833432520 160000 --- a/meng_yao/Assets/common +++ b/meng_yao/Assets/common @@ -1 +1 @@ -Subproject commit a187c6ecc790ce7b3b03cc52bc5b610961584df3 +Subproject commit 833432520044afdb4bf6566e25b8c31cf3635e53 diff --git a/meng_yao/Assets/script/A_Fight/Monster_Infos.cs b/meng_yao/Assets/script/A_Fight/Monster_Infos.cs deleted file mode 100644 index fb67c3b5f..000000000 --- a/meng_yao/Assets/script/A_Fight/Monster_Infos.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -[System.Serializable] -public class monster -{ - public string id; - public GameObject prefab; - -} - -public class Monster_Infos : MonoBehaviour -{ - public List monsters = new List(); - public static Monster_Infos instance; - - void Awake() - { - instance = this; - } - - - /// - /// idõԤ壬ҲӦidĬϷصһ - /// - /// - /// - public GameObject GetMonster(string id) - { - foreach (monster value in monsters) - { - if (value.id==id) - { - return value.prefab; - } - } - return monsters[0].prefab; - } -} - diff --git a/meng_yao/Assets/script/A_Fight/Monster_Infos.cs.meta b/meng_yao/Assets/script/A_Fight/Monster_Infos.cs.meta deleted file mode 100644 index 4897a60fc..000000000 --- a/meng_yao/Assets/script/A_Fight/Monster_Infos.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 3ee6cb1a8b4020040bddd9c037e404b4 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/meng_yao/Assets/script/A_Fight/SpawnMonster.cs b/meng_yao/Assets/script/A_Fight/SpawnMonster.cs index c7a7afdb0..564836781 100644 --- a/meng_yao/Assets/script/A_Fight/SpawnMonster.cs +++ b/meng_yao/Assets/script/A_Fight/SpawnMonster.cs @@ -4,10 +4,20 @@ using System.Threading.Tasks; using UnityEngine.Rendering; +[System.Serializable] +public class monster +{ + public string id; + public GameObject prefab; + +} + public class SpawnMonster : Base { public static SpawnMonster intance; + public List monsters = new List(); + [Header("λ")] public List SpawnLocations; @@ -132,7 +142,7 @@ public class SpawnMonster : Base Debug.Log("ɹ"); GameObject go = GameObject.Instantiate( - Monster_Infos.instance.GetMonster(enemy.id), + GetMonster(enemy.id), SpawnLocations[value.spawnPoint - 1].position, Quaternion.identity ); @@ -154,8 +164,23 @@ public class SpawnMonster : Base } } - - + /// + /// idõԤ壬ҲӦidĬϷصһ + /// + /// + /// + public GameObject GetMonster(string id) + { + foreach (monster value in monsters) + { + if (value.id == id) + { + return value.prefab; + } + } + return monsters[0].prefab; + } + private void OnDisable() {