修改
This commit is contained in:
parent
0073cf807f
commit
0c7d6df5ee
@ -0,0 +1,27 @@
|
|||||||
|
namespace UnityEngine
|
||||||
|
{
|
||||||
|
[UnityEngine.Scripting.Preserve]
|
||||||
|
public static class UnityEngine_UIExtension
|
||||||
|
{
|
||||||
|
//重置为全屏自适应UI
|
||||||
|
public static void ResetToFullScreen(this RectTransform self)
|
||||||
|
{
|
||||||
|
self.anchorMin = Vector2.zero;
|
||||||
|
self.anchorMax = Vector2.one;
|
||||||
|
self.anchoredPosition3D = Vector3.zero;
|
||||||
|
self.pivot = new Vector2(0.5f, 0.5f);
|
||||||
|
self.offsetMax = Vector2.zero;
|
||||||
|
self.offsetMin = Vector2.zero;
|
||||||
|
self.sizeDelta = Vector2.zero;
|
||||||
|
self.localEulerAngles = Vector3.zero;
|
||||||
|
self.localScale = Vector3.one;
|
||||||
|
}
|
||||||
|
|
||||||
|
//重置位置与旋转
|
||||||
|
public static void ResetLocalPosAndRot(this RectTransform self)
|
||||||
|
{
|
||||||
|
self.localPosition = Vector3.zero;
|
||||||
|
self.localRotation = Quaternion.identity;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 56352ccd99c4451e8356690eff9b1e90
|
||||||
|
timeCreated: 1739263302
|
Loading…
Reference in New Issue
Block a user