Navigation and AI merge for level 3 #445
|
@ -18,7 +18,7 @@ namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework
|
|||
|
||||
if (transform)
|
||||
{
|
||||
transform.GlobalPosition = aiTransform.GlobalPosition;
|
||||
transform.GlobalPosition = aiTransform.GlobalPosition + aiTransform.Forward * 2.2f; ;
|
||||
transform.GlobalEulerAngles = aiTransform.GlobalEulerAngles;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,12 +14,14 @@ namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework.States
|
|||
|
||||
float windupTime = 8.0f / 30.0f;
|
||||
float holdTime = 0.3f;
|
||||
float seqTime = 8.0f / 30.0f + 0.5f;
|
||||
float seqTime = 8.0f / 30.0f;
|
||||
float endTime = 0.5f;
|
||||
|
||||
|
||||
bool windUp = false;
|
||||
bool hold = false;
|
||||
bool seq = false;
|
||||
bool end = false;
|
||||
|
||||
public AttackState(StateMachine machine): base(machine)
|
||||
{
|
||||
|
@ -34,6 +36,7 @@ namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework.States
|
|||
windUp = true;
|
||||
hold = false;
|
||||
seq = false;
|
||||
end = false;
|
||||
timer = windupTime;
|
||||
|
||||
RotateToVelocity rotate = machine.GetScript<RotateToVelocity>();
|
||||
|
@ -106,9 +109,20 @@ namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework.States
|
|||
if(timer <= 0.0f)
|
||||
{
|
||||
seq = false;
|
||||
end = true;
|
||||
animator.PlayOneShot(ai.atkSeqAnim);
|
||||
timer = endTime;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
else if(end)
|
||||
{
|
||||
if(timer <= 0.0f)
|
||||
{
|
||||
end = false;
|
||||
AILineOfSight los = ai.GetScript<AILineOfSight>();
|
||||
if(los && los.withinSight)
|
||||
if (los && los.withinSight)
|
||||
{
|
||||
machine.SetState(typeof(ChaseState));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue