private void Update() { var boundsJob = new BoundsJob() { Positions = _positions, Accelerations = _accelerations, AreaSize = _areaSize }; var accelerationJob = new AccelerationJob() { Positions = _positions, Velocities = _velocities, Accelerations = _accelerations, DestinationThreshold = _destinationThreshold, Weights = _accelerationWeights }; var moveJob = new MoveJob() { Positions = _positions, Velocities = _velocities, Accelerations = _accelerations, DeltaTime = Time.deltaTime, VelocityLimit = _velocityLimit }; var boundsHandle = boundsJob.Schedule(_numberOfEntities, 0); var accelerationHandle = accelerationJob.Schedule(_numberOfEntities, 0, boundsHandle); var moveHandle = moveJob.Schedule(_transformAccessArray, accelerationHandle); moveHandle.Complete(); }
void Update() { _objectCount = (int)Mathf.Pow(2, PowerOfTwo); if (cachedObjectCount != _objectCount) { UpdateArrays(); } // Prepare jobs with data m_AccelJob = new AccelerationJob() { deltaTime = Time.deltaTime, velocity = _Velocities, acceleration = m_Acceleration, positions = _Positions, colors = _Colors, Time = Time.time }; m_Job = new PositionUpdateJob() { deltaTime = Time.deltaTime, velocity = _Velocities, position = _Positions }; //Schedule the first job m_AccelJobHandle = m_AccelJob.Schedule(_objectCount, 64); //Schedule the second job, chained to the first m_PositionJobHandle = m_Job.Schedule(_objectCount, 64, m_AccelJobHandle); }
protected override JobHandle OnUpdate(JobHandle inputDeps) { var job = new AccelerationJob() { deltaTime = Time.deltaTime }; return(job.Schedule(this, inputDeps)); }
protected override void OnUpdate() { var job = new AccelerationJob() { DeltaTime = Time.DeltaTime, TranslationType = GetComponentTypeHandle <Translation>(), SpeedType = GetComponentTypeHandle <Speed>(), MovableType = GetComponentTypeHandle <Movable>(), DestinationType = GetComponentTypeHandle <Destination>() }; Dependency = job.Schedule(_query, Dependency); }
public void Update() { m_AccelJob = new AccelerationJob() { deltaTime = Time.deltaTime, velocity = m_Velocities, acceleration = m_Acceleration, accelerationMod = m_AccelerationMod }; m_Job = new PositionUpdateJob() { deltaTime = Time.deltaTime, velocity = m_Velocities, }; m_AccelJobHandle = m_AccelJob.Schedule(m_ObjectCount, 64); m_PositionJobHandle = m_Job.Schedule(m_TransformsAccessArray, m_AccelJobHandle); }
private void Update() { accelerationJob = new AccelerationJob { deltaTime = Time.deltaTime, velocity = velocities, acceleration = acceleration, accelerationMod = accelerationMod }; job = new PositionUpdateJob { deltaTime = Time.deltaTime, velocity = velocities }; accelJobHandle = accelerationJob.Schedule(particleCount, 64); positionJobHandle = job.Schedule(transformAccessArray, accelJobHandle); }
public void Update() { m_AccelJob = new AccelerationJob() { deltaTime = Time.deltaTime, velocity = m_Velocities, acceleration = m_Acceleration, accelerationMod = m_AccelerationMod }; m_Job = new PositionUpdateJob() { deltaTime = Time.deltaTime, position = m_Positions, velocity = m_Velocities, }; m_AccelJobHandle = m_AccelJob.Schedule(m_Positions.Length, 64); m_JobHandle = m_Job.Schedule(m_Positions.Length, 64, m_AccelJobHandle); }
public void Update() { accelJob = new AccelerationJob() { deltaTime = Time.deltaTime, velocity = Velocities, accel = acceleration, accelM = accelerationM }; posJob = new PositionUpdateJob() { deltatime = Time.deltaTime, velocity = Velocities }; AccelJobHandle = accelJob.Schedule(m_ObjectCount, 64); postJobHandle = posJob.Schedule(transformsAccessArray, AccelJobHandle); }