UDN
Search public documentation:

GFxHUDTriggerCH
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 > 怎样在触碰到触发器时在HUD上显示内容

怎样在触碰到触发器时在HUD上显示内容


概述


要在触碰到触发器时在玩家HUD上显示内容的方法有很多。 比如,只使用kismet是一个可行的途径。 另一种可行的途径是在虚幻脚本中创建一个自定义触发器对象(您可以把它放置在关卡里),它可以通知Scaleform进行一些操作。

YourTrigger.uc
class MyTrigger extends Trigger
  placeable
  ClassGroup(Common);

event Touch(Actor Other, PrimitiveComponent OtherComp, vector HitLocation, vector HitNormal)
{
  local Pawn TouchingPawn;
  local MyPlayerController PC;
  local MyHUD HUD;

  TouchingPawn = Pawn(Other);
  if (TouchingPawn != None)
  {
    PC = MyPlayerController(TouchingPawn.Controller);
    if (PC != None)
    {
      HUD = MyHUD(PC.MyHUD);
      if (HUD != None && HUD.HUDMovie != None)
      {
        HUD.HUDMovie.DoSomething();
      }
    }
  }
}

这样就能调用HUDMovie::DoSomething(),这样您就可以天马行空,让HUD动起来,您也可以显示一些示例文本。