UDN
Search public documentation:
GFxUScriptVarAccessJP
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
中国翻译
한국어
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
外部の SWF 内で UnrealScript の変数にアクセスする方法
概要
このチュートリアルでは、変数を (UnrealScript からプッシュするのではなく) UnrealScript から Flash ファイルに読み取る (引き出す) ための方法について、簡潔に説明しています。
var retVal:Object = {}; retVal = ExternalInterface.call("GetUnrealVariable", "someFloat", "float"); // Parameter 2 = the variable name in UnrealScript. // Parameter 3 = the variable type in UnrealScript - float, string, etc. trace("My UnrealScript Variable: " + retVal.someFloat);
var float someFloat; var string someString; var bool someBoolean; someFloat = 1337; someString = "Boo!"; someBoolean = true; function GFxObject GetUnrealVariable(string VarName, string VarType) { local GFxObject TempObj; local ASValue asval; local array<ASValue> args; TempObj = CreateObject("Object"); switch(VarType) { case ("float"): asval.Type = AS_Number; break; case ("string"): asval.Type = AS_String; break; case ("bool"): asval.Type = AS_Boolean; break; default: break; } switch(VarName) { case ("someFloat"): asval.n = someFloat; break; case ("someString"): asval.s = someString; break; case ("someBoolean"): asval.b = someBoolean; break; default: break; } args[0] = asval; TempObj.Set(VarName, args[0]); return TempObj; }