Пример #1
0
    void IndividualSpawn(SpawnSettings _settings, SquadSpawner _spawner)
    {
        RaycastHit hit;

        if (!JHelper.RaycastMousePosToLayer("Floor", out hit))
        {
            return;
        }

        selected_squad.AddSquaddie(_spawner.CreateSquaddie(_settings.faction, hit.point));
        selected_squad.SelectSquad();
    }
Пример #2
0
    /// <summary>
    /// Creates a new squad with the passed faction settings.
    /// The squaddies are arranged in a circular pattern at the passed position, based on the squad size.
    /// </summary>
    /// <param name="_faction">The faction of the squad.</param>
    /// <param name="_num_squaddies">The size of the squad.</param>
    /// <param name="_pos">The where the squad should be arranged.</param>
    /// <returns>A reference to the instantiated squad.</returns>
    public SquadManager CreateSquad(FactionSettings _faction, int _num_squaddies, Vector3 _pos)
    {
        SquadManager squad_manager = new SquadManager(_faction);

        for (int i = 0; i < _num_squaddies; ++i)
        {
            SquaddieAI squaddie = CreateSquaddie(_faction, _pos);
            squaddie.transform.position = JHelper.PosToCirclePos(_pos, _num_squaddies, i, _num_squaddies * 0.5f);

            squad_manager.AddSquaddie(squaddie);
        }

        return(squad_manager);
    }