当前位置: 首页>>代码示例>>C#>>正文


C# Bounds.MiddleCenter方法代码示例

本文整理汇总了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)));
 }
开发者ID:joshleejosh,项目名称:filutil,代码行数:22,代码来源:FExtensionsTest.cs

示例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)));
 }
开发者ID:joshleejosh,项目名称:filutil,代码行数:22,代码来源:FExtensionsTest.cs


注:本文中的UnityEngine.Bounds.MiddleCenter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。