public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem) { var spawnerData = new UnitSpawning { Prefab = conversionSystem.GetPrimaryEntity(Prefab) }; dstManager.AddComponentData(entity, spawnerData); }
// one time at object init void Start() { this.transform.parent = transform; Transform player = this.transform.parent.parent; UnitSpawning spawnScript = player.GetComponentInChildren <UnitSpawning>(); index = spawnScript.troops.IndexOf(transform); targetGrid = spawnScript.troopPoints; target = targetGrid[index].transform; }