Beispiel #1
0
    // Use this for initialization
    IEnumerator Start()
    {
        t   = transform;
        _bc = this.GetComponentInChildren <BattleCenter> ();

        _planeCache = new List <FighterAI>();

        for (int i = 0; i < 20; i++)
        {
            _planeCache.Add(Create());
        }

        yield return(new WaitForSeconds(.1f));
    }
Beispiel #2
0
 void Start()
 {
     timetolockcount  = Time.time;
     flight           = this.GetComponent <FlightSystem> (); // get Flight System
     flight.AutoPilot = true;                                // set auto pilot to true will make this plane flying and looking to Target automatically
     timestatetemp    = 0;
     if (!CenterOfBattle)
     {
         BattleCenter btcenter = (BattleCenter)GameObject.FindObjectOfType(typeof(BattleCenter));
         if (btcenter != null)
         {
             CenterOfBattle = btcenter.gameObject.GetComponent <BattleCenter>();
         }
     }
 }
Beispiel #3
0
    public void Init(BattleCenter bc, Bigship owner = null)
    {
        _aiController.CenterOfBattle = bc;

        _living = true;

        if (owner != null)
        {
            _owner   = owner;
            _faction = owner._faction;
        }
        else
        {
            _faction = Faction.ALLY;
        }
    }
Beispiel #4
0
    public virtual void Initialize(BattleCenter battleCenter, Bigship _owner)
    {
        targetNavWaypoint = new List <GameObject> ();
        possibleTargets   = new List <Killable> ();
        target            = null;
        targetTransform   = null;
        // for demo only - i've varied the sensitivity and speed so that they react/behave differently
        // in a game situation, where you want to target the other enemies, you'll have to
        // set the speed to the same as the player to make it work, unless you provide the player
        // with controls to change speed.
        actualSensitivity   = Random.Range(actualSensitivity - .2f, actualSensitivity + .2f);
        originalSensitivity = actualSensitivity;

        speed = Random.Range(speed - 5f, speed + 5f);

        targetLight.enabled = false;

        this.battleCenter = battleCenter;

        this._owner = _owner;

        CreateField();
    }