1
0

random bool

This commit is contained in:
ZetaKebab 2018-09-02 19:11:44 +02:00
parent f9baa11ffa
commit 801df4cd21
3 changed files with 20 additions and 0 deletions

Binary file not shown.

View File

@ -8,6 +8,20 @@ ANPC::ANPC()
PrimaryActorTick.bCanEverTick = true;
}
bool ANPC::CustomRandomBool()
{
bool bool1 = FMath::RandBool();
if (bool1 == saveBool1 && bool1 == saveBool2) {
saveBool2 = saveBool1;
saveBool1 = !bool1;
return !bool1;
}
saveBool2 = saveBool1;
saveBool1 = bool1;
return bool1;
}
FString ANPC::GetQuestionLeft()
{
if (NPC_Name == "Zyxel") {

View File

@ -16,6 +16,12 @@ public:
virtual void BeginPlay() override;
virtual void Tick(float DeltaTime) override;
bool saveBool1 = true;
bool saveBool2 = true;
UFUNCTION(BlueprintCallable)
bool CustomRandomBool();
UFUNCTION(BlueprintCallable)
FString GetQuestionLeft();
UFUNCTION(BlueprintCallable)