From 89bfbf3100bceb54383fbee5f4e861ad03678da0 Mon Sep 17 00:00:00 2001 From: maverickdgg Date: Sat, 25 Mar 2023 18:18:29 +0800 Subject: [PATCH] WIP --- Assets/Scenes/Level3.shade | 32 +++++++++++++++-- .../AIRework/HomeOwnerAttackHitbox.cs | 35 +++++++++++++------ 2 files changed, 54 insertions(+), 13 deletions(-) diff --git a/Assets/Scenes/Level3.shade b/Assets/Scenes/Level3.shade index b3281ab9..2e39c77a 100644 --- a/Assets/Scenes/Level3.shade +++ b/Assets/Scenes/Level3.shade @@ -15459,7 +15459,7 @@ NumberOfChildren: 0 Components: Transform Component: - Translate: {x: 0, y: 0, z: -2.93461704} + Translate: {x: 0.667429447, y: 0, z: 1.10868871} Rotate: {x: -0, y: 0, z: -0} Scale: {x: 1, y: 1, z: 1} IsActive: true @@ -15487,7 +15487,7 @@ - Is Trigger: false Collision Tag: 5 Type: Box - Half Extents: {x: 0.600000024, y: 1.79999995, z: 0.400000006} + Half Extents: {x: 0.200000003, y: 1.79999995, z: 0.200000003} Friction: 0.400000006 Bounciness: 0 Density: 1 @@ -15548,4 +15548,30 @@ - Type: StateMachine Enabled: true currentStateName: "" - currentAnimName: "" \ No newline at end of file + currentAnimName: "" +- EID: 627 + Name: AttackHitbox + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0, y: -0.10252738, z: -2.20271254} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 1, y: 1, z: 1} + IsActive: true + Collider Component: + Colliders: + - Is Trigger: true + Collision Tag: 5 + Type: Box + Half Extents: {x: 0.800000012, y: 1.79999995, z: 1.5} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 1, z: 0} + Rotation Offset: {x: 0, y: 0, z: 0} + IsActive: true + Scripts: + - Type: SHADE_Scripting.Gameplay.AIBehaviour.AIRework.HomeOwnerAttackHitbox + Enabled: true + aiGO: 66078 \ No newline at end of file diff --git a/Assets/Scripts/Gameplay/AIBehaviour/AIRework/HomeOwnerAttackHitbox.cs b/Assets/Scripts/Gameplay/AIBehaviour/AIRework/HomeOwnerAttackHitbox.cs index 08b3c2a5..db381906 100644 --- a/Assets/Scripts/Gameplay/AIBehaviour/AIRework/HomeOwnerAttackHitbox.cs +++ b/Assets/Scripts/Gameplay/AIBehaviour/AIRework/HomeOwnerAttackHitbox.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using static PlayerController; @@ -11,15 +12,25 @@ namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework public class HomeOwnerAttackHitbox : Script { public GameObject aiGO; + + Transform transform; + Transform aiTransform; + + + protected override void start() + { + transform = GetComponent(); + aiTransform = aiGO.GetComponent(); + } + protected override void update() { - Transform transform = GetComponent(); - Transform aiTransform = aiGO.GetComponent(); - - if (transform) + if (transform && aiTransform) { - transform.GlobalPosition = aiTransform.GlobalPosition + aiTransform.Forward * 2.2f; ; + + transform.GlobalPosition = aiTransform.GlobalPosition + aiTransform.Forward * 0.7f; transform.GlobalEulerAngles = aiTransform.GlobalEulerAngles; + } } @@ -31,13 +42,17 @@ namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework HomeOwnerAI ai = aiGO.GetScript(); if (pc) { - pc.currentState = RaccoonStates.CAUGHT; - if (pc.stateMachine && !pc.stateMachine.IsState(typeof(PlayerCaughtState))) - pc.stateMachine.SetState(typeof(PlayerCaughtState)); + //pc.currentState = RaccoonStates.CAUGHT; + //if (pc.stateMachine && !pc.stateMachine.IsState(typeof(PlayerCaughtState))) + // pc.stateMachine.SetState(typeof(PlayerCaughtState)); - pc.GotCaught(); + //pc.GotCaught(); if (ai) - ai.Reset(); + { + ai.Reset(); + GameObject.SetActive(false); + } + } }