From c9372e5620490e5aa07d3cdcf850b3571927cbeb Mon Sep 17 00:00:00 2001 From: Irgiansyah Mondo <13521167@std.stei.itb.ac.id> Date: Fri, 10 May 2024 03:43:54 +0700 Subject: [PATCH] feat: make obs position constant --- Assets/Prefabs/DropLootDamage.prefab | 4 ++-- Assets/Prefabs/DropLootHealth.prefab | 6 ++--- Assets/Prefabs/DropLootSpeed.prefab | 8 +++---- Assets/Prefabs/Enemies/Hellephant.prefab | 2 +- Assets/Prefabs/Enemies/ZomBear.prefab | 4 +++- Assets/Prefabs/Enemies/ZomBunny.prefab | 2 +- Assets/Scenes/Level01.unity | 28 +++++++++++++++--------- Assets/Scripts/Enemy/EnemyHealth.cs | 5 +++-- Assets/Scripts/Enemy/EnemyHealth.cs.meta | 4 +++- Assets/Scripts/Power Orb/DamageUp.cs | 1 - Assets/Scripts/Power Orb/MovementUp.cs | 4 ++-- Assets/Scripts/Power Orb/PowerUp.cs | 2 +- 12 files changed, 41 insertions(+), 29 deletions(-) diff --git a/Assets/Prefabs/DropLootDamage.prefab b/Assets/Prefabs/DropLootDamage.prefab index 4b3b246..991c376 100644 --- a/Assets/Prefabs/DropLootDamage.prefab +++ b/Assets/Prefabs/DropLootDamage.prefab @@ -30,7 +30,7 @@ Transform: m_GameObject: {fileID: 1631747706536756881} serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -0.084, y: 1.285, z: -2.03} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0.5, y: 0.5, z: 0.5} m_ConstrainProportionsScale: 0 m_Children: [] @@ -105,7 +105,7 @@ SphereCollider: m_ProvidesContacts: 0 m_Enabled: 1 serializedVersion: 3 - m_Radius: 4 + m_Radius: 1 m_Center: {x: 0, y: 0, z: 0} --- !u!114 &7799069328573986885 MonoBehaviour: diff --git a/Assets/Prefabs/DropLootHealth.prefab b/Assets/Prefabs/DropLootHealth.prefab index a160af7..79e83d2 100644 --- a/Assets/Prefabs/DropLootHealth.prefab +++ b/Assets/Prefabs/DropLootHealth.prefab @@ -100,8 +100,8 @@ Transform: m_GameObject: {fileID: 3911068780554973824} serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 1.3, y: 1.44, z: 0} - m_LocalScale: {x: 0.3, y: 0.3, z: 0.3} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.5, y: 0.5, z: 0.5} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 2888127330787397467} @@ -175,7 +175,7 @@ SphereCollider: m_ProvidesContacts: 0 m_Enabled: 1 serializedVersion: 3 - m_Radius: 4 + m_Radius: 1 m_Center: {x: 0, y: 0, z: 0} --- !u!114 &6690802349414767826 MonoBehaviour: diff --git a/Assets/Prefabs/DropLootSpeed.prefab b/Assets/Prefabs/DropLootSpeed.prefab index a1cde8b..3334855 100644 --- a/Assets/Prefabs/DropLootSpeed.prefab +++ b/Assets/Prefabs/DropLootSpeed.prefab @@ -15,7 +15,7 @@ GameObject: - component: {fileID: 9011567618586610139} - component: {fileID: 6981913561157702007} m_Layer: 0 - m_Name: Sphere + m_Name: LootSpeed m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -30,7 +30,7 @@ Transform: m_GameObject: {fileID: 363900914505423559} serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 1.3, y: 1.44, z: -2.022} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0.3, y: 0.3, z: 0.3} m_ConstrainProportionsScale: 0 m_Children: [] @@ -105,7 +105,7 @@ SphereCollider: m_ProvidesContacts: 0 m_Enabled: 1 serializedVersion: 3 - m_Radius: 4 + m_Radius: 1 m_Center: {x: 0, y: 0, z: 0} --- !u!114 &9011567618586610139 MonoBehaviour: @@ -159,7 +159,7 @@ Transform: serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 1.37, y: -0.62, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalScale: {x: 2, y: 2, z: 2} m_ConstrainProportionsScale: 1 m_Children: - {fileID: 8795715905463978639} diff --git a/Assets/Prefabs/Enemies/Hellephant.prefab b/Assets/Prefabs/Enemies/Hellephant.prefab index 4765944..3fc1b2a 100644 --- a/Assets/Prefabs/Enemies/Hellephant.prefab +++ b/Assets/Prefabs/Enemies/Hellephant.prefab @@ -10252,7 +10252,7 @@ MonoBehaviour: sinkSpeed: 2.5 scoreValue: 77 deathClip: {fileID: 8300000, guid: 8c615fd0429f34edf85539d70279360d, type: 3} - DropLootPrefab: {fileID: 2230256781738153086, guid: 29bfe8a4b5e442943950ecba6d812dad, type: 3} + DropLootPrefabs: {fileID: 2230256781738153086, guid: 29bfe8a4b5e442943950ecba6d812dad, type: 3} --- !u!114 &11415352 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/Prefabs/Enemies/ZomBear.prefab b/Assets/Prefabs/Enemies/ZomBear.prefab index 69583fa..9a90d9d 100644 --- a/Assets/Prefabs/Enemies/ZomBear.prefab +++ b/Assets/Prefabs/Enemies/ZomBear.prefab @@ -177,7 +177,7 @@ MonoBehaviour: sinkSpeed: 2.5 scoreValue: 11 deathClip: {fileID: 8300000, guid: 62366b8d2c37a49dca550841c741317f, type: 3} - DropLootPrefab: {fileID: 2456408812728333572, guid: 2a0d87a75ce834a47abbb5148568bc96, type: 3} + DropLootPrefabs: {fileID: 2456408812728333572, guid: 2a0d87a75ce834a47abbb5148568bc96, type: 3} --- !u!114 &11400000 MonoBehaviour: m_ObjectHideFlags: 0 @@ -319,6 +319,8 @@ MonoBehaviour: attackRadius: 4 timeBetweenAttacks: 1 attackDamage: 5 + speedMultiplier: 1 + damageMultiplier: 1 --- !u!114 &6607688628792931596 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/Prefabs/Enemies/ZomBunny.prefab b/Assets/Prefabs/Enemies/ZomBunny.prefab index fed6204..09616b2 100644 --- a/Assets/Prefabs/Enemies/ZomBunny.prefab +++ b/Assets/Prefabs/Enemies/ZomBunny.prefab @@ -276,7 +276,7 @@ MonoBehaviour: sinkSpeed: 2.5 scoreValue: 7 deathClip: {fileID: 8300000, guid: 1d3bfb9269f136947bf8ac164cace1ff, type: 3} - DropLootPrefab: {fileID: 8571611032601786641, guid: b811b54c1e8b7a940b8eba567ad9df64, type: 3} + DropLootPrefabs: {fileID: 8571611032601786641, guid: b811b54c1e8b7a940b8eba567ad9df64, type: 3} --- !u!114 &11400000 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/Scenes/Level01.unity b/Assets/Scenes/Level01.unity index 289458d..398eb27 100644 --- a/Assets/Scenes/Level01.unity +++ b/Assets/Scenes/Level01.unity @@ -17217,15 +17217,15 @@ PrefabInstance: m_Modifications: - target: {fileID: 433098062486980927, guid: 2a0d87a75ce834a47abbb5148568bc96, type: 3} propertyPath: m_LocalPosition.x - value: 1.37 + value: 2.21 objectReference: {fileID: 0} - target: {fileID: 433098062486980927, guid: 2a0d87a75ce834a47abbb5148568bc96, type: 3} propertyPath: m_LocalPosition.y - value: -0.62 + value: 0.54 objectReference: {fileID: 0} - target: {fileID: 433098062486980927, guid: 2a0d87a75ce834a47abbb5148568bc96, type: 3} propertyPath: m_LocalPosition.z - value: 0 + value: -1.07 objectReference: {fileID: 0} - target: {fileID: 433098062486980927, guid: 2a0d87a75ce834a47abbb5148568bc96, type: 3} propertyPath: m_LocalRotation.w @@ -17255,6 +17255,10 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 2099190356446398194, guid: 2a0d87a75ce834a47abbb5148568bc96, type: 3} + propertyPath: m_Radius + value: 1 + objectReference: {fileID: 0} - target: {fileID: 2456408812728333572, guid: 2a0d87a75ce834a47abbb5148568bc96, type: 3} propertyPath: m_Name value: DropLootDamage @@ -17286,7 +17290,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 2888127330787397467, guid: 29bfe8a4b5e442943950ecba6d812dad, type: 3} propertyPath: m_LocalPosition.y - value: -0.62 + value: 0.652 objectReference: {fileID: 0} - target: {fileID: 2888127330787397467, guid: 29bfe8a4b5e442943950ecba6d812dad, type: 3} propertyPath: m_LocalPosition.z @@ -17324,6 +17328,10 @@ PrefabInstance: propertyPath: Target value: objectReference: {fileID: 1652526558} + - target: {fileID: 8242039966244924009, guid: 29bfe8a4b5e442943950ecba6d812dad, type: 3} + propertyPath: m_Radius + value: 1 + objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] @@ -17337,17 +17345,13 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 0} m_Modifications: - - target: {fileID: 363900914505423559, guid: b811b54c1e8b7a940b8eba567ad9df64, type: 3} - propertyPath: m_Name - value: LootSpeed - objectReference: {fileID: 0} - target: {fileID: 1905947952399408790, guid: b811b54c1e8b7a940b8eba567ad9df64, type: 3} propertyPath: m_LocalPosition.x - value: 1.37 + value: 3.34 objectReference: {fileID: 0} - target: {fileID: 1905947952399408790, guid: b811b54c1e8b7a940b8eba567ad9df64, type: 3} propertyPath: m_LocalPosition.y - value: -0.62 + value: 0.58 objectReference: {fileID: 0} - target: {fileID: 1905947952399408790, guid: b811b54c1e8b7a940b8eba567ad9df64, type: 3} propertyPath: m_LocalPosition.z @@ -17381,6 +17385,10 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 4432166420362754038, guid: b811b54c1e8b7a940b8eba567ad9df64, type: 3} + propertyPath: m_Radius + value: 1 + objectReference: {fileID: 0} - target: {fileID: 5931696256801419771, guid: b811b54c1e8b7a940b8eba567ad9df64, type: 3} propertyPath: Target value: diff --git a/Assets/Scripts/Enemy/EnemyHealth.cs b/Assets/Scripts/Enemy/EnemyHealth.cs index 54505f2..2ce1031 100644 --- a/Assets/Scripts/Enemy/EnemyHealth.cs +++ b/Assets/Scripts/Enemy/EnemyHealth.cs @@ -9,7 +9,8 @@ namespace Nightmare public int scoreValue = 10; public AudioClip deathClip; - public GameObject DropLootPrefab; + public GameObject DropLootPrefabs; + int currentHealth; Animator anim; @@ -107,7 +108,7 @@ namespace Nightmare QuestManager.AddEnemy(this.gameObject); //aktifin efek drop looting - Instantiate(DropLootPrefab, transform.position + new Vector3(0, Random.Range(0, 2)), Quaternion.identity); + Instantiate(DropLootPrefabs, transform.position + new Vector3(0,1), Quaternion.identity); } public void StartSinking () diff --git a/Assets/Scripts/Enemy/EnemyHealth.cs.meta b/Assets/Scripts/Enemy/EnemyHealth.cs.meta index aef13e0..2f57f02 100644 --- a/Assets/Scripts/Enemy/EnemyHealth.cs.meta +++ b/Assets/Scripts/Enemy/EnemyHealth.cs.meta @@ -5,7 +5,9 @@ MonoImporter: serializedVersion: 2 defaultReferences: - deathClip: {instanceID: 0} - - DropLootPrefab: {fileID: 2103577913801387051, guid: 47385d9b4519f5947a0e0284c6a91feb, type: 3} + - DropLootHealth: {fileID: 2230256781738153086, guid: 29bfe8a4b5e442943950ecba6d812dad, type: 3} + - DropLootDamage: {fileID: 2456408812728333572, guid: 2a0d87a75ce834a47abbb5148568bc96, type: 3} + - DropLootSpeed: {fileID: 8571611032601786641, guid: b811b54c1e8b7a940b8eba567ad9df64, type: 3} executionOrder: 0 icon: {instanceID: 0} userData: diff --git a/Assets/Scripts/Power Orb/DamageUp.cs b/Assets/Scripts/Power Orb/DamageUp.cs index efe5705..5bb5da0 100644 --- a/Assets/Scripts/Power Orb/DamageUp.cs +++ b/Assets/Scripts/Power Orb/DamageUp.cs @@ -17,7 +17,6 @@ namespace Nightmare { //Debug.Log("Anda memasuki area"); Pickup(other); - Destroy(transform.parent.gameObject); Debug.Log("Damage shot anda :" + PlayerShooting.damagePerShot); diff --git a/Assets/Scripts/Power Orb/MovementUp.cs b/Assets/Scripts/Power Orb/MovementUp.cs index 0db9f09..2c0ccfb 100644 --- a/Assets/Scripts/Power Orb/MovementUp.cs +++ b/Assets/Scripts/Power Orb/MovementUp.cs @@ -34,8 +34,8 @@ public class MovementUp : MonoBehaviour remainingTime = 15f; isPowerUpActive = true; - // Destroy the pickup object and its effect after a delay - Destroy(gameObject); + //Destroy the pickup object and its effect after a delay + //Destroy(gameObject); //Destroy(effectInstance, 2f); // Log and update timer text diff --git a/Assets/Scripts/Power Orb/PowerUp.cs b/Assets/Scripts/Power Orb/PowerUp.cs index 9d6db01..4ad3897 100644 --- a/Assets/Scripts/Power Orb/PowerUp.cs +++ b/Assets/Scripts/Power Orb/PowerUp.cs @@ -40,7 +40,7 @@ public class PowerUp : MonoBehaviour health.healthSlider.value = health.currentHealth; } - Destroy(gameObject); + //Destroy(gameObject); //Destroy(effectInstance, 2f); } -- GitLab