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