public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
    {
        var spawnerData = new UnitSpawning
        {
            Prefab = conversionSystem.GetPrimaryEntity(Prefab)
        };

        dstManager.AddComponentData(entity, spawnerData);
    }
Beispiel #2
0
    // 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;
    }