using UnityEngine; namespace ETModel { public static class UnitFactory { public static Unit Create(Entity domain, long id) { ResourcesComponent resourcesComponent = Game.Scene.GetComponent(); GameObject bundleGameObject = (GameObject)resourcesComponent.GetAsset("Unit.unity3d", "Unit"); GameObject prefab = bundleGameObject.Get("Skeleton"); UnitComponent unitComponent = Game.Scene.GetComponent(); GameObject go = UnityEngine.Object.Instantiate(prefab); Unit unit = EntityFactory.CreateWithId(domain, id, go); unit.AddComponent(); unit.AddComponent(); unit.AddComponent(); unit.AddComponent(); unitComponent.Add(unit); return unit; } } }