コード例 #1
0
ファイル: HealthBar.cpp プロジェクト: mcseyyy/ParallaxTD
void UHealthBar::AddToCreep()
{
	if (!GetIsVisible())
	{
		AddToViewport();
	}
	
	ABasicCreep *creep = Cast<ABasicCreep>(GetOwningPlayerPawn());
	if (creep)
	{
		hp = (float)creep->GetHP() / (float)creep->GetHP();

	}
}
コード例 #2
0
//called by the blueprint widget when server clicks the start game button.
void ULobby_Widget::InvertYAxis()
{
	AMainPlayerController* PC = Cast<AMainPlayerController>(GetOwningPlayerPawn()->Controller);

	PC->PlayerInput->InvertAxis("Pitch");
}
コード例 #3
0
FText UMyPlayerAmmoWidget::GetAmmo() const
{
	AMyCharacter* MyCharacter = Cast<AMyCharacter>(GetOwningPlayerPawn());
	return FText::FromString(FString::FromInt(MyCharacter->Data("Ammo")));
}