https://differentdirection.youtrack.cloud/issue/OC-3/Replication-Projectiles complete #3
BIN
Content/ProofOfConcept/ProjectileBase_BP.uasset
Normal file
BIN
Content/ProofOfConcept/ProjectileBase_BP.uasset
Normal file
Binary file not shown.
BIN
Content/Worlds/_GENERATED/Core/ProjectileBase.uasset
Normal file
BIN
Content/Worlds/_GENERATED/Core/ProjectileBase.uasset
Normal file
Binary file not shown.
34
Source/OpenConflict/Weapons/Projectiles/ProjectileBase.cpp
Normal file
34
Source/OpenConflict/Weapons/Projectiles/ProjectileBase.cpp
Normal file
@@ -0,0 +1,34 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "ProjectileBase.h"
|
||||
|
||||
// Sets default values
|
||||
AProjectileBase::AProjectileBase()
|
||||
{
|
||||
// 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;
|
||||
|
||||
collision = CreateDefaultSubobject<USphereComponent>("Collision");
|
||||
RootComponent = collision;
|
||||
|
||||
projectileMesh = CreateDefaultSubobject<UStaticMeshComponent>("ProjectileMesh");
|
||||
projectileMesh->SetupAttachment(collision);
|
||||
|
||||
projectileMotion = CreateDefaultSubobject<UProjectileMovementComponent>("ProjectileMovementComponent");
|
||||
}
|
||||
|
||||
// Called when the game starts or when spawned
|
||||
void AProjectileBase::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
|
||||
}
|
||||
|
||||
// Called every frame
|
||||
void AProjectileBase::Tick(float DeltaTime)
|
||||
{
|
||||
Super::Tick(DeltaTime);
|
||||
|
||||
}
|
||||
|
||||
61
Source/OpenConflict/Weapons/Projectiles/ProjectileBase.h
Normal file
61
Source/OpenConflict/Weapons/Projectiles/ProjectileBase.h
Normal file
@@ -0,0 +1,61 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Components/SphereComponent.h"
|
||||
#include "GameFramework/Actor.h"
|
||||
#include "GameFramework/ProjectileMovementComponent.h"
|
||||
#include "ProjectileBase.generated.h"
|
||||
|
||||
UCLASS()
|
||||
class OPENCONFLICT_API AProjectileBase : public AActor
|
||||
{
|
||||
GENERATED_BODY()
|
||||
/*UPROPERTY and UFUNCTION declarations*/
|
||||
private:
|
||||
/*Properties*/
|
||||
|
||||
/*Functions*/
|
||||
|
||||
protected:
|
||||
/*Properties*/
|
||||
|
||||
/*Functions*/
|
||||
|
||||
public:
|
||||
/*Properties*/
|
||||
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Projectile")
|
||||
UStaticMeshComponent* projectileMesh;
|
||||
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Projectile")
|
||||
USphereComponent* collision;
|
||||
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Projectile")
|
||||
UProjectileMovementComponent* projectileMotion;
|
||||
|
||||
/*Functions*/
|
||||
|
||||
/*C++ only declarations*/
|
||||
private:
|
||||
/*Properties*/
|
||||
|
||||
/*Functions*/
|
||||
|
||||
protected:
|
||||
/*Properties*/
|
||||
|
||||
/*Functions*/
|
||||
// Called when the game starts
|
||||
virtual void BeginPlay() override;
|
||||
|
||||
public:
|
||||
/*Properties*/
|
||||
|
||||
/*Functions*/
|
||||
|
||||
// Called every frame
|
||||
virtual void Tick(float DeltaTime) override;
|
||||
|
||||
// Sets default values for this actor's properties
|
||||
AProjectileBase();
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user