protected override JobHandle OnUpdate(JobHandle inputDependencies) { timeout -= Time.deltaTime; if (timeout < 0) { if (!settings) { CreateTexts(); } timeout += settings.tickTime; var job = new AsteroidSystemJob() { changes = changes.ToConcurrent(), launches = launches.ToConcurrent(), minShip = settings.minShipStock, shipCost = settings.shipCost }; int2 todo; while (changes.TryDequeue(out todo)) { texts[todo.x].text = cache[todo.y + 1]; } int l; while (launches.TryDequeue(out l)) { SpawnShip(l); } return(job.Schedule(this, inputDependencies)); } else { return(inputDependencies); } }
protected override JobHandle OnUpdate(JobHandle inputDependencies) { var job = new AsteroidSystemJob(); job.time = UnityEngine.Time.deltaTime; return(job.Schedule(this, inputDependencies)); }