// Use this for initialization
 void Start()
 {
     myAI = this.GetComponentInChildren<AIRig>();
     if(myAI==null)
         Debug.Log("You need to add an AI Component!",this.gameObject);
     myFormationHarnessElement = myAI.AI.GetCustomElement<FormationHarnessElement>();
     if(displayText!=null)
         displayText.text=
             "FORMATION TYPE:\n"+
             wedge+" - Wedge Formation\n"+
             column+" - Column Formation\n"+
             skirmishLeft+" - Skirmish Left Formation\n"+
             skirmishRight+" - Skirmish Right Formation\n"+
             echelonLeft+" - Echelon Left Formation\n"+
             echelonRight+" - Echelon Right Formation\n"+
             "\n"+
             "SQUAD COMMANDS\n"+
             formUp+" - Squad Form Up\n"+
             attack+" - Squad Attack\n"+
             coverMe+" - Squad Cover Me\n"+
             takeCover+" - Squad Take Cover\n"+
             flank+" - Squad Flank\n";
 }
示例#2
0
    /// <summary>
    /// On Start, grab the game manager and AimAndFireElement
    /// </summary>
    public override void Start()
    {
        base.Start();

        // Grab the game manager from the scene
        _gameManager = UnityEngine.Object.FindObjectOfType<GameManager>();

        // Set our accuracy to 0 (0 error that is) and our muzzle tip to our camera so we fire straight
        _aimElement = AI.GetCustomElement<AimAndFireElement>();
        _aimElement.Accuracy = 0;

        _formationHarnessElement = AI.GetCustomElement<FormationHarnessElement>();
    }