random bool
This commit is contained in:
parent
f9baa11ffa
commit
801df4cd21
Binary file not shown.
@ -8,6 +8,20 @@ ANPC::ANPC()
|
|||||||
PrimaryActorTick.bCanEverTick = true;
|
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()
|
FString ANPC::GetQuestionLeft()
|
||||||
{
|
{
|
||||||
if (NPC_Name == "Zyxel") {
|
if (NPC_Name == "Zyxel") {
|
||||||
|
@ -16,6 +16,12 @@ public:
|
|||||||
virtual void BeginPlay() override;
|
virtual void BeginPlay() override;
|
||||||
virtual void Tick(float DeltaTime) override;
|
virtual void Tick(float DeltaTime) override;
|
||||||
|
|
||||||
|
bool saveBool1 = true;
|
||||||
|
bool saveBool2 = true;
|
||||||
|
UFUNCTION(BlueprintCallable)
|
||||||
|
bool CustomRandomBool();
|
||||||
|
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
FString GetQuestionLeft();
|
FString GetQuestionLeft();
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
|
Loading…
Reference in New Issue
Block a user