saving/loading systems successfully migrated to player controller
This commit is contained in:
@ -28,6 +28,9 @@ public:
|
||||
UFUNCTION(BlueprintImplementableEvent)
|
||||
void ReloadCraftUI();
|
||||
|
||||
UFUNCTION(BlueprintImplementableEvent)
|
||||
void SaveGameplay();
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "Utils")
|
||||
int32 GetInventoryWeight();
|
||||
|
||||
|
22
hwanyoung2/Source/hwanyoung2/HYSaveGameActor.cpp
Normal file
22
hwanyoung2/Source/hwanyoung2/HYSaveGameActor.cpp
Normal 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();
|
||||
}
|
27
hwanyoung2/Source/hwanyoung2/HYSaveGameActor.h
Normal file
27
hwanyoung2/Source/hwanyoung2/HYSaveGameActor.h
Normal 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;
|
||||
|
||||
};
|
Reference in New Issue
Block a user