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은 주로 이 오브젝트의 구동에 이용되어집니다.

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

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

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














































































caution

this document is made in Unreal Ver 4.14

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

나는 언리얼 안에서 c++클래스를 만들었다.

그 후 변수를 만들었다.

i made C++class in Unreal Engine.

and  make variable.


불 형태의 변수 (BOOL이라고 치면 컴파일 안된다.)

bool for boolean values (NEVER assume the size of bool). BOOL will not compile.


TCHAR형태의 캐릭터 변수

TCHAR for a character (NEVER assume the size of TCHAR).


unit8의 변수, 이건 언사인드 바이트를 위해 만들어졌다.

uint8 for unsigned bytes (1 byte).


int8의 변수는 일반적인 byte를 위해 만들어졌다.(1byte의 크기를 가졌다.)

int8 for signed bytes (1 byte).


unit16의 변수는 언사인드 shorts를 위해 만들어졌다.(2byte의 크기를 가졌다.)

uint16 for unsigned "shorts" (2 bytes).


int16의 변수는 shorts를 위해 만들어졌다.(2byte의 크기를 가졌다.)

int16 for signed "shorts" (2 bytes).


unit32의 변수는 언사인드 int를 위해 만들어졌다.(4byte의 크기를 가졌다.)

uint32 for unsigned ints (4 bytes).


int32는 일반적인 int를 표현하기 위해 만들어졌다.(4byte의 크기를 가졌다.) 이건 평소 다른 언어에 쓰던 Int와 똑같다.

int32 for signed ints (4 bytes).


uint64는 언사인드 quad word를 다루기 위해 만들어졌다.(8byte)

uint64 for unsigned "quad words" (8 bytes).


int64는 quad word를 다루기 위해 만들어졌다.(8byte)

int64 for signed "quad words" (8 bytes).


float은 기존의 float과 같다

float for single precision floating point (4 bytes).


double도 역시 기존의 double과 같다.

double for double precision floating point (8 bytes).


PTRINT는 int형태의 포인터를 잡기 위해 만들어졌다.

PTRINT for an integer that may hold a pointer (NEVER assume the size of PTRINT).


-source by Unreal Donument https://docs.unrealengine.com/latest/INT/Programming/Development/CodingStandard/#portablealiasesforbasicc++types



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