Skip to content

Instantly share code, notes, and snippets.

@fornof
Created August 6, 2018 17:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fornof/f78211e5242f5fb050874a947e0e7726 to your computer and use it in GitHub Desktop.
Save fornof/f78211e5242f5fb050874a947e0e7726 to your computer and use it in GitHub Desktop.
MorganFreemanActor.cpp
// Fill out your copyright notice in the Description page of Project Settings.
//#include "..\Source\Runtime\MediaAssets\Public\MediaPlayer.h" // this does not want to compile
#include "MorganFreemanActor.h"
// Sets default values
AMorganFreemanActor::AMorganFreemanActor()
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
TotalDamage = 200;
DamageTimeInSeconds = 1.4f;
}
//AMorganFreemanActor::AMorganFreemanActor() :
// TotalDamage(200),
// DamageTimeInSeconds(1.f)
//{}
// Called when the game starts or when spawned
void AMorganFreemanActor::BeginPlay()
{
Super::BeginPlay();
//UMediaPlayer * PlayTest;
}
// Called every frame
void AMorganFreemanActor::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}
void AMorganFreemanActor::CalculateValues()
{
DamagePerSecond = TotalDamage / DamageTimeInSeconds;
}
void AMorganFreemanActor::PostInitProperties()
{
Super::PostInitProperties();
CalculateValues();
}
#if WITH_EDITOR
void AMorganFreemanActor::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent)
{
CalculateValues();
Super::PostEditChangeProperty(PropertyChangedEvent);
}
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment