2Bbear's knowledge workshop

caution!!

this document is made in Unreal Ver 4.14

--------------------------------------------------------------------------------------------------------------------------------


언리얼 내부에서 새로운 클래스를 만드려면 file -> 새로운 c++클래스를 눌러야합니다.

if you made New Class for c++, you must touch [File]->make New C++ Class



그 후 부모 클래스를 선택하게 되는데 

부모 클래스라 함은 앞으로 만들 클래스가 상속받을 클래스를 말합니다.

after that must choose parents class in this window

parents class is base class ,now made this class


자신이 만든 클래스 또한 이와 같이 상속을 받을 수 있습니다. 부모 클래스 선택창의 우측 상단에 있는 모든 클래스 표시를 체크 후 자신의 클래스를 찾아 상속을 받을 수 있습니다.

also made class use as a parents class. you can check this [All Class Show] box . and you found you made class   


Actor 클래스 상속 -> 월드에 배치 또는 스폰시킬때 사용하는 클래스입니다.

Actor class inherit -> this parent class is use when world spawn, placement.

Pawn 클래스 상속 -> '빙의'(카메라의 시점이 변경 되거나, 컨트롤러의 주도권이 변경되거나)하여 컨트롤러에서 

입력을 받으려고 할 때 사용하는 클래스입니다.

Pawn class inherit -> this parent class is use when you possession in game object

Character클래스 상속-> World 내에서 돌아다니는 물리법칙을 적용시키거나 움직임을 표현하려 할때 쓰입니다.

Character class inherit -> this parent class is use when you show Character motion or law of physical 




상속이 가능한 다양한 클래스들이 존재합니다만, 그중 Actor 클래스를 선택하고 Next를 누릅니다.

choose Actor class and touch the Next button.



이제 경로와 이름을 설정합니다.

다른 버튼들은 건드리지 않습니다. 그 버튼들은 아직 자세히 모릅니다.

and now write the name , file address

and do not touch another button. i don't know how to work that 


(위 사진은 Actor를 상속 받은 다른 클래스입니다.)

(this picture is Something different class that inherit Actor )


클래스를 만들면 VS(비쥬얼 스튜디오)에 


UCLASS()

class 만든 프로젝트 A클래스명 : public AActor

{

 GENERATED_BODY()


 A클래스명 //constructor 생성자


 virtual BeginPlay() override //가상함수 BeginPlay() 오버라이드


 virtual Tick()override//가상함수 Tick() 오버라이드

}


이런식으로 구성이 되어 있습니다.


When you create a class in unreal . must show up this things in VS(Visual Studio)


생성자의 경우 오버로드가 불가능합니다.(왜 인지는 모르겠습니다.)

또한 오버라이딩도 불가능합니다.(왜 인지는 모르겠습니다.)

constructor be unalbe to do overload ( i don't know why that unable)

also constructor be unalbe to do overriding


BeginePlay()는 해당 Class가 World에 출연할때 한 번만 불려지는 메소드입니다.

Tick()은 매 프레임마다 호출되어지는 메소드입니다.

BeginePlay() is when this class spawn in World , this method is calling once

Tick() is calling every frame


두 메소드 역시 오버로드가 불가능하다고 생각합니다.

그러나 오버라이딩은 가능합니다.

i'm think that these method is also unalble to do overload

but these method is can be overriding


--------------------------------------------------

생성자constructor


생성자의 내부에 보시면 PrimaryActorTick.bCanEverTick = true; 라는 문장이 있는데

이 문장은 Tick메소드가 매 프레임마다 호출되는걸 결정하는 문구입니다.

false로 두면 Tick메스드가 호출되지 않습니다.

if you see the inside of constructor. you can find [PrimaryActorTick.bCanEverTick = true; ] sentence.

this sentence is set the call Tick method each flame .

set false is not working Tick method

set true is working Tick method each flame.


생성자는 주로 Component를 이용 할 때 사용합니다.

연결시에 생성자를 이용해서 연결합니다.

constructor is use, to linking the Component



--------------------------------------------------


--------------------------------------------------

BeginPlay


BeginPlay 내부에는 Super::BeginPlay(); 라는 문구가 있습니다.

이 뜻은 현재 클래스의 부모클래스에 있는 BeginPlay() 메소드를 실행시켜라 라는 의미입니다.

결론적으로 저 문구는 AActor 클래스의 BeginPlay메소드를 실행시키게 됩니다.


보통 BeginPlay 는 현재 클래스의 초기화 작업에 이용되어집니다.

--------------------------------------------------


---------------------------------------------------

Tick


Tick의 내부에도 Super::Tick()라는 문구가 있습니다.

역시 현재 클래스의 부모 클래스인 AActor의 Tick메소드를 실행시키라는 의미입니다.


Tick은 주로 이 오브젝트의 구동에 이용되어집니다.

연산은 되도록이면 하지 않도록 합니다.

많은 시스템 자원을 잡아 먹게 됩니다.

---------------------------------------------------