コード例 #1
0
    void UpdateVertexBuffer()
    {
        var job = new VertexUpdateJob {
            seed           = _randomSeed,
            extent         = _extent,
            noiseFrequency = _noiseFrequency,
            noiseOffset    = _noiseAnimation * Time.time,
            noiseAmplitude = _noiseAmplitude,
            buffer         = _vertexBuffer
        };

        job.Schedule((int)_triangleCount, 64).Complete();
    }
コード例 #2
0
    NativeArray <Vertex> CreateVertexArray()
    {
        var vertexArray = new NativeArray <Vertex>(
            _resolution.x * _resolution.y,
            Allocator.TempJob, NativeArrayOptions.UninitializedMemory
            );

        var job = new VertexUpdateJob {
            rotation    = Time.time * 0.3f,
            resolution  = _resolution,
            radius      = _radius,
            depth       = _depth,
            noiseRepeat = _noiseRepeat,
            noiseAmp    = _noiseAmplitude,
            noiseRot    = Time.time * _noiseAnimation,
            buffer      = vertexArray
        };

        job.Schedule(vertexArray.Length, 64).Complete();

        return(vertexArray);
    }