Пример #1
0
    public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
    {
        var spawnerData = new SpawnerGardenEntity
        {
            prefabEarth       = conversionSystem.GetPrimaryEntity(prefabEarth),
            prefabFollowJuice = conversionSystem.GetPrimaryEntity(prefabFollowJuice),
        };

        dstManager.AddComponentData(entity, spawnerData);
    }
Пример #2
0
    protected override JobHandle OnUpdate(JobHandle inputDependencies)
    {
        if (currentCooldown <= 0)
        {
            currentCooldown = Root.SimulationTick;

            NativeArray <SpawnerGardenEntity> spawnerArray = spawnerQuery.ToComponentDataArray <SpawnerGardenEntity>(Allocator.TempJob);
            spawner = spawnerArray[0];
            spawnerArray.Dispose();

            JobHandle compoundJobHandle = DelayedUpdate(inputDependencies);
            return(compoundJobHandle);
        }
        else
        {
            currentCooldown -= UnityEngine.Time.deltaTime;
            return(inputDependencies);
        }
    }