add go to bed
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,35 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "Bed.h"
|
||||
|
||||
// Sets default values
|
||||
ABed::ABed()
|
||||
{
|
||||
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
|
||||
PrimaryActorTick.bCanEverTick = true;
|
||||
Root = CreateDefaultSubobject<USceneComponent>(TEXT("Root"));
|
||||
RootComponent = Root;
|
||||
|
||||
Body = CreateAbstractDefaultSubobject<UStaticMeshComponent>(TEXT("Body"));
|
||||
Body->SetupAttachment(Root);
|
||||
BoxCollision = CreateDefaultSubobject<UBoxComponent>(TEXT("Box Collision"));
|
||||
BoxCollision->SetupAttachment(Root);
|
||||
}
|
||||
|
||||
// Called when the game starts or when spawned
|
||||
void ABed::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
// Called every frame
|
||||
void ABed::Tick(float DeltaTime)
|
||||
{
|
||||
Super::Tick(DeltaTime);
|
||||
|
||||
}*/
|
||||
|
||||
@@ -23,6 +23,7 @@ void AFemale::BeginPlay()
|
||||
capsule->OnComponentEndOverlap.AddDynamic(this, &AFemale::OnOverlapEnd);
|
||||
maxMood = 0.0f;
|
||||
currentMood = 0.0f;
|
||||
isGoToBed = false;
|
||||
GetData();
|
||||
}
|
||||
|
||||
@@ -38,8 +39,8 @@ void AFemale::OnOverlapBegin(UPrimitiveComponent* OverlappedComp, AActor* OtherA
|
||||
UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep,
|
||||
const FHitResult& SweepResult)
|
||||
{
|
||||
|
||||
|
||||
if(!isGoToBed)
|
||||
{
|
||||
UE_LOG(LogTemp, Warning, TEXT("not in place"), InPlace);
|
||||
ItemForWork = Cast<ABaseItem>(OtherActor);
|
||||
if (!ItemForWork->used && ItemForWork->nameItem == NameItem)
|
||||
@@ -48,7 +49,7 @@ void AFemale::OnOverlapBegin(UPrimitiveComponent* OverlappedComp, AActor* OtherA
|
||||
//StartUseItem();
|
||||
UE_LOG(LogTemp, Warning, TEXT("start anim working"));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void AFemale::OnOverlapEnd(UPrimitiveComponent* OverlappedComp, AActor* OtherActor,
|
||||
@@ -89,6 +90,7 @@ void AFemale::CheckingUpset()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void AFemale::MoodDecreace()
|
||||
{
|
||||
|
||||
@@ -114,7 +116,10 @@ void AFemale::EndUseItem_Implementation()
|
||||
void AFemale::whatShouldIDo_Implementation()
|
||||
{
|
||||
}
|
||||
|
||||
void AFemale::SetIsGoToBed(bool goes)
|
||||
{
|
||||
isGoToBed = goes;
|
||||
}
|
||||
|
||||
|
||||
// Called every frame
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameFramework/Actor.h"
|
||||
#include "Components/BoxComponent.h"
|
||||
#include "Bed.generated.h"
|
||||
|
||||
UCLASS()
|
||||
class WBIF_API ABed : public AActor
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
// Sets default values for this actor's properties
|
||||
ABed();
|
||||
|
||||
protected:
|
||||
// Called when the game starts or when spawned
|
||||
virtual void BeginPlay() override;
|
||||
// ===================Variables===================================
|
||||
|
||||
UPROPERTY(EditAnyWhere, BlueprintReadWrite, Category = "Objects")
|
||||
USceneComponent* Root;
|
||||
UPROPERTY(EditAnyWhere, BlueprintReadWrite, Category = "Objects")
|
||||
UStaticMeshComponent* Body;
|
||||
UPROPERTY(EditAnyWhere, BlueprintReadWrite, Category = "Objects")
|
||||
UBoxComponent* BoxCollision;
|
||||
|
||||
public:
|
||||
// Called every frame
|
||||
//virtual void Tick(float DeltaTime) override;
|
||||
|
||||
};
|
||||
@@ -54,6 +54,8 @@ protected:
|
||||
FName NameItem;
|
||||
UPROPERTY(EditAnyWhere, BlueprintReadWrite, Category= "Data")
|
||||
UWBIFGameInstance* gameInstance;
|
||||
UPROPERTY(EditAnywhere, Category = "Data")
|
||||
bool isGoToBed;
|
||||
|
||||
|
||||
|
||||
@@ -71,6 +73,8 @@ public:
|
||||
void EndUseItem();
|
||||
UFUNCTION(BlueprintCallable, Category = "Mood")
|
||||
void CheckingUpset();
|
||||
UFUNCTION(BlueprintCallable, Category = "Dta")
|
||||
void SetIsGoToBed(bool goes);
|
||||
|
||||
// ===================Variable===================================
|
||||
UPROPERTY() // variable for timer
|
||||
|
||||
Reference in New Issue
Block a user