반응형
Notice
Recent Posts
Recent Comments
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Archives
Today
Total
관리 메뉴

Do Something IT

언리얼4 코드 인트로 실행해보기 본문

Unreal

언리얼4 코드 인트로 실행해보기

아낙시만더 2014. 10. 10. 01:29
반응형

언리얼4 환경 셋팅


 visual studio 2013 버전 또는visual studio 2013  for  windows desktop 버전을 다운 받아

설치 한다.


코드 작성방법은 프로젝트에서 파일-> 프로젝트에 클래스 코드로 추가 하기 를 클릭 한다.

이와 동시에  visual studio 가 켜져야 한다. 미리 켜져 있거나하면

#include "Powerup.generated.h"  error:  파일 소스를 열수 없습니다. "PowerUp.generated.h" 


위와 같은 에러가 발생 할수 있다. 


그리고  OVERRIDE 메크로 함수는  4.4.3 에서 아래와 같이 패치 되었다

  • New: Changed OVERRIDE and FINAL macros to keywords override and final. The usage of macros is now deprecated.

새로운 기능 : 변경 무시하고 override 및 final 키워드에 FINAL 매크로. 매크로의 사용은 이제 더 이상 사용되지 않습니다.

라고 하니 참조하자.   


그리고 또하나 주의 해야 될 점은 솔류션 구성을 Development Editor 로 했을땐   UnrealEditor  창이 켜져 있을때에는 빌드가 되지 않는데 이에 주의 하자.


간단한  언리얼스크립트와  c++ 의 구조는 일단  c++ 구조상 해더 파일인   프로젝트명. h 파일과   프로젝트명.cpp 파일로 이루어 한 클래스가 구성 된다. 해더 파일엔  public 으로 속성및 함수를 명시 선언 하고  cpp  파일에서 값 명시 및 로직 처리 함수구현 부분을 처리 하는 구조이다. 언리얼 엔진에서 선언된 프로펄티나 클래스 를 등등을 확인 하기 위해서 UCALSS(), GENERATED_UCLASS_BODY(), UPROPERTY() 등 다양 한 메크로를 사용한다.

... 현재 회전이 잘 되지 않는다 틱이 실행 되지 않는거 같다 확인되는대로 수정 하겠다

코드를 아래 정리 해본다 

#pragma once

#include "GameFramework/Actor.h"
#include "Powerup.generated.h"

/**
 * 
 */
UCLASS()
class PIZZA_API APowerup : public AActor
{
	GENERATED_UCLASS_BODY()

	UPROPERTY(VisibleDefaultsOnly, Category = PowerUp)
	TSubobjectPtr

TouchSphere; UPROPERTY(VisibleDefaultsOnly, Category = PowerUp) float RotationRate; virtual void Tick(float DeltaTime); };
  
#include "Pizza.h"
#include "Powerup.h"


APowerup::APowerup(const class FPostConstructInitializeProperties& PCIP)
	: Super(PCIP)
{
	PrimaryActorTick.bCanEverTick = true;

	TouchSphere = PCIP.CreateDefaultSubobject(this, TEXT("TouchSphereComponent"));
	TouchSphere->SetSphereRadius(20.f, false);
	RootComponent = TouchSphere;

	RotationRate = 180.f;
}
void APowerup::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime); // error 클래스  uSoundClass에 " Tick"  멤버가 없습니다.

	FRotator MyRot = GetActorRotation();
	MyRot.Yaw = RotationRate * DeltaTime;
	SetActorRotation(MyRot);
}


반응형

'Unreal' 카테고리의 다른 글

Unreal4과 Unity의 작동 차이점  (0) 2014.11.25
언리얼4 프레임워크 클래스 관계  (0) 2014.11.13
Unreal Summit 2014  (0) 2014.07.19
Comments