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


C# Rect.TopLeft方法代碼示例

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


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

示例1: Begin

 public static Rect Begin(float zoomScale, Rect screenCoordsArea)
 {
     GUI.EndGroup();
     Rect clippedArea = screenCoordsArea.ScaleSizeBy(1.0f / zoomScale, screenCoordsArea.TopLeft());
     clippedArea.y += BonWindow.TopOffset;
     GUI.BeginGroup(clippedArea);
     _prevGuiMatrix = GUI.matrix;
     Matrix4x4 translation = Matrix4x4.TRS(clippedArea.TopLeft(), Quaternion.identity, Vector3.one);
     _tmpScaleVector.Set(zoomScale, zoomScale, 1.0f);
     Matrix4x4 scale = Matrix4x4.Scale(_tmpScaleVector);
     GUI.matrix = translation * scale * translation.inverse * GUI.matrix;
     return clippedArea;
 }
開發者ID:RudraNilBasu,項目名稱:BrotherhoodOfNode,代碼行數:13,代碼來源:EditorZoomArea.cs

示例2: Begin

        public static Rect Begin(float zoomScale, Rect screenCoordsArea)
        {
            GUI.EndGroup();        // End the group Unity begins automatically for an EditorWindow to clip out the window tab. This allows us to draw outside of the size of the EditorWindow.
            
            Rect clippedArea = screenCoordsArea.ScaleSizeBy(1.0f / zoomScale, screenCoordsArea.TopLeft());
            clippedArea.y += kEditorWindowTabHeight;
            GUI.BeginGroup(clippedArea);
            
            _prevGuiMatrix = GUI.matrix;

            Matrix4x4 translation = Matrix4x4.TRS(clippedArea.TopLeft(), Quaternion.identity, Vector3.one);
            Matrix4x4 scale = Matrix4x4.Scale(new Vector3(zoomScale, zoomScale, 1.0f));
            GUI.matrix = translation * scale * translation.inverse * GUI.matrix;
            

            return clippedArea;
        }
開發者ID:KRUR,項目名稱:NotJustASheep,代碼行數:17,代碼來源:EditorZoomArea.cs

示例3: IsRectInRect

 private bool IsRectInRect(Rect rect1, Rect rect2)
 {
     if (rect1.Contains (rect2.BottomRight ()) || rect1.Contains (rect2.BottomLeft ()) || rect1.Contains (rect2.TopLeft ()) || rect1.Contains (rect2.TopRight ()))
     {
         return true;
     }
     return false;
 }
開發者ID:WastNotWantNot,項目名稱:WasteNotWantNot,代碼行數:8,代碼來源:ActionListEditorWindow.cs

示例4: BeginZoomArea

        public static Rect BeginZoomArea(float zoomScale, Rect screenCoordsArea)
        {
            GUI.EndGroup();

            Rect clippedArea = screenCoordsArea.ScaleSizeBy(1.0f / zoomScale, screenCoordsArea.TopLeft());
            clippedArea.y += kEditorWindowTabHeight;
            GUI.BeginGroup(clippedArea);

            preZoomGUIMatrix = GUI.matrix;
            Matrix4x4 translation = Matrix4x4.TRS(clippedArea.TopLeft(), Quaternion.identity, Vector3.one);
            Matrix4x4 scale = Matrix4x4.Scale(new Vector3(zoomScale, zoomScale, 1.0f));
            GUI.matrix = translation * scale * translation.inverse * GUI.matrix;

            return clippedArea;
        }
開發者ID:anneomcl,項目名稱:LetsMake,代碼行數:15,代碼來源:NodifyEditorUtilities.cs

示例5: Begin

		public static Rect Begin(Rect screenCoordsArea, float zoomScale)
		{
			GUI.EndGroup();
			Rect rect = screenCoordsArea.ScaleSizeBy(1f / zoomScale, screenCoordsArea.TopLeft());
			rect.y += 21f;
			GUI.BeginGroup(rect);
			EditorZoomArea._prevGuiMatrix = GUI.matrix;
			Matrix4x4 lhs = Matrix4x4.TRS(rect.TopLeft(), Quaternion.identity, Vector3.one);
			Vector3 one = Vector3.one;
			one.y = zoomScale;
			one.x = zoomScale;
			Matrix4x4 rhs = Matrix4x4.Scale(one);
			GUI.matrix = lhs * rhs * lhs.inverse * GUI.matrix;
			return rect;
		}
開發者ID:learnUnity,項目名稱:KU_NET,代碼行數:15,代碼來源:GUITools.cs


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