4#include "GameFramework/GameModeBase.h"
12 if(GetOwner()->GetClass()->ImplementsInterface(UPixoVRStoryObject::StaticClass()))
14 if(GetWorld()->GetAuthGameMode()->GetClass()->ImplementsInterface(UPixoCoreInterface::StaticClass()))
16 const auto GameMode = GetWorld()->GetAuthGameMode();
17 GameManager = Cast<UGameManager>(IPixoCoreInterface::Execute_GetManagerRef(GameMode, UGameManager::StaticClass()));
18 StoryManager = Cast<UStoryManager>(IPixoCoreInterface::Execute_GetManagerRef(GameMode, UStoryManager::StaticClass()));
30 GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red,
"Error - GameMode doesn't implement UPixoCoreInterface!");
35 const FString ErrorMassage =
"WARNING___Actor__" + GetOwner()->GetName() +
"__Has_Not_Implemented_BI_InteractableObjectInterface";
36 GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, ErrorMassage);
49 if (ScriptInstance.StepName.EqualTo(StepName))
51 ScriptInstance.StepScriptInstance->ExecuteScript(GetOwner());
57 UE_LOG(LogTemp,
Error, TEXT(
"Error - StoryComponent - GameManager, Story Manager is not valid!"));
65 bool StepFound =
false;
66 bool SubStepFound =
false;
83 if(GetOwner()->GetClass()->ImplementsInterface(UPixoVRStoryObject::StaticClass()))
90 IPixoVRStoryObject::Execute_ObjectActivated(GetOwner());
95 IPixoVRStoryObject::Execute_ObjectDeactivated(GetOwner());
100 GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red,
"PixoVRInteractiveObject interface not implemented!!!");
109 bool StepFound =
false;
110 bool SubStepFound =
false;
127 if(GetOwner()->GetClass()->ImplementsInterface(UPixoVRStoryObject::StaticClass()))
134 IPixoVRStoryObject::Execute_ObjectActivated(GetOwner());
139 IPixoVRStoryObject::Execute_ObjectDeactivated(GetOwner());
144 GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red,
"PixoVRInteractiveObject interface not implemented!!!");
TArray< FScriptInstanceData > ScriptInstancesData
UPROPERTY(BlueprintReadOnly, Category = "GamaManager|Script")
bool IsUsingStoryScriptData
UPROPERTY(EditDefaultsOnly, Category = "GameManager|Script")
FText ActiveStep
UPROPERTY(BlueprintReadWrite)
virtual void BeginPlay() override
TArray< FText > ActiveSteps
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Story|Setup")
UGameManager * GameManager
UPROPERTY(BlueprintReadOnly, Category = "Story|Setup")
void NewStep(FStoryStep NewStep, bool IsForward)
Called when a new step is reached in the story.
bool ObjectActive
UPROPERTY(BlueprintReadWrite)
FText ActiveSubStep
UPROPERTY(BlueprintReadWrite)
void StoryLoaded()
Called when the story is loaded.
void ExecuteScript()
UFUNCTION(BlueprintCallable, Category = "Story|Script")
void NewSubStep(FStoryStep NewSubStep)
Called when a new substep is reached in the story.
TArray< FText > ActiveSubSteps
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Story|Setup")
UStoryManager * StoryManager
UPROPERTY(BlueprintReadWrite)
FOnNewStep OnNewStep
UPROPERTY(BlueprintAssignable, Category = "Story Delegate")
FStoryStep CurrentSubStep
UPROPERTY(BlueprintReadWrite, Replicated)
FOnStoryLoaded OnStoryLoaded
UPROPERTY(BlueprintAssignable, Category = "Story Delegate")
FOnNewSubStep OnNewSubStep
UPROPERTY(BlueprintAssignable, Category = "Story Delegate")
FStoryStep CurrentStep
UPROPERTY(BlueprintReadWrite, Replicated)
FText StepName
UPROPERTY(BlueprintReadWrite, EditAnywhere)