Exemplo n.º 1
0
    /// <summary>
    /// Start finds and stores the AimAndFireElement
    /// </summary>
    /// <param name="ai">The AI executing the action</param>
    public override void Start(AI ai)
    {
        base.Start(ai);

        if (_aimAndFire == null)
            _aimAndFire = ai.GetCustomElement<AimAndFireElement>();
    }
Exemplo 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>();
    }