public BehaviourTrajectoryToTarget(GameElement parent, Trajectory trajectory, GameObject target, float speed) : base(parent) { trajectory_mover = new BehaviourMoverTrajectory(parent, trajectory, speed, false); target_mover = new BehaviourMoverTarget(parent, target, speed, false); CurrentBehaviour = trajectory_mover; }
public override void GameElementFixedUpdate() { CurrentBehaviour.GameElementFixedUpdate(); if (CurrentBehaviour.ReachedDestination) { CurrentBehaviour = target_mover; } }