Navigation and AI merge for level 3 #445
|
@ -4,10 +4,11 @@ using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using static PlayerController;
|
||||||
|
|
||||||
namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework
|
namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework
|
||||||
{
|
{
|
||||||
public class HomeOwnerAttackHitbox:Script
|
public class HomeOwnerAttackHitbox : Script
|
||||||
{
|
{
|
||||||
public GameObject aiGO;
|
public GameObject aiGO;
|
||||||
protected override void update()
|
protected override void update()
|
||||||
|
@ -15,9 +16,10 @@ namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework
|
||||||
Transform transform = GetComponent<Transform>();
|
Transform transform = GetComponent<Transform>();
|
||||||
Transform aiTransform = aiGO.GetComponent<Transform>();
|
Transform aiTransform = aiGO.GetComponent<Transform>();
|
||||||
|
|
||||||
if(transform)
|
if (transform)
|
||||||
{
|
{
|
||||||
transform.GlobalPosition = aiTransform.GlobalPosition;
|
transform.GlobalPosition = aiTransform.GlobalPosition;
|
||||||
|
transform.GlobalEulerAngles = aiTransform.GlobalEulerAngles;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,8 +31,12 @@ namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework
|
||||||
HomeOwnerAI ai = aiGO.GetScript<HomeOwnerAI>();
|
HomeOwnerAI ai = aiGO.GetScript<HomeOwnerAI>();
|
||||||
if (pc)
|
if (pc)
|
||||||
{
|
{
|
||||||
|
pc.currentState = RaccoonStates.CAUGHT;
|
||||||
|
if (pc.stateMachine && !pc.stateMachine.IsState(typeof(PlayerCaughtState)))
|
||||||
|
pc.stateMachine.SetState(typeof(PlayerCaughtState));
|
||||||
|
|
||||||
pc.GotCaught();
|
pc.GotCaught();
|
||||||
if(ai)
|
if (ai)
|
||||||
ai.Reset();
|
ai.Reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -510,7 +510,8 @@ public class PlayerController : Script
|
||||||
currentState = RaccoonStates.IDLE;
|
currentState = RaccoonStates.IDLE;
|
||||||
if (stateMachine && !stateMachine.IsState(typeof(PlayerIdleState)))
|
if (stateMachine && !stateMachine.IsState(typeof(PlayerIdleState)))
|
||||||
stateMachine.SetState(typeof(PlayerIdleState));
|
stateMachine.SetState(typeof(PlayerIdleState));
|
||||||
tranform.LocalPosition = respawnPoint.GetComponent<Transform>().LocalPosition;
|
|
||||||
|
tranform.GlobalPosition = respawnPoint.GetComponent<Transform>().GlobalPosition;
|
||||||
|
|
||||||
GameManager.Instance.RacoonCaught();
|
GameManager.Instance.RacoonCaught();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue