当前位置: 首页>>代码示例>>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;未经允许,请勿转载。