From 97f1d7cb15799de47463fcc6d95f50d3e9a929d5 Mon Sep 17 00:00:00 2001 From: washingtonwagner <104013233+washingtonwagner@users.noreply.github.com> Date: Mon, 12 Feb 2024 16:59:12 -0300 Subject: [PATCH] #2 --- Game/Assets/_Game/Assets/Player.prefab | 13 +++++++++++++ Game/Assets/_Game/_Scripts/Damage/DeathOnDamage.cs | 3 ++- Game/Assets/_Game/_Scripts/Enemies/BasicMovement.cs | 3 ++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Game/Assets/_Game/Assets/Player.prefab b/Game/Assets/_Game/Assets/Player.prefab index 2dd93a7..4546b02 100644 --- a/Game/Assets/_Game/Assets/Player.prefab +++ b/Game/Assets/_Game/Assets/Player.prefab @@ -96,6 +96,7 @@ GameObject: - component: {fileID: 8097234193942473045} - component: {fileID: 8097234193942473042} - component: {fileID: 8097234193942473043} + - component: {fileID: 2998274518755878785} m_Layer: 7 m_Name: Player m_TagString: Player @@ -185,6 +186,18 @@ MonoBehaviour: serializedVersion: 2 m_Bits: 136 jumpHeight: 7 +--- !u!114 &2998274518755878785 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8097234193942473040} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c8cf347defefa0c498c3e199658f94a7, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &8097234194677802117 GameObject: m_ObjectHideFlags: 0 diff --git a/Game/Assets/_Game/_Scripts/Damage/DeathOnDamage.cs b/Game/Assets/_Game/_Scripts/Damage/DeathOnDamage.cs index 28873a0..5097140 100644 --- a/Game/Assets/_Game/_Scripts/Damage/DeathOnDamage.cs +++ b/Game/Assets/_Game/_Scripts/Damage/DeathOnDamage.cs @@ -6,6 +6,7 @@ public class DeathOnDamage : MonoBehaviour, IDamageble { public void TakeDamage(int damage) { - Destroy(gameObject); + Debug.Log(gameObject.name + " foi atingido"); + //Destroy(gameObject); } } diff --git a/Game/Assets/_Game/_Scripts/Enemies/BasicMovement.cs b/Game/Assets/_Game/_Scripts/Enemies/BasicMovement.cs index 0e23118..bd89727 100644 --- a/Game/Assets/_Game/_Scripts/Enemies/BasicMovement.cs +++ b/Game/Assets/_Game/_Scripts/Enemies/BasicMovement.cs @@ -22,7 +22,7 @@ public class BasicMovement : MonoBehaviour [Header("Tests")] private bool isRight = true; - private bool seePlayer = false; + [SerializeField] private bool seePlayer = false; private bool onBord = false; // Start is called before the first frame update @@ -65,6 +65,7 @@ private void FindPlayer() Vector2 playerPosition = coll.transform.position; Vector2 direction = playerPosition - position; RaycastHit2D hit = Physics2D.Raycast(position, direction.normalized); + Debug.Log(hit.transform.name); if (hit.transform != null) { if (hit.transform.CompareTag("Player"))