17 - Creating the HUD Blueprint

修正BatteryCollectorGameMode
float ABatteryCollectorGameMode::GetPowerToWin()const
{
return PowerToWin;
}

创建一个UI Widget batteryHUD

17 - Creating the HUD Blueprint_第1张图片
Paste_Image.png

面板中创建一个ProgressBar 调整大小位置 并且绑定Progress下的Percent

Paste_Image.png

修改绑定时间 计算角色当前power / GameMode中设置的Win Power 作为进度

17 - Creating the HUD Blueprint_第2张图片
Paste_Image.png

创建以上面c++类为父类的子GameMode 蓝图类 修改Power/ HUDWidgetClass 为刚才创建的UI Widget

17 - Creating the HUD Blueprint_第3张图片
Paste_Image.png

编译运行

你可能感兴趣的:(17 - Creating the HUD Blueprint)