1. 파츠별로 나뉜 메쉬 (사실 각메쉬는 전체 스켈레톤 트리정보를 가지고있음)
2. Character Actor BP에서 드래곤볼
3. BP에서 Master로 설정한 SKM component의 값, 포인터 호출 공유
작동 테스트
'Unreal > Animation' 카테고리의 다른 글
UE Animation 구조 (0) | 2024.05.20 |
---|---|
Anim Asset 구조 (0) | 2024.05.16 |
1. 파츠별로 나뉜 메쉬 (사실 각메쉬는 전체 스켈레톤 트리정보를 가지고있음)
2. Character Actor BP에서 드래곤볼
3. BP에서 Master로 설정한 SKM component의 값, 포인터 호출 공유
작동 테스트
UE Animation 구조 (0) | 2024.05.20 |
---|---|
Anim Asset 구조 (0) | 2024.05.16 |
Subsystem (0) | 2024.05.16 |
---|---|
Field (0) | 2024.05.16 |
기본 구성 리스트 (0) | 2024.05.16 |
부모 | 자식 | ||
부모.h | 부모(호출).cpp | 자식.h | 자식(실행).cpp |
DECLARE_MULTICAST_DELEGATE([Delegate 클래스명 선언]); UClass() { [Delegate 클래스명] [Delegate 객체]; } |
호출 [Delegate 객체].Broadcast(); ( multi일 경우 ) [Delegate 객체].ExcuteIfBound(); ( single일 경우 ) |
[부모class]->[Delegate 객체].AddUObject([자식](타겟 함수를 보유한 class의 객체), &[타겟 함수]); ( multi일 경우 ) ( single은 BindUObject // UObject 외에도 TsharedReference, Function 등 존재 ) |
|
- static 함수로 BlueprintCallable함수를 만듬 ( delegate를 포함한 class의 생성 함수 )
- dynamic delegate는 BlueprintAssignable로 지정
class ADispatcherTest;
부모.h
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Components/BoxComponent.h"
#include "Components/SceneComponent.h"
#include "Components/ArrowComponent.h"
#include "DisPatcherChild.h"
#include "GameFramework/Actor.h"
#include "DispatcherTest.generated.h"
DECLARE_MULTICAST_DELEGATE(TurnLightDelegate);
UCLASS()
class MYPROJECT_API ADispatcherTest final : public AActor
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
ADispatcherTest();
UPROPERTY(EditAnywhere, blueprintReadWrite, Category = "Dispatcher")
USceneComponent* RootComp;
UPROPERTY(EditAnywhere, blueprintReadWrite, Category = "Dispatcher")
UBoxComponent* BoxComp;
UPROPERTY(EditAnywhere, blueprintReadWrite, Category = "Dispatcher")
UArrowComponent* ArrowComp;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dispatcher")
UStaticMeshComponent* BoxMesh;
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
bool bIsOn = false;
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Dispatcher")
TArray<ADisPatcherChild*> MyChildren;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dispatcher")
int32 ChildCount=5;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dispatcher")
TSubclassOf<ADisPatcherChild> ChildClass;
UFUNCTION(BlueprintCallable, Category = "Dispatcher")
void CreateChildActor(int Count, TArray<ADisPatcherChild*>& ChildrenArr) const;
UFUNCTION()
void OnOverlapBegin(UPrimitiveComponent* OverlappedComp, AActor* OtherActor,
UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep,
const FHitResult& SweepResult);
TurnLightDelegate TurnLightDelegatePtr; // 1. Declare a delegate pointer
};
부모.cpp
// Fill out your copyright notice in the Description page of Project Settings.
#include "DispatcherTest.h"
#include "ActorReferencesUtils.h"
// Sets default values
ADispatcherTest::ADispatcherTest()
{
// 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;
RootComp = CreateDefaultSubobject<USceneComponent>(TEXT("Root"));
RootComponent = RootComp;
BoxComp = CreateDefaultSubobject<UBoxComponent>(TEXT("BoxComp"));
BoxComp->SetupAttachment(RootComponent);
BoxComp->SetRelativeScale3D(FVector(2, 2, 2));
ArrowComp = CreateDefaultSubobject<UArrowComponent>(TEXT("ArrowComp"));
ArrowComp->SetRelativeRotation(FRotator(0, 90, 0));
ArrowComp->SetupAttachment(RootComponent);
BoxMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("BoxMesh"));
BoxMesh->SetRelativeScale3D(FVector(0.64, 0.64, 0.64));
BoxMesh->SetCollisionEnabled(ECollisionEnabled::NoCollision);
BoxMesh->SetupAttachment(BoxComp);
BoxComp->OnComponentBeginOverlap.AddDynamic(this, &ADispatcherTest::OnOverlapBegin);
}
// Called when the game starts or when spawned
void ADispatcherTest::BeginPlay()
{
Super::BeginPlay();
CreateChildActor(ChildCount, MyChildren);
}
// Called every frame
void ADispatcherTest::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}
void ADispatcherTest::CreateChildActor(const int Count, TArray<ADisPatcherChild*>& ChildrenArr) const
{
for (int i = 0; i <= Count; i++)
{
FVector TargetLoc = GetActorLocation() + FVector(0, 100*i, 0);
TargetLoc -= this->GetActorLocation();
TargetLoc = FRotationMatrix(RootComponent->GetComponentTransform().Rotator()).TransformPosition(TargetLoc);
TargetLoc += this->GetActorLocation();
AActor* TempChild;
TempChild = GetWorld()->SpawnActorDeferred<AActor>(ChildClass, FTransform(TargetLoc), nullptr, nullptr, ESpawnActorCollisionHandlingMethod::AlwaysSpawn);
TempChild->FinishSpawning(FTransform(TargetLoc));
if (ADisPatcherChild* Child = Cast<ADisPatcherChild>(TempChild))
{
ADispatcherTest* SelfRef = const_cast<ADispatcherTest*>(this);
Child->InitFunction( SelfRef );
ChildrenArr.Add(Child);
}
}
//ParentActor->TurnLightDelegatePtr.BindSP(this, &ADisPatcherChild::TurnLight);
}
void ADispatcherTest::OnOverlapBegin(UPrimitiveComponent* OverlappedComp, AActor* OtherActor,
UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
{
UE_LOG(LogTemp, Log, TEXT("Overlap Begin"));
TurnLightDelegatePtr.Broadcast();
//TurnLightDelegatePtr.ExecuteIfBound();
자식.h
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
//#include "DispatcherTest.h"
#include "Components/ArrowComponent.h"
#include "Components/SphereComponent.h"
#include "Components/SceneComponent.h"
#include "Components/StaticMeshComponent.h"
#include "Components/PointLightComponent.h"
#include "GameFramework/Actor.h"
#include "DisPatcherChild.generated.h"
class ADispatcherTest;
UCLASS()
class MYPROJECT_API ADisPatcherChild : public AActor
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
ADisPatcherChild();
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dispatcher")
USceneComponent* RootComp;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dispatcher")
USphereComponent* SphereComp;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dispatcher")
UStaticMeshComponent* SphereMesh;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dispatcher")
UPointLightComponent* PointLightComp;
bool bIsOn = false;
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
UFUNCTION(BlueprintCallable, Category = "Dispatcher")
void TurnLight();
void InitFunction(ADispatcherTest* ParentActor);
};
자식.cpp
// Fill out your copyright notice in the Description page of Project Settings.
#include "DisPatcherChild.h"
#include "DispatcherTest.h"
// Sets default values
ADisPatcherChild::ADisPatcherChild()
{
// 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;
RootComp = CreateDefaultSubobject<USceneComponent>(TEXT("Root"));
RootComponent = RootComp;
SphereComp = CreateDefaultSubobject<USphereComponent>(TEXT("sphereComp"));
SphereComp->SetupAttachment(RootComponent);
SphereMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("SphereMesh"));
SphereMesh->SetRelativeLocation(FVector(0, 0, 0));
SphereMesh->SetRelativeScale3D(FVector(0.5, 0.5, 0.5));
SphereMesh->SetupAttachment(SphereComp);
//SphereMesh->SetStaticMesh(ConstructorHelpers::FObjectFinder<UStaticMesh>(TEXT("StaticMesh'/Engine/BasicShapes/Sphere.Sphere'")).Object);
PointLightComp = CreateDefaultSubobject<UPointLightComponent>(TEXT("PointLightComp"));
PointLightComp->SetRelativeLocation(FVector(0, 0, 100));
PointLightComp->SetupAttachment(RootComponent);
PointLightComp->SetIntensity(1000);
}
// Called when the game starts or when spawned
void ADisPatcherChild::BeginPlay()
{
Super::BeginPlay();
}
// Called every frame
void ADisPatcherChild::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}
void ADisPatcherChild::TurnLight()
{
if (bIsOn == false) // 불켜기
{
UE_LOG(LogTemp, Log, TEXT("TurnOn"));
PointLightComp->SetIntensity(100000);
bIsOn = true;
}
else// if (bIsOn == true) // 불끄기
{
UE_LOG(LogTemp, Log, TEXT("TurnOff"));
PointLightComp->SetIntensity(1000);
bIsOn = false;
}
}
void ADisPatcherChild::InitFunction(ADispatcherTest* ParentActor)
{
ADispatcherTest* ParentIns = Cast<ADispatcherTest>(ParentActor);
UE_LOG(LogTemp, Log, TEXT("Initted Child"));
//ParentIns->TurnLightDelegatePtr.BindUObject( this , &ADisPatcherChild::TurnLight);
//ParentIns->TurnLightDelegatePtr.BindUFunction(this, FName("TurnLight"));
ParentIns->TurnLightDelegatePtr.AddUObject(this, &ADisPatcherChild::TurnLight);
//ParentIns->TurnLightDelegatePtr.BindUObject(this, &ADisPatcherChild::TurnLight);
}
Class Name 접두 (0) | 2024.05.17 |
---|---|
code 내장 함수 (0) | 2024.05.17 |
BP Interface (0) | 2024.05.16 |
BP node list 1 (0) | 2024.05.16 |
BP Node 리스트 (0) | 2024.05.16 |
Animation Blueprint
몽타주
|
|
Blend Space
UE Animation 구조 (0) | 2024.05.20 |
---|---|
Skeletal Mesh 모듈화 기능 ( Set Leader Pose Component ) (0) | 2024.05.16 |
Class Name 접두 (0) | 2024.05.17 |
---|---|
code 내장 함수 (0) | 2024.05.17 |
BP Interface (0) | 2024.05.16 |
BP node list 1 (0) | 2024.05.16 |
UE Dispatch & Delegate (0) | 2024.05.16 |
https://blog.naver.com/PostView.naver?blogId=happynewmind&logNo=221562652852
Commands (0) | 2024.05.16 |
---|
횡스크롤 슈팅 게임
움직임
코어
조작특징
그래픽특징
감성
UI 특징
보스 패턴 규칙
실패 연출
성공 연출
영화관모드인데, 캐릭터는 프레임을 뚫고나오네 - 배경과 캐릭터를 분리 → 정적인 배경과 동적인 캐릭터를 더 강하게 대비시킴
인터랙션 가능한 대상 ( 입장가능한 건물, 확인가능한 오브젝트, NPC )는 모두 움직임 혹은 떨림효과를 가짐 - 움직임 기반 구분
Carto (0) | 2024.05.16 |
---|---|
보드 게임 (0) | 2024.05.16 |