本文整理汇总了C#中UnityEngine.Bounds.MiddleCenter方法的典型用法代码示例。如果您正苦于以下问题:C# Bounds.MiddleCenter方法的具体用法?C# Bounds.MiddleCenter怎么用?C# Bounds.MiddleCenter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.Bounds
的用法示例。
在下文中一共展示了Bounds.MiddleCenter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestBoundsZero
public void TestBoundsZero()
{
Bounds b = new Bounds();
Assert.That(b.TopLeft(), Is.EqualTo(Vector3.zero));
Assert.That(b.TopCenter(), Is.EqualTo(Vector3.zero));
Assert.That(b.TopRight(), Is.EqualTo(Vector3.zero));
Assert.That(b.MiddleLeft(), Is.EqualTo(Vector3.zero));
Assert.That(b.MiddleCenter(), Is.EqualTo(Vector3.zero));
Assert.That(b.MiddleRight(), Is.EqualTo(Vector3.zero));
Assert.That(b.BottomLeft(), Is.EqualTo(Vector3.zero));
Assert.That(b.BottomCenter(), Is.EqualTo(Vector3.zero));
Assert.That(b.BottomRight(), Is.EqualTo(Vector3.zero));
Assert.That(b.TopLeft(2), Is.EqualTo(new Vector3(-2, 2, 0)));
Assert.That(b.TopCenter(2), Is.EqualTo(new Vector3( 0, 2, 0)));
Assert.That(b.TopRight(2), Is.EqualTo(new Vector3( 2, 2, 0)));
Assert.That(b.MiddleLeft(2), Is.EqualTo(new Vector3(-2, 0, 0)));
Assert.That(b.MiddleCenter(2), Is.EqualTo(new Vector3( 0, 0, 0)));
Assert.That(b.MiddleRight(2), Is.EqualTo(new Vector3( 2, 0, 0)));
Assert.That(b.BottomLeft(2), Is.EqualTo(new Vector3(-2, -2, 0)));
Assert.That(b.BottomCenter(2), Is.EqualTo(new Vector3( 0, -2, 0)));
Assert.That(b.BottomRight(2), Is.EqualTo(new Vector3( 2, -2, 0)));
}
示例2: TestBounds
public void TestBounds()
{
Bounds b = new Bounds(new Vector3(-2, 2, -2), new Vector3(4, 6, 8));
Assert.That(b.TopLeft(), Is.EqualTo(new Vector3(-4, 5, -2)));
Assert.That(b.TopCenter(), Is.EqualTo(new Vector3(-2, 5, -2)));
Assert.That(b.TopRight(), Is.EqualTo(new Vector3( 0, 5, -2)));
Assert.That(b.MiddleLeft(), Is.EqualTo(new Vector3(-4, 2, -2)));
Assert.That(b.MiddleCenter(), Is.EqualTo(new Vector3(-2, 2, -2)));
Assert.That(b.MiddleRight(), Is.EqualTo(new Vector3( 0, 2, -2)));
Assert.That(b.BottomLeft(), Is.EqualTo(new Vector3(-4, -1, -2)));
Assert.That(b.BottomCenter(), Is.EqualTo(new Vector3(-2, -1, -2)));
Assert.That(b.BottomRight(), Is.EqualTo(new Vector3( 0, -1, -2)));
Assert.That(b.TopLeft(2), Is.EqualTo(new Vector3(-6, 7, -2)));
Assert.That(b.TopCenter(2), Is.EqualTo(new Vector3(-2, 7, -2)));
Assert.That(b.TopRight(2), Is.EqualTo(new Vector3( 2, 7, -2)));
Assert.That(b.MiddleLeft(2), Is.EqualTo(new Vector3(-6, 2, -2)));
Assert.That(b.MiddleCenter(2), Is.EqualTo(new Vector3(-2, 2, -2)));
Assert.That(b.MiddleRight(2), Is.EqualTo(new Vector3( 2, 2, -2)));
Assert.That(b.BottomLeft(2), Is.EqualTo(new Vector3(-6, -3, -2)));
Assert.That(b.BottomCenter(2), Is.EqualTo(new Vector3(-2, -3, -2)));
Assert.That(b.BottomRight(2), Is.EqualTo(new Vector3( 2, -3, -2)));
}