{"id":168,"date":"2025-04-27T19:32:57","date_gmt":"2025-04-27T11:32:57","guid":{"rendered":"https:\/\/playerzhou.com\/blog\/?p=168"},"modified":"2025-04-27T19:32:57","modified_gmt":"2025-04-27T11:32:57","slug":"ue5-5%e9%80%9a%e8%bf%87fworldpartitionactordescinstance%e5%8a%a0%e8%bd%bdactor","status":"publish","type":"post","link":"https:\/\/playerzhou.com\/blog\/?p=168","title":{"rendered":"UE5.5\u901a\u8fc7FWorldPartitionActorDescInstance\u52a0\u8f7dActor"},"content":{"rendered":"<ul>\n<li>\n<p>UE5.5\u76ee\u524d\u4f7f\u7528<code>FWorldPartitionActorDescInstance<\/code>\u6765\u7ba1\u7406world partition\u4e0b\u7684actor\u4fe1\u606f\u548c\u903b\u8f91\u64cd\u4f5c\uff0c\u539f\u6765\u7684<code>FWorldPartitionActorDesc<\/code>\u4ec5\u50a8\u5b58\u6570\u636e<\/p>\n<\/li>\n<li>\n<p><code>FWorldPartitionActorDescInstance::GetActor<\/code>\u51fd\u6570\u4e0d\u4f1a\u89e6\u53d1\u52a0\u8f7d\uff0c\u4ec5\u7528\u4e8e\u83b7\u53d6\u5df2\u52a0\u8f7d\u6216\u5904\u4e8e\u5f02\u6b65\u52a0\u8f7d\u72b6\u6001\u7684actor\uff0c\u4f46\u5982\u679cactor\u5904\u4e8e\u5f02\u6b65\u52a0\u8f7d\u72b6\u6001\u65f6\uff0c\u4f1a\u89e6\u53d1<code>FWorldPartitionActorDescInstance::FlushAsyncLoad<\/code>\u7b49\u5f85\u52a0\u8f7d\u5b8c\u6210<\/p>\n<\/li>\n<li>\n<p>UE5.5\u5220\u9664\u4e86<code>FWorldPartitionActorDescInstance::Load<\/code>\u63a5\u53e3\u5e76\u5c06<code>FWorldPartitionActorDesc::Load<\/code>\u8bbe\u4e3a\u7a7a\u51fd\u6570\uff0c\u4ec5\u5728private\u5185\u63d0\u4f9b\u4e86\u5f02\u6b65\u52a0\u8f7d\u63a5\u53e3\uff0c\u7406\u7531\u5982\u4e0b<\/p>\n<ul>\n<li>World Partition Actor Descriptors:<\/li>\n<li>Make loading functions private to make sure all code requesting actors loading state changes in the editor goes through the loading contexts.<\/li>\n<li>Actor descriptors can now load async when using the deferred context, in preparation of editor async loading through a new async context.<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u56e0\u6b64\u5916\u90e8\u65e0\u6cd5\u76f4\u63a5\u901a\u8fc7FWorldPartitionActorDescInstance\u52a0\u8f7dActor\uff0c\u76ee\u524dUE\u63d0\u4f9b\u4e86\u4e24\u79cd\u52a0\u8f7d\u63a5\u53e3<code>FWorldPartitionLoadingContext::FImmediate<\/code>\u548c<code>FWorldPartitionLoadingContext::FDeferred<\/code>\uff0c\u5206\u522b\u4ee3\u8868\u540c\u6b65\u548c\u5f02\u6b65\u52a0\u8f7d<\/p>\n<\/li>\n<li>\n<p>UE5.5\u53ef\u901a\u8fc7<code>void FWorldPartitionLoadingContext::LoadAndRegisterActor(FWorldPartitionActorDescInstance* InActorDescInstance)<\/code>\u76f4\u63a5\u52a0\u8f7dactor\uff0c\u5176\u5b9e\u73b0\u5982\u4e0b<\/p>\n<ul>\n<li>\n<pre><code>void FWorldPartitionLoadingContext::LoadAndRegisterActor(FWorldPartitionActorDescInstance* InActorDescInstance)\n{\ncheck(!InActorDescInstance->bIsRegisteringOrUnregistering);\nInActorDescInstance->bIsRegisteringOrUnregistering = true;\n\nActiveContext->RegisterActor(InActorDescInstance);\n}<\/code><\/pre>\n<\/li>\n<li>\n<p>\u5176\u4e2d\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u91c7\u7528\u540c\u6b65\u52a0\u8f7d:<\/p>\n<\/li>\n<li>\n<pre><code>FWorldPartitionLoadingContext::FImmediate FWorldPartitionLoadingContext::DefaultContext;\nFWorldPartitionLoadingContext::IContext* FWorldPartitionLoadingContext::ActiveContext = &DefaultContext;<\/code><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>UE\u5728\u6b64\u57fa\u7840\u4e0a\u5c01\u88c5\u4e86\u7c7b\u578b<code>typedef TWorldPartitionHandle&lt;FWorldPartitionReferenceImpl&gt; FWorldPartitionReference;<\/code>\uff0c\u7528\u4e8e\u8bb0\u5f55actor\u5f15\u7528\u8ba1\u6570\uff0c\u5e76\u4e14\u53ef\u4ee5\u6839\u636e\u5f15\u7528\u8ba1\u6570\u52a0\u8f7d\u548c\u5378\u8f7dactor<\/p>\n<ul>\n<li>\n<pre><code>\/**\n* FWorldPartitionReference will increment\/decrement the hard reference count on the actor descriptor.\n* This will trigger actor loading\/unloading when the hard reference counts gets to one\/zero.\n*\/<\/code><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u540c\u65f6UE\u8fd8\u63d0\u4f9b\u4e86<code>typedef TWorldPartitionHandle&lt;FWorldPartitionHandleImpl&gt; FWorldPartitionHandle;<\/code>\u7c7b\u578b\u4ec5\u7528\u4e8e\u8bb0\u5f55\u5f15\u7528\u8ba1\u6570<\/p>\n<ul>\n<li>\n<pre><code>\/**\n* FWorldPartitionHandle will increment\/decrement the soft reference count on the actor descriptor.\n* This won't trigger any loading, but will prevent cleanup of the actor descriptor when destroying an\n* actor in the editor.\n*\/\ntypedef TWorldPartitionHandle<FWorldPartitionHandleImpl> FWorldPartitionHandle;<\/code><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u56e0\u6b64\u53ef\u4ee5\u901a\u8fc7<code>FWorldPartitionReference ActorReference(WorldPartition, ActorDesc-&gt;GetGuid());<\/code>\u6765\u52a0\u8f7dactor\uff0c\u5728\u5176\u6784\u9020\u51fd\u6570\u4e2d\u4f1a\u8bb0\u5f55\u5f15\u7528\u8ba1\u6570\uff0c\u5e76\u89e6\u53d1\u52a0\u8f7d\u4efb\u52a1\uff0c\u5176\u5185\u90e8\u4e5f\u662f\u8c03\u7528<code>FWorldPartitionLoadingContext::LoadAndRegisterActor<\/code>\u5b9e\u73b0\u7684<\/p>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>UE5.5\u76ee\u524d\u4f7f\u7528FWorldPartitionActorDescInstance\u6765\u7ba1\u7406world parti [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[15,3],"tags":[],"_links":{"self":[{"href":"https:\/\/playerzhou.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/168"}],"collection":[{"href":"https:\/\/playerzhou.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/playerzhou.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/playerzhou.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/playerzhou.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=168"}],"version-history":[{"count":1,"href":"https:\/\/playerzhou.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/168\/revisions"}],"predecessor-version":[{"id":169,"href":"https:\/\/playerzhou.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/168\/revisions\/169"}],"wp:attachment":[{"href":"https:\/\/playerzhou.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=168"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/playerzhou.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=168"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/playerzhou.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=168"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}