From 1843445cf7d34c6bd113b699a0a38d533d5f3161 Mon Sep 17 00:00:00 2001 From: Jesica <13519011@std.stei.itb.ac.id> Date: Sun, 10 Apr 2022 12:57:59 +0700 Subject: [PATCH] add boss spawn point --- Assets/Prefabs/BossSpawnPoint.prefab | 32 +++++++++++++++++++++++ Assets/Prefabs/BossSpawnPoint.prefab.meta | 7 +++++ Assets/Scenes/Wave_Mode.unity | 2 ++ Assets/Scripts/Player/PlayerMovement.cs | 2 ++ Assets/Scripts/WaveMode/WaveSpawner.cs | 4 +-- 5 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 Assets/Prefabs/BossSpawnPoint.prefab create mode 100644 Assets/Prefabs/BossSpawnPoint.prefab.meta diff --git a/Assets/Prefabs/BossSpawnPoint.prefab b/Assets/Prefabs/BossSpawnPoint.prefab new file mode 100644 index 0000000..57bb9cf --- /dev/null +++ b/Assets/Prefabs/BossSpawnPoint.prefab @@ -0,0 +1,32 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &2848184888090971024 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2848184888090971025} + m_Layer: 0 + m_Name: BossSpawnPoint + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2848184888090971025 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2848184888090971024} + m_LocalRotation: {x: 0, y: 0.9063079, z: 0, w: 0.42261827} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 130, z: 0} diff --git a/Assets/Prefabs/BossSpawnPoint.prefab.meta b/Assets/Prefabs/BossSpawnPoint.prefab.meta new file mode 100644 index 0000000..8e5a5c2 --- /dev/null +++ b/Assets/Prefabs/BossSpawnPoint.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: eaa7741a7b8a86749b58c541f11e9e88 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/Wave_Mode.unity b/Assets/Scenes/Wave_Mode.unity index a760714..d7c1d7d 100644 --- a/Assets/Scenes/Wave_Mode.unity +++ b/Assets/Scenes/Wave_Mode.unity @@ -10324,6 +10324,8 @@ MonoBehaviour: - {fileID: 9083842937541373870, guid: 6bbf9ef8fcce5114482d813a9b680d17, type: 3} - {fileID: 304385461253102273, guid: c88f58001921a7a4a9a51563d60192e6, type: 3} - {fileID: 6813828724793316333, guid: c0c22a60c7b049f41b6bed6dd108a447, type: 3} + bossSpawnPoint: {fileID: 2848184888090971025, guid: eaa7741a7b8a86749b58c541f11e9e88, + type: 3} skeletonSpawnPoints: - {fileID: 8745574277898036913, guid: 77bfae8c18f59cc4c8595c4d1fc6aeae, type: 3} - {fileID: 2031830206958591936, guid: 732806fb505e83241b25495a44933b44, type: 3} diff --git a/Assets/Scripts/Player/PlayerMovement.cs b/Assets/Scripts/Player/PlayerMovement.cs index 774a5e3..f1199bd 100644 --- a/Assets/Scripts/Player/PlayerMovement.cs +++ b/Assets/Scripts/Player/PlayerMovement.cs @@ -70,6 +70,8 @@ public class PlayerMovement : MonoBehaviour //Rotasi player playerRigidbody.MoveRotation(newRotation); } + + playerRigidbody.isKinematic = false; } public void Animating(float h, float v) diff --git a/Assets/Scripts/WaveMode/WaveSpawner.cs b/Assets/Scripts/WaveMode/WaveSpawner.cs index ec2b086..6f9cb92 100644 --- a/Assets/Scripts/WaveMode/WaveSpawner.cs +++ b/Assets/Scripts/WaveMode/WaveSpawner.cs @@ -28,7 +28,7 @@ public class WaveSpawner : MonoBehaviour public Transform[] spawnPoints; // boss spawn point - //public Transform bossSpawnPoint; + public Transform bossSpawnPoint; // skeleton spawn point (tengah?) public Transform[] skeletonSpawnPoints; @@ -206,7 +206,7 @@ public class WaveSpawner : MonoBehaviour // spawn point nya random // atau tentuin point khusus boss? - Transform _sp = spawnPoints[Random.Range(0, spawnPoints.Length)]; + Transform _sp = bossSpawnPoint; // spawn boss sesuai dengan wave ke berapa Instantiate(_boss, _sp.position, _sp.rotation); -- GitLab