Exemple #1
0
        public override SyncSceneToStreamJob Create(Animator animator, ref T data)
        {
            var job = new SyncSceneToStreamJob();

            var objects = data.objects;
            var sync = data.sync;
            job.sceneHandles = new NativeArray<TransformSceneHandle>(objects.Length, Allocator.Persistent, NativeArrayOptions.UninitializedMemory);
            job.streamHandles = new NativeArray<TransformStreamHandle>(objects.Length, Allocator.Persistent, NativeArrayOptions.UninitializedMemory);
            job.syncSceneToStream = new BitArray(data.sync);

            for (int i = 0; i < objects.Length; ++i)
            {
                job.sceneHandles[i] = animator.BindSceneTransform(objects[i]);
                job.streamHandles[i] = animator.BindStreamTransform(objects[i]);
            }

            return job;
        }
Exemple #2
0
 public override void Destroy(SyncSceneToStreamJob job)
 {
     job.sceneHandles.Dispose();
     job.streamHandles.Dispose();
     job.syncSceneToStream.Dispose();
 }