mirror of
https://github.com/FriendshipIsEpic/FiE-Game.git
synced 2024-11-23 22:27:58 +01:00
26 lines
952 B
C#
26 lines
952 B
C#
using Fie.Ponies;
|
|
using UnityEngine;
|
|
|
|
namespace Fie.AI {
|
|
public class FieAITaskRainbowDashEnemyTracking : FieAITaskBase {
|
|
public override bool Task(FieAITaskController manager) {
|
|
if (manager.ownerCharacter.detector.lockonTargetObject == null) {
|
|
return true;
|
|
}
|
|
|
|
float num = Vector3.Distance(manager.ownerCharacter.transform.position, manager.ownerCharacter.detector.lockonTargetObject.centerTransform.position);
|
|
|
|
if (num <= 2) {
|
|
return true;
|
|
}
|
|
|
|
Vector3 vector = manager.ownerCharacter.detector.lockonTargetObject.centerTransform.position - manager.ownerCharacter.transform.position;
|
|
vector.y = vector.z;
|
|
vector.z = 0f;
|
|
|
|
manager.ownerCharacter.RequestToChangeState<FieStateMachinePoniesGallop>(vector.normalized, 1, FieGameCharacter.StateMachineType.Base);
|
|
|
|
return false;
|
|
}
|
|
}
|
|
}
|