Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Fill out your copyright notice in the Description page of Project Settings.
- #pragma once
- #include "CoreMinimal.h"
- #include "GameFramework/Character.h"
- #include "InputActionValue.h"//Struct header file
- #include "CharacterTypes.h"
- #include "SlashCharacter.generated.h"
- class UInputMappingContext;
- class UInputAction;
- class USpringArmComponent;
- class UCameraComponent;
- class UGroomComponent;
- class AItem;
- class UAnimMontage;
- class AWeapon;
- UCLASS()
- class SLASH_API ASlashCharacter : public ACharacter
- {
- GENERATED_BODY()
- public:
- // Sets default values for this character's properties
- ASlashCharacter();
- UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input)
- UInputMappingContext* SlashMappingContext;
- UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input)
- UInputAction* MovementAction;
- UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input)
- UInputAction* LookAction;
- UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input)
- UInputAction* JumpAction;
- UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input)
- UInputAction* EquipAction;
- UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input)
- UInputAction* AttackAction;
- UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input)
- UInputAction* DodgeAction;
- // Called every frame
- virtual void Tick(float DeltaTime) override;
- // Called to bind functionality to input
- virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
- UFUNCTION(BlueprintCallable)
- void SetWeaponCollisionEnable(ECollisionEnabled::Type CollisionEnabled);
- //UFUNCTION(BlueprintCallable)
- //void SetWeaponCollisionDisable(ECollisionEnabled::Type CollisionEnabled);
- protected:
- // Called when the game starts or when spawned
- virtual void BeginPlay() override;
- /*
- Callbacks for inputs
- */
- void Move(const FInputActionValue& Value);
- void Look(const FInputActionValue& Value);
- void Jump();
- void Equip();
- void Attack();
- void Dodge();
- /*
- Play Montage Functions
- */
- void PlayAttackMontage();
- UFUNCTION(BlueprintCallable)
- void AttackEnd();
- bool CanAttack();
- void PlayeEquipMontage(const FName& SectionName);
- bool CanDisarm();
- bool CanArm();
- UFUNCTION(BlueprintCallable)
- void Disarm();
- UFUNCTION(BlueprintCallable)
- void Arm();
- UFUNCTION(BlueprintCallable)
- void FinishEquipping();
- private:
- ECharacterState CharacterState = ECharacterState::ECS_Unequipped;
- UPROPERTY(BlueprintReadWrite, meta = (AllowPrivateAccess = "true"))
- EActionState ActionState = EActionState::EAS_Unoccupied;
- UPROPERTY(VisibleAnywhere, Category = "Camera")
- USpringArmComponent* CameraBoom;
- UPROPERTY(VisibleAnywhere, Category = "Camera")
- UCameraComponent* ViewCamera;
- UPROPERTY(VisibleAnywhere, Category = Hair)
- UGroomComponent* Hair;
- UPROPERTY(VisibleAnywhere, Category = Hair)
- UGroomComponent* Eyebrows;
- UPROPERTY(VisibleInstanceOnly)
- AItem* OverlapingItem;
- UPROPERTY(VisibleAnywhere, Category = Weapon)
- AWeapon* EquippedWeapon;
- /*
- Animation Montages
- */
- UPROPERTY(EditDefaultsOnly, Category = Montages)
- UAnimMontage* AttackMontage;
- UPROPERTY(EditDefaultsOnly, Category = Montages)
- UAnimMontage* EquipMontage;
- public:
- FORCEINLINE void SetOverlappingItem(AItem* Item) { OverlapingItem = Item; }//inline or FORCEINLINE
- FORCEINLINE ECharacterState GetCharacterState() const { return CharacterState; }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement