Skip to content

Instantly share code, notes, and snippets.

@shadowmint
Created March 18, 2015 02:02
Show Gist options
  • Save shadowmint/f30607a4d18f85e6c838 to your computer and use it in GitHub Desktop.
Save shadowmint/f30607a4d18f85e6c838 to your computer and use it in GitHub Desktop.
// Fill out your copyright notice in the Description page of Project Settings.
#include "HelloWorld.h"
#include "Sample1.h"
#include "Sample2.h"
// Sets default values
ASample1::ASample1()
{
// 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;
}
// Called when the game starts or when spawned
void ASample1::BeginPlay()
{
Super::BeginPlay();
}
// Called every frame
void ASample1::Tick( float DeltaTime )
{
Super::Tick( DeltaTime );
}
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "Shared.h"
#include "GameFramework/Actor.h"
#include "Sample1.generated.h"
UCLASS()
class HELLOWORLD_API ASample1 : public AActor
{
GENERATED_BODY()
public:
// Or TWeakObjectPtr or whatever
ASample2 *two;
// Sets default values for this actor's properties
ASample1();
// Called when the game starts or when spawned
virtual void BeginPlay() override;
// Called every frame
virtual void Tick( float DeltaSeconds ) override;
};
// Fill out your copyright notice in the Description page of Project Settings.
#include "HelloWorld.h"
#include "Sample2.h"
#include "Sample1.h"
// Sets default values
ASample2::ASample2()
{
// 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;
}
// Called when the game starts or when spawned
void ASample2::BeginPlay()
{
Super::BeginPlay();
}
// Called every frame
void ASample2::Tick( float DeltaTime )
{
Super::Tick( DeltaTime );
}
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "Shared.h"
#include "GameFramework/Actor.h"
#include "Sample2.generated.h"
UCLASS()
class HELLOWORLD_API ASample2 : public AActor
{
GENERATED_BODY()
public:
// Or TWeakObjectPtr or whatever
ASample1 *one;
// Sets default values for this actor's properties
ASample2();
// Called when the game starts or when spawned
virtual void BeginPlay() override;
// Called every frame
virtual void Tick( float DeltaSeconds ) override;
};
#ifndef ASample2__HEADER
#define ASample2__HEADER
class ASample2;
#endif
#ifndef ASample1__HEADER
#define ASample1__HEADER
class ASample1;
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment