Update Character for Loaf Crouch
This commit is contained in:
parent
d1b19e6f71
commit
9fc962cd77
BIN
SeagullGame/Content/John/BP_John.uasset
(Stored with Git LFS)
BIN
SeagullGame/Content/John/BP_John.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
SeagullGame/Content/TopDown/Blueprints/BP_SeagullPlayer.uasset
(Stored with Git LFS)
BIN
SeagullGame/Content/TopDown/Blueprints/BP_SeagullPlayer.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
SeagullGame/Content/TopDown/Blueprints/edwin_loaf.uasset
(Stored with Git LFS)
Normal file
BIN
SeagullGame/Content/TopDown/Blueprints/edwin_loaf.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
SeagullGame/Content/TopDown/Blueprints/standardSurface1.uasset
(Stored with Git LFS)
Normal file
BIN
SeagullGame/Content/TopDown/Blueprints/standardSurface1.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
SeagullGame/Content/TopDown/Input/Actions/IAS_Crouch.uasset
(Stored with Git LFS)
Normal file
BIN
SeagullGame/Content/TopDown/Input/Actions/IAS_Crouch.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
SeagullGame/Content/TopDown/Input/IMC_DefaultMain.uasset
(Stored with Git LFS)
BIN
SeagullGame/Content/TopDown/Input/IMC_DefaultMain.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
SeagullGame/Content/__ExternalActors__/TopDown/Maps/TopDownMap/8/4X/3W1TJMD96Q8MJD7QM7AWU7.uasset
(Stored with Git LFS)
BIN
SeagullGame/Content/__ExternalActors__/TopDown/Maps/TopDownMap/8/4X/3W1TJMD96Q8MJD7QM7AWU7.uasset
(Stored with Git LFS)
Binary file not shown.
@ -156,6 +156,22 @@ void ASeagullGameCharacter::EndGame()
|
||||
OnGameEnd.Broadcast("You Win!");
|
||||
}
|
||||
|
||||
void ASeagullGameCharacter::CrouchActionPressed(const FInputActionValue& Value)
|
||||
{
|
||||
GetMesh()->SetVisibility(false);
|
||||
TArray<UActorComponent*> ActorComponents = GetComponentsByTag(UStaticMeshComponent::StaticClass(), "Loaf");
|
||||
UStaticMeshComponent* StaticMeshComponent = Cast<UStaticMeshComponent>(ActorComponents[0]);
|
||||
StaticMeshComponent->SetVisibility(true);
|
||||
}
|
||||
|
||||
void ASeagullGameCharacter::CrouchActionUnPressed(const FInputActionValue& Value)
|
||||
{
|
||||
GetMesh()->SetVisibility(true);
|
||||
TArray<UActorComponent*> ActorComponents = GetComponentsByTag(UStaticMeshComponent::StaticClass(), "Loaf");
|
||||
UStaticMeshComponent* StaticMeshComponent = Cast<UStaticMeshComponent>(ActorComponents[0]);
|
||||
StaticMeshComponent->SetVisibility(false);
|
||||
}
|
||||
|
||||
void ASeagullGameCharacter::PickupItem()
|
||||
{
|
||||
OnPlayerPickupItem.Broadcast();
|
||||
@ -229,6 +245,10 @@ void ASeagullGameCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInp
|
||||
|
||||
//Pickup
|
||||
EnhancedInputComponent->BindAction(PickupAction, ETriggerEvent::Started, this, &ASeagullGameCharacter::PickupItem);
|
||||
|
||||
//Crouch
|
||||
EnhancedInputComponent->BindAction(CrouchAction, ETriggerEvent::Started, this, &ASeagullGameCharacter::CrouchActionPressed);
|
||||
EnhancedInputComponent->BindAction(CrouchAction, ETriggerEvent::Completed, this, &ASeagullGameCharacter::CrouchActionUnPressed);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -53,6 +53,10 @@ public:
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input, meta = (AllowPrivateAccess = "true"))
|
||||
class UInputAction* PickupAction;
|
||||
|
||||
/** Crouch Input Action */
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input, meta = (AllowPrivateAccess = "true"))
|
||||
class UInputAction* CrouchAction;
|
||||
|
||||
/** Move Input Action */
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input, meta = (AllowPrivateAccess = "true"))
|
||||
class UInputAction* MoveAction;
|
||||
@ -85,6 +89,10 @@ public:
|
||||
float GameTime = 120;
|
||||
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "General")
|
||||
float Score = 0;
|
||||
UFUNCTION(Category = "General")
|
||||
void CrouchActionPressed(const FInputActionValue& Value);
|
||||
UFUNCTION(Category = "General")
|
||||
void CrouchActionUnPressed(const FInputActionValue& Value);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "Item")
|
||||
void PickupItem();
|
||||
|
Loading…
Reference in New Issue
Block a user