i cant understand it too)
this is header
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
include “CoreMinimal.h”
include “Components/ActorComponent.h”
include “MagicComponent.generated.h”
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
class MYPROJECT2_API UMagicComponent : public UActorComponent
{
GENERATED_BODY()
public:
// Sets default values for this component’s properties
UMagicComponent();
void UseSpell();
void UseSpellWithCast();
UFUNCTION(BlueprintCallable)
void ChangeSpell(TSubclassOf<class ASpells_Base> NewSpell);
FString GetSpellName();
bool bCanDoMagic=true;
class UUserWidget* CastWidget;
UPROPERTY(EditAnywhere)
TSubclassOf<class UUserWidget> SpellCastWidget;
FTimerHandle MyTimerHandle;
void Casting();
class IINF_MainChar* CompOwner;
protected:
// Called when the game starts
virtual void BeginPlay() override;
public:
// Called every frame
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
UPROPERTY(EditAnywhere)
TSubclassOf<class ASpells_Base> MagicImpulseClass;
UPROPERTY(EditAnywhere)
TSubclassOf<class ASpells_Base> MagicBlastClass;
UPROPERTY()
class ASpells_Base* CurrentSpell;
private:
UPROPERTY(EditAnywhere)
TSubclassOf FirstSpellClass;
TSubclassOf CurrentSpellClass;
};