Ejemplo n.º 1
0
        // Start is called before the first frame update
        void Start()
        {
            NativeArray <float> result = new NativeArray <float>(1, Allocator.TempJob);

            SomeJob jobData = new SomeJob {
                a = 5, b = 3, result = result
            };

            JobHandle handle = jobData.Schedule();

            handle.Complete();

            float resultOfJob = result[0];

            Debug.Log(resultOfJob);

            result.Dispose();
        }
Ejemplo n.º 2
0
    private JobHandle SomeTaskJob()
    {
        var job = new SomeJob();

        return(job.Schedule());
    }