public GameObject create_unit()
        {
            GameObject     unit = create_object(unit_prefab);
            Unit_simulator sim  = unit.AddComponent <Unit_simulator>();

            units.Add(next_unit_id, sim);
            next_unit_id++;

            return(unit);
        }
Пример #2
0
        /// <summary>
        /// Creates a unit in the game for the given team at given position
        /// </summary>
        /// <param name="team"></param>
        /// <param name="position"></param>
        /// <returns>Whether allowed to create the unit</returns>
        public bool create_unit(Team team, Vector3 position)
        {
            //TODO: Add logic for authentication when necessary
            GameObject     obj = w_simulator.create_unit();
            Unit_simulator us  = obj.GetComponent <Unit_simulator>();

            us.init(position, team);

            return(true);
        }