本文整理汇总了C#中IMyCubeBlock.GetPosition方法的典型用法代码示例。如果您正苦于以下问题:C# IMyCubeBlock.GetPosition方法的具体用法?C# IMyCubeBlock.GetPosition怎么用?C# IMyCubeBlock.GetPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMyCubeBlock
的用法示例。
在下文中一共展示了IMyCubeBlock.GetPosition方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetLauncherReference
public void SetLauncherReference(IMyCubeBlock launcherReference,
Base6Directions.Direction direction = Base6Directions.Direction.Forward)
{
LauncherReferencePoint = launcherReference.GetPosition();
var forward3I = launcherReference.Position + Base6Directions.GetIntVector(launcherReference.Orientation.TransformDirection(direction));
var forwardPoint = launcherReference.CubeGrid.GridIntegerToWorld(forward3I);
LauncherReferenceDirection = Vector3D.Normalize(forwardPoint - LauncherReferencePoint);
}
示例2: LineSample
public LineSample(IMyCubeBlock reference, Vector3I forward3I)
{
Point = reference.GetPosition();
var forwardPoint = reference.CubeGrid.GridIntegerToWorld(forward3I);
Direction = Vector3D.Normalize(forwardPoint - Point);
}
示例3: TargetableBlock
/// <remarks>
/// <para>Targeting non-terminal blocks would cause confusion.</para>
/// <para>Open doors should not be targeted.</para>
/// </remarks>
private bool TargetableBlock(IMyCubeBlock block, bool Disable)
{
if (!(block is IMyTerminalBlock))
return false;
if (block.Mass < 100)
return false;
IMyDoor asDoor = block as IMyDoor;
if (asDoor != null && asDoor.OpenRatio > 0.01)
return false;
if (Disable && !block.IsWorking)
if (!block.IsFunctional || !Options.FlagSet(TargetingFlags.Functional))
return false;
if (!CanRotateTo(block.GetPosition()))
return false;
return true;
}