浏览代码

Update DynamicLibrary sample to use non-deprecated API

/4.1
Tim Mowrer 4 年前
当前提交
38f76e28
共有 1 个文件被更改,包括 5 次插入5 次删除
  1. 10
      Assets/Scenes/ImageTracking/DynamicLibrary.cs

10
Assets/Scenes/ImageTracking/DynamicLibrary.cs


set => m_Width = value;
}
public JobHandle jobHandle { get; set; }
public AddReferenceImageJobState jobState { get; set; }
}
[SerializeField, Tooltip("The set of images to add to the image library at runtime")]

m_StringBuilder.AppendLine("Add image status:");
foreach (var image in m_Images)
{
m_StringBuilder.AppendLine($"\t{image.name}: {(image.jobHandle.IsCompleted ? "done" : "pending")}");
m_StringBuilder.AppendLine($"\t{image.name}: {(image.jobState.status.ToString())}");
}
GUILayout.Label(m_StringBuilder.ToString());
break;

// Note: You do not need to do anything with the returned JobHandle, but it can be
// useful if you want to know when the image has been added to the library since it may
// take several frames.
image.jobHandle = mutableLibrary.ScheduleAddImageJob(image.texture, image.name, image.width);
image.jobState = mutableLibrary.ScheduleAddImageWithValidationJob(image.texture, image.name, image.width);
}
m_State = State.AddingImages;

var done = true;
foreach (var image in m_Images)
{
if (!image.jobHandle.IsCompleted)
if (!image.jobState.jobHandle.IsCompleted)
{
done = false;
break;

}
}
}
}
}
正在加载...
取消
保存