C++ 生成Actor
AInventory* ABackPackCPPCharacter::GetInventory() { if (!Inventory) { FActorSpawnParameters Params; Params.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn; Params.Owner = this; Inventory = GetWorld()->SpawnActor<AInventory>(AInventory::StaticClass(), FTransform(), Params); } check(Inventory && "Inventory == NULL"); return Inventory; }