📜  获取玩家棋子 - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:52.258000             🧑  作者: Mango

代码示例1
//file to include
#include "Kismet/GameplayStatics.h"

//Syntax
static APawn * GetPlayerPawn(const UObject * WorldContextObject, int32 PlayerIndex);

//ExampleCode
APawn* PlayerPawn = UGameplayStatics::GetPlayerPawn(GetWorld(), 0);
//                                this is a reference to world  | This is the index of player which you want. In this case  have written 0 that means the first player
//For more information vist https://docs.unrealengine.com/en-US/API/Runtime/Engine/Kismet/UGameplayStatics/GetPlayerPawn/index.html