Add `RandomWeapon` Class
This commit is contained in:
parent
4363d2ad23
commit
e83659123e
|
@ -0,0 +1,19 @@
|
||||||
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
|
||||||
|
#include "RandomWeapon.h"
|
||||||
|
|
||||||
|
ARandomWeapon::ARandomWeapon()
|
||||||
|
{
|
||||||
|
RandomWeaponParameters = CreateDefaultSubobject<URandomWeaponParameters>(TEXT("Random Weapon Parameters"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void ARandomWeapon::BeginPlay()
|
||||||
|
{
|
||||||
|
WeaponProperties = RandomWeaponParameters->GenerateRandomWeaponProperties();
|
||||||
|
WeaponSkeletalMesh = RandomWeaponParameters->PickRandomMesh();
|
||||||
|
FireSound = RandomWeaponParameters->PickRandomSoundBase();
|
||||||
|
FieldSystemActor = RandomWeaponParameters->PickRandomFieldSystem();
|
||||||
|
|
||||||
|
Super::BeginPlay();
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "CoreMinimal.h"
|
||||||
|
#include "RandomWeaponParameters.h"
|
||||||
|
#include "Weapon.h"
|
||||||
|
#include "RandomWeapon.generated.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
UCLASS()
|
||||||
|
class NAKATOMI_API ARandomWeapon : public AWeapon
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
UPROPERTY(VisibleAnywhere, Category = "Random Weapon Parameters")
|
||||||
|
URandomWeaponParameters* RandomWeaponParameters;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
ARandomWeapon();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void BeginPlay() override;
|
||||||
|
};
|
Loading…
Reference in New Issue