UDN
Search public documentation:

GFxAScriptToKismetKR
English Translation
日本語訳
中国翻译

Interested in the Unreal Engine?
Visit the Unreal Technology site.

Looking for jobs and company info?
Check out the Epic games site.

Questions about support via UDN?
Contact the UDN Staff

UE3 홈 > 유저 인터페이스와 HUD > Scaleform GFx > 외부 인터페이스 호출이 키즈멧을 거치게 하는 법

외부 인터페이스 호출이 키즈멧을 거치게 하는 법


문서 변경내역: James Tan 작성. 홍성진 번역.

개요


스케일폼을 텍스처로 렌더한 다음 월드 안에 표시되도록 할 수가 있기 때문에, ActionScript 에서 바로 키즈멧을 호출할 수 있다면 매우 좋을 것입니다.

ActionScript 2.0 메서드


Flash 버튼 셋업은 이와 같습니다.

ActionScript
on (press)
{
  import flash.external.ExternalInterface;
  ExternalInterface.call("MyUnrealScriptFunction");
}

ExternalInterface 호출에 파라미터는 많게든 적게든 원하는 대로 전해줄 수 있습니다. (예: ExternalInterface.call("MyFunction", "Matthew", 37, true) 는 스트링, 인티저, 불리언을 전달하고 있습니다.) 다만 여기서는 아무것도 전달하지 않고 그냥 MyUnrealScriptFunction 함수를 호출하겠습니다.

그러면 UnrealScript 가 이렇게 됩니다:

Unrealscript
class MyMoviePlayer extends GFxMoviePlayer;

//외부 인터페이스 호출을 받을 함수
function MyUnrealScriptFunction()
{
  `log("###### ExternalInterface Call Received #####");
  TriggerRemoteKismetEvent('MyEvent');
}

//리모트 키즈멧 이벤트를 발동시킬 함수
function TriggerRemoteKismetEvent( name EventName )
{
  local array<SequenceObject> AllSeqEvents;
  local Sequence GameSeq;
  local int i;

  GameSeq = GetPC().WorldInfo.GetGameSequence();
  if (GameSeq != None)
  {
    // 기존의 Level Reset 이벤트를 찾습니다.
    GameSeq.FindSeqObjectsByClass(class'SeqEvent_RemoteEvent', true, AllSeqEvents);

    // 활성화시킵니다.
    for (i = 0; i < AllSeqEvents.Length; i++)
    {
      if(SeqEvent_RemoteEvent(AllSeqEvents[i]).EventName == EventName)
      {
        SeqEvent_RemoteEvent(AllSeqEvents[i]).CheckActivate(GetPC().WorldInfo, None);
      }
    }
  }
}

레벨에 Remote Event 키즈멧 노드를 추가하고, 그 이름을 MyEvent 라 짓습니다.

그런 다음 그 이벤트에 원하는 작업을 연결해 줍니다.