예제 #1
0
    /// <summary>
    /// Constructs an individual squaddie with the passed faction settings.
    /// </summary>
    /// <param name="_faction">The faction of the squaddie.</param>
    /// <param name="_pos">The location the squaddie should be placed.</param>
    /// <returns>A reference to the instantiated squaddie.</returns>
    public SquaddieAI CreateSquaddie(FactionSettings _faction, Vector3 _pos)
    {
        GameObject clone    = Instantiate(squaddie_prefab, _pos, Quaternion.identity);
        SquaddieAI squaddie = clone.GetComponent <SquaddieAI>();

        squaddie.Init(_faction);

        return(squaddie);
    }
예제 #2
0
    public void AddSquaddie(SquaddieAI _squaddie_ai)
    {
        if (squad_sense.squaddies.Contains(_squaddie_ai))
        {
            return;
        }

        _squaddie_ai.Init(squad_faction);
        _squaddie_ai.LinkSquadSense(ref squad_sense);

        squad_sense.squaddies.Add(_squaddie_ai);
    }