protected override JobHandle OnUpdate(JobHandle inputDeps)
    {
        ComponentTypeHandle <Velocity>     velocityType     = GetComponentTypeHandle <Velocity>();
        ComponentTypeHandle <Acceleration> accelerationType = GetComponentTypeHandle <Acceleration>();

        VelocityUpdateJob job = new VelocityUpdateJob
        {
            VelocityType     = velocityType,
            AccelerationType = accelerationType,
            dt = Time.DeltaTime
        };

        return(job.Schedule(m_Group, inputDeps));
    }
Beispiel #2
0
    /// <summary>
    /// フレーム更新
    /// </summary>
    private void Update()
    {
        _velocityUpdateJob = new VelocityUpdateJob {
            velocity  = _velocityArray,
            deltaTime = Time.deltaTime,
            minPos    = _minPos,
            maxPos    = _maxPos,
        };

        _positionUpdateJob = new PositionUpdateJob {
            velocity  = _velocityArray,
            deltaTime = Time.deltaTime,
        };

        _velocityUpdateJobHandle = _velocityUpdateJob.Schedule(_transformsAccessArray);
        _positionUpdateJobHandle = _positionUpdateJob.Schedule(_transformsAccessArray, _velocityUpdateJobHandle);
    }