本文整理汇总了C#中BinaryPhoenix.Fusion.Runtime.Scripting.ScriptThread.SetReturnValue方法的典型用法代码示例。如果您正苦于以下问题:C# ScriptThread.SetReturnValue方法的具体用法?C# ScriptThread.SetReturnValue怎么用?C# ScriptThread.SetReturnValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BinaryPhoenix.Fusion.Runtime.Scripting.ScriptThread
的用法示例。
在下文中一共展示了ScriptThread.SetReturnValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CommandLineExists
public void CommandLineExists(ScriptThread thread)
{
string commandLine = thread.GetStringParameter(0);
foreach (string arg in Engine.GlobalInstance.CommandLineArguments)
{
string[] value = new string[0];
string command = arg;
int colonIndex = arg.IndexOf(':');
// Seperate values and command if a colon exists.
if (colonIndex >= 0)
{
value = new string[1];
value[0] = arg.Substring(colonIndex + 1, arg.Length - colonIndex - 1);
if (value[0].IndexOf(",") >= 0) value = value[0].Split(new char[1] { ',' });
command = arg.Substring(0, colonIndex);
}
if (command.ToLower() == commandLine.ToLower())
{
thread.SetReturnValue(true);
return;
}
}
thread.SetReturnValue(false);
}
示例2: DistanceToPoint
public void DistanceToPoint(ScriptThread thread)
{
double vectorX = thread.GetDoubleParameter(0) - thread.GetDoubleParameter(2);
double vectorY = thread.GetDoubleParameter(1) - thread.GetDoubleParameter(3);
double distance = Math.Sqrt(vectorX * vectorX + vectorY * vectorY);
thread.SetReturnValue(distance);
}
示例3: GameFlag
public void GameFlag(ScriptThread thread)
{
string key = thread.GetStringParameter(0).ToLower();
if (!Fusion.GlobalInstance.GameFlags.Contains(key))
return;
thread.SetReturnValue((string)Fusion.GlobalInstance.GameFlags[key]);
}
示例4: CharacterCount
public void CharacterCount(ScriptThread thread)
{
string haystack = thread.GetStringParameter(0);
string needle = thread.GetStringParameter(1);
int count = 0;
for (int i = 0; i < haystack.Length; i++)
if (haystack[i] == needle[0]) count++;
thread.SetReturnValue(count);
}
示例5: CameraClearColor
public void CameraClearColor(ScriptThread thread)
{
CameraNode entity = ((NativeObject)thread.GetObjectParameter(0)).Object as CameraNode;
if (entity == null)
{
DebugLogger.WriteLog((thread.Process.Url != null && thread.Process.Url != "" ? thread.Process.Url : "A script") + " called CameraClearColor with an invalid object.", LogAlertLevel.Error);
return;
}
thread.SetReturnValue(entity.ClearColor);
}
示例6: OpenStream
public void OpenStream(ScriptThread thread)
{
Stream stream = StreamFactory.RequestStream(thread.GetStringParameter(0), (StreamMode)thread.GetIntegerParameter(1));
if (stream == null)
{
DebugLogger.WriteLog((thread.Process.Url != null && thread.Process.Url != "" ? thread.Process.Url : "A script") + " called OpenStream with an unreachable url.", LogAlertLevel.Error);
return;
}
thread.SetReturnValue(new StreamScriptObject(new ScriptStream(stream)));
}
示例7: ChannelLength
public void ChannelLength(ScriptThread thread)
{
ISampleBuffer sound = ((NativeObject)thread.GetObjectParameter(0)).Object as ISampleBuffer;
if (sound == null)
{
DebugLogger.WriteLog((thread.Process.Url != null && thread.Process.Url != "" ? thread.Process.Url : "A script") + " called ChannelLength with an invalid object.", LogAlertLevel.Error);
return;
}
thread.SetReturnValue(sound.Length);
}
示例8: CreateAnimationProcessB
public void CreateAnimationProcessB(ScriptThread thread)
{
EntityNode entity = ((NativeObject)thread.GetObjectParameter(0)).Object as EntityNode;
if (entity == null)
{
DebugLogger.WriteLog((thread.Process.Url != null && thread.Process.Url != "" ? thread.Process.Url : "A script") + " called CreateAnimationProcess with an invalid object.", LogAlertLevel.Error);
return;
}
thread.SetReturnValue(new ProcessScriptObject(new AnimationProcess(entity, (AnimationMode)thread.GetIntegerParameter(1), thread.GetIntegerParameter(2), thread.GetIntegerParameter(3), thread.GetIntegerParameter(4))));
}
示例9: GameFlagValueAtIndex
public void GameFlagValueAtIndex(ScriptThread thread)
{
int index = thread.GetIntegerParameter(0);
int currentIndex = 0;
foreach (string value in Fusion.GlobalInstance.GameFlags.Values)
{
if (index == currentIndex)
{
thread.SetReturnValue(value);
return;
}
currentIndex++;
}
}
示例10: KeyReleased
public void KeyReleased(ScriptThread thread)
{
thread.SetReturnValue(InputManager.KeyReleased((KeyCodes)thread.GetIntegerParameter(0)));
}
示例11: MouseScroll
public void MouseScroll(ScriptThread thread)
{
thread.SetReturnValue(InputManager.MouseScroll);
}
示例12: LanguagePackName
public void LanguagePackName(ScriptThread thread)
{
thread.SetReturnValue(LanguageManager.Name);
}
示例13: ExecutingThread
public void ExecutingThread(ScriptThread thread)
{
thread.SetReturnValue(new ThreadScriptObject(thread));
}
示例14: Implode
public void Implode(ScriptThread thread)
{
int arrayMemoryIndex = thread.GetArrayParameter(0);
int arrayLength = thread.GetArrayLength(arrayMemoryIndex);
string implodedString = "";
for (int i = 0; i < arrayLength; i++)
implodedString += thread.GetStringArrayElement(arrayMemoryIndex, i);
thread.SetReturnValue(implodedString);
}
示例15: Contains
public void Contains(ScriptThread thread)
{
thread.SetReturnValue(thread.GetStringParameter(0).Contains(thread.GetStringParameter(1)));
}