示例#1
0
 public override void OnStart(GameObject obj, SNPCComponent ai)
 {
     index = 0;
     if (obj.TryGetComponent <AutopilotComponent>(out var ap))
     {
         ap.GotoVec(Eval(0), Cruise != AiGotoKind.GotoNoCruise, MaxThrottle);
     }
 }
示例#2
0
 public override void Update(GameObject obj, SNPCComponent ai, double time)
 {
     if (obj.TryGetComponent <WeaponControlComponent>(out var weapons))
     {
         weapons.AimPoint = Vector3.Transform(Vector3.Zero, target.WorldTransform);
         weapons.FireAll();
     }
 }
示例#3
0
 public override void Update(GameObject obj, SNPCComponent ai, double time)
 {
     t += time;
     if (t >= Duration)
     {
         ai.SetState(Next);
     }
 }
示例#4
0
 public override void OnStart(GameObject obj, SNPCComponent ai)
 {
     if (obj.TryGetComponent <AutopilotComponent>(out var ap) &&
         target.TryGetComponent <SDockableComponent>(out var dock))
     {
         dock.StartDock(obj, 0);
         ap.StartDock(target);
     }
 }
示例#5
0
 public override void OnStart(GameObject obj, SNPCComponent ai)
 {
     if (obj.TryGetComponent <AutopilotComponent>(out var ap))
     {
         ap.GotoVec(Target, Cruise != AiGotoKind.GotoNoCruise, MaxThrottle, Range);
         if (Cruise == AiGotoKind.GotoCruise)
         {
             obj.GetComponent <ShipPhysicsComponent>().BeginCruise();
         }
     }
 }
示例#6
0
 public override void Update(GameObject obj, SNPCComponent ai, double time)
 {
     if (obj.TryGetComponent <AutopilotComponent>(out var ap))
     {
         if (ap.CurrentBehaviour == AutopilotBehaviours.None)
         {
             ;
         }
         ai.SetState(Next);
     }
     else
     {
         ai.SetState(Next);
     }
 }
示例#7
0
 public override void Update(GameObject obj, SNPCComponent ai, double dt)
 {
     if (obj.TryGetComponent <AutopilotComponent>(out var ap))
     {
         if (ap.CurrentBehaviour == AutopilotBehaviours.None)
         {
             if (index + 1 < 4)
             {
                 index++;
                 //ap.GotoVec(Points[index], Cruise, MaxThrottle, Range);
                 ap.GotoVec(Eval(times[index]), Cruise != AiGotoKind.GotoNoCruise, MaxThrottle);
             }
             else
             {
                 ai.SetState(Next);
             }
         }
     }
     else
     {
         ai.SetState(Next);
     }
 }
示例#8
0
 public override void Update(GameObject obj, SNPCComponent ai, double time)
 {
 }
示例#9
0
 public abstract void Update(GameObject obj, SNPCComponent ai, double dt);
示例#10
0
 public abstract void OnStart(GameObject obj, SNPCComponent ai);
示例#11
0
 public override void OnStart(GameObject obj, SNPCComponent ai)
 {
 }