4#include "GameFramework/GameModeBase.h"
13 if(GetOwner()->GetClass()->ImplementsInterface(UPixoVRStoryObject::StaticClass()))
15 if(GetWorld()->GetAuthGameMode()->GetClass()->ImplementsInterface(UPixoCoreInterface::StaticClass()))
17 const auto GameMode = GetWorld()->GetAuthGameMode();
18 GameManager = Cast<UGameManager>(IPixoCoreInterface::Execute_GetManagerRef(GameMode, UGameManager::StaticClass()));
25 StoryManager = Cast<UStoryManager>(IPixoCoreInterface::Execute_GetManagerRef(GameMode, UStoryManager::StaticClass()));
37 GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red,
"Error - GameMode doesn't implement UPixoCoreInterface!");
42 const FString ErrorMassage =
"WARNING___Actor__" + GetOwner()->GetName() +
"__Has_Not_Implemented_BI_InteractableObjectInterface";
43 GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, ErrorMassage);
56 if (ScriptInstance.StepName.EqualTo(StepName))
58 ScriptInstance.StepScriptInstance->ExecuteScript(GetOwner());
64 UE_LOG(LogTemp, Error, TEXT(
"Error - StoryComponent - GameManager, Story Manager is not valid!"));
72 bool StepFound =
false;
73 bool SubStepFound =
false;
90 if(GetOwner()->GetClass()->ImplementsInterface(UPixoVRStoryObject::StaticClass()))
97 IPixoVRStoryObject::Execute_ObjectActivated(GetOwner());
102 IPixoVRStoryObject::Execute_ObjectDeactivated(GetOwner());
107 GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red,
"PixoVRInteractiveObject interface not implemented!!!");
116 bool StepFound =
false;
117 bool SubStepFound =
false;
134 if(GetOwner()->GetClass()->ImplementsInterface(UPixoVRStoryObject::StaticClass()))
141 IPixoVRStoryObject::Execute_ObjectActivated(GetOwner());
146 IPixoVRStoryObject::Execute_ObjectDeactivated(GetOwner());
151 GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red,
"PixoVRInteractiveObject interface not implemented!!!");
Base class for story actors.
void AddNewInteractableObject(ABaseStoryActor *InteractableActor)
UFUNCTION(BlueprintCallable, Category = "GameManager|InteractiveItems")
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)