Skip to content

Commit

Permalink
Meu
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre-Messias committed Oct 4, 2024
1 parent 8e0ae3f commit 89fd0ee
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 120 deletions.
2 changes: 1 addition & 1 deletion Assets/Items/Sword.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ MonoBehaviour:
m_EditorClassIdentifier:
damage: 1
range: 1
attackCooldown: 1
attackCooldown: 0.4
1 change: 1 addition & 0 deletions Assets/Prefabs/Arrow 1.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,4 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
gravity: 0
damage: 40
2 changes: 1 addition & 1 deletion Assets/Prefabs/Key.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ MeshCollider:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_IsTrigger: 1
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 5
Expand Down
110 changes: 1 addition & 109 deletions Assets/Prefabs/Player.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 789050426170080411}
- {fileID: 6120108858367297094}
- {fileID: 4606442901204940964}
- {fileID: 2550346019587320212}
Expand Down Expand Up @@ -66,113 +65,6 @@ Transform:
m_Children: []
m_Father: {fileID: 1142203119912126955}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2356987898014946539
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 789050426170080411}
- component: {fileID: 1487390817645227106}
- component: {fileID: 9196647876338871759}
- component: {fileID: 4009654061755094346}
m_Layer: 0
m_Name: Capsule
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &789050426170080411
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2356987898014946539}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 3132287012912503951}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &1487390817645227106
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2356987898014946539}
m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &9196647876338871759
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2356987898014946539}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 545c0e0afc6dffe4989af815ed500723, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!136 &4009654061755094346
CapsuleCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2356987898014946539}
m_Material: {fileID: 13400000, guid: 10d8435f85a6df545b301cc1fd0216a6, type: 2}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.5
m_Height: 2
m_Direction: 1
m_Center: {x: 0, y: 0, z: 0}
--- !u!1 &3816423300936239161
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -279,7 +171,7 @@ MonoBehaviour:
playerInput: {fileID: 7551316284096253634}
rb: {fileID: 9187463006278666535}
orientation: {fileID: 0}
body: {fileID: 789050426170080411}
body: {fileID: 2550346019587320212}
foot: {fileID: 4606442901204940964}
firstPerson: {fileID: 0}
groundMoveSpeed: 12
Expand Down
Binary file modified Assets/Scenes/Test Scene 2 Alecx Boogalooo/NavMesh-Plane.asset
Binary file not shown.
2 changes: 1 addition & 1 deletion Assets/Scripts/AI/MagicBall.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private void OnCollisionEnter(Collision other)

if (other.gameObject.CompareTag("Player"))
{
Debug.Log("Acertou o jogador");
//Debug.Log("Acertou o jogador");
other.gameObject.GetComponent<HPController>().LoseHP(damage);
//other.gameObject.GetComponent<Transform>().parent.GetComponentInParent<HPController>().LoseHP(damage);
}
Expand Down
2 changes: 1 addition & 1 deletion Assets/Scripts/Player/HPController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void Update()

public void LoseHP(int Damage)
{
Debug.Log($"{name} perdeu vida");
//Debug.Log($"{name} perdeu vida");
CurrentHP -= Damage;

if (CurrentHP <= 0) // Condicao de derrota
Expand Down
16 changes: 9 additions & 7 deletions Assets/Scripts/Player/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class Player : MonoBehaviour
[SerializeField] private PlayerAttack playerAttack;
[SerializeField] private PlayerMovement playerMovement;
[SerializeField] private HPController playerHealth;
[SerializeField] private PlayerSoundEffects playerSoundEffects;

[Header("Weapon")]
[SerializeField] private ScriptableItem basicWeapon;
Expand All @@ -20,14 +21,15 @@ private void Start()
{
if(playerAttack == null)
Generics.FamilyTryGetComponent(gameObject, out playerAttack);
playerAttack.ResetAttack();

if (playerMovement == null)
Generics.FamilyTryGetComponent(gameObject, out playerMovement);

if (playerHealth == null)
Generics.FamilyTryGetComponent(gameObject, out playerHealth);
playerHealth.ResetHP();

if(playerSoundEffects == null)
Generics.FamilyTryGetComponent(gameObject, out playerSoundEffects);
}

public void ResetPlayer() => ResetPlayer(transform.position);
Expand All @@ -50,14 +52,15 @@ private void OnCollisionEnter(Collision collision)
foreach (Key key in keys)
{
if (door.IsDoorKey(key))
{
GameObject.FindWithTag("Player").GetComponent<PlayerSoundEffects>().PlayDoorSound();
{
playerSoundEffects.PlayDoorSound();
keys.Remove(key);
key.UseKey();


// Inicia a coroutine para esperar 1 segundo antes de ir para o próximo nível
// Inicia a coroutine para esperar 1 segundo antes de ir para o pr�ximo n�vel
StartCoroutine(WaitAndGoToNextLevel(door));
break;
}
}
}
Expand All @@ -77,8 +80,7 @@ private void OnTriggerEnter(Collider other)
key.GetKey();
key.ShowUIKey();
keys.Add(key);
Debug.Log("Pegou chave");
GameObject.FindWithTag("Player").GetComponent<PlayerSoundEffects>().PlayKeySound();
playerSoundEffects.PlayKeySound();
}
}
}

0 comments on commit 89fd0ee

Please sign in to comment.