some small changes
This commit is contained in:
@@ -14,6 +14,10 @@ ACCharacter::ACCharacter()
|
||||
|
||||
CAbilitySystemComponent = CreateDefaultSubobject<UCAbilitySystemComponent>(TEXT("Ability System Component"));
|
||||
CAttributeSet = CreateDefaultSubobject<UCAttributeSet>(TEXT("CAttribute Set"));
|
||||
/**
|
||||
* This is also valid
|
||||
* CAttributeSet = CAbilitySystemComponent->GetSet<UCAttributeSet>();
|
||||
**/
|
||||
}
|
||||
|
||||
void ACCharacter::ServerSideInit()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Multipalyer By Caleb
|
||||
// Multiplayer By Caleb
|
||||
|
||||
|
||||
#include "Crunch/Public/Player/CPlayerController.h"
|
||||
@@ -8,8 +8,7 @@
|
||||
void ACPlayerController::OnPossess(APawn* InPawn)
|
||||
{
|
||||
Super::OnPossess(InPawn);
|
||||
CPlayerCharacter = Cast<ACPlayerCharacter>(InPawn);
|
||||
if (CPlayerCharacter)
|
||||
if (CPlayerCharacter = Cast<ACPlayerCharacter>(InPawn); IsValid(CPlayerCharacter))
|
||||
{
|
||||
CPlayerCharacter->ServerSideInit();
|
||||
}
|
||||
@@ -18,8 +17,7 @@ void ACPlayerController::OnPossess(APawn* InPawn)
|
||||
void ACPlayerController::AcknowledgePossession(class APawn* P)
|
||||
{
|
||||
Super::AcknowledgePossession(P);
|
||||
CPlayerCharacter = Cast<ACPlayerCharacter>(P);
|
||||
if (CPlayerCharacter)
|
||||
if (CPlayerCharacter = Cast<ACPlayerCharacter>(P); IsValid(CPlayerCharacter))
|
||||
{
|
||||
CPlayerCharacter->ClientSideInit();
|
||||
}
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
#include "GameFramework/Character.h"
|
||||
#include "CCharacter.generated.h"
|
||||
|
||||
class UCAbilitySystemComponent;
|
||||
class UCAttributeSet;
|
||||
|
||||
UCLASS()
|
||||
class CRUNCH_API ACCharacter : public ACharacter, public IAbilitySystemInterface
|
||||
{
|
||||
@@ -24,7 +27,7 @@ public:
|
||||
|
||||
private:
|
||||
UPROPERTY(EditDefaultsOnly, Category="Gameplay Effects")
|
||||
class UCAbilitySystemComponent* CAbilitySystemComponent;
|
||||
UPROPERTY()
|
||||
class UCAttributeSet* CAttributeSet;
|
||||
UCAbilitySystemComponent* CAbilitySystemComponent;
|
||||
UPROPERTY(BlueprintReadOnly, Category="Gameplay Effects", meta=(AllowPrivateAccess=true))
|
||||
const UCAttributeSet* CAttributeSet;
|
||||
};
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
#include "CAbilitySystemComponent.generated.h"
|
||||
|
||||
|
||||
UCLASS(ClassGroup=(Custom), meta=(BlueprintSpawnableComponent))
|
||||
class CRUNCH_API UCAbilitySystemComponent : public UAbilitySystemComponent
|
||||
{
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include "AttributeSet.h"
|
||||
#include "CAttributeSet.generated.h"
|
||||
|
||||
|
||||
/**
|
||||
* This defines a set of helper functions for accessing and initializing attributes, to avoid having to manually write these functions.
|
||||
* It would creates the following functions, for attribute Health
|
||||
|
||||
@@ -6,9 +6,6 @@
|
||||
#include "GameFramework/GameModeBase.h"
|
||||
#include "CGameMode.generated.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS()
|
||||
class CRUNCH_API ACGameMode : public AGameModeBase
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@ class CRUNCH_API ACPlayerController : public APlayerController
|
||||
|
||||
public:
|
||||
virtual void OnPossess(APawn* InPawn) override;
|
||||
virtual void AcknowledgePossession(class APawn* P) override;
|
||||
virtual void AcknowledgePossession(APawn* P) override;
|
||||
|
||||
private:
|
||||
UPROPERTY()
|
||||
|
||||
Reference in New Issue
Block a user