Пример #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>();
 }
Пример #2
0
 public AIState(string name, AIPilot pilot)
 {
     this.name = name;
     this.pilot = pilot;
     this.entity = pilot.entity;
     this.transform = entity.transform;
     this.sensorSystem = entity.sensorSystem;
     this.engineSystem = entity.engineSystem;
     this.weaponSystem = entity.weaponSystem;
     this.commSystem = entity.commSystem;
     this.navSystem = entity.navSystem;
 }
Пример #3
0
 public AISubstate(AIState parentState)
 {
     this.parentState = parentState;
     this.pilot = parentState.pilot;
     this.entity = parentState.pilot.entity;
     this.transform = entity.transform;
     this.sensorSystem = entity.sensorSystem;
     this.engineSystem = entity.engineSystem;
     this.weaponSystem = entity.weaponSystem;
     this.commSystem = entity.commSystem;
     this.navSystem = entity.navSystem;
 }
Пример #4
0
 public void Awake()
 {
     if (radius <= 0) radius = 10f; //todo do this better, use collider bounds
     weaponSystem = GetComponentInChildren<WeaponSystem>();
     engineSystem = GetComponentInChildren<EngineSystem>();
 }
Пример #5
0
 public void FillEnergy(float i_AmonutOfEnergy, string i_EnergyType)
 {
     EngineSystem.FillEnergy(i_AmonutOfEnergy, i_EnergyType);
     m_PercentOfEnergy = (100 * EngineSystem.CurrentEnergyStatus) / EngineSystem.MaxEnergyCapacity;
 }
Пример #6
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();
 }
Пример #7
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();
    }