Advertisement
Guest User

Health class

a guest
Nov 28th, 2015
337
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1. ////////////////////////////// HEALTH.H
  2.  
  3. #pragma once
  4.  
  5. #include "Pickup.h"
  6. #include "Health.generated.h"
  7.  
  8. UCLASS()
  9. class MYPROJECTCPP_API AHealth : public APickup
  10. {
  11.     GENERATED_BODY()
  12.  
  13. public:
  14.     AHealth();
  15.  
  16.     UFUNCTION(BlueprintCallable, Category = "OnPickup")
  17.     void OnPickup();
  18.  
  19. protected:
  20.     // Methods
  21.     UFUNCTION(BlueprintCallable, Category = "Health")
  22.     int32 CalculateFinalHealth(int32 PlayerHealth, int32 AddingHealth);
  23.    
  24. };
  25.  
  26.  
  27.  
  28. //////////////////////////// HEALTH.CPP
  29.  
  30. // Fill out your copyright notice in the Description page of Project Settings.
  31.  
  32. #include "MyProjectCPP.h"
  33. #include "Health.h"
  34. #include "Engine.h"
  35.  
  36. void AHealth::OnPickup()
  37. {
  38.     GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, FString::Printf(TEXT("HEALTH PICKED!")));
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement