本文整理汇总了C#中BinaryPhoenix.Fusion.Runtime.Scripting.ScriptThread.GetFloatParameter方法的典型用法代码示例。如果您正苦于以下问题:C# ScriptThread.GetFloatParameter方法的具体用法?C# ScriptThread.GetFloatParameter怎么用?C# ScriptThread.GetFloatParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BinaryPhoenix.Fusion.Runtime.Scripting.ScriptThread
的用法示例。
在下文中一共展示了ScriptThread.GetFloatParameter方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RandomA
public void RandomA(ScriptThread thread)
{
thread.SetReturnValue(MathMethods.Random(thread.GetFloatParameter(0), thread.GetFloatParameter(1)));
}
示例2: CheckForCollisionB
public void CheckForCollisionB(ScriptThread thread)
{
thread.SetReturnValue(CollisionManager.HitTest(new CollisionRectangle(new Transformation(thread.GetFloatParameter(0), thread.GetFloatParameter(1), 0, 0, 0, 0, 1.0f, 1.0f, 1.0f), thread.GetFloatParameter(2), thread.GetFloatParameter(3))));
}
示例3: NodeAtPoint
public void NodeAtPoint(ScriptThread thread)
{
CollisionPolygon polygon = CollisionManager.PolygonAtPoint((int)thread.GetFloatParameter(0), (int)thread.GetFloatParameter(1));
if (polygon == null || polygon.MetaData == null) return;
thread.SetReturnValue(new SceneNodeScriptObject(polygon.MetaData as SceneNode));
}
示例4: 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);
}
示例5: StreamWriteF
public void StreamWriteF(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.GetFloatParameter(1));
}
示例6: RotateEntity
public void RotateEntity(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 RotateEntity with an invalid object.", LogAlertLevel.Error);
return;
}
entity.Rotate(thread.GetFloatParameter(1), thread.GetFloatParameter(2), thread.GetFloatParameter(3));
}
示例7: MoveEntityTowardsPoint
public void MoveEntityTowardsPoint(ScriptThread thread)
{
EntityNode entity = ((NativeObject)thread.GetObjectParameter(0)).Object as EntityNode;
float x = thread.GetFloatParameter(1);
float y = thread.GetFloatParameter(2);
float speed = thread.GetFloatParameter(3);
if (entity == null)
{
DebugLogger.WriteLog((thread.Process.Url != null && thread.Process.Url != "" ? thread.Process.Url : "A script") + " called MoveEntityTowardsPoint with an invalid object.", LogAlertLevel.Error);
return;
}
// Work out the central points.
Transformation entityTransform = entity.CalculateTransformation();
// If its a camera then we need to invert the coordinates as it uses
// slightly different ones from normal entities.
if (entity is CameraNode)
{
entityTransform.X = -entityTransform.X;
entityTransform.Y = -entityTransform.Y;
}
// Are we at the correct place? If so why bother with the below code :P.
if (entityTransform.X == x && entityTransform.Y == y)
return;
float entityTransformCenterX = entityTransform.X + ((entity.BoundingRectangle.Width / 2) * entityTransform.ScaleX);
float entityTransformCenterY = entityTransform.Y + ((entity.BoundingRectangle.Height / 2) * entityTransform.ScaleY);
float vectorX = entityTransformCenterX - x;
float vectorY = entityTransformCenterY - y;
float distance = (float)Math.Sqrt(vectorX * vectorX + vectorY * vectorY);
vectorX /= distance;
vectorY /= distance;
if (float.IsNaN(vectorX * speed) || float.IsNaN(vectorY * speed)) return;
// Work out vector towards entity.
entity.Move(-(vectorX * speed),-(vectorY * speed), 0.0f);
}
示例8: CreateShakingProcess
public void CreateShakingProcess(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 CreateShakingProcess with an invalid object.", LogAlertLevel.Error);
return;
}
thread.SetReturnValue(new ProcessScriptObject(new EntityShakeProcess(entity, thread.GetFloatParameter(1))));
}
示例9: CreateMoveToProcessB
public void CreateMoveToProcessB(ScriptThread thread)
{
EntityNode entity = ((NativeObject)thread.GetObjectParameter(0)).Object as EntityNode;
EntityNode moveEntity = ((NativeObject)thread.GetObjectParameter(3)).Object as EntityNode;
if (entity == null || moveEntity == null)
{
DebugLogger.WriteLog((thread.Process.Url != null && thread.Process.Url != "" ? thread.Process.Url : "A script") + " called CreateMoveToProcess with an invalid object.", LogAlertLevel.Error);
return;
}
thread.SetReturnValue(new ProcessScriptObject(new EntityMoveToProcess(entity, moveEntity.Transformation.X + ((moveEntity.BoundingRectangle.Width / 2.0f) * moveEntity.Transformation.ScaleX), moveEntity.Transformation.Y + ((moveEntity.BoundingRectangle.Height / 2.0f) * moveEntity.Transformation.ScaleY), new StartFinishF(thread.GetFloatParameter(1), thread.GetFloatParameter(2)))));
}
示例10: CreateChannelFadeProcess
public void CreateChannelFadeProcess(ScriptThread thread)
{
Audio.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 CreateChannelFadeProcess with an invalid object.", LogAlertLevel.Error);
return;
}
thread.SetReturnValue(new ProcessScriptObject(new ChannelFadeProcess(sound, thread.GetFloatParameter(1), thread.GetFloatParameter(2), thread.GetIntegerParameter(3))));
}