summaryrefslogtreecommitdiff
path: root/Assets/Test/15_RectTransform/RectTransformDetail.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-07-23 19:38:11 +0800
committerchai <chaifix@163.com>2021-07-23 19:38:11 +0800
commitd592de2d14148ee61da21dbabd6603e4b55228f5 (patch)
tree701bc4f55b5feacf727d954e0b149bc9a6f366d6 /Assets/Test/15_RectTransform/RectTransformDetail.cs
parenta257e8db13ed740c016d1acebc6f9edc2801dac8 (diff)
Revert "*misc"HEADmaster
This reverts commit a257e8db13ed740c016d1acebc6f9edc2801dac8.
Diffstat (limited to 'Assets/Test/15_RectTransform/RectTransformDetail.cs')
-rw-r--r--Assets/Test/15_RectTransform/RectTransformDetail.cs43
1 files changed, 43 insertions, 0 deletions
diff --git a/Assets/Test/15_RectTransform/RectTransformDetail.cs b/Assets/Test/15_RectTransform/RectTransformDetail.cs
new file mode 100644
index 0000000..05dc4fb
--- /dev/null
+++ b/Assets/Test/15_RectTransform/RectTransformDetail.cs
@@ -0,0 +1,43 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+[ExecuteInEditMode]
+public class RectTransformDetail : MonoBehaviour {
+
+ public Vector3 localPosition;
+ public Vector3 position;
+ [Space]
+ public Vector2 anchorPosition;
+ public Vector3 anchorPosition3D;
+ public Vector2 anchorMin;
+ public Vector2 anchorMax;
+ public Vector2 offsetMin;
+ public Vector2 offsetMax;
+ public Vector2 pivot;
+ public Rect rect;
+ public Vector2 sizeDelta;
+
+ private RectTransform rectTransform;
+
+ // Use this for initialization
+ void Start () {
+ rectTransform = GetComponent<RectTransform>();
+
+ }
+
+ // Update is called once per frame
+ void Update () {
+ position = rectTransform.position;
+ localPosition = rectTransform.localPosition;
+
+ anchorPosition = rectTransform.anchoredPosition;
+ anchorPosition3D = rectTransform.anchoredPosition3D;
+ anchorMin = rectTransform.anchorMin;
+ anchorMax = rectTransform.anchorMax;
+ offsetMin = rectTransform.offsetMin;
+ offsetMax = rectTransform.offsetMax;
+ pivot = rectTransform.pivot;
+ rect = rectTransform.rect;
+ sizeDelta = rectTransform.sizeDelta;
+ }
+}