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 void SetTarget(GameObject target) { if (target != null) { BehaviourMoverTarget mover = new BehaviourMoverTarget(this, target, speed, true); mover.SetDestroyTimer(destroy_timer); Behaviours.Add(mover); Behaviours.Add(new BehaviourDoDamageTarget(this, target, damage)); Behaviours.Add(new BehaviourRotateToDirection(this)); } }