本文整理汇总了C#中BinaryPhoenix.Fusion.Runtime.Scripting.ScriptThread.GetObjectParameter方法的典型用法代码示例。如果您正苦于以下问题:C# ScriptThread.GetObjectParameter方法的具体用法?C# ScriptThread.GetObjectParameter怎么用?C# ScriptThread.GetObjectParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BinaryPhoenix.Fusion.Runtime.Scripting.ScriptThread
的用法示例。
在下文中一共展示了ScriptThread.GetObjectParameter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CenterEntityOn
public void CenterEntityOn(ScriptThread thread)
{
EntityNode entity = ((NativeObject)thread.GetObjectParameter(0)).Object as EntityNode;
EntityNode target = ((NativeObject)thread.GetObjectParameter(1)).Object as EntityNode;
if (entity == null || target == null)
{
DebugLogger.WriteLog((thread.Process.Url != null && thread.Process.Url != "" ? thread.Process.Url : "A script") + " called CenterEntityOn with an invalid object.", LogAlertLevel.Error);
return;
}
// Work out the central points.
Transformation entityTransform = entity.CalculateTransformation();
Transformation targetTransform = target.CalculateTransformation();
// If its a camera then we need to invert the coordinates as it uses
// slightly different ones from normal entities.
if (entity as CameraNode != null)
{
entityTransform.X = -entityTransform.X;
entityTransform.Y = -entityTransform.Y;
}
if (target as CameraNode != null)
{
targetTransform.X = -targetTransform.X;
targetTransform.Y = -targetTransform.Y;
}
float targetEntityTransformCenterX = targetTransform.X + ((target.BoundingRectangle.Width / 2) * targetTransform.ScaleX);
float targetEntityTransformCenterY = targetTransform.Y + ((target.BoundingRectangle.Height / 2) * targetTransform.ScaleY);
entity.Position(targetEntityTransformCenterX - ((entity.BoundingRectangle.Width / 2) * entityTransform.ScaleX), targetEntityTransformCenterY - ((entity.BoundingRectangle.Height / 2) * entityTransform.ScaleY), entity.Transformation.Z);
}
示例2: StopThread
public void StopThread(ScriptThread thread)
{
ScriptThread actionThread = ((NativeObject)thread.GetObjectParameter(0)).Object as ScriptThread;
if (actionThread == null)
{
DebugLogger.WriteLog((thread.Process.Url != null && thread.Process.Url != "" ? thread.Process.Url : "A script") + " called StopThread with an invalid object.", LogAlertLevel.Error);
return;
}
actionThread.Stop();
}
示例3: ActivateProcess
public void ActivateProcess(ScriptThread thread)
{
Runtime.Processes.Process process = ((NativeObject)thread.GetObjectParameter(0)).Object as Runtime.Processes.Process;
if (process == null)
{
DebugLogger.WriteLog((thread.Process.Url != null && thread.Process.Url != "" ? thread.Process.Url : "A script") + " called ActivateProcess with an invalid object.", LogAlertLevel.Error);
return;
}
ProcessManager.AttachProcess(process);
}
示例4: SeekStream
public void SeekStream(ScriptThread thread)
{
ScriptStream stream = ((NativeObject)thread.GetObjectParameter(0)).Object as ScriptStream;
if (stream == null)
{
DebugLogger.WriteLog((thread.Process.Url != null && thread.Process.Url != "" ? thread.Process.Url : "A script") + " called SeekStream with an invalid object.", LogAlertLevel.Error);
return;
}
stream.Stream.Position = thread.GetIntegerParameter(1);
}
示例5: 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))));
}
示例6: ActivateCamera
public void ActivateCamera(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 AttachCameraToSceneGraph with an invalid object.", LogAlertLevel.Error);
return;
}
Engine.GlobalInstance.Map.SceneGraph.AttachCamera(entity);
}
示例7: 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);
}
示例8: InvokeThreadFunction
public void InvokeThreadFunction(ScriptThread thread)
{
ScriptThread actionThread = ((NativeObject)thread.GetObjectParameter(0)).Object as ScriptThread;
if (actionThread == null)
{
DebugLogger.WriteLog((thread.Process.Url != null && thread.Process.Url != "" ? thread.Process.Url : "A script") + " called InvokeThreadFunction with an invalid object.", LogAlertLevel.Error);
return;
}
actionThread.InvokeFunction(thread.GetStringParameter(1), thread.GetBooleanParameter(2), thread.GetBooleanParameter(3), false);
}
示例9: ChannelLooping
public void ChannelLooping(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 ChannelLooping with an invalid object.", LogAlertLevel.Error);
return;
}
thread.SetReturnValue(sound.Looping);
}
示例10: CreateAnimationProcessC
public void CreateAnimationProcessC(ScriptThread thread)
{
EntityNode entity = ((NativeObject)thread.GetObjectParameter(0)).Object as EntityNode;
int memoryIndex = thread.GetArrayParameter(3);
if (entity == null || memoryIndex == 0)
{
DebugLogger.WriteLog((thread.Process.Url != null && thread.Process.Url != "" ? thread.Process.Url : "A script") + " called CreateAnimationProcess with an invalid object.", LogAlertLevel.Error);
return;
}
int arrayLength = thread.GetArrayLength(memoryIndex);
int[] frames = new int[arrayLength];
for (int i = 0; i < arrayLength; i++)
frames[i] = thread.GetIntArrayElement(memoryIndex, i);
thread.SetReturnValue(new ProcessScriptObject(new AnimationProcess(entity, (AnimationMode)thread.GetIntegerParameter(1), thread.GetIntegerParameter(2), frames, thread.GetIntegerParameter(4))));
}
示例11: SetChannelVolume
public void SetChannelVolume(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 SetChannelVolume with an invalid object.", LogAlertLevel.Error);
return;
}
sound.Volume = thread.GetFloatParameter(1);
}
示例12: ResumeChannel
public void ResumeChannel(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 ResumeChannel with an invalid object.", LogAlertLevel.Error);
return;
}
sound.Paused = false;
}
示例13: PlaySound
public void PlaySound(ScriptThread thread)
{
Sound sound = ((NativeObject)thread.GetObjectParameter(0)).Object as Sound;
if (sound == null)
{
DebugLogger.WriteLog((thread.Process.Url != null && thread.Process.Url != "" ? thread.Process.Url : "A script") + " called PlaySound with an invalid object.", LogAlertLevel.Error);
return;
}
thread.SetReturnValue(new ChannelScriptObject(sound.Play()));
}
示例14: EntityCollisionBoxHeight
public void EntityCollisionBoxHeight(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 EntityCollisionBoxHeight with an invalid object.", LogAlertLevel.Error);
return;
}
thread.SetReturnValue(entity.CollisionRectangle.Height);
}
示例15: StreamWriteA
public void StreamWriteA(ScriptThread thread)
{
ScriptStream stream = ((NativeObject)thread.GetObjectParameter(0)).Object as ScriptStream;
if (stream == null)
{
DebugLogger.WriteLog((thread.Process.Url != null && thread.Process.Url != "" ? thread.Process.Url : "A script") + " called StreamWrite with an invalid object.", LogAlertLevel.Error);
return;
}
stream.Writer.Write(thread.GetBooleanParameter(1));
}