Added new dials to the oven, added material for the fire with offset
Migrated some assets from another repo, added new float curves and actions. Created new material with twinkling over time and gradient color. Added knobs and button needles to the oven
This commit is contained in:
parent
b800f29c3e
commit
b01e9b5891
26 changed files with 35 additions and 8 deletions
BIN
Content/Blueprints/Curves/FireScaleXY.uasset
Normal file
BIN
Content/Blueprints/Curves/FireScaleXY.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprints/Curves/FireScaleZ.uasset
Normal file
BIN
Content/Blueprints/Curves/FireScaleZ.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprints/Input/IA_ActivateKnob.uasset
Normal file
BIN
Content/Blueprints/Input/IA_ActivateKnob.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprints/Input/IA_KnobMoveController.uasset
Normal file
BIN
Content/Blueprints/Input/IA_KnobMoveController.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprints/Input/IA_KnobMoveKeyboard.uasset
Normal file
BIN
Content/Blueprints/Input/IA_KnobMoveKeyboard.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprints/Input/IA_KnobToggleKeyboard.uasset
Normal file
BIN
Content/Blueprints/Input/IA_KnobToggleKeyboard.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprints/Input/IA_OpenMenu.uasset
Normal file
BIN
Content/Blueprints/Input/IA_OpenMenu.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprints/Input/IA_OvenKnobSelection.uasset
Normal file
BIN
Content/Blueprints/Input/IA_OvenKnobSelection.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprints/Input/IA_SelectKnobLeft.uasset
Normal file
BIN
Content/Blueprints/Input/IA_SelectKnobLeft.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprints/Input/IA_SelectKnobRight.uasset
Normal file
BIN
Content/Blueprints/Input/IA_SelectKnobRight.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprints/Input/IMC_Furnace.uasset
Normal file
BIN
Content/Blueprints/Input/IMC_Furnace.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprints/Materials/MI_Fire.uasset
Normal file
BIN
Content/Blueprints/Materials/MI_Fire.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprints/Materials/M_Fire.uasset
Normal file
BIN
Content/Blueprints/Materials/M_Fire.uasset
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -20,6 +20,20 @@ AOvenCookspot::AOvenCookspot()
|
|||
CookpotMesh->SetupAttachment(RootComponent);
|
||||
}
|
||||
|
||||
void AOvenCookspot::UpdateFire(const float DeltaTime) const
|
||||
{
|
||||
if (FireScaleCurveXY && FireScaleCurveZ && FireMesh)
|
||||
{
|
||||
const float ScaleXY = FireScaleCurveXY->GetFloatValue(CurrentHeat);
|
||||
const float ScaleZ = FireScaleCurveZ->GetFloatValue(CurrentHeat);
|
||||
FireMesh->SetWorldScale3D(FVector(ScaleXY, ScaleXY, ScaleZ));
|
||||
}
|
||||
else
|
||||
{
|
||||
UE_LOG(LogTemp, Error, TEXT("FireScaleCurveXY, FireScaleCurveZ or FireMesh is null"));
|
||||
}
|
||||
}
|
||||
|
||||
// Called when the game starts or when spawned
|
||||
void AOvenCookspot::BeginPlay()
|
||||
{
|
||||
|
|
@ -28,8 +42,9 @@ void AOvenCookspot::BeginPlay()
|
|||
}
|
||||
|
||||
// Called every frame
|
||||
void AOvenCookspot::Tick(float DeltaTime)
|
||||
void AOvenCookspot::Tick(const float DeltaTime)
|
||||
{
|
||||
Super::Tick(DeltaTime);
|
||||
|
||||
UpdateFire(DeltaTime);
|
||||
}
|
||||
|
|
@ -15,6 +15,9 @@ public:
|
|||
// Sets default values for this actor's properties
|
||||
AOvenCookspot();
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "Cookspot")
|
||||
void UpdateFire(const float DeltaTime) const;
|
||||
|
||||
protected:
|
||||
// Called when the game starts or when spawned
|
||||
virtual void BeginPlay() override;
|
||||
|
|
@ -24,8 +27,6 @@ public:
|
|||
virtual void Tick(float DeltaTime) override;
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||
TObjectPtr<USceneComponent> RootComp;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||
TObjectPtr<UStaticMeshComponent> FireMesh;
|
||||
|
|
@ -35,4 +36,13 @@ public:
|
|||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||
TObjectPtr<UStaticMeshComponent> CookpotMesh;
|
||||
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Default")
|
||||
TObjectPtr<UCurveFloat> FireScaleCurveXY;
|
||||
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Default")
|
||||
TObjectPtr<UCurveFloat> FireScaleCurveZ;
|
||||
private:
|
||||
// [0.0, 1.0]
|
||||
double CurrentHeat;
|
||||
};
|
||||
|
|
@ -112,6 +112,9 @@ void AOvenPawn::BeginPlay()
|
|||
{
|
||||
Super::BeginPlay();
|
||||
|
||||
Cookstoves.AddDefaulted(CookspotLocations.Num());
|
||||
|
||||
size_t CookspotIdx{0};
|
||||
for (const AActor *CookspotLoc : CookspotLocations)
|
||||
{
|
||||
FActorSpawnParameters SpawnParameters;
|
||||
|
|
@ -120,11 +123,9 @@ void AOvenPawn::BeginPlay()
|
|||
CookspotLoc->GetTransform(),
|
||||
SpawnParameters);
|
||||
OvenCookspotActor->SetActorLocation(CookspotLoc->GetActorLocation());
|
||||
CookstoveObjects.Add(OvenCookspotActor);
|
||||
Cookstoves[CookspotIdx].OvenCookstoveActor = OvenCookspotActor;
|
||||
CookspotIdx++;
|
||||
}
|
||||
// Setup the cookstove related items
|
||||
Cookstoves.AddDefaulted(CookspotLocations.Num());
|
||||
checkf(Cookstoves.Num() == CookstoveObjects.Num(), TEXT("Cookstoves and CookstoveObjects have different sizes"))
|
||||
}
|
||||
|
||||
void AOvenPawn::Tick(float DeltaTime)
|
||||
|
|
|
|||
|
|
@ -69,6 +69,8 @@ struct FCookstove
|
|||
|
||||
FCookingStats CookingStats{};
|
||||
|
||||
TObjectPtr<AOvenCookspot> OvenCookstoveActor;
|
||||
|
||||
/**
|
||||
* @brief Given a @param DataTablePtr and a @param MealID, configure the cookstove to start cooking the meal.
|
||||
* @return Returns whether we found a meal with the provided @param MealID and successfully started cooking it.
|
||||
|
|
@ -151,6 +153,5 @@ public:
|
|||
|
||||
private:
|
||||
// An array of all the cookstoves, from left to right on the screen.
|
||||
TArray<TObjectPtr<AOvenCookspot>> CookstoveObjects;
|
||||
TArray<FCookstove> Cookstoves;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue