我发的这个是static mesh,跟skeletal mesh使用类似。你说的这个两个方法:第一种,你先在C++里写好语句,然后编译后在编辑器中选项框里点击调用你需要的skeletal mesh就行了。第二种,直接把需要调用的骨骼文件目录放到C++里面。我给你分别演示一下:
第一种方法:
[mw_shl_code=cpp,true]public:
UPROPERTY(Category = Mesh, VisibleDefaultsOnly, BlueprintReadWrite, meta = (AllowPrivateAccess = "true"))
class UStaticMeshComponent* APC_Body;
UPROPERTY(Category = Mesh, VisibleDefaultsOnly, BlueprintReadWrite, meta = (AllowPrivateAccess = "true"))
class UStaticMeshComponent* APC_Turret;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera, meta = (AllowPrivateAccess = "true"))
class UCameraComponent* FirstCameraComponent;[/mw_shl_code]
第二种方法:
[mw_shl_code=cpp,true] //资源加载
static ConstructorHelpers::FObjectFinder<USkeletalMesh> CarMesh(TEXT("/Game/Mesh/8_Wheel.8_Wheel"));
GetMesh()->SetSkeletalMesh(CarMesh.Object);
static ConstructorHelpers::FClassFinder<UObject> AnimBPClass(TEXT("/Game/Mesh/Vehicle8W-BP"));
GetMesh()->SetAnimInstanceClass(AnimBPClass.Class);[/mw_shl_code] |