Compare commits
2 Commits
8a585c3a64
...
22ce1ea591
Author | SHA1 | Date | |
---|---|---|---|
22ce1ea591 | |||
af3da182c4 |
@ -9,7 +9,8 @@
|
|||||||
"Type": "Runtime",
|
"Type": "Runtime",
|
||||||
"LoadingPhase": "Default",
|
"LoadingPhase": "Default",
|
||||||
"AdditionalDependencies": [
|
"AdditionalDependencies": [
|
||||||
"Engine"
|
"Engine",
|
||||||
|
"GameplayAbilities"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -20,6 +21,10 @@
|
|||||||
"TargetAllowList": [
|
"TargetAllowList": [
|
||||||
"Editor"
|
"Editor"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "GameplayAbilities",
|
||||||
|
"Enabled": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -8,9 +8,9 @@ public class Aura : ModuleRules
|
|||||||
{
|
{
|
||||||
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
|
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
|
||||||
|
|
||||||
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "EnhancedInput" });
|
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "EnhancedInput", "GameplayAbilities" });
|
||||||
|
|
||||||
PrivateDependencyModuleNames.AddRange(new string[] { });
|
PrivateDependencyModuleNames.AddRange(new string[] { "GameplayTags", "GameplayTasks" });
|
||||||
|
|
||||||
// Uncomment if you are using Slate UI
|
// Uncomment if you are using Slate UI
|
||||||
// PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
|
// PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
// Copyright; GhostPacket Games
|
||||||
|
|
||||||
|
|
||||||
|
#include "AbilitySystem/AuraAbilitySystemComponent.h"
|
||||||
|
|
5
Source/Aura/Private/AbilitySystem/AuraAttributeSet.cpp
Normal file
5
Source/Aura/Private/AbilitySystem/AuraAttributeSet.cpp
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
// Copyright; GhostPacket Games
|
||||||
|
|
||||||
|
|
||||||
|
#include "AbilitySystem/AuraAttributeSet.h"
|
||||||
|
|
@ -10,7 +10,12 @@ AAuraCharacterBase::AAuraCharacterBase()
|
|||||||
Weapon->SetCollisionEnabled(ECollisionEnabled::NoCollision);
|
Weapon->SetCollisionEnabled(ECollisionEnabled::NoCollision);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UAbilitySystemComponent* AAuraCharacterBase::GetAbilitySystemComponent() const
|
||||||
|
{
|
||||||
|
return AbilitySystemComponent;
|
||||||
|
}
|
||||||
|
|
||||||
void AAuraCharacterBase::BeginPlay()
|
void AAuraCharacterBase::BeginPlay()
|
||||||
{
|
{
|
||||||
Super::BeginPlay();
|
Super::BeginPlay();
|
||||||
}
|
}
|
||||||
|
@ -3,11 +3,18 @@
|
|||||||
|
|
||||||
#include "Character/AuraEnemy.h"
|
#include "Character/AuraEnemy.h"
|
||||||
|
|
||||||
|
#include "AbilitySystem/AuraAbilitySystemComponent.h"
|
||||||
|
#include "AbilitySystem/AuraAttributeSet.h"
|
||||||
#include "Aura/Aura.h"
|
#include "Aura/Aura.h"
|
||||||
|
|
||||||
AAuraEnemy::AAuraEnemy()
|
AAuraEnemy::AAuraEnemy()
|
||||||
{
|
{
|
||||||
GetMesh()->SetCollisionResponseToChannel(ECC_Visibility, ECR_Block);
|
GetMesh()->SetCollisionResponseToChannel(ECC_Visibility, ECR_Block);
|
||||||
|
|
||||||
|
AbilitySystemComponent = CreateDefaultSubobject<UAuraAbilitySystemComponent>("AbilitySystemComponent");
|
||||||
|
AbilitySystemComponent->SetIsReplicated(true);
|
||||||
|
|
||||||
|
AttributeSet = CreateDefaultSubobject<UAuraAttributeSet>("AttributeSet");
|
||||||
}
|
}
|
||||||
|
|
||||||
void AAuraEnemy::HighlightActor()
|
void AAuraEnemy::HighlightActor()
|
||||||
|
@ -3,7 +3,20 @@
|
|||||||
|
|
||||||
#include "Player/AuraPlayerState.h"
|
#include "Player/AuraPlayerState.h"
|
||||||
|
|
||||||
|
#include "AbilitySystem/AuraAbilitySystemComponent.h"
|
||||||
|
#include "AbilitySystem/AuraAttributeSet.h"
|
||||||
|
|
||||||
AAuraPlayerState::AAuraPlayerState()
|
AAuraPlayerState::AAuraPlayerState()
|
||||||
{
|
{
|
||||||
NetUpdateFrequency = 100.f;
|
AbilitySystemComponent = CreateDefaultSubobject<UAuraAbilitySystemComponent>("AbilitySystemComponent");
|
||||||
|
AbilitySystemComponent->SetIsReplicated(true);
|
||||||
|
|
||||||
|
AttributeSet = CreateDefaultSubobject<UAuraAttributeSet>("AttributeSet");
|
||||||
|
|
||||||
|
SetNetUpdateFrequency(100.f);
|
||||||
|
}
|
||||||
|
|
||||||
|
UAbilitySystemComponent* AAuraPlayerState::GetAbilitySystemComponent() const
|
||||||
|
{
|
||||||
|
return AbilitySystemComponent;
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,16 @@
|
|||||||
|
// Copyright; GhostPacket Games
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "CoreMinimal.h"
|
||||||
|
#include "AbilitySystemComponent.h"
|
||||||
|
#include "AuraAbilitySystemComponent.generated.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
UCLASS()
|
||||||
|
class AURA_API UAuraAbilitySystemComponent : public UAbilitySystemComponent
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
};
|
17
Source/Aura/Public/AbilitySystem/AuraAttributeSet.h
Normal file
17
Source/Aura/Public/AbilitySystem/AuraAttributeSet.h
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
// Copyright; GhostPacket Games
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "CoreMinimal.h"
|
||||||
|
#include "AttributeSet.h"
|
||||||
|
#include "AuraAttributeSet.generated.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
UCLASS()
|
||||||
|
class AURA_API UAuraAttributeSet : public UAttributeSet
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
};
|
@ -3,20 +3,32 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
|
#include "AbilitySystemInterface.h"
|
||||||
#include "GameFramework/Character.h"
|
#include "GameFramework/Character.h"
|
||||||
#include "AuraCharacterBase.generated.h"
|
#include "AuraCharacterBase.generated.h"
|
||||||
|
|
||||||
|
class UAbilitySystemComponent;
|
||||||
|
class UAttributeSet;
|
||||||
|
|
||||||
UCLASS(Abstract) // Abstract so that it cannot be dragged to a level
|
UCLASS(Abstract) // Abstract so that it cannot be dragged to a level
|
||||||
class AURA_API AAuraCharacterBase : public ACharacter
|
class AURA_API AAuraCharacterBase : public ACharacter, public IAbilitySystemInterface
|
||||||
{
|
{
|
||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AAuraCharacterBase();
|
AAuraCharacterBase();
|
||||||
|
virtual UAbilitySystemComponent* GetAbilitySystemComponent() const override;
|
||||||
|
UAttributeSet* GetAttributeSet() const { return AttributeSet; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void BeginPlay() override;
|
virtual void BeginPlay() override;
|
||||||
|
|
||||||
UPROPERTY(EditAnywhere, Category = "Combat")
|
UPROPERTY(EditAnywhere, Category = "Combat")
|
||||||
TObjectPtr<USkeletalMeshComponent> Weapon;
|
TObjectPtr<USkeletalMeshComponent> Weapon;
|
||||||
|
|
||||||
|
UPROPERTY ()
|
||||||
|
TObjectPtr<UAbilitySystemComponent> AbilitySystemComponent;
|
||||||
|
|
||||||
|
UPROPERTY ()
|
||||||
|
TObjectPtr<UAttributeSet> AttributeSet;
|
||||||
};
|
};
|
||||||
|
@ -3,17 +3,27 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
|
#include "AbilitySystemInterface.h"
|
||||||
#include "GameFramework/PlayerState.h"
|
#include "GameFramework/PlayerState.h"
|
||||||
#include "AuraPlayerState.generated.h"
|
#include "AuraPlayerState.generated.h"
|
||||||
|
|
||||||
/**
|
class UAbilitySystemComponent;
|
||||||
*
|
class UAttributeSet;
|
||||||
*/
|
|
||||||
UCLASS()
|
UCLASS()
|
||||||
class AURA_API AAuraPlayerState : public APlayerState
|
class AURA_API AAuraPlayerState : public APlayerState, public IAbilitySystemInterface
|
||||||
{
|
{
|
||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AAuraPlayerState();
|
AAuraPlayerState();
|
||||||
|
virtual UAbilitySystemComponent* GetAbilitySystemComponent() const override;
|
||||||
|
UAttributeSet* GetAttributeSet() const { return AttributeSet; }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
UPROPERTY()
|
||||||
|
TObjectPtr<UAbilitySystemComponent> AbilitySystemComponent;
|
||||||
|
|
||||||
|
UPROPERTY()
|
||||||
|
TObjectPtr<UAttributeSet> AttributeSet;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user