From bcec41db6b062c3118728f34482166884392e97a Mon Sep 17 00:00:00 2001 From: Ader Alisma 01 Date: Sun, 30 Nov 2025 19:47:40 -0500 Subject: [PATCH] Fin MonsterCore --- Assets/Scenes/Game.unity | 118 +++++++++--------- Assets/Scripts/LevelConfig/WaveConfig.cs | 2 +- Assets/Scripts/LevelConfig/WaveObserver.cs | 20 ++- Assets/Scripts/Opponent/MonsterCoreDrop.cs | 26 ---- .../Scripts/Opponent/MonsterCoreDrop.cs.meta | 11 -- Assets/Scripts/Opponent/Opponent.cs | 48 ++++--- 6 files changed, 101 insertions(+), 124 deletions(-) delete mode 100644 Assets/Scripts/Opponent/MonsterCoreDrop.cs delete mode 100644 Assets/Scripts/Opponent/MonsterCoreDrop.cs.meta diff --git a/Assets/Scenes/Game.unity b/Assets/Scenes/Game.unity index bf5bb13..d9dfc3b 100644 --- a/Assets/Scenes/Game.unity +++ b/Assets/Scenes/Game.unity @@ -2217,7 +2217,7 @@ PrefabInstance: objectReference: {fileID: -2253911629886400664, guid: 7339506cf80058543b88c545d0979ebd, type: 3} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.size - value: 70 + value: 69 objectReference: {fileID: 0} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[0] @@ -2266,235 +2266,235 @@ PrefabInstance: - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[11] value: - objectReference: {fileID: 11400000, guid: 0d11424e05059b143b2bb6eb98ed1262, type: 2} + objectReference: {fileID: 11400000, guid: a387250a316b97e43be83b85980101e1, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[12] value: - objectReference: {fileID: 11400000, guid: a387250a316b97e43be83b85980101e1, type: 2} + objectReference: {fileID: 11400000, guid: ef5a154519b23a34aaded32e86bf7f2f, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[13] value: - objectReference: {fileID: 11400000, guid: ef5a154519b23a34aaded32e86bf7f2f, type: 2} + objectReference: {fileID: 11400000, guid: 5f47d74ebc4a8fe439ac6a4fe9ec436f, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[14] value: - objectReference: {fileID: 11400000, guid: 5f47d74ebc4a8fe439ac6a4fe9ec436f, type: 2} + objectReference: {fileID: 11400000, guid: 760092a3b8a4148488386ce5208108f4, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[15] value: - objectReference: {fileID: 11400000, guid: 760092a3b8a4148488386ce5208108f4, type: 2} + objectReference: {fileID: 11400000, guid: 4abc113f1a69a564b863f76e96756a75, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[16] value: - objectReference: {fileID: 11400000, guid: 4abc113f1a69a564b863f76e96756a75, type: 2} + objectReference: {fileID: 11400000, guid: a6e34739c9325da4cac4fbaea30d052c, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[17] value: - objectReference: {fileID: 11400000, guid: a6e34739c9325da4cac4fbaea30d052c, type: 2} + objectReference: {fileID: 11400000, guid: a432e0009e329054fb5f63ffc8aa5da1, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[18] value: - objectReference: {fileID: 11400000, guid: a432e0009e329054fb5f63ffc8aa5da1, type: 2} + objectReference: {fileID: 11400000, guid: 04c2cffdf7facd847b42eba02033c969, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[19] value: - objectReference: {fileID: 11400000, guid: 04c2cffdf7facd847b42eba02033c969, type: 2} + objectReference: {fileID: 11400000, guid: f1253a96234fecb4b82e83d1cec40677, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[20] value: - objectReference: {fileID: 11400000, guid: f1253a96234fecb4b82e83d1cec40677, type: 2} + objectReference: {fileID: 11400000, guid: 91f94bcdfb059454481917b575559c48, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[21] value: - objectReference: {fileID: 11400000, guid: 91f94bcdfb059454481917b575559c48, type: 2} + objectReference: {fileID: 11400000, guid: d37561e153d6a6448a03839488fdec5e, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[22] value: - objectReference: {fileID: 11400000, guid: d37561e153d6a6448a03839488fdec5e, type: 2} + objectReference: {fileID: 11400000, guid: 7a1313e5c16e74c4ba11a8114b9fd786, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[23] value: - objectReference: {fileID: 11400000, guid: 7a1313e5c16e74c4ba11a8114b9fd786, type: 2} + objectReference: {fileID: 11400000, guid: b501f7eea1fdfb843853bcba5b30533a, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[24] value: - objectReference: {fileID: 11400000, guid: b501f7eea1fdfb843853bcba5b30533a, type: 2} + objectReference: {fileID: 11400000, guid: 0a9c94eb38c575948992453fc29bcede, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[25] value: - objectReference: {fileID: 11400000, guid: 0a9c94eb38c575948992453fc29bcede, type: 2} + objectReference: {fileID: 11400000, guid: ec229632b369eb746a30dbfafe3de373, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[26] value: - objectReference: {fileID: 11400000, guid: ec229632b369eb746a30dbfafe3de373, type: 2} + objectReference: {fileID: 11400000, guid: 7b9178a588ec3c5479d7ea8989cc0b35, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[27] value: - objectReference: {fileID: 11400000, guid: 7b9178a588ec3c5479d7ea8989cc0b35, type: 2} + objectReference: {fileID: 11400000, guid: 042265144e4e260438b10752dc404d71, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[28] value: - objectReference: {fileID: 11400000, guid: 042265144e4e260438b10752dc404d71, type: 2} + objectReference: {fileID: 11400000, guid: 363fc227e0d4c98488d7dccb6c8acae0, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[29] value: - objectReference: {fileID: 11400000, guid: 363fc227e0d4c98488d7dccb6c8acae0, type: 2} + objectReference: {fileID: 11400000, guid: d8140ae36f1b7fd4fb1a57ab3dc69de4, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[30] value: - objectReference: {fileID: 11400000, guid: d8140ae36f1b7fd4fb1a57ab3dc69de4, type: 2} + objectReference: {fileID: 11400000, guid: 2a601d614d4075f4fbe54dcab4016d2d, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[31] value: - objectReference: {fileID: 11400000, guid: 2a601d614d4075f4fbe54dcab4016d2d, type: 2} + objectReference: {fileID: 11400000, guid: f6660e22eb6be1d4589c27cb3bec6eb2, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[32] value: - objectReference: {fileID: 11400000, guid: f6660e22eb6be1d4589c27cb3bec6eb2, type: 2} + objectReference: {fileID: 11400000, guid: e9e134bb6a24e4647a27955d3d276bd2, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[33] value: - objectReference: {fileID: 11400000, guid: e9e134bb6a24e4647a27955d3d276bd2, type: 2} + objectReference: {fileID: 11400000, guid: c22ff5f49b21f9844a4d9693dc06777c, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[34] value: - objectReference: {fileID: 11400000, guid: c22ff5f49b21f9844a4d9693dc06777c, type: 2} + objectReference: {fileID: 11400000, guid: 5ccff833a19a71f4499a3b3d786f4d11, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[35] value: - objectReference: {fileID: 11400000, guid: 5ccff833a19a71f4499a3b3d786f4d11, type: 2} + objectReference: {fileID: 11400000, guid: 2462ecbf554cf1d4883dea95b2504a9f, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[36] value: - objectReference: {fileID: 11400000, guid: 2462ecbf554cf1d4883dea95b2504a9f, type: 2} + objectReference: {fileID: 11400000, guid: eee8fc46b43d8144ca603169dc9f26d6, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[37] value: - objectReference: {fileID: 11400000, guid: eee8fc46b43d8144ca603169dc9f26d6, type: 2} + objectReference: {fileID: 11400000, guid: 82472d65388277c449f87a0815b70093, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[38] value: - objectReference: {fileID: 11400000, guid: 82472d65388277c449f87a0815b70093, type: 2} + objectReference: {fileID: 11400000, guid: 28dbf66982750964aac6760b543389b9, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[39] value: - objectReference: {fileID: 11400000, guid: 28dbf66982750964aac6760b543389b9, type: 2} + objectReference: {fileID: 11400000, guid: 480af6886a535ee4aa8ea20ff8420405, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[40] value: - objectReference: {fileID: 11400000, guid: 480af6886a535ee4aa8ea20ff8420405, type: 2} + objectReference: {fileID: 11400000, guid: 97e48df72a61cce49a948324f6eb38ed, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[41] value: - objectReference: {fileID: 11400000, guid: 97e48df72a61cce49a948324f6eb38ed, type: 2} + objectReference: {fileID: 11400000, guid: 1fb1df19432ef1d4e8084017d733b0b7, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[42] value: - objectReference: {fileID: 11400000, guid: 1fb1df19432ef1d4e8084017d733b0b7, type: 2} + objectReference: {fileID: 11400000, guid: 4c72177270b51eb46872d1665e3a097e, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[43] value: - objectReference: {fileID: 11400000, guid: 4c72177270b51eb46872d1665e3a097e, type: 2} + objectReference: {fileID: 11400000, guid: 61b21509b3e4be0438ea87b4e7a73e17, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[44] value: - objectReference: {fileID: 11400000, guid: 61b21509b3e4be0438ea87b4e7a73e17, type: 2} + objectReference: {fileID: 11400000, guid: 9ff4b606166b07d4bb3afb15e5a23f41, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[45] value: - objectReference: {fileID: 11400000, guid: 9ff4b606166b07d4bb3afb15e5a23f41, type: 2} + objectReference: {fileID: 11400000, guid: 865ba64414c55f245b62d64b83e0ec9d, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[46] value: - objectReference: {fileID: 11400000, guid: 865ba64414c55f245b62d64b83e0ec9d, type: 2} + objectReference: {fileID: 11400000, guid: 85994a48470bfb741972adb2e34dca4b, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[47] value: - objectReference: {fileID: 11400000, guid: 85994a48470bfb741972adb2e34dca4b, type: 2} + objectReference: {fileID: 11400000, guid: 4728bef0a18b70945bedf5b1190c491e, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[48] value: - objectReference: {fileID: 11400000, guid: 4728bef0a18b70945bedf5b1190c491e, type: 2} + objectReference: {fileID: 11400000, guid: f4dcf11b827a5ca49a70b5db1e72e16e, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[49] value: - objectReference: {fileID: 11400000, guid: f4dcf11b827a5ca49a70b5db1e72e16e, type: 2} + objectReference: {fileID: 11400000, guid: ee85fc25d3460c745806649e7f9d166a, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[50] value: - objectReference: {fileID: 11400000, guid: ee85fc25d3460c745806649e7f9d166a, type: 2} + objectReference: {fileID: 11400000, guid: f433c214b267f2a40b7427ae18ac80ac, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[51] value: - objectReference: {fileID: 11400000, guid: f433c214b267f2a40b7427ae18ac80ac, type: 2} + objectReference: {fileID: 11400000, guid: 4fda8972f6f46684891773953155782e, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[52] value: - objectReference: {fileID: 11400000, guid: 4fda8972f6f46684891773953155782e, type: 2} + objectReference: {fileID: 11400000, guid: 0334115ab72f6d5449497db1bb50377e, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[53] value: - objectReference: {fileID: 11400000, guid: 0334115ab72f6d5449497db1bb50377e, type: 2} + objectReference: {fileID: 11400000, guid: 4855deb66869b934bb7a63c02d4442fe, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[54] value: - objectReference: {fileID: 11400000, guid: 4855deb66869b934bb7a63c02d4442fe, type: 2} + objectReference: {fileID: 11400000, guid: b326df01bdba895448b1df3f2918fa9b, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[55] value: - objectReference: {fileID: 11400000, guid: b326df01bdba895448b1df3f2918fa9b, type: 2} + objectReference: {fileID: 11400000, guid: 625b62b58ac7f0449a40dd93b073f75d, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[56] value: - objectReference: {fileID: 11400000, guid: 625b62b58ac7f0449a40dd93b073f75d, type: 2} + objectReference: {fileID: 11400000, guid: e7ff62830456cdc438af6fd07bcbf5d3, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[57] value: - objectReference: {fileID: 11400000, guid: e7ff62830456cdc438af6fd07bcbf5d3, type: 2} + objectReference: {fileID: 11400000, guid: ee631efcc559c264c8c267a0f242f20c, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[58] value: - objectReference: {fileID: 11400000, guid: ee631efcc559c264c8c267a0f242f20c, type: 2} + objectReference: {fileID: 11400000, guid: b39a6491f6ec8cd409c7309c588fcd71, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[59] value: - objectReference: {fileID: 11400000, guid: b39a6491f6ec8cd409c7309c588fcd71, type: 2} + objectReference: {fileID: 11400000, guid: 0409f399020f9ba44a4d563dde4325dc, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[60] value: - objectReference: {fileID: 11400000, guid: 0409f399020f9ba44a4d563dde4325dc, type: 2} + objectReference: {fileID: 11400000, guid: e30df5cb33c63d0449075a565d8cbf62, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[61] value: - objectReference: {fileID: 11400000, guid: e30df5cb33c63d0449075a565d8cbf62, type: 2} + objectReference: {fileID: 11400000, guid: 1639cd6a5b9ac1f4c96319ebfcac741a, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[62] value: - objectReference: {fileID: 11400000, guid: 1639cd6a5b9ac1f4c96319ebfcac741a, type: 2} + objectReference: {fileID: 11400000, guid: 9c0d637186327a544bad3f9cbccebd42, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[63] value: - objectReference: {fileID: 11400000, guid: 9c0d637186327a544bad3f9cbccebd42, type: 2} + objectReference: {fileID: 11400000, guid: 9ec7cc6ffd0ee3546aa48a421746dc06, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[64] value: - objectReference: {fileID: 11400000, guid: 9ec7cc6ffd0ee3546aa48a421746dc06, type: 2} + objectReference: {fileID: 11400000, guid: 0c3268393deaed84d87f041b2a4f970c, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[65] value: - objectReference: {fileID: 11400000, guid: 0c3268393deaed84d87f041b2a4f970c, type: 2} + objectReference: {fileID: 11400000, guid: 13f86b851462cf04884a0e0d6840e48b, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[66] value: - objectReference: {fileID: 11400000, guid: 13f86b851462cf04884a0e0d6840e48b, type: 2} + objectReference: {fileID: 11400000, guid: 20ad512fe083b804d85da6dafa69ecaf, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[67] value: - objectReference: {fileID: 11400000, guid: 20ad512fe083b804d85da6dafa69ecaf, type: 2} + objectReference: {fileID: 11400000, guid: bb9859dfbbeec1d4583f967ab91c2248, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[68] value: - objectReference: {fileID: 11400000, guid: bb9859dfbbeec1d4583f967ab91c2248, type: 2} + objectReference: {fileID: 11400000, guid: 4a2a06e07aa635c4b9c78c94e0c34f80, type: 2} - target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3} propertyPath: _scriptableObjects.Array.data[69] value: diff --git a/Assets/Scripts/LevelConfig/WaveConfig.cs b/Assets/Scripts/LevelConfig/WaveConfig.cs index 35ca7fa..bd69d40 100644 --- a/Assets/Scripts/LevelConfig/WaveConfig.cs +++ b/Assets/Scripts/LevelConfig/WaveConfig.cs @@ -5,7 +5,7 @@ public class GroupList { public List groupSpawn; public float triggerTime; - public bool dropsMonsterCore; + public int monsterCoreAmount; } [CreateAssetMenu(menuName = "Gather And Defend/Levels/WaveConfig")] public class WaveConfig : ScriptableObject diff --git a/Assets/Scripts/LevelConfig/WaveObserver.cs b/Assets/Scripts/LevelConfig/WaveObserver.cs index f8262be..4111ad8 100644 --- a/Assets/Scripts/LevelConfig/WaveObserver.cs +++ b/Assets/Scripts/LevelConfig/WaveObserver.cs @@ -13,7 +13,7 @@ public class WaveObserver : Singleton private List _copyConstantSpawn; private List _intervalTiming = new List(); private List> _copyGroupSpawn; //Contains count of enemies per group - private List _monsterCoreGroups; + private List _monsterCoreGroupAmount; private WaveConfig _levelConfig; private int _spawnerTiming = 0; private int _currentGroupIndex = 0; @@ -29,7 +29,7 @@ public class WaveObserver : Singleton _copyConstantSpawn = new List(); _copyGroupSpawn = new List>(); _groupSpawnTimers = new List(); - _monsterCoreGroups = new List(); + _monsterCoreGroupAmount = new List(); _spawnerTiming = 0; _currentGroupIndex = 0; @@ -53,7 +53,7 @@ public class WaveObserver : Singleton _copyGroupSpawn[index].Add(_levelConfig.NestedGroupSpawn[index].groupSpawn[nestedIndex].Count); } _groupSpawnTimers.Add(_levelConfig.NestedGroupSpawn[index].triggerTime); - _monsterCoreGroups.Add(_levelConfig.NestedGroupSpawn[index].dropsMonsterCore); + _monsterCoreGroupAmount.Add(_levelConfig.NestedGroupSpawn[index].monsterCoreAmount); } // Start game timer, at the end, player wins. @@ -148,6 +148,7 @@ public class WaveObserver : Singleton */ public void NotifyDies(int position, float toughness, GameObject paramPrefab) { + Debug.Log("Enemy died : " + paramPrefab.name); _aliveEnemyCount[position] -= toughness; if (_aliveEnemyCount[position] < MAXTOUGHNESS) { @@ -250,14 +251,8 @@ public class WaveObserver : Singleton private void CycleRows(List usedRows, List currentGroup, int groupIndex) { System.Random rand = new System.Random(); - bool dropsCore = _monsterCoreGroups != null && _monsterCoreGroups.Count > _currentGroupIndex && _monsterCoreGroups[_currentGroupIndex]; + int totalMonsterCores = _monsterCoreGroupAmount[_currentGroupIndex]; int totalToSpawn = _copyGroupSpawn[_currentGroupIndex][groupIndex]; - int monsterCoreTarget = -1; - // TODO : Si spécifié, nbr fixe de core à drop - if (dropsCore && totalToSpawn > 0) - { - monsterCoreTarget = rand.Next(0, totalToSpawn); - } int spawnCount = 0; while (usedRows.Count < _subjects.Count) { @@ -266,10 +261,11 @@ public class WaveObserver : Singleton { Opponent spawnedInstance = _subjects[currentRow].TriggerSpawn(currentGroup[groupIndex].GetEnemyObject()).GetComponent(); - // When Monster core time - if (monsterCoreTarget >= 0 && spawnCount == monsterCoreTarget) + // When Monster core time : Random or remaining spawns >= remaining monster cores + if ((rand.Next() % 2 == 0 || totalMonsterCores <= totalToSpawn) && totalMonsterCores > 0) { spawnedInstance.ActivateMonsterCore(); + totalMonsterCores--; } _copyGroupSpawn[_currentGroupIndex][groupIndex]--; diff --git a/Assets/Scripts/Opponent/MonsterCoreDrop.cs b/Assets/Scripts/Opponent/MonsterCoreDrop.cs deleted file mode 100644 index b539ff7..0000000 --- a/Assets/Scripts/Opponent/MonsterCoreDrop.cs +++ /dev/null @@ -1,26 +0,0 @@ -using UnityEngine; - -[CreateAssetMenu(menuName = "Gather And Defend/" + nameof(MonsterCoreDrop))] -public class MonsterCoreDrop : ScriptableObject -{ - [SerializeField] - private GameObject _monsterCorePrefab; - - public void Start() - { - Debug.Log("MONSTER CORING SSO HARD"); - if (_monsterCorePrefab == null) - { - Debug.LogWarning("Prefab MonsterCore non defini"); - } - } - - public void Death(Vector3 position) - { - if (_monsterCorePrefab != null) - { - Instantiate(_monsterCorePrefab, position, Quaternion.identity); - } - Debug.Log("MONSTER CORE DROPPEDD"); - } -} diff --git a/Assets/Scripts/Opponent/MonsterCoreDrop.cs.meta b/Assets/Scripts/Opponent/MonsterCoreDrop.cs.meta deleted file mode 100644 index 9443e99..0000000 --- a/Assets/Scripts/Opponent/MonsterCoreDrop.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: f431d5fa196e5ea4da69343642d10d2f -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Opponent/Opponent.cs b/Assets/Scripts/Opponent/Opponent.cs index 10e5380..b29ff5f 100644 --- a/Assets/Scripts/Opponent/Opponent.cs +++ b/Assets/Scripts/Opponent/Opponent.cs @@ -1,6 +1,7 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; +using UnityEngine.UIElements; public class Opponent : Entity { @@ -15,7 +16,9 @@ public class Opponent : Entity private WaveObserver _observer; private int _observerIndex; private float _toughness; - private bool _dropsMonsterCore = false; + private bool _hasMonsterCore = false; + private bool _isDying = false; + public override void Start() { @@ -28,14 +31,14 @@ public class Opponent : Entity _observerIndex = _observer.NotifyEnemy(transform.position.y, _toughness); } - public override void Update() + public override void Update() { base.Update(); - if(IsEnemyDetected) + if (IsEnemyDetected) { AttackEnemy(); } - else + else { _movementVector.x = -Time.deltaTime * Speed; @@ -45,32 +48,47 @@ public class Opponent : Entity } } - void AttackEnemy() + void AttackEnemy() { //Attack Cooldown - if(AttackInterval < AttackSpeedWait) + if (AttackInterval < AttackSpeedWait) { - Animation.PlayAttackAnim(); + Animation.PlayAttackAnim(); - AttackSpeedWait = 0f; - } + AttackSpeedWait = 0f; + } - AttackSpeedWait += Time.deltaTime; + AttackSpeedWait += Time.deltaTime; } public override void Death() { - if (_dropsMonsterCore) + if (!_isDying) { - // TODO: Fetch scriptable object from Dict + if (_hasMonsterCore) + { + DropMonsterCore(); + } + _isDying = true; + _observer.NotifyDies(_observerIndex, _toughness, gameObject); + base.Death(); + } + } + + private void DropMonsterCore() + { + GameObject _monsterCorePrefab = Database.Instance.Prefabs["yieldMonsterCore"]; + + if (_monsterCorePrefab != null) + { + Instantiate(_monsterCorePrefab, transform.position, Quaternion.identity); + _hasMonsterCore = false; } - _observer.NotifyDies(_observerIndex, _toughness, gameObject); - base.Death(); } public void ActivateMonsterCore() { - _dropsMonsterCore = true; + _hasMonsterCore = true; } }