Example #1
0
 public void Start()
 {
     engines = GetComponent<EngineSystem>();
     weaponSystem = GetComponent<WeaponSystem>();
     flightControls = new FlightControls(yawDamp, pitchDamp, rollDamp);
     engines.SetFlightControls(flightControls);
     flightControls.SetStickInputs(0f, 0f, 0f, startThrottle);
     EventManager.Instance.AddListener<Event_EntityDespawned>(OnEntityDespawned);
     PlayerManager.PlayerEventManager.AddListener<Event_EntityDamaged>(OnDamageTaken);
     cameraEye = GetComponentInChildren<CameraEye>();
 }
Example #2
0
 public void Start()
 {
     entity = GetComponent<Entity>();
     engines = GetComponentInChildren<AIEngineSystem>();
     flightControls = new FlightControls(transform.position);
     engines.SetFlightControls(flightControls);
     rigidbody = GetComponent<Rigidbody>();
     //todo remove this, replace it with orders / tasks
     waypointIndex = -1;
 }
Example #3
0
 public void Awake()
 {
     this.controls = new FlightControls();
 }
Example #4
0
 public AIState_Idle(AIPilot pilot)
     : base("Idle", pilot)
 {
     this.controls = pilot.FlightControls;
 }
Example #5
0
 public virtual void Start()
 {
     entity = GetComponent<Entity>();
     engines = GetComponentInChildren<EngineSystem>();
     weaponSystem = GetComponent<WeaponSystem>();
     flightControls = new FlightControls();
     engines.SetFlightControls(flightControls);
     rigidbody = GetComponent<Rigidbody>();
     EventManager.Instance.AddListener<Event_EntityDespawned>(OnEntityDespawned);
     SelectWeapon();
 }
Example #6
0
    //todo -- probably takes a descriptor to read pilot stats out of
    public void Start()
    {
        this.entity = GetComponent<Entity>();
        this.engines = GetComponentInChildren<EngineSystem>();
        this.controls = engines.FlightControls;
        this.sensorSystem = entity.sensorSystem;
        this.weaponSystem = entity.weaponSystem;
        this.commSystem = entity.commSystem;
        this.navSystem = entity.navSystem;
        Assert.IsNotNull(this.entity, "AIPilot needs an entity " + transform.name);
        Assert.IsNotNull(this.engines, "AIPilot needs an engine system");
        Assert.IsNotNull(this.sensorSystem, "AIPilot needs a sensor system");
        goals = new List<AIGoal>(5);
        AddGoal(new AIGoal_Idle());

        AIGoalDescriptor desc = new AIGoalDescriptor(0.5f);
        AddGoal(new AIGoal_GoTo(desc, new Vector3(0, 0, 42f), 5f));

        aiStates = CreateAIStates(this);

        SetAIState();
    }
Example #7
0
 public void SetFlightControls(FlightControls flightControls)
 {
     this.flightControls = flightControls;
 }