Advertisement
fcamuso

Unreal Engine - 10

Aug 16th, 2023
700
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.76 KB | None | 0 0
  1. //MyActor.h
  2. // Fill out your copyright notice in the Description page of Project Settings.
  3.  
  4. #pragma once
  5.  
  6. #include "CoreMinimal.h"
  7. #include "GameFramework/Actor.h"
  8. #include "MyActor.generated.h"
  9.  
  10. UCLASS()
  11. class THIRDPERSONTEST_1_API AMyActor : public AActor
  12. {
  13.     GENERATED_BODY()
  14.    
  15. public:
  16.     // Sets default values for this actor's properties
  17.     AMyActor();
  18.  
  19. protected:
  20.     // Called when the game starts or when spawned
  21.     virtual void BeginPlay() override;
  22.  
  23.     APawn *player = nullptr;
  24.    
  25. public:
  26.     // Called every frame
  27.     virtual void Tick(float DeltaTime) override;
  28.  
  29.     UFUNCTION(BlueprintCallable, Category = "My Input")
  30.     void OnFire();
  31.  
  32.     UFUNCTION(BlueprintCallable, Category = "My Input")
  33.         void OnAim();
  34.  
  35.     UFUNCTION(BlueprintCallable, Category = "My Input")
  36.         void OnNoAim();
  37.  
  38.  
  39.     UPROPERTY(EditAnywhere, BlueprintReadWrite)
  40.     int32 salute = 999;
  41.  
  42. };
  43.  
  44. ///////////////////////////
  45. MyActor.cpp
  46.  
  47. // Fill out your copyright notice in the Description page of Project Settings.
  48.  
  49. #pragma once
  50.  
  51. #include "CoreMinimal.h"
  52. #include "GameFramework/Actor.h"
  53. #include "MyActor.generated.h"
  54.  
  55. UCLASS()
  56. class THIRDPERSONTEST_1_API AMyActor : public AActor
  57. {
  58.     GENERATED_BODY()
  59.    
  60. public:
  61.     // Sets default values for this actor's properties
  62.     AMyActor();
  63.  
  64. protected:
  65.     // Called when the game starts or when spawned
  66.     virtual void BeginPlay() override;
  67.  
  68.     APawn *player = nullptr;
  69.    
  70. public:
  71.     // Called every frame
  72.     virtual void Tick(float DeltaTime) override;
  73.  
  74.     UFUNCTION(BlueprintCallable, Category = "My Input")
  75.     void OnFire();
  76.  
  77.     UFUNCTION(BlueprintCallable, Category = "My Input")
  78.         void OnAim();
  79.  
  80.     UFUNCTION(BlueprintCallable, Category = "My Input")
  81.         void OnNoAim();
  82.  
  83.  
  84.     UPROPERTY(EditAnywhere, BlueprintReadWrite)
  85.     int32 salute = 999;
  86.  
  87. };
  88.  
  89.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement