{"id":288,"date":"2024-05-17T09:16:49","date_gmt":"2024-05-17T01:16:49","guid":{"rendered":"https:\/\/www.vanforever.com.cn\/?p=288"},"modified":"2024-10-11T09:07:44","modified_gmt":"2024-10-11T01:07:44","slug":"ue-%e6%8a%95%e5%b0%84%e7%89%a9%e5%ad%a6%e4%b9%a0%e4%b9%8b%e8%b7%af","status":"publish","type":"post","link":"https:\/\/www.vanforever.com.cn\/?p=288","title":{"rendered":"UE \u6295\u5c04\u7269\u5b66\u4e60\u4e4b\u8def"},"content":{"rendered":"<p><div  class='collapse-block shadow-sm collapse-block-transparent collapsed hide-border-left'><div class='collapse-block-title'><span class='collapse-block-title-inner'>\u67e5\u770b\u7279\u8272\u56fe\u7247<\/span><i class='collapse-icon fa fa-angle-down'><\/i><\/div><div class='collapse-block-body' style='display:none;'><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/pic.vanforever.com.cn\/Vanforever\/20240421\/wallhaven-43pkd6_3840x2400.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large\" data-original=\"https:\/\/pic.vanforever.com.cn\/Vanforever\/20240421\/wallhaven-43pkd6_3840x2400.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" width=\"3840\" height=\"2400\" \/><\/div><\/div><\/div><br \/>\n<body><\/p>\n<h1 id='ue-\u6295\u5c04\u7269\u5b66\u4e60\u4e4b\u8def'>UE \u6295\u5c04\u7269\u5b66\u4e60\u4e4b\u8def<\/h1>\n<h2 id='\u5b9e\u73b0\u53d1\u5c04\u7c92\u5b50'>\u5b9e\u73b0\u53d1\u5c04\u7c92\u5b50<\/h2>\n<h3 id='1-\u521b\u5efa\u9b54\u6cd5\u7c92\u5b50'>1. \u521b\u5efa\u9b54\u6cd5\u7c92\u5b50<\/h3>\n<p>    \u5728UE\u4e2d\u4eceActor\u6d3e\u751f\u51fa\u4e00\u4e2a\u516c\u5171class\uff0c\u547d\u540d\u4e3a<code>SMagicProjectile<\/code>\uff0c\u8868\u793a\u8fd9\u4e2a\u7c7b\u7528\u4e8e\u5b9e\u73b0\u9b54\u6cd5\u6295\u63b7\u7269\u653b\u51fb\u3002\u521b\u5efa\u5b8c\u6bd5\u540e\u5728<code>SMagicProjectile.h<\/code>\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4e09\u4e2a\u7528\u4e8e\u8ba1\u7b97\u78b0\u649e\u548c\u663e\u793a\u7279\u6548\u7684\u7ec4\u4ef6\uff0c\u5e76\u5728<code>SMagicProjectile.cpp<\/code>\u4e2d\u521b\u5efa\u5b9e\u4f8b\uff1a<\/p>\n<p>&nbsp;<\/p>\n<pre><code class='language-cpp' lang='cpp'>\/\/SMagicProjectile.h\n#pragma once\n\n#include &quot;CoreMinimal.h&quot;\n#include &quot;Components\/SphereComponent.h&quot;\n#include &quot;GameFramework\/Actor.h&quot;\n#include &quot;GameFramework\/ProjectileMovementComponent.h&quot;\n#include &quot;Particles\/ParticleSystemComponent.h&quot;\n#include &quot;SMagicProjectile.generated.h&quot;\n\nclass USphereComponent;\nclass UProjectileMovementComponent;\nclass UParticleSystemComponent;\n\nUCLASS()\nclass ACTIONROGUELIKE_API ASMagicProjectile : public AActor\n{\n\tGENERATED_BODY()\n\t\n\nprotected:\n\n\t\/\/ \u7403\u4f53,\u7528\u4e8e\u8ba1\u7b97\u78b0\u649e\n\tUPROPERTY(BlueprintReadOnly,VisibleAnywhere)\n\tUSphereComponent* SphereComp;\n\n\t\/\/ \u6295\u5c04\u4f53\uff0c\u63a7\u5236\u7403\u4f53\u7684\u8fd0\u52a8\n\tUPROPERTY(BlueprintReadOnly,VisibleAnywhere)\n\tUProjectileMovementComponent* MovementComp;\n\n\t\/\/ \u7c92\u5b50\u7cfb\u7edf\uff0c\u63a7\u5236\u7279\u6548\n\tUPROPERTY(BlueprintReadOnly,VisibleAnywhere)\n\tUParticleSystemComponent* EffectComp;\n\n};\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre><code class='language-cpp' lang='cpp'>\/\/SMagicProjectile.cpp\n\n#include &quot;SMagicProjectile.h&quot;\n\n#include &quot;SAttributeComponent.h&quot;\n#include &quot;Components\/SphereComponent.h&quot;\n#include &quot;GameFramework\/ProjectileMovementComponent.h&quot;\n#include &quot;Particles\/ParticleSystemComponent.h&quot;\n\n\n\/\/ Sets default values\nASMagicProjectile::ASMagicProjectile()\n{\n\t\/\/ Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don&#39;t need it.\n\tPrimaryActorTick.bCanEverTick = true;\n\n\tSphereComp = CreateDefaultSubobject&lt;USphereComponent&gt;(&quot;SphereComp&quot;);\n\tSphereComp-&gt;SetCollisionProfileName(&quot;Projectile&quot;);\n\tSphereComp-&gt;OnComponentBeginOverlap.AddDynamic(this,&amp;ASMagicProjectile::OnActorOverlap);\n\tRootComponent = SphereComp;\n\t\n\n\tEffectComp = CreateDefaultSubobject&lt;UParticleSystemComponent&gt;(&quot;EffectComp&quot;);\n\tEffectComp-&gt;SetupAttachment(SphereComp);\n\n\tMovementComp = CreateDefaultSubobject&lt;UProjectileMovementComponent&gt;(&quot;MovementComp&quot;);\n\tMovementComp-&gt;InitialSpeed = 1000.0f;\n    \/\/\u8fd9\u8868\u660e\u7269\u4f53\u7684\u65cb\u8f6c\u5c06\u4f1a\u8ddf\u968f\u5176\u901f\u5ea6\u5411\u91cf\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u7269\u4f53\u5c06\u4f1a\u671d\u5b83\u79fb\u52a8\u7684\u65b9\u5411\u65cb\u8f6c\uff0c\n\t\/\/\u8fd9\u5bf9\u4e8e\u6a21\u62df\u4f8b\u5982\u5b50\u5f39\u6216\u8005\u706b\u7bad\u8fd9\u6837\u7684\u7269\u4f53\u662f\u5f88\u5e38\u89c1\u7684\uff0c\u8fd9\u4e9b\u7269\u4f53\u7684\u5c3e\u90e8\u901a\u5e38\u6307\u5411\u5b83\u4eec\u79fb\u52a8\u7684\u53cd\u65b9\u5411\u3002\n\tMovementComp-&gt;bRotationFollowsVelocity = true;\n    \/\/\u8fd9\u8868\u793a\u7269\u4f53\u7684\u521d\u59cb\u901f\u5ea6\u662f\u76f8\u5bf9\u4e8e\u7269\u4f53\u81ea\u8eab\u7684\u5c40\u90e8\u7a7a\u95f4\u6765\u5b9a\u4e49\u7684\uff0c\u800c\u4e0d\u662f\u4e16\u754c\u7a7a\u95f4\u3002\n\t\/\/\u5c40\u90e8\u7a7a\u95f4\u610f\u5473\u7740\u901f\u5ea6\u5411\u91cf\u662f\u76f8\u5bf9\u4e8e\u7269\u4f53\u81ea\u8eab\u7684\u65b9\u5411\u548c\u5750\u6807\u7cfb\u7edf\u3002\u5982\u679c\u8fd9\u4e2a\u5c5e\u6027\u8bbe\u7f6e\u4e3afalse\uff0c\u90a3\u4e48\u521d\u59cb\u901f\u5ea6\u5c06\u4f1a\u5728\u4e16\u754c\u7a7a\u95f4\u4e2d\u5b9a\u4e49\uff0c\u4e0e\u7269\u4f53\u7684\u671d\u5411\u65e0\u5173\u3002\n\tMovementComp-&gt;bInitialVelocityInLocalSpace = true;\n\n}\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p> \u4ee3\u7801\u7f16\u5199\u5b8c\u6bd5\u540e\uff0c\u9700\u8981\u5728UE\u4e2d\u521b\u5efa\u84dd\u56fe\u7c7b<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/pic.vanforever.com.cn\/UE\/Projectile\/20240517\/2024051701.jpg\" referrerpolicy=\"no-referrer\"><\/p>\n<p>&nbsp;<\/p>\n<p>\u7136\u540e\u6253\u5f00MagicProjectileBP\uff0c\u5728\u7c92\u5b50\u7cfb\u7edf\u63a7\u4ef6EffectComp\u7684\u201c\u7c92\u5b50\u201d\u5c5e\u6027\u4e2d\u968f\u610f\u9009\u62e9\u4e00\u79cd\u6a21\u677f\uff0c\u6211\u8fd9\u91cc\u9009\u62e9\u7684\u662fP_Gideon_Primary_Projectile\u3002\u5728\u9009\u62e9\u6a21\u677f\u540e\u6211\u4eec\u53ef\u4ee5\u76f4\u63a5\u5728\u754c\u9762\u4e2d\u95f4\u7684\u89c6\u53e3\u4e2d\u770b\u5230\u7c92\u5b50\u7279\u6548\u7684\u6837\u5b50\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/pic.vanforever.com.cn\/UE\/Projectile\/20240517\/2024051702.jpg\" referrerpolicy=\"no-referrer\"><\/p>\n<p>&nbsp;<\/p>\n<h3 id='2\u63a7\u5236\u7c92\u5b50\u751f\u6210'>2.\u63a7\u5236\u7c92\u5b50\u751f\u6210<\/h3>\n<p>    \u6211\u4eec\u9700\u8981\u901a\u8fc7\u9f20\u6807\u70b9\u51fb\u6216\u952e\u76d8\u6309\u4e0b\uff0c\u6765\u63a7\u5236\u751f\u6210\u4e0a\u8ff0\u9b54\u6cd5\u7c92\u5b50\u3002\u8981\u5b9e\u73b0\u8fd9\u4e2a\u529f\u80fd\uff0c\u53ef\u4ee5\u53c2\u8003\u524d\u6587\u6709\u5173\u63a7\u5236\u4eba\u7269\u79fb\u52a8\u7684\u64cd\u4f5c\uff0c\u9700\u8981\u5728<code>SCharacter.cpp<\/code>\u7684<code>SetupPlayerInputComponent()<\/code>\u51fd\u6570\u4e2d\u7ed1\u5b9a\u4e00\u4e2a\u65b0\u52a8\u4f5c\u3002\u4e0d\u540c\u4e8e\u63a7\u5236\u79fb\u52a8\u7684\u8f74\u7ed1\u5b9a\uff0c\u5bf9\u4e8e\u6309\u4e0b\u6309\u94ae\u8fd9\u79cd\u52a8\u4f5c\u9700\u8981\u4f7f\u7528\u64cd\u4f5c\u7ed1\u5b9a\uff0c\u5373<code>BindAction()<\/code>\u51fd\u6570\uff1a<\/p>\n<pre><code class='language-cpp' lang='cpp'>\/\/SCharacter.cpp\nPlayerInputComponent-&gt;BindAction(&quot;PrimaryAttack&quot;,IE_Pressed,this,&amp;ASCharacter::PrimaryAttack);\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>\u4e3a\u6b64\uff0c\u9700\u8981\u589e\u52a0\u4e00\u4e2a\u63a7\u5236\u91ca\u653e\u653b\u51fb\u7684\u51fd\u6570PrimaryAttack()\u3002\u8fd9\u4e2a\u51fd\u6570\u7684\u6838\u5fc3\u662fGetWorld()\u5728\u5f53\u524d\u4e16\u754c\u4e0bSpawnActor()\u6765\u751f\u6210\u4e0a\u9762\u521b\u5efa\u7684\u9b54\u6cd5\u7c92\u5b50\u3002\u5176\u4e2d\u4f20\u5165\u4e09\u4e2a\u5bf9\u8c61\u53c2\u6570\u5206\u522b\u4e3a\uff1a\u8981\u751f\u6210\u7684\u5bf9\u8c61\u7684class\u3001\u6240\u6709Actor\u57fa\u672c\u7684Transform\u53d8\u6362\u5c5e\u6027\uff08\u63a7\u5236Actor\u7684\u4f4d\u7f6e\u548c\u7f29\u653e\uff09\u3001\u751f\u6210\u7684\u76f8\u5173\u53c2\u6570\u8bbe\u7f6e<\/p>\n<pre><code class='language-cpp' lang='cpp'>\/\/SCharacter.cpp\nvoid ASCharacter::PrimaryAttack() {\n\t\/\/ Spawn Transform Matrix\uff0c spawn\u7684\u53d8\u6362\u77e9\u9635\n\t\/\/ \u671d\u5411\u89d2\u8272\u65b9\u5411\uff0c\u5728\u89d2\u8272\u7684\u4e2d\u5fc3\u4f4d\u7f6e\u751f\u6210\n    \/\/Rotation\uff08\u65cb\u8f6c\uff09\u3001Translation\uff08\u5e73\u79fb\uff09\u548cScale3D\uff08\u7f29\u653e\uff09\n\tFTransform SpawnTM = FTransform(GetActorRotation(),GetActorLocation());\n \n\t\/\/ \u53c2\u6570\u8bbe\u7f6e\u3002\n    \/\/ \u6b64\u5904\u8bbe\u7f6e\u78b0\u649e\u68c0\u6d4b\u89c4\u5219\u4e3a\uff1a\u5373\u4f7f\u78b0\u649e\u4e5f\u603b\u662f\u751f\u6210\uff0c\u56e0\u4e3a\u7c92\u5b50\u5728\u89d2\u8272\u4e2d\u95f4\u751f\u6210\u5fc5\u7136\u78b0\u649e\n\tFActorSpawnParameters SpawnParams;\n\tSpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;\n \n\t\/\/ \u6240\u6709\u80fd\u653e\u7f6e\u6216\u751f\u6210\u7684\u5bf9\u8c61\u90fd\u662fActor\n\tGetWorld()-&gt;SpawnActor&lt;AActor&gt;(ProjectileClass, SpawnTM, SpawnParams);\n}\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>\u5728\u4e0a\u9762\u7684\u4ee3\u7801\u4e2d\uff0c\u4f20\u5165SpawnActor()\u7684\u7b2c\u4e00\u4e2a\u53c2\u6570\u662fProjectileClass\uff0c\u8fd9\u662f\u4e00\u4e2a\u9700\u8981\u5728SCharacter.h\u5b9a\u4e49\u7684AActor\u5b50\u7c7b\u3002\u540c\u65f6\uff0c\u5229\u7528PROPERTY\u5b8f\u5b9a\u4e49\u5c06\u5176\u66b4\u9732\u5728UE\u4e2d\uff0c\u8fd9\u6837\u5c31\u53ef\u4ee5\u5728Player\u84dd\u56fe\u7c7b\u7684\u7ec6\u8282\u9762\u677f\u4e2d\uff0c\u50cf\u9009\u62e9\u53c2\u6570\u90a3\u6837\u76f4\u63a5\u9009\u62e9MagicProjection\u5b9e\u4f8b\u8fdb\u884c\u8c03\u7528\u3002<\/p>\n<pre><code class='language-cpp' lang='cpp'>\/\/SCharacter.h\nUCLASS()\nclass ACTIONROGUELIKE_API ASCharacter : public ACharacter\n{\nprotected:\n    \n    \/\/TSubclassOf \u662f\u4e00\u4e2a\u6a21\u677f\u7c7b\uff0c\u7528\u4e8e\u5b58\u50a8\u5bf9\u67d0\u4e2a\u7279\u5b9a\u7c7b\u7684\u5f15\u7528\n    \/\/\u5728UE\u7684\u84dd\u56fe\u7cfb\u7edf\u4e2d\uff0cTSubclassOf \u4e5f\u7528\u4e8e\u6307\u5b9a\u4e00\u4e2a\u7c7b\u6216\u5176\u5b50\u7c7b\u4f5c\u4e3a\u84dd\u56fe\u8282\u70b9\u7684\u8f93\u5165\u3002\n    \/\/ \u6295\u5c04\u4f53\u5b50\u7c7b\n\tUPROPERTY(EditAnywhere,Category = &quot;Attack&quot;)\n\tTSubclassOf&lt;AActor&gt; ProjectileClass;\n \n\tvoid PrimaryAttack();\n};\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>\u6253\u5f00UE\uff0c\u5c06PrimaryAttack\u7ed1\u5b9a\u4e3a\u9f20\u6807\u5de6\u952e\uff1b\u540c\u65f6\u5c06\u4ee5SCharacter\u521b\u5efa\u7684\u84dd\u56fe\u4e2d\u7684ProjectileClass\u9009\u62e9\u4e3a\u7b2c\u4e00\u6b65\u521b\u5efa\u7684\u84dd\u56fe\u7c7bMagicProjectile\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/pic.vanforever.com.cn\/UE\/Projectile\/20240517\/2024051703.jpg\" referrerpolicy=\"no-referrer\"><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/pic.vanforever.com.cn\/UE\/Projectile\/20240517\/2024051704.jpg\" referrerpolicy=\"no-referrer\"><\/p>\n<p> \u73b0\u5728\u8fd0\u884c\u5173\u5361\uff0c\u70b9\u51fb\u9f20\u6807\u5de6\u952e\u5c31\u53ef\u4ee5\u4ece\u89d2\u8272\u7684\u4e2d\u5fc3\u53d1\u5c04\u51fa\u9b54\u6cd5\u7c92\u5b50\u3002<\/p>\n<p>&nbsp;<\/p>\n<h3 id='3\u66f4\u6539\u7c92\u5b50\u53d1\u5c04\u4f4d\u7f6e'>3.\u66f4\u6539\u7c92\u5b50\u53d1\u5c04\u4f4d\u7f6e<\/h3>\n<p>    \u6700\u4f73\u7684\u653b\u51fb\u6f14\u51fa\u6548\u679c\uff0c\u5e94\u8be5\u662f\u4ece\u89d2\u8272\u7684\u624b\u638c\u53d1\u51fa\uff0c\u6240\u4ee5\u9996\u5148\u9700\u8981\u627e\u5230\u9aa8\u9abc\u4f53\u6a21\u578b\u4e2d\u624b\u7684\u4f4d\u7f6e\u3002\u53cc\u51fbPlayer\u4f7f\u7528\u7684\u7f51\u683c\u4f53\u53ef\u4ee5\u6253\u5f00Gideon\u7684\u6a21\u578b\uff0c\u518d\u70b9\u51fb\u53f3\u4e0a\u89d2\u53ef\u4ee5\u5207\u6362\u4e3a\u9aa8\u9abc\u3002\u754c\u9762\u5de6\u4fa7\u4f1a\u51fa\u73b0\u6240\u6709\u7684\u9aa8\u9abc\u548cSocket\uff0c\u53ef\u4ee5\u627e\u5230\u89d2\u8272\u53f3\u624b\u7684\u4f4d\u7f6e\u4e3a\u201cMuzzle_01\u201d\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/pic.vanforever.com.cn\/UE\/Projectile\/20240517\/2024051705.jpg\" referrerpolicy=\"no-referrer\"><\/p>\n<p>&nbsp;<\/p>\n<p>\u8981\u627e\u5230\u8fd9\u4e2a\u4f4d\u7f6e\uff0cUE\u63d0\u4f9b\u4e86\u76f8\u5e94\u51fd\u6570\u4f9b\u5f00\u53d1\u8005\u8c03\u7528\uff1a<\/p>\n<pre><code class='language-cpp' lang='cpp'>FVector HandLocation = GetMesh()-&gt;GetSocketLocation(&quot;Muzzle_01&quot;);\n<\/code><\/pre>\n<p>\u73b0\u5728\u89d2\u8272\u5c31\u53ef\u4ee5\u4ece\u53f3\u624b\u53d1\u5c04\u9b54\u6cd5\u7c92\u5b50\u4e86\uff0c\u540e\u7eed\u8fd8\u4f1a\u914d\u5408\u52a8\u753b\u64ad\u653e\uff0c\u5c06\u4f1a\u5b9e\u73b0\u89d2\u8272\u4f38\u624b\u53d1\u5c04\u7c92\u5b50\u653b\u51fb\u7684\u6f14\u51fa\u6548\u679c\u3002\u4f46\u76ee\u524d\u53d1\u5c04\u7684\u7c92\u5b50\u4e0d\u80fd\u4ea7\u751f\u7269\u7406\u78b0\u649e\uff0c\u5982\u679c\u5411\u5899\u58c1\u53d1\u5c04\uff0c\u7c92\u5b50\u4f1a\u76f4\u63a5\u7a7f\u8fc7\u5899\u58c1\u3002<\/p>\n<p>&nbsp;<\/p>\n<h3 id='4\u5b9e\u73b0\u7269\u7406\u78b0\u649e'>4.\u5b9e\u73b0\u7269\u7406\u78b0\u649e<\/h3>\n<p>    \u9996\u5148\uff0c\u5c06MagicProjectile\u7684MovementComp\u7ec4\u4ef6\u7684\u201c\u53d1\u5c04\u91cd\u529b\u8303\u56f4\u201d\u8bbe\u7f6e\u4e3a0\uff0c\u8fd9\u6837\u53d1\u5c04\u7684\u7c92\u5b50\u53ef\u4ee5\u4e0d\u6536\u91cd\u529b\u4e0b\u843d\u800c\u4fdd\u6301\u76f4\u7ebf\u8fd0\u52a8\u3002\u7136\u540e\u5728\u9879\u76ee\u8bbe\u7f6e -&gt; \u78b0\u649e -&gt; Preset\u4e2d\u65b0\u5efa\u540d\u4e3a\u201cProjectile\u201d\u7684\u914d\u7f6e\uff0c\u7528\u4e8e\u9b54\u6cd5\u7c92\u5b50\u78b0\u649e\u68c0\u6d4b\u3002<br \/>\n<img decoding=\"async\" src=\"https:\/\/pic.vanforever.com.cn\/UE\/Projectile\/20240517\/2024051706.jpg\" referrerpolicy=\"no-referrer\"><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/pic.vanforever.com.cn\/UE\/Projectile\/20240517\/2024051707.jpg\" referrerpolicy=\"no-referrer\"><\/p>\n<p>\u7136\u540e\u5728MagicProjectile\u4e2d\u7684\u201c\u78b0\u649e\u201d\u5c5e\u6027\u4e2d\u8bbe\u7f6e\u4f7f\u7528\u8be5\u914d\u7f6e\uff0c\u6216\u8005\u76f4\u63a5\u4f7f\u7528\u5982\u4e0bC++\u4ee3\u7801\u5b9e\u73b0\uff1a<\/p>\n<pre><code class='language-cpp' lang='cpp'>\/\/SMagicProjectile.cpp\nSphereComp-&gt;SetCollisionProfileName(&quot;Projectile&quot;);\n<\/code><\/pre>\n<p> \u73b0\u5728\u89d2\u8272\u53d1\u5c04\u7684\u7c92\u5b50\u5c31\u53ef\u4ee5\u548c\u5899\u58c1\u53d1\u751f\u78b0\u649e\u4e86\u3002(\u8fd9\u91cc\u53d1\u751f\u78b0\u649e\u7684\u524d\u63d0\u662f \u4e16\u754c\u4e2d\u7684\u90a3\u4e2a\u7269\u4f53\u9047\u5230WorldDynamic\u7c7b\u578b\u65f6\u9009\u62e9\u7684\u662f Block)<\/p>\n<p>&nbsp;<\/p>\n<h2 id='\u4f18\u5316\u653b\u51fb'>\u4f18\u5316\u653b\u51fb<\/h2>\n<h3 id='1-\u9500\u6bc1\u7c92\u5b50'>1. \u9500\u6bc1\u7c92\u5b50<\/h3>\n<p>\u5728MagicProjectile\u7684\u84dd\u56fe\u9009\u62e9SphereComp\uff0c\u5728\u7ec6\u8282\u9762\u677f\u4e2d\u7684\u201c\u4e8b\u4ef6\u201d\u4e2d\u6dfb\u52a0\u201c\u7ec4\u4ef6\u547d\u4e2d\u65f6\u201d\u4e8b\u4ef6\uff0c\u8fd9\u4e2a\u4e8b\u4ef6\u4f1a\u5728\u89d2\u8272Gideon\u53d1\u51fa\u7684\u9b54\u6cd5\u7c92\u5b50\u547d\u4e2d\uff08Hit\uff09\u7269\u4f53\u65f6\u89e6\u53d1\u3002\u4e3a\u4e86\u66f4\u52a0\u65b9\u4fbf\u7684\u8c03\u8bd5\uff0c\u6211\u4eec\u5728\u5176\u540e\u6dfb\u52a0\u201c\u7ed8\u5236\u8c03\u8bd5\u7403\u4f53\uff08Draw Debug Sphere\uff09\u201d\uff0c\u5176Center\u4f20\u5165\u201c\u83b7\u53d6Actor\u4f4d\u7f6e\uff08Get Actor Location\uff09\u201d\uff0c\u5373\u53d1\u751f\u91cd\u53e0\u4e8b\u4ef6\u65f6\u7c92\u5b50\u6240\u5728\u7684\u4f4d\u7f6e\u3002\u540c\u65f6\uff0c\u5c06Radius\u8bbe\u7f6e\u4e3a10\uff0cDuration\u8bbe\u7f6e\u4e3a1\uff0cColor\u6362\u6210\u4efb\u610f\u660e\u663e\u7684\u989c\u8272\u3002\u8fd9\u6837\uff0c\u5728\u4e16\u754c\u4e2d\u53d1\u5c04\u7c92\u5b50\u65f6\u5c31\u53ef\u4ee5\u770b\u89c1\u4e8b\u4ef6\u89e6\u53d1\u7684\u4f4d\u7f6e\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/pic.vanforever.com.cn\/UE\/Projectile\/20240523\/2024052301.jpg\" referrerpolicy=\"no-referrer\"><\/p>\n<p>&nbsp;<\/p>\n<p>\u8fd9\u91cc\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5728\u4e4b\u524d\u7684\u5185\u5bb9\u4e2d\uff0c\u6211\u4eec\u8bbe\u7f6e\u4e86SphereComp\u7684\u201c\u78b0\u649e\u9884\u8bbe\u201d\u4e3a\u81ea\u5b9a\u4e49\u7684Projectile\uff0c\u5728\u5176\u4e2d\u8bbe\u7f6e\u4e86\u5bf9WorldStatic\u548cPhysicsBody\u4e3a\u963b\u6321\u3002\u73b0\u5728\uff0c\u4e3a\u4e86\u5bf9\u6240\u6709\u7269\u4f53\u90fd\u53ef\u4ee5\u6b63\u786e\u8fdb\u884c\u78b0\u649e\uff0c\u6211\u4eec\u5c06Projectile\u4e2d\u9664\u4e86Visibility\u548cCamera\u7684\u9009\u9879\u5168\u7f6e\u4e3a\u963b\u6321\u3002\u540c\u65f6\uff0c\u6211\u4eec\u4e5f\u9700\u8981\u8bbe\u7f6e\u5899\u9762\u5bf9WorldStatic\u4e3a\u963b\u6321\uff08\u6216\u8005\u76f4\u63a5\u8bbe\u7f6e\u78b0\u649e\u9884\u8bbe\u4e3aPhysicsActor\uff09\u3002\u8fd0\u884c\u5173\u5361\uff0c\u53ef\u4ee5\u53d1\u73b0\u5728\u5899\u9762\u963b\u6321\u9b54\u6cd5\u7c92\u5b50\u7684\u540c\u65f6\u7ed8\u5236\u4e86Debug\u7403\u4f53\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u63a5\u4e0b\u6765\uff0c\u9700\u8981\u5b9e\u73b0\u9b54\u6cd5\u7c92\u5b50\u51fb\u4e2d\u7269\u4f53\u540e\u7684\u9500\u6bc1\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/pic.vanforever.com.cn\/UE\/Projectile\/20240523\/2024052302.jpg\" referrerpolicy=\"no-referrer\"><\/p>\n<p>&nbsp;<\/p>\n<h3 id='2-\u4f7f\u7528instigator'>2. \u4f7f\u7528Instigator<\/h3>\n<p>\u8bfe\u7a0b\u4e2d\u8fdb\u884c\u5230\u8fd9\u4e00\u6b65\u65f6\uff0c\u51fa\u73b0\u4e86\u53d1\u5c04\u7684\u9b54\u6cd5\u7c92\u5b50\u76f4\u63a5\u5728Gideon\u624b\u4e2d\u7206\u70b8\u7684\u60c5\u51b5\uff0c\u539f\u56e0\u53ef\u80fd\u662f\u9b54\u6cd5\u7c92\u5b50\u4e00\u521b\u5efa\u5c31HIt\u5230\u4e86\u81ea\u8eab\u89d2\u8272\uff0c\u4ece\u800c\u89e6\u53d1\u540e\u7eed\u7684\u4e8b\u4ef6\u3002\u867d\u7136\u6211\u81ea\u5df1\u590d\u73b0\u65f6\u6ca1\u6709\u51fa\u73b0\u8fd9\u4e2a\u60c5\u51b5\uff0c\u4f46\u51fa\u4e8e\u5b66\u4e60\u7684\u76ee\u7684\uff0c\u672c\u793a\u4f8b\u4e5f\u4f1a\u540c\u8bfe\u7a0b\u5185\u5bb9\u4e00\u6837\u4f7f\u7528Instigator\u3002<\/p>\n<p>\u6839\u636e\u8bfe\u7a0b\u4e2d\u7684\u8bb2\u8ff0\uff0c\u5728UE\u4e2d\u5b9e\u73b0\u4f24\u5bb3\u5224\u5b9a\u65f6\u901a\u5e38\u4f1a\u5f15\u5165Instigator\uff0c\u5373\u53d1\u8d77\u8005\uff0c\u5728\u672c\u8282\u4e2d\u5c31\u662f\u89d2\u8272Gideon<\/p>\n<p>&nbsp;<\/p>\n<p>\u4e00\u79cd\u4f7f\u7528Instigator\u7684\u5e38\u89c1\u573a\u666f\u662f\u5c04\u51fb\u6e38\u620f\uff0c\u5728\u73a9\u5bb6\u53d1\u5c04\u5b50\u5f39\u51fb\u6740\u4e86\u67d0\u4e2a\u89d2\u8272\u540e\uff0c\u9700\u8981\u66f4\u65b0\u73a9\u5bb6\u7684\u5956\u52b1\u548c\u6570\u636e\u7edf\u8ba1\u65f6\uff0c\u5c31\u53ef\u4ee5\u901a\u8fc7\u8fd9\u4e2aInstigator\u5feb\u901f\u627e\u5230\u53d1\u5c04\u5b50\u5f39\u7684\u73a9\u5bb6\u5bf9\u8c61\u3002\u56e0\u6b64\uff0c\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\u6211\u4eec\u4e5f\u5c1d\u8bd5\u4f7f\u7528Instigator\u3002<\/p>\n<p>\u56de\u5230SCharacter.cpp\u7684PrimaryAttack_TimeElapsed\u51fd\u6570\u4e2d\uff0c\u5728SpawnParams\u4e2d\u76f4\u63a5\u6dfb\u52a0<\/p>\n<pre><code>Instigator\uff1aSpawnParams.Instigator = this;\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>\u4fdd\u5b58\u7f16\u8bd1\u540e\u56de\u5230UE\uff0c\u5728\u84dd\u56fe\u4e2d\u6dfb\u52a0\u5728\u8fdb\u5165Hit\u4e8b\u4ef6\u524d\u5224\u65ad\u662f\u4e0d\u662f\u81ea\u5df1\u7684\u903b\u8f91\u3002\u5728\uff0c\u521b\u5efa\u201c\u83b7\u53d6Instigator\uff08Get Instigator\uff09\u201d\u8282\u70b9\uff0c\u5e76\u4e0eOther Actor\uff08\u547d\u4e2d\u5bf9\u8c61\uff09\u8fdb\u884c\u6bd4\u8f83\uff0c\u5728\u7ed3\u679c\u4e3aTrue\u4f7f\u7528Branch\u5206\u652f\u6267\u884c\u540e\u7eed\u7684\u8282\u70b9<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/pic.vanforever.com.cn\/UE\/Projectile\/20240523\/2024052303.jpg\" referrerpolicy=\"no-referrer\"><\/p>\n<p>&nbsp;<\/p>\n<h2 id='\u9ed1\u6d1e\u6280\u80fd'>\u9ed1\u6d1e\u6280\u80fd<\/h2>\n<h3 id='1-\u4ee3\u7801\u7ed3\u6784\u66f4\u6539'>1. \u4ee3\u7801\u7ed3\u6784\u66f4\u6539<\/h3>\n<p>\u968f\u7740\u8bfe\u7a0b\u5185\u5bb9\u7684\u6df1\u5165\uff0c\u6211\u4eec\u5c06\u4f1a\u6dfb\u52a0\u7684\u6280\u80fd\u4f1a\u8d8a\u6765\u8d8a\u591a\uff0c\u5355\u7eaf\u5728SCharacter.cpp\u91cc\u4e0d\u65ad\u6dfb\u52a0\u65b0\u4ee3\u7801\u4f1a\u4f7f\u7ed3\u6784\u53d8\u5f97\u6108\u53d1\u81c3\u80bf\u3002\u4e3a\u4e86\u540e\u7eed\u5f00\u53d1\u7684\u53ef\u6269\u5c55\u6027\uff0c\u9700\u8981\u91cd\u6784\u6280\u80fd\u90e8\u5206\u7684\u4ee3\u7801\u3002<\/p>\n<p>\u56e0\u4e3aGideon\u8fd9\u4e2a\u89d2\u8272\u7684\u6280\u80fd\u90fd\u662f\u4ece\u53f3\u624b\u53d1\u51fa\u4e0d\u540c\u7684\u7c92\u5b50\uff0c\u90a3<strong>\u4ece\u53f3\u624b\u53d1\u51fa<\/strong>\u8fd9\u4e2a\u529f\u80fd\u7684\u4ee3\u7801\u662f\u53ef\u4ee5\u590d\u7528\u7684\u3002\u56e0\u6b64\u628a\u8fd9\u90e8\u5206\u4ee3\u7801\u5355\u72ec\u5c01\u88c5\uff0c\u53ea\u9700\u8981\u4f20\u5165\u9700\u8981\u751f\u6210\u7684\u7c7b\u5373\u53ef\u3002\u4e8e\u662f\uff0c\u5728SCharacter\u4e2d\u52a0\u5165\u4e00\u4e2a\u8d1f\u8d23\u751f\u6210\u7c92\u5b50\u7684\u51fd\u6570SpawnProjectile\uff08\u8bb0\u5f97\u5728.h\u6587\u4ef6\u4e2d\u58f0\u660e\uff09\uff1a<\/p>\n<pre><code class='language-cpp' lang='cpp'>\/\/SCharacter.h\nvoid SpawnProjectile(TSubclassOf&lt;AActor&gt; ClassToSpawn);\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre><code class='language-cpp' lang='cpp'>\/\/SCharacter.cpp\nvoid ASCharacter::SpawnProjectile(TSubclassOf&lt;AActor&gt; ClassToSpawn)\n{\n\tif(ensure(ClassToSpawn))\n\t{\n\t\t\/\/ \u83b7\u53d6\u6a21\u578b\u53f3\u624b\u4f4d\u7f6e\n\t\tFVector RightHandLoc = GetMesh()-&gt;GetSocketLocation(&quot;Muzzle_01&quot;);\n \t\n\t\t\/\/ \u68c0\u6d4b\u8ddd\u79bb\u4e3a 5000 cm = 50 m\n\t\tFVector TraceStart = CameraComp-&gt;GetComponentLocation();\n\t\tFVector TraceEnd = TraceStart + ( GetControlRotation().Vector() * 5000 );\n \t\n\t\t\/\/ \u68c0\u6d4b\u534a\u5f84\n\t\tFCollisionShape Shape;\n\t\tShape.SetSphere(20.0f);\n \t\n\t\t\/\/ \u4e0d\u8981\u68c0\u6d4b\u81ea\u5df1\u89d2\u8272\n\t\tFCollisionQueryParams Params;\n\t\tParams.AddIgnoredActor(this);\n \t\n\t\t\/\/ \u78b0\u649e\u8bbe\u7f6e\n\t\tFCollisionObjectQueryParams ObjParams;\n\t\tObjParams.AddObjectTypesToQuery(ECC_WorldStatic);\n\t\tObjParams.AddObjectTypesToQuery(ECC_WorldDynamic);\n\t\tObjParams.AddObjectTypesToQuery(ECC_Pawn);\n \t\n\t\tFHitResult Hit;\n\t\tif (GetWorld()-&gt;SweepSingleByObjectType(Hit, TraceStart, TraceEnd, FQuat::Identity, ObjParams, Shape, Params)) {\n\t\t\tTraceEnd = Hit.ImpactPoint;\n\t\t}\n\t\t\t\n\t\t\/\/ \u5c3e\u5411\u91cf - \u5934\u5411\u91cf = \u65b9\u5411\u5411\u91cf eg\uff1a\u8d77\u70b9(0,0) \u7ec8\u70b9(1,1)\uff0c\u65b9\u5411\u5411\u91cf\u4e3a(1,1)\n\t\tFRotator ProjRotation = FRotationMatrix::MakeFromX(TraceEnd - RightHandLoc).Rotator();\n\t\t\/\/ \u671d\u5411\u68c0\u6d4b\u5230\u7684\u843d\u70b9\u65b9\u5411\uff0c\u5728\u89d2\u8272\u7684\u53f3\u624b\u4f4d\u7f6e\u751f\u6210\n\t\tFTransform SpawnTM = FTransform(ProjRotation, RightHandLoc);\n \t\n\t\t\/\/ \u6b64\u5904\u8bbe\u7f6e\u78b0\u649e\u68c0\u6d4b\u89c4\u5219\u4e3a\uff1a\u5373\u4f7f\u78b0\u649e\u4e5f\u603b\u662f\u751f\u6210\n\t\tFActorSpawnParameters SpawnParams;\n\t\tSpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;\n\t\tSpawnParams.Instigator = this;\n\n\t\t\/*\n\t\tGetWorld()-&gt;SpawnActor&lt;AActor&gt;(ProjectileClass, SpawnTM, SpawnParams);\n\t\t*\/\n\n\t\tGetWorld()-&gt;SpawnActor&lt;AActor&gt;(ClassToSpawn,SpawnTM,SpawnParams);\n\t}\n\n\t\n}\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre><code class='language-cpp' lang='cpp'>\/\/2024.10.11\n\/\/ \u751f\u6210\u89d2\u5ea6\u548c\u5750\u6807\n\t\t\/\/ \u83b7\u53d6\u4eba\u7269\u6a21\u578b\u4e2d\u624b\u7684\u5750\u6807\uff0cGetSocketLocation\u53ef\u4ee5\u83b7\u53d6\u9aa8\u9abc\u4e2d\u7684\u63d2\u4ef6\n\t\tconst FVector HandLocation = GetMesh()-&gt;GetSocketLocation(&quot;Muzzle_01&quot;);\n\t\t\/\/ \u672a\u6821\u6b63\u524d\u7684\u751f\u6210\u65b9\u4f4d\n\t\t\/\/ const FTransform SpawnTM = FTransform(GetControlRotation(), HandLocation);\n\t\tFActorSpawnParameters SpawnParams;\n\t\t\/\/ \u65e0\u8bba\u4efb\u4f55\u60c5\u51b5\u90fd\u751f\u6210\uff08\u65e0\u89c6\u91cd\u53e0\uff0c\u78b0\u649e\uff0c\u8986\u76d6...\uff09\n\t\tSpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;\n\t\t\/\/ \u5c06\u89d2\u8272\u81ea\u8eab\u4f5c\u4e3a\u89e6\u53d1\u8005\u4f20\u5165\uff0c\u4ee5\u4fbf\u5b50\u5f39\u5224\u65ad\u6b63\u786e\u7684\u4ea4\u4e92\u5bf9\u8c61\n\t\tSpawnParams.Instigator = this;\n\n\t\t\/\/ \u78b0\u649e\u53c2\u6570\uff0c\u5ffd\u7565\u81ea\u8eab\n\t\tFCollisionQueryParams Params;\n\t\tParams.AddIgnoredActor(this);\n\n\t\t\/\/ \u83b7\u53d6Camera\u7ec4\u4ef6\n\t\tAPlayerCameraManager* CurrentCamera = GetWorld()-&gt;GetFirstPlayerController()-&gt;PlayerCameraManager;\n\t\t\/\/ \u65b9\u5411\u662f\u6444\u50cf\u673a\u89c6\u89d2\u7684\u6b63\u524d\u65b9\uff08\u5c4f\u5e55\u6b63\u4e2d\u592e\uff09\uff0c\u8fd9\u91cc\u4e0d\u8981\u628a\u624b\u90e8\u6a21\u578b\u7684\u5750\u6807\u4f20\u5165\uff0c\u65b9\u5411\u4f1a\u504f\n\t\tFVector TraceDirection = CurrentCamera-&gt;GetActorForwardVector();\n\t\t\/\/ \u8d77\u59cb\u4f4d\u7f6e\u662f\u6444\u50cf\u673a\u7684\u4f4d\u7f6e\n\t\tFVector TraceStart = CurrentCamera-&gt;GetCameraLocation();\n\t\t\/\/ \u7ec8\u70b9\u662f\u4e00\u6bb5\u8ddd\u79bb\uff0c\u540e\u9762\u76845000\u4e0d\u56fa\u5b9a\n\t\tFVector TraceEnd = TraceStart + (TraceDirection * 5000);\n\t\n\t\tFHitResult Hit;\n\t\t\/\/ Line Trace\u68c0\u6d4b\u4e0e\u969c\u788d\u7269\u7684\u649e\u51fb\u70b9\n\t\tif (GetWorld()-&gt;LineTraceSingleByChannel(Hit, TraceStart, TraceEnd, ECC_GameTraceChannel1, Params))\n\t\t{\n\t\t\t\/\/ \u5c06\u649e\u51fb\u70b9\u4f5c\u4e3a\u65b9\u5411\u5411\u91cf\u7684\u7ec8\u70b9\u4f4d\u7f6e\n\t\t\tTraceEnd = Hit.ImpactPoint;\n\t\t}\n\t\t\/\/ \u8d77\u59cb\u70b9\u662f\u6211\u4eec\u7684\u5b50\u5f39\u751f\u6210\u70b9\uff08\u624b\uff09\uff0c\u7ec8\u70b9\u662f\u76ee\u6807\u70b9\uff0c\u83b7\u5f97Rotation\n\t\tFRotator ProjRotation = (TraceEnd - HandLocation).Rotation();\n\t\t\/\/ \u6700\u7ec8\u83b7\u5f97\u6821\u6b63\u540e\u7684\u751f\u6210\u65b9\u4f4d\n\t\tFTransform SpawnTM = FTransform(ProjRotation, HandLocation);\n\t\n\t\t\/\/ \u5728\u4e16\u754c\u4e2d\u751f\u6210\n\t\tGetWorld()-&gt;SpawnActor&lt;AActor&gt;(ClassToSpawn, SpawnTM, SpawnParams);\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>\u76f8\u5e94\u7684\uff0c\u6b64\u524dPrimaryAttack_TimeElapsed\u51fd\u6570\u5c31\u4fdd\u7559\u4e00\u884c\u4ee3\u7801\uff1a<\/p>\n<pre><code class='language-cpp' lang='cpp'>void ASCharacter::PrimaryAttack_TimeElapsed() {\n\tSpawnProjectile(ProjectileClass);\n}\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<h3 id='2-\u5b9e\u73b0\u9ed1\u6d1e\u7c92\u5b50'>2. \u5b9e\u73b0\u9ed1\u6d1e\u7c92\u5b50<\/h3>\n<p>\u9996\u5148\uff0c\u590d\u5236\u4e00\u4efd\u4e4b\u524dPrimaryAttack\u7684\u4ee3\u7801\uff0c\u628a\u540d\u5b57\u6539\u6210BlackHoleAttack\u548cBlackHoleAttack_TimeElapsed\u3002\u5728SetupPlayerInputComponent\u6dfb\u52a0\u540e\uff0c\u518d\u5728UE\u91cc\u7ed1\u5b9a\u4efb\u610f\u6309\u952e\u3002\u8fd0\u884c\u6d4b\u8bd5\uff0c\u82e5\u89d2\u8272\u80fd\u6b63\u5e38\u53d1\u5c04\u4e4b\u524d\u7684\u9b54\u6cd5\u7c92\u5b50\u5219\u53ef\u7ee7\u7eed\uff0c\u63a5\u4e0b\u6765\u5c31\u9700\u8981\u5c06\u751f\u6210\u7684\u7c92\u5b50\u6539\u66f4\u4e3a\u9ed1\u6d1e\u7c92\u5b50\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u53c2\u8003\u6211\u4eec\u7b2c\u4e00\u6b21\u5b9e\u73b0\u53d1\u5c04\u7c92\u5b50\u7684\u505a\u6cd5\uff0c\u5728SCharacter.h\u4e2d\u65b0\u5efa\u4e00\u4e2a\u5b50\u7c7b\u5e76\u66b4\u9732\u5728\u84dd\u56fe\u4e2d\uff0c\u7136\u540e\u5728BlackHoleAttack_TimeElapsed\u4f20\u5165\u6211\u4eec\u521b\u5efa\u7684\u5b50\u7c7b\u540d\u5b57\uff1a<\/p>\n<pre><code class='language-cpp' lang='cpp'>\/\/ SCharacter.h\nUPROPERTY(EditAnywhere, Category = &quot;Attack&quot;)\nTSubclassOf&lt;AActor&gt; BlackHoleProjectileClass;\n \n\/\/ SCharacter.cpp\nvoid ASurCharacter::BlackHoleAttack_TimeElapsed() {\n\tSpawnProjectile(BlackHoleProjectileClass);\n}\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>\u968f\u540e\u5c31\u6253\u5f00UE\uff0c\u5728Player\u7684\u84dd\u56fe\u7f16\u8f91\u5668\u4e2d\u627e\u5230Attack\u5c5e\u6027\u4e0b\u7684BlackHoleProjectileClass\uff0c\u6682\u65f6\u628a\u5b83\u8bbe\u7f6e\u4e3a\u5df2\u6709\u7684\u666e\u653b\u9b54\u6cd5\u7c92\u5b50MagicProjectile\uff0c\u7f16\u8bd1\u4fdd\u5b58\u5e76\u8fd0\u884c\u6d4b\u8bd5\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u8bfe\u7a0b\u4e2d\u8003\u8651\u5230\u63a5\u4e0b\u6765\u8fd8\u8981\u5b9e\u73b0\u51e0\u4e2a\u4e0d\u540c\u7684\u7c92\u5b50\uff0c\u6240\u4ee5\u5148\u521b\u5efa\u4e00\u4e2a\u57fa\u7c7b\u6765\u590d\u7528\u4e00\u4e9b\u5171\u6709\u7684\u4ee3\u7801\u5185\u5bb9\u3002\u5728UE\u4e2d\u4eceActor\u6d3e\u751f\u4e00\u4e2aSProjectileBase\u7c7b\uff0c\u4f7f\u7528ABSTRACT\u5b8f\u5c06\u8be5\u7c7b\u58f0\u660e\u4e3a&quot;\u62bd\u8c61\u57fa\u7c7b&quot;\uff0c\u4f7f\u5176\u4e0d\u663e\u793a\u5728UE\u7684\u4e0b\u62c9\u7a97\u4e2d\uff0c\u9632\u6b62\u6211\u4eec\u5728\u5173\u5361\u4e2d\u6dfb\u52a0\u6b64\u7c7b\u7684Actor<\/p>\n<p>&nbsp;<\/p>\n<pre><code class='language-cpp' lang='cpp'>\/\/ ASProjectileBase.cpp\nASProjectileBase::ASurProjectileBase()\n{\n\tSphereComp = CreateDefaultSubobject&lt;USphereComponent&gt;(&quot;SphereComp&quot;);\n\tSphereComp-&gt;SetCollisionProfileName(&quot;Projectile&quot;);\n\tRootComponent = SphereComp;\n \n\tMoveComp = CreateDefaultSubobject&lt;UProjectileMovementComponent&gt;(&quot;ProjectileMoveComp&quot;);\n\tMoveComp-&gt;bRotationFollowsVelocity = true;\n\tMoveComp-&gt;bInitialVelocityInLocalSpace = true;\n\tMoveComp-&gt;ProjectileGravityScale = 0.0f;\n\tMoveComp-&gt;InitialSpeed = 500;\n \n\tEffectComp = CreateDefaultSubobject&lt;UParticleSystemComponent&gt;(&quot;EffectComp&quot;);\n\tEffectComp-&gt;SetupAttachment(RootComponent);\n \n}\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>\u63a5\u4e0b\u6765\u6362\u5230UE\u4e2d\uff0c\u7531\u4e8e\u9ed1\u6d1e\u7684\u529f\u80fd\u8f83\u4e3a\u7b80\u5355\uff0c\u6240\u4ee5\u4ec5\u4f7f\u7528UE\u5c31\u5f88\u5bb9\u6613\u5b9e\u73b0\u3002\u5728UE\u4e2d\u521b\u5efa\u9ed1\u6d1e\u7684\u84dd\u56fe\u7c7bProj_BlackHole\uff0c\u7ee7\u627f\u81eaSProjectileBase\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u6253\u5f00\u84dd\u56fe\u7f16\u8f91\u5668\uff0c\u518d\u6dfb\u52a0Physics\u4e2d\u7684\u5f84\u5411\u529b\u7ec4\u4ef6RadialForce\uff0c\u8fd9\u4e2a\u7ec4\u4ef6\u53ef\u4ee5\u5b9e\u73b0\u5728\u4e00\u4e2a\u8303\u56f4\u5185\u4ea7\u751f\u529b\u3002\u5728\u5c5e\u6027\u201c\u5f84\u5411\u529b\u7ec4\u4ef6\u201d\u4e2d\u8bbe\u7f6e\u201c\u8981\u5f71\u54cd\u7684\u5bf9\u8c61\u201d\uff0c\u70b9\u51fb\u53f3\u8fb9\u5c0f\u4e09\u89d2\u5f62\u5c06Pawn\u5220\u9664\uff0c\u8fd9\u6837\u5c31\u4e0d\u4f1a\u628a\u6211\u4eec\u81ea\u5df1\u5438\u8fdb\u53bb\u3002\u7136\u540e\uff0c\u8bbe\u7f6e\u5176\u534a\u5f84\u4e3a500\uff0c\u8bbe\u7f6e\u201c\u529b\u201d\u5c5e\u6027\u4e3a-2,000,000\u3002<\/p>\n<p>\u53e6\u5916\uff0c\u6211\u4eec\u4e0d\u5e0c\u671b\u8fd9\u4e2a\u9ed1\u6d1e\u5728\u79fb\u52a8\u65f6\u4f1a\u88ab\u7269\u4f53\u963b\u6321\uff0c\u6240\u4ee5\u9009\u62e9SphereComp\uff0c\u5207\u6362\u5176\u78b0\u649e\u9884\u8bbe\u4e3aCustom\uff0c\u5e76\u8bbe\u7f6e\u5982\u4e0b\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/pic.vanforever.com.cn\/UE\/Projectile\/20240524\/2024052401.jpg\" referrerpolicy=\"no-referrer\"><\/p>\n<p>\u7531\u4e8e\u8fd9\u662f\u4e00\u4e2a\u6709\u65f6\u95f4\u9650\u5236\u7684\u6280\u80fd\uff0c\u56e0\u6b64\u6211\u4eec\u9009\u62e9Proj_Base(\u81ea\u8eab)\uff0c\u8bbe\u7f6eActor\u5c5e\u6027\u7684\u201c\u521d\u59cb\u751f\u547d\u5468\u671f\u201d\u4e3a5\u79d2\uff0c\u5373\u8981\u6dfb\u52a0\u52a8\u753b\u7684\u65f6\u957f\u3002<\/p>\n<p>\u6700\u540e\uff0c\u9009\u62e9EffectComp\uff0c\u4e3a\u8fd9\u4e2a\u7c92\u5b50\u9009\u62e9\u4e00\u4e2a\u6a21\u677f\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u6b64\u5916\uff0c\u8bfe\u7a0b\u4e2d\u8fd8\u5728Proj_BlackHole\u7684\u84dd\u56fe\u4e2d\u6dfb\u52a0\u4e86\u9500\u6bc1\u78b0\u5230\u7684\u3001\u542f\u7528\u4e86\u201c\u6a21\u62df\u7269\u7406\u201d\u7684\u7269\u4f53\uff08\u6ca1\u6709\u542f\u7528\u201c\u6a21\u62df\u7269\u7406\u201d\uff0c\u4e00\u822c\u662f\u4e0d\u4e0e\u6280\u80fd\u4ea4\u4e92\u7684\u9759\u6001\u7269\u4f53\uff09\uff0c\u5927\u5bb6\u53ef\u4ee5\u5c1d\u8bd5\u6dfb\u52a0\u67e5\u770b\u6548\u679c\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/pic.vanforever.com.cn\/UE\/Projectile\/20240524\/2024052402.jpg\" referrerpolicy=\"no-referrer\">*<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h2 id='\u4f4d\u79fb\u6280\u80fd'>\u4f4d\u79fb\u6280\u80fd<\/h2>\n<p>\u5b9e\u73b0\u89d2\u8272\u7684\u7c92\u5b50\u4f4d\u79fb\u6280\u80fd\uff0c\u5373\u53d1\u5c04\u51fa\u4e00\u4e2a\u7279\u6b8a\u7684\u7c92\u5b50\uff0c\u7ecf\u8fc7\u4e00\u5b9a\u65f6\u95f4\u540e\uff0c\u8be5\u7c92\u5b50\u4f1a\u7206\u70b8\u5e76\u5c06\u89d2\u8272\u4f20\u9001\u5230\u7206\u70b8\u4f4d\u7f6e\u3002<\/p>\n<h3 id='1-\u521b\u5efa\u7c92\u5b50\u7c7b'>1. \u521b\u5efa\u7c92\u5b50\u7c7b<\/h3>\n<p>\u8003\u8651\u5230\u540e\u9762\u5236\u4f5c\u7684\u7c92\u5b50\u90fd\u9700\u8981\u5b9e\u73b0\u7206\u70b8\u6548\u679c\uff0c\u6240\u4ee5\u5728SProjectileBase\u4e2d\u6dfb\u52a0\u5b9e\u73b0\u7206\u70b8\u7684\u51fd\u6570\u548cOnActorHit\u4e8b\u4ef6\u51fd\u6570\uff0c\u7206\u70b8\u51fd\u6570\u4ec5\u5305\u62ec\u6700\u57fa\u672c\u7684\u7206\u70b8\u540e\u9500\u6bc1\u81ea\u8eab\u7684\u529f\u80fd\uff0c\u65b9\u4fbf\u5b50\u7c7b\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7684\u9700\u6c42\u6765\u8fdb\u884c\u91cd\u5199\u3002<\/p>\n<p>&nbsp;<\/p>\n<pre><code class='language-cpp' lang='cpp'>\/\/ SProjectileBase.h\n\nUPROPERTY(EditDefaultsOnly, Category = &quot;Effects&quot;)\nUParticleSystem* ImpactVFX;\/\/VFX\u6307Visual effects, \u5373\u89c6\u89c9\u7279\u6548\uff0c\u8d1f\u8d23\u7206\u70b8\u65f6\u7684\u7279\u6548\n\nUFUNCTION()\nvirtual void OnActorHit(UPrimitiveComponent* HitComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult&amp; Hit);\n\nUFUNCTION(BlueprintCallable, BlueprintNativeEvent)\nvoid Explode(); \/\/ \u7206\u70b8\u51fd\u6570\n\n\n\/\/ SProjectileBase.cpp\n\nvoid ASProjectileBase::OnActorHit(UPrimitiveComponent* HitComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult&amp; Hit)\n{\n\tExplode();\n}\n\n\/\/ BlueprintNativeEvent\u9700\u8981\u52a0\u4e0a\u540e\u7f00_Implementation\nvoid ASProjectileBase::Explode_Implementation()\n{\n\t\/\/ IsPendingKill\u786e\u4fdd\u5bf9\u8c61\u6709\u6548\uff0c\u9632\u6b62\u91cd\u590ddestroy\n\tif (ensure(IsPendingKill()))\n\t{\n\t\t\/\/ \u89e6\u53d1\u7206\u70b8\u65f6\u7684\u7279\u6548\uff0c\u7279\u6548\u6837\u5f0f\u5728UE\u4e2d\u8bbe\u7f6eImpactVFX\u53d8\u91cf\n\t\tUGameplayStatics::SpawnEmitterAtLocation(this, ImpactVFX, GetActorLocation(), GetActorRotation());\n\n\t\tDestroy();\n\t}\n}\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>\u7531\u4e8e\u8fd9\u4e2a\u6280\u80fd\u9700\u8981\u5b9e\u73b0\u989d\u5916\u7684\u4f20\u9001\u89d2\u8272\u4ee3\u7801\uff0c\u56e0\u6b64\u6211\u4eec\u8981\u5728UE\u4e2d\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u7c92\u5b50\u7c7bSDashProjectile\uff0c\u5728\u521b\u5efa\u65f6\u9009\u62e9\u201c\u663e\u793a\u6240\u6709\u7c7b\u201d\uff0c\u5e76\u901a\u8fc7\u641c\u7d22\u9009\u62e9\uff0c\u4ece\u4e0a\u4e00\u8282\u521b\u5efa\u7684\u57fa\u7c7bSProjectileBase\u6d3e\u751f\u51fa\u6765\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u8bfe\u7a0b\u4e2d\u5728DashProjectile\u4e2d\u8bbe\u7f6e\u4e24\u4e2a\u65f6\u95f4\uff0c\u7ecf\u8fc7DetonateDelay\u540e\u751f\u6210\u7206\u70b8\u7279\u6548\uff0c\u7136\u540e\u518d\u7ecf\u8fc7TeleportDelay\u540e\u4f20\u9001\u89d2\u8272\u3002\u5c06\u63a7\u5236\u7206\u70b8\u7684TimerHandle_DelayedDetonate\u58f0\u660e\u4e3a\u7c7b\u7684\u4fdd\u62a4\u6210\u5458\uff0c\u5f53\u7c92\u5b50\u63d0\u524d\u9047\u5230\u969c\u788d\u7269\u7206\u70b8\u8c03\u7528Explode\u51fd\u6570\u65f6\uff0c\u6211\u4eec\u53ef\u4ee5\u624b\u52a8\u6e05\u9664\u8fd9\u4e2aTimer\uff0c\u4ece\u800c\u9632\u6b62\u89e6\u53d1\u4e24\u6b21\u3002\u76f8\u5bf9\u7684\uff0c\u63a7\u5236\u4f20\u9001\u5ef6\u8fdf\u7684Timer\u4e0d\u6d89\u53ca\u8fd9\u4e2a\u95ee\u9898\uff0c\u56e0\u6b64\u5b9a\u4e49\u4e3a\u5c40\u90e8\u53d8\u91cf\u5373\u53ef\uff1a<\/p>\n<pre><code class='language-cpp' lang='cpp'>\/\/SDashProjectile.h\n\n#pragma once\n\n#include &quot;CoreMinimal.h&quot;\n#include &quot;SProjectileBase.h&quot;\n#include &quot;SDashProjectile.generated.h&quot;\n\n\/**\n * \n *\/\nUCLASS()\nclass ACTIONROGUELIKE_API ASDashProjectile : public ASProjectileBase\n{\n\tGENERATED_BODY()\n\n\n\t\npublic:\n \n\tASDashProjectile();\n \nprotected:\n\t\n\tUPROPERTY(EditDefaultsOnly, Category = &quot;Teleport&quot;)\n\tfloat TeleportDelay; \/\/ \u4f20\u9001\u5ef6\u8fdf\n \n\tUPROPERTY(EditDefaultsOnly, Category = &quot;Teleport&quot;)\n\tfloat DetonateDelay; \/\/ \u7206\u70b8\u5ef6\u8fdf\n\t\n\n \n\t\/\/ hit\u540e\u6e05\u9664\u8ba1\u65f6\u5668\n\tFTimerHandle TimerHandle_DelayedDetonate;\n \n\tvirtual void Explode_Implementation() override;\n \n\tvoid TeleportInstigator();\n \n\tvirtual void BeginPlay() override;\n\n};\n\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<h3 id='2-\u5b9e\u73b0\u4f20\u9001'>2. \u5b9e\u73b0\u4f20\u9001<\/h3>\n<p>\u5b9e\u73b0\u89d2\u8272\u7684\u4f20\u9001\uff0c\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528UE\u7684TeleportTo\u51fd\u6570\u63a5\u53e3\u3002\u8fd9\u90e8\u5206\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u4e00\u8fdb\u5165Explode\u5c31\u8981\u6e05\u9664\u63a7\u5236\u7206\u70b8\u7684Timer\uff0c\u9632\u6b62\u63d0\u524d\u89e6\u53d1Hit\u4e8b\u4ef6\u7206\u70b8\u540e\u3001\u539f\u6709\u7684\u8ba1\u65f6\u5668\u7ed3\u675f\u518d\u6b21\u89e6\u53d1\u3002<\/p>\n<pre><code class='language-cpp' lang='cpp'>\/\/SDashProjectile.cpp\n#include &quot;SDashProjectile.h&quot;\n#include &quot;Kismet\/GameplayStatics.h&quot;\n#include &quot;Particles\/ParticleSystemComponent.h&quot;\n#include &quot;GameFramework\/ProjectileMovementComponent.h&quot; \n\n\nASDashProjectile::ASDashProjectile()\n{\n\tTeleportDelay = 0.2f;\n\tDetonateDelay = 0.2f;\n\t\n\tMovementComp-&gt;InitialSpeed = 6000.0f;\n}\n \nvoid ASDashProjectile::BeginPlay()\n{\n\tSuper::BeginPlay();\n \n\t\/\/ \u5230\u7206\u70b8\u65f6\u95f4\u540e\uff0c\u89e6\u53d1Explode()\n\tGetWorldTimerManager().SetTimer(TimerHandle_DelayedDetonate, this, &amp;ASDashProjectile::Explode, DetonateDelay);\n}\n \nvoid ASDashProjectile::Explode_Implementation()\n{\n\t\/\/ \u53ef\u80fd\u6709\u78b0\u5230\u969c\u788d\u7269\u63d0\u524d\u7206\u70b8\u7684\u60c5\u51b5\uff0c\u56e0\u6b64\u8981\u6e05\u9664Timer\u9632\u6b62\u88ab\u8c03\u7528\u4e24\u6b21\n\tGetWorldTimerManager().ClearTimer(TimerHandle_DelayedDetonate);\n\t\/\/ \u7206\u70b8\u7279\u6548\n\tUGameplayStatics::SpawnEmitterAtLocation(this, ImpactVFX, GetActorLocation(), GetActorRotation());\n \n\t\/\/ \u7c92\u5b50\u7206\u70b8\u540e\u5173\u95ed\u7cfb\u7edf\u3001\u505c\u6b62\u79fb\u52a8\u3001\u505c\u6b62\u78b0\u649e\n\tEffectComp-&gt;DeactivateSystem();\n\tMovementComp-&gt;StopMovementImmediately();\n\tSetActorEnableCollision(false);\n \n\t\/\/ \u5230\u4f20\u9001\u65f6\u95f4\u540e\uff0c\u89e6\u53d1\u4f20\u9001\n\tFTimerHandle TimerHandle_DelayedTeleport;\n\tGetWorldTimerManager().SetTimer(TimerHandle_DelayedTeleport, this, &amp;ASDashProjectile::TeleportInstigator, TeleportDelay);\n \n\t\/\/ \u4e0d\u8c03\u7528base\u4e2d\u7684Explode\u4e2d\u7684destroy\u81ea\u8eab\uff0c\u56e0\u4e3a\u4f20\u9001\u65f6\u95f4\u8ba1\u65f6\u5668\u9700\u8981\u4e00\u70b9\u65f6\u95f4\n\t\/\/Super::Explode_Implementation();\n}\n \nvoid ASDashProjectile::TeleportInstigator()\n{\n\tAActor* ActorToTeleport = GetInstigator();\n\tif (ensure(ActorToTeleport))\n\t{\n\t\t\/\/ \u4f20\u9001\u65f6\u4fdd\u6301\u89d2\u8272\u539f\u59cbRotation\n\t\tActorToTeleport-&gt;TeleportTo(GetActorLocation(), ActorToTeleport-&gt;GetActorRotation(), false, false);\n\t}\n\t\/\/ \u4e4b\u524d\u6ca1\u6709\u8c03\u7528\uff0c\u73b0\u5728\u9500\u6bc1\n\tDestroy();\n}\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>\u63a5\u4e0b\u6765\u5c31\u662f\u5e38\u89c4\u7684\u7ed1\u5b9a\u6309\u952e\u64cd\u4f5c\uff0c\u5728UE\u4e2d\u521b\u5efa\u84dd\u56fe\u7c7b\uff0c\u7136\u540e\u8bbe\u7f6e\u53d1\u5c04\u7684\u7c92\u5b50\u4e3a\u8be5\u84dd\u56fe\u7c7b\uff0c\u8fd9\u5df2\u7ecf\u5728\u4e4b\u524d\u7684\u5185\u5bb9\u51fa\u73b0\u8fc7\u5f88\u591a\u6b21\uff0c\u6545\u4e0d\u518d\u8d58\u8ff0\u3002<\/p>\n<p>&nbsp;<\/p>\n<h3 id='3-\u52a8\u753b\u8bbe\u7f6e'>3. \u52a8\u753b\u8bbe\u7f6e<\/h3>\n<p>\u6700\u540e\uff0c\u5728\u521b\u5efa\u7684\u84dd\u56fe\u7c7b\u4e2d\u8bbe\u7f6e\u7c92\u5b50\u7684\u52a8\u753b\u3002\u4e00\u5171\u9700\u8981\u8bbe\u7f6e\u4e24\u4e2a\u52a8\u753b\uff1a\u4e00\u662f\u53d1\u5c04\u51fa\u53bb\u7c92\u5b50\u7684\u6837\u5b50\uff0c\u5bf9\u5e94ProjectileBase\u4e2d\u7684Effect Comp\uff1b\u4e8c\u662f\u7206\u70b8\u65f6\u7684\u52a8\u753b\uff0c\u5bf9\u5e94\u521a\u521a\u58f0\u660e\u7684ImpactVFX\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u5728C++\u4e2d\u6211\u4eec\u5c06\u4e24\u4e2a\u5ef6\u8fdf\u4f7f\u7528UPROPERTY\u66b4\u9732\u5230\u4e86UE\u4e2d\uff0c\u6240\u4ee5\u6b64\u65f6\u53ef\u4ee5\u5f88\u65b9\u4fbf\u5730\u8c03\u8282\u6570\u636e\u3002\u6211\u5c06\u7206\u70b8\u5ef6\u8fdf\u8bbe\u7f6e\u4e3a1\uff0c\u4f20\u9001\u5ef6\u8fdf\u8bbe\u7f6e\u4e3a0.2\uff0c\u5373\u6b63\u5e38\u60c5\u51b5\u4e0b\u7c92\u5b50\u98de\u884c1s\u540e\u518d\u7ecf\u8fc70.2s\uff0c\u89d2\u8272\u4f1a\u4f20\u9001\u5230\u7c92\u5b50\u6700\u7ec8\u4f4d\u7f6e\u3002\u4f46\u5982\u679c\u7c92\u5b50\u9047\u5230\u969c\u788d\u7269\uff0c\u5219\u4ee3\u7801\u4e2d\u6e05\u9664Timer\u7684\u8bed\u53e5\u5c31\u4f1a\u53d1\u6325\u4f5c\u7528\uff0c\u57280.2s\u540e\u76f4\u63a5\u4f20\u9001\u89d2\u8272<\/p>\n<p><\/body><br \/>\n<\/html><\/p>\n","protected":false},"excerpt":{"rendered":"<p>UE \u6295\u5c04\u7269\u5b66\u4e60\u4e4b\u8def \u5b9e\u73b0\u53d1\u5c04\u7c92\u5b50 1. \u521b\u5efa\u9b54\u6cd5\u7c92\u5b50 \u5728UE\u4e2d\u4eceActor\u6d3e\u751f\u51fa\u4e00\u4e2a\u516c\u5171class\uff0c\u547d\u540d\u4e3aS [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,27],"tags":[4,5],"class_list":["post-288","post","type-post","status-publish","format-standard","hentry","category-ue","category-cs193u","tag-c","tag-ue"],"_links":{"self":[{"href":"https:\/\/www.vanforever.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/288","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vanforever.com.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vanforever.com.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vanforever.com.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vanforever.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=288"}],"version-history":[{"count":4,"href":"https:\/\/www.vanforever.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/288\/revisions"}],"predecessor-version":[{"id":523,"href":"https:\/\/www.vanforever.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/288\/revisions\/523"}],"wp:attachment":[{"href":"https:\/\/www.vanforever.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=288"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vanforever.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=288"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vanforever.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=288"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}