首页 > 解决方案 > 如何在ue4中停止终端

问题描述

嗨,我在 UE4 中有一个非常简单的游戏,我猜我制作了静态网格并添加了终端,所以它现在显示,当玩家用完直播时它应该结束我得到它

void UBullCowCartridge::BeginPlay() // When the game starts
{
    Super::BeginPlay();
    PrintLine(TEXT("DEV: Slovo je: "));
    PrintLine(TEXT("Riskuj"));
    PrintLine(TEXT("Budes hadat slovo"));
    PrintLine(TEXT("Mas 5 zivotu slovo je ISOGram (pismenka ve"));
    PrintLine(TEXT("slove se neopakuji)"));
    PrintLine(TEXT("pokud nejake pismeno bude dobre pricte se ti byk pokud nejake spatne pricte se ti"));
    PrintLine(TEXT("krava"));
    PrintLine(TEXT("Zacnes psat pomoci TAB tlacitka."));
    HiddenWord = TEXT("Svoboda");

}

void UBullCowCartridge::OnInput(const FString& Input) // When the player hits enter
{
    ClearScreen();
    if(Input == HiddenWord)
    {
        PrintLine(TEXT("You win!"));
    } else {
        PrintLine(TEXT("You lose"));
        --live;
    }

    if(live == 0) {
        end();      
        
    }
    
    
}

标签: functionif-statementterminal

解决方案


如果我理解正确,您想设置不可见的“终端”静态网格。在这种情况下,您可以这样做:

//don't forget cast the class containing mesh component

terminal_static_mesh_component->SetVisibility(false);

推荐阅读