mirror of
https://github.com/FriendshipIsEpic/FiE-Game.git
synced 2024-11-23 22:27:58 +01:00
43 lines
1.1 KiB
C#
43 lines
1.1 KiB
C#
using Fie.Enemies.HoovesRaces.Flightling;
|
|
using Fie.Object;
|
|
using UnityEngine;
|
|
|
|
namespace Fie.AI
|
|
{
|
|
public class FieAITaskFlightlingFlyMove : FieAITaskBase
|
|
{
|
|
private enum FlightState
|
|
{
|
|
PREPARE,
|
|
SET_ARTITUDE,
|
|
DO
|
|
}
|
|
|
|
public override bool Task(FieAITaskController manager)
|
|
{
|
|
if (!(manager.ownerCharacter != null))
|
|
{
|
|
return true;
|
|
}
|
|
if (manager.ownerCharacter.groundState == FieObjectGroundState.Grounding)
|
|
{
|
|
return true;
|
|
}
|
|
if (manager.ownerCharacter.detector.lockonTargetObject == null)
|
|
{
|
|
return true;
|
|
}
|
|
float num = Vector3.Distance(manager.ownerCharacter.transform.position, manager.ownerCharacter.detector.lockonTargetObject.transform.position);
|
|
if (!(num >= 4f))
|
|
{
|
|
nextStateWeightList[typeof(FieAITaskFlightlingFly)] = 100;
|
|
return true;
|
|
}
|
|
Vector3 vector = manager.ownerCharacter.detector.lockonTargetObject.transform.position - manager.ownerCharacter.transform.position;
|
|
vector.y = vector.z;
|
|
vector.z = 0f;
|
|
manager.ownerCharacter.RequestToChangeState<FieStateMachineFlightlingFlyMove>(vector.normalized, 1f, FieGameCharacter.StateMachineType.Base);
|
|
return false;
|
|
}
|
|
}
|
|
}
|