From d592de2d14148ee61da21dbabd6603e4b55228f5 Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 23 Jul 2021 19:38:11 +0800 Subject: Revert "*misc" This reverts commit a257e8db13ed740c016d1acebc6f9edc2801dac8. --- .../Test/15_RectTransform/RectTransformDetail.cs | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 Assets/Test/15_RectTransform/RectTransformDetail.cs (limited to 'Assets/Test/15_RectTransform/RectTransformDetail.cs') 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(); + + } + + // 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; + } +} -- cgit v1.1-26-g67d0