當前位置: 首頁>>代碼示例>>C#>>正文


C# Bounds.BottomLeft方法代碼示例

本文整理匯總了C#中UnityEngine.Bounds.BottomLeft方法的典型用法代碼示例。如果您正苦於以下問題:C# Bounds.BottomLeft方法的具體用法?C# Bounds.BottomLeft怎麽用?C# Bounds.BottomLeft使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UnityEngine.Bounds的用法示例。


在下文中一共展示了Bounds.BottomLeft方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: 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

示例2: 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


注:本文中的UnityEngine.Bounds.BottomLeft方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。