/// <summary>
        ///
        /// </summary>
        /// <param name="unitID"></param>
        /// <returns></returns>
        public Entity SpawnUnit(string unitID)
        {
            Assert.IsNotNull(GameManager.Instance, "GameManager is missing. Can't spawn unit");

            Entity spawnedEntity = GameManager.Instance.SpawnEntity(unitID, GetSpawnPoint(), Quaternion.identity, Entity.Team);

            MoveEntityToAnchor(spawnedEntity);

            OnUnitCreated?.Invoke(Entity, spawnedEntity);

            return(spawnedEntity);
        }
Beispiel #2
0
 /// <summary>
 /// Notifies all about new unit created.
 /// </summary>
 /// <param name="unit">The created unit.</param>
 protected void NotifyAllAboutNewUnit(Unit unit) => OnUnitCreated?.Invoke(unit);