diff --git a/Assets/Animation/GameOverClip.anim b/Assets/Animation/GameOverClip.anim index 7f89835ad058987c103b5e93cbf1ef80b8d31964..ca9b6538a142bce65098d5bb87aac26531d63382 100644 --- a/Assets/Animation/GameOverClip.anim +++ b/Assets/Animation/GameOverClip.anim @@ -54,7 +54,7 @@ AnimationClip: serializedVersion: 2 m_Curve: - serializedVersion: 3 - time: 1.5 + time: 0 value: {x: 1, y: 1, z: 1} inSlope: {x: 0, y: 0, z: 0} outSlope: {x: 0, y: 0, z: 0} @@ -62,6 +62,15 @@ AnimationClip: weightedMode: 0 inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 1.5 + value: {x: 1.5, y: 1.5, z: 1.5} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - serializedVersion: 3 time: 2 value: {x: 0.8, y: 0.8, z: 0.8} @@ -75,6 +84,40 @@ AnimationClip: m_PostInfinity: 2 m_RotationOrder: 4 path: Score + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: {x: 1, y: 1, z: 1} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 1.5 + value: {x: 1.5, y: 1.5, z: 1.5} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 2 + value: {x: 0.8, y: 0.8, z: 0.8} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + path: Wave m_FloatCurves: - curve: serializedVersion: 2 @@ -103,7 +146,7 @@ AnimationClip: attribute: m_Color.r path: GameOverText classID: 114 - script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} - curve: serializedVersion: 2 m_Curve: @@ -131,7 +174,7 @@ AnimationClip: attribute: m_Color.g path: GameOverText classID: 114 - script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} - curve: serializedVersion: 2 m_Curve: @@ -159,7 +202,7 @@ AnimationClip: attribute: m_Color.b path: GameOverText classID: 114 - script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} - curve: serializedVersion: 2 m_Curve: @@ -187,7 +230,7 @@ AnimationClip: attribute: m_Color.a path: GameOverText classID: 114 - script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} - curve: serializedVersion: 2 m_Curve: @@ -215,7 +258,7 @@ AnimationClip: attribute: m_Color.r path: ScreenFade classID: 114 - script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - curve: serializedVersion: 2 m_Curve: @@ -243,7 +286,7 @@ AnimationClip: attribute: m_Color.g path: ScreenFade classID: 114 - script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - curve: serializedVersion: 2 m_Curve: @@ -271,7 +314,7 @@ AnimationClip: attribute: m_Color.b path: ScreenFade classID: 114 - script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - curve: serializedVersion: 2 m_Curve: @@ -299,7 +342,7 @@ AnimationClip: attribute: m_Color.a path: ScreenFade classID: 114 - script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} m_PPtrCurves: [] m_SampleRate: 60 m_WrapMode: 0 @@ -322,59 +365,66 @@ AnimationClip: typeID: 4 customType: 0 isPPtrCurve: 0 + - serializedVersion: 2 + path: 2050359991 + attribute: 3 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 - serializedVersion: 2 path: 2185909552 attribute: 304273561 - script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} typeID: 114 customType: 0 isPPtrCurve: 0 - serializedVersion: 2 path: 1453643700 attribute: 304273561 - script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} typeID: 114 customType: 0 isPPtrCurve: 0 - serializedVersion: 2 path: 2185909552 attribute: 2526845255 - script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} typeID: 114 customType: 0 isPPtrCurve: 0 - serializedVersion: 2 path: 2185909552 attribute: 4215373228 - script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} typeID: 114 customType: 0 isPPtrCurve: 0 - serializedVersion: 2 path: 2185909552 attribute: 2334886179 - script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} typeID: 114 customType: 0 isPPtrCurve: 0 - serializedVersion: 2 path: 1453643700 attribute: 2526845255 - script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} typeID: 114 customType: 0 isPPtrCurve: 0 - serializedVersion: 2 path: 1453643700 attribute: 4215373228 - script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} typeID: 114 customType: 0 isPPtrCurve: 0 - serializedVersion: 2 path: 1453643700 attribute: 2334886179 - script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} typeID: 114 customType: 0 isPPtrCurve: 0 @@ -538,7 +588,7 @@ AnimationClip: attribute: m_Color.r path: GameOverText classID: 114 - script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} - curve: serializedVersion: 2 m_Curve: @@ -566,7 +616,7 @@ AnimationClip: attribute: m_Color.g path: GameOverText classID: 114 - script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} - curve: serializedVersion: 2 m_Curve: @@ -594,7 +644,7 @@ AnimationClip: attribute: m_Color.b path: GameOverText classID: 114 - script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} - curve: serializedVersion: 2 m_Curve: @@ -622,12 +672,12 @@ AnimationClip: attribute: m_Color.a path: GameOverText classID: 114 - script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} - curve: serializedVersion: 2 m_Curve: - serializedVersion: 3 - time: 1.5 + time: 0 value: 1 inSlope: 0 outSlope: 0 @@ -635,6 +685,15 @@ AnimationClip: weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.5 + value: 1.5 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 - serializedVersion: 3 time: 2 value: 0.8 @@ -655,7 +714,7 @@ AnimationClip: serializedVersion: 2 m_Curve: - serializedVersion: 3 - time: 1.5 + time: 0 value: 1 inSlope: 0 outSlope: 0 @@ -663,6 +722,15 @@ AnimationClip: weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.5 + value: 1.5 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 - serializedVersion: 3 time: 2 value: 0.8 @@ -683,7 +751,7 @@ AnimationClip: serializedVersion: 2 m_Curve: - serializedVersion: 3 - time: 1.5 + time: 0 value: 1 inSlope: 0 outSlope: 0 @@ -691,6 +759,15 @@ AnimationClip: weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.5 + value: 1.5 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 - serializedVersion: 3 time: 2 value: 0.8 @@ -734,7 +811,7 @@ AnimationClip: attribute: m_Color.r path: ScreenFade classID: 114 - script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - curve: serializedVersion: 2 m_Curve: @@ -762,7 +839,7 @@ AnimationClip: attribute: m_Color.g path: ScreenFade classID: 114 - script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - curve: serializedVersion: 2 m_Curve: @@ -790,7 +867,7 @@ AnimationClip: attribute: m_Color.b path: ScreenFade classID: 114 - script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - curve: serializedVersion: 2 m_Curve: @@ -818,7 +895,118 @@ AnimationClip: attribute: m_Color.a path: ScreenFade classID: 114 - script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.5 + value: 1.5 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 2 + value: 0.8 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalScale.x + path: Wave + classID: 224 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.5 + value: 1.5 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 2 + value: 0.8 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalScale.y + path: Wave + classID: 224 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.5 + value: 1.5 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 2 + value: 0.8 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalScale.z + path: Wave + classID: 224 + script: {fileID: 0} m_EulerEditorCurves: [] m_HasGenericRootTransform: 0 m_HasMotionFloatCurves: 0 diff --git a/Assets/Scenes/Wave_Mode.unity b/Assets/Scenes/Wave_Mode.unity index abd0baa8c8f5b8071daf9a5811bd6cf8b7a9b2fd..6e0392af549a67c3fa5afc73fae75279414343f1 100644 --- a/Assets/Scenes/Wave_Mode.unity +++ b/Assets/Scenes/Wave_Mode.unity @@ -7387,6 +7387,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: be0237d7b3ea5064f9b490936cca41f5, type: 3} m_Name: m_EditorClassIdentifier: + bossPool: + - {fileID: 1206665596, guid: f264ab47e25d0374ba89abced0b94b2a, type: 3} + - {fileID: 2022850303, guid: 73871ddf5c8d02442be00d9671a9d510, type: 3} waves: - name: Wave 1 enemyPool: @@ -7431,7 +7434,7 @@ MonoBehaviour: - {fileID: 9083842937541373870, guid: 6bbf9ef8fcce5114482d813a9b680d17, type: 3} - {fileID: 304385461253102273, guid: c88f58001921a7a4a9a51563d60192e6, type: 3} - {fileID: 6813828724793316333, guid: c0c22a60c7b049f41b6bed6dd108a447, type: 3} - timeBetweenWaves: 5 + timeBetweenWaves: 1 --- !u!4 &2093855849 Transform: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/WaveMode/WaveSpawner.cs b/Assets/Scripts/WaveMode/WaveSpawner.cs index 6f00a6ad572c7843933f290edadacd6fe329eadf..e542da49674d5bf50d0c23f1418381711495428c 100644 --- a/Assets/Scripts/WaveMode/WaveSpawner.cs +++ b/Assets/Scripts/WaveMode/WaveSpawner.cs @@ -15,6 +15,9 @@ public class WaveSpawner : MonoBehaviour public float rate; } + // array of boss + public Transform[] bossPool; + // array of waves public Wave[] waves; @@ -26,7 +29,6 @@ public class WaveSpawner : MonoBehaviour public float timeBetweenWaves = 5f; private float waveCountdown; - private float searchCountdown = 1f; private SpawnState state = SpawnState.COUNTING; @@ -39,6 +41,8 @@ public class WaveSpawner : MonoBehaviour } waveCountdown = timeBetweenWaves; + + // initialize Waves[] } private void Update() @@ -75,12 +79,19 @@ public class WaveSpawner : MonoBehaviour { Debug.Log("Wave Completed!"); + // kalo wave yang barusan completed merupakan kelipatan 3 + if (nextWave % 3 == 0) + { + WeaponUpgradeOption(); + } + state = SpawnState.COUNTING; waveCountdown = timeBetweenWaves; if (nextWave + 1 > waves.Length - 1) { - //nextWave = -1; // biar pas di-increment jadi 0 + // nextWave = -1; // biar pas di-increment jadi 0 + // stuck di wave 6, belom ada tamat Debug.Log("All Waves Completed! Looping..."); return; } @@ -113,7 +124,7 @@ public class WaveSpawner : MonoBehaviour // increment wave UI WaveManager.wave++; - // menangani enemy pool kosong + // nemy pool kosong if (_wave.enemyPool.Length == 0) { Debug.LogError("Enemy pool is empty!"); @@ -131,7 +142,8 @@ public class WaveSpawner : MonoBehaviour { Debug.Log("SPAWN BOSS WAVE " + (nextWave + 1)); // TODO Spawn boss - SpawnEnemy(_wave.enemyPool[0]); + //SpawnEnemy(_wave.enemyPool[0]); + SpawnBoss(bossPool, nextWave); } // balik set jadi waiting @@ -154,4 +166,26 @@ public class WaveSpawner : MonoBehaviour { return _wave.enemyPool[Random.Range(0, _wave.enemyPool.Length)]; } + + void SpawnBoss (Transform[] _bossPool, int wave) + { + int idx = ((wave + 1) / 3) - 1; + + Transform _boss = _bossPool[idx]; + + Debug.Log("Spawning Boss: " + _boss.name); + + // spawn point nya random + // atau tentuin point khusus boss? + Transform _sp = spawnPoints[Random.Range(0, spawnPoints.Length)]; + + // spawn boss sesuai dengan wave ke berapa + Instantiate(_boss, _sp.position, _sp.rotation); + } + + void WeaponUpgradeOption() + { + Debug.Log("Tampilin screen upgrade weapon disini"); + + } }