Esempio n. 1
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;
 }
Esempio n. 2
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;
 }
Esempio n. 3
0
 public override void OnAwake()
 {
     pilot = GetComponent<Pilot>();
     sensors = GetComponent<SensorSystem>();
     weapons = GetComponent<WeaponSystem>();
 }
Esempio n. 4
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();
    }