示例#1
0
class UUserWidget* UHMIYCGameInstance::CreateUIWidget( const FString& Path )
{
    UClass* WidgetClass = StaticLoadClass( UUserWidget::StaticClass(), nullptr, *Path );

    UUserWidget* Widget = CreateWidget<UUserWidget>( GetWorld(), WidgetClass );

    Widget->AddToViewport( UI_ZORDER );

    Widget->SetVisibility( ESlateVisibility::Hidden );

    return Widget;
}
示例#2
0
void APoseidonCharacter::EndScene()
{
	if (IsEndScene == false)
	{
		PlayerHUD->ChangeCrosshair(EReticleEnum::RE_NO_RETICLE);
		APlayerController* PlayerController = UGameplayStatics::GetPlayerController(GetWorld(), 0);
		UUserWidget* WidgetInstance = CreateWidget<UUserWidget>(PlayerController, WidgetCreditsClass);
		WidgetInstance->AddToViewport();
		FName shouldLoop = FName("ShouldLoop");
		UBoolProperty* BoolProp = FindField<UBoolProperty>(WidgetInstance->GetClass(), shouldLoop);
		if (BoolProp != NULL)
		{
			BoolProp->SetPropertyValue_InContainer(WidgetInstance, false);
		}
		IsEndScene = true;

	}
}