Пример #1
0
        public static GameObject InstantiateEntity(Player entity, int prefabId, LVector3 position)
        {
            var    prefab = ResourceManager.LoadPrefab(prefabId);
            object config = ResourceManager.GetPlayerConfig(prefabId);
            var    obj    = UnityEntityService.CreateEntity(entity, prefabId, position, prefab, config);

            return(obj);
        }
Пример #2
0
        public static BaseEntity InstantiateEntity(int prefabId, LVector3 position)
        {
            var    prefab = ResourceManager.LoadPrefab(prefabId);
            object config = ResourceManager.GetEnemyConfig(prefabId);

            Debug.Trace("createEnemy");
            var entity = new Enemy();
            var obj    = UnityEntityService.CreateEntity(entity, prefabId, position, prefab, config);

            obj.name = obj.name + enemyID++;
            return(entity);
        }