"景先生毕设|www.jxszl.com

C# AnchorType类代码示例

2023-12-29 17:04编辑: www.jxszl.com景先生毕设
本文整理汇总了C#中AnchorType类的典型用法代码示例。如果您正苦于以下问题:C#AnchorType类的具体用法?C#AnchorType怎么用?C#AnchorType使用的例子?这里精选的类代码示例或许可以为您提供帮助。 示例1:SetAnchor publicstaticvoidSetAnchor(AnchorTypeat,RectTransformrt) { Vector2anchor; Vector2pivot; if(at==AnchorType.TopLeft) { anchor=newVector2(0,1); pivot=newVector2(0,1); } elseif(at==AnchorType.LeftCenter) { anchor=newVector2(0,0.5f); pivot=newVector2(0.5f,0.5f); } elseif(at==AnchorType.Center) { anchor=newVector2(0.5f,0.5f); pivot=newVector2(0.5f,0.5f); } else { anchor=newVector2(1,1); pivot=newVector2(1,1); } rt.anchorMin=anchor; rt.anchorMax=anchor; rt.pivot=pivot; }
原文链接:http://www.jxszl.com/biancheng/C/556528.html