Add combat deplacement inputs
This commit is contained in:
parent
10fc850f11
commit
37d62ed440
BIN
Pawn_Unreal/Content/Characters/BP_Judy.uasset
(Stored with Git LFS)
BIN
Pawn_Unreal/Content/Characters/BP_Judy.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Pawn_Unreal/Content/Core/GM_MainGameMode.uasset
(Stored with Git LFS)
BIN
Pawn_Unreal/Content/Core/GM_MainGameMode.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Pawn_Unreal/Content/Input/BP_MainPlayerController.uasset
(Stored with Git LFS)
BIN
Pawn_Unreal/Content/Input/BP_MainPlayerController.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Pawn_Unreal/Content/Input/IA_Move.uasset
(Stored with Git LFS)
BIN
Pawn_Unreal/Content/Input/IA_Move.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Pawn_Unreal/Content/Input/IA_Move_Combat.uasset
(Stored with Git LFS)
Normal file
BIN
Pawn_Unreal/Content/Input/IA_Move_Combat.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Pawn_Unreal/Content/Input/IA_Move_Narrative.uasset
(Stored with Git LFS)
Normal file
BIN
Pawn_Unreal/Content/Input/IA_Move_Narrative.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Pawn_Unreal/Content/Input/IMC_Judy_Combat.uasset
(Stored with Git LFS)
Normal file
BIN
Pawn_Unreal/Content/Input/IMC_Judy_Combat.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Pawn_Unreal/Content/Systems/Camera/BP_MainCameraManager.uasset
(Stored with Git LFS)
BIN
Pawn_Unreal/Content/Systems/Camera/BP_MainCameraManager.uasset
(Stored with Git LFS)
Binary file not shown.
@ -0,0 +1,17 @@
|
||||
#include "GameplayModes/PwnGameplayModeLibrary.h"
|
||||
|
||||
#include "GameplayModes/PwnGameplayModeSubsystem.h"
|
||||
|
||||
bool UPwnGameplayModeLibrary::IsNarrativeMode(UObject* WorldContext) {
|
||||
const UWorld* World = GEngine->GetWorldFromContextObject(WorldContext, EGetWorldErrorMode::LogAndReturnNull);
|
||||
const UPwnGameplayModeSubsystem* Subsystem = World->GetSubsystem<UPwnGameplayModeSubsystem>();
|
||||
check(Subsystem);
|
||||
return Subsystem->IsNarrativeMode();
|
||||
}
|
||||
|
||||
bool UPwnGameplayModeLibrary::IsCombatMode(UObject* WorldContext) {
|
||||
const UWorld* World = GEngine->GetWorldFromContextObject(WorldContext, EGetWorldErrorMode::LogAndReturnNull);
|
||||
const UPwnGameplayModeSubsystem* Subsystem = World->GetSubsystem<UPwnGameplayModeSubsystem>();
|
||||
check(Subsystem);
|
||||
return Subsystem->IsCombatMode();
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
#include "GameplayModes/PwnGameplayModeSubsystem.h"
|
||||
|
||||
void UPwnGameplayModeSubsystem::Initialize(FSubsystemCollectionBase& Collection) {
|
||||
Super::Initialize(Collection);
|
||||
CurrentGameplayMode = EPwnGameplayMode::Narrative;
|
||||
}
|
||||
|
||||
void UPwnGameplayModeSubsystem::Deinitialize() {
|
||||
Super::Deinitialize();
|
||||
}
|
||||
|
||||
void UPwnGameplayModeSubsystem::SetGameplayMode(EPwnGameplayMode GameplayMode) {
|
||||
if (GameplayMode != CurrentGameplayMode) {
|
||||
CurrentGameplayMode = GameplayMode;
|
||||
if (OnGameplayModeChanged.IsBound()) {
|
||||
OnGameplayModeChanged.Broadcast(CurrentGameplayMode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EPwnGameplayMode UPwnGameplayModeSubsystem::GetCurrentGameplayMode() const {
|
||||
return CurrentGameplayMode;
|
||||
}
|
||||
|
||||
bool UPwnGameplayModeSubsystem::IsNarrativeMode() const {
|
||||
return CurrentGameplayMode == EPwnGameplayMode::Narrative;
|
||||
}
|
||||
bool UPwnGameplayModeSubsystem::IsCombatMode() const {
|
||||
return CurrentGameplayMode == EPwnGameplayMode::Combat;
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Kismet/BlueprintFunctionLibrary.h"
|
||||
#include "PwnGameplayModeLibrary.generated.h"
|
||||
|
||||
UCLASS(DisplayName="Gameplay Mode Library")
|
||||
class PAWN_API UPwnGameplayModeLibrary : public UBlueprintFunctionLibrary {
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
UFUNCTION(BlueprintCallable, BlueprintPure, Category="Gameplay Modes", meta=(WorldContext="WorldContext", HidePin="WorldContext"))
|
||||
static bool IsNarrativeMode(UObject* WorldContext);
|
||||
|
||||
UFUNCTION(BlueprintCallable, BlueprintPure, Category="Gameplay Modes", meta=(WorldContext="WorldContext", HidePin="WorldContext"))
|
||||
static bool IsCombatMode(UObject* WorldContext);
|
||||
};
|
||||
@ -0,0 +1,42 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Subsystems/WorldSubsystem.h"
|
||||
#include "PwnGameplayModeSubsystem.generated.h"
|
||||
|
||||
UENUM(BlueprintType, DisplayName = "Gameplay Mode")
|
||||
enum class EPwnGameplayMode : uint8 {
|
||||
Narrative,
|
||||
Combat
|
||||
};
|
||||
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FGameplayModeChangedDelegate, EPwnGameplayMode, NewMode);
|
||||
|
||||
UCLASS(DisplayName="Gameplay Mode Subsystem")
|
||||
class PAWN_API UPwnGameplayModeSubsystem : public UWorldSubsystem {
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
virtual void Initialize(FSubsystemCollectionBase& Collection) override;
|
||||
|
||||
virtual void Deinitialize() override;
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="Gameplay Modes")
|
||||
void SetGameplayMode(EPwnGameplayMode GameplayMode);
|
||||
|
||||
UFUNCTION(BlueprintCallable, BlueprintPure, Category="Gameplay Modes")
|
||||
EPwnGameplayMode GetCurrentGameplayMode() const;
|
||||
|
||||
UFUNCTION(BlueprintCallable, BlueprintPure, Category="Gameplay Modes")
|
||||
bool IsNarrativeMode() const;
|
||||
|
||||
UFUNCTION(BlueprintCallable, BlueprintPure, Category="Gameplay Modes")
|
||||
bool IsCombatMode() const;
|
||||
|
||||
public:
|
||||
UPROPERTY(BlueprintAssignable)
|
||||
FGameplayModeChangedDelegate OnGameplayModeChanged;
|
||||
|
||||
private:
|
||||
EPwnGameplayMode CurrentGameplayMode;
|
||||
};
|
||||
Loading…
x
Reference in New Issue
Block a user