saving/loading systems successfully migrated to player controller

This commit is contained in:
Ji Yoon Rhee 2024-09-05 11:43:15 +09:00
parent 95f07b67ac
commit eeaf691a1a
12 changed files with 71 additions and 13 deletions

Binary file not shown.

Binary file not shown.

View File

@ -28,6 +28,9 @@ public:
UFUNCTION(BlueprintImplementableEvent) UFUNCTION(BlueprintImplementableEvent)
void ReloadCraftUI(); void ReloadCraftUI();
UFUNCTION(BlueprintImplementableEvent)
void SaveGameplay();
UFUNCTION(BlueprintCallable, Category = "Utils") UFUNCTION(BlueprintCallable, Category = "Utils")
int32 GetInventoryWeight(); int32 GetInventoryWeight();

View File

@ -0,0 +1,22 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "HYSaveGameActor.h"
#include "HYPlayerCharacController.h"
AHYSaveGameActor::AHYSaveGameActor()
{
SavepointMesh = CreateDefaultSubobject<UStaticMeshComponent>("SavepointMesh");
RootComponent = Cast<USceneComponent>(SavepointMesh);
Super::Name = "Haetae statue";
Super::Action = "touch";
}
void AHYSaveGameActor::Interact_Implementation(APlayerController* Controller)
{
Super::Interact_Implementation(Controller);
AHYPlayerCharacController* IController = Cast<AHYPlayerCharacController>(Controller);
IController->SaveGameplay();
}

View File

@ -0,0 +1,27 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "HYInteractableActor.h"
#include "HYSaveGameActor.generated.h"
/**
*
*/
UCLASS()
class HWANYOUNG2_API AHYSaveGameActor : public AHYInteractableActor
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
AHYSaveGameActor();
void Interact_Implementation(APlayerController* Controller) override;
protected:
UPROPERTY(EditDefaultsOnly)
UStaticMeshComponent* SavepointMesh;
};