Skip to content

Instantly share code, notes, and snippets.

@MrMatthias
Created January 27, 2016 05:03
Show Gist options
  • Save MrMatthias/5b31e26ce3612b315513 to your computer and use it in GitHub Desktop.
Save MrMatthias/5b31e26ce3612b315513 to your computer and use it in GitHub Desktop.
using UnityEngine;
using UnityEditor;
using System.Collections;
[CustomEditor (typeof(UIInspect))]
public class UIInspectEditor : Editor
{
public override void OnInspectorGUI ()
{
RectTransform rt = ((UIInspect)target).GetComponent<RectTransform> ();
rt.localPosition = EditorGUILayout.Vector3Field ("LocalPosition", rt.localPosition);
rt.position = EditorGUILayout.Vector3Field ("Position", rt.position);
rt.offsetMin = EditorGUILayout.Vector2Field ("Offset Min", rt.offsetMin);
rt.offsetMax = EditorGUILayout.Vector2Field ("Offset Max", rt.offsetMax);
rt.pivot = EditorGUILayout.Vector2Field ("Pivot", rt.pivot);
rt.sizeDelta = EditorGUILayout.Vector2Field ("Size Delta", rt.sizeDelta);
rt.anchoredPosition = EditorGUILayout.Vector2Field ("Anchored Position", rt.anchoredPosition);
rt.anchoredPosition3D = EditorGUILayout.Vector3Field ("Anchored Position 3D", rt.anchoredPosition3D);
rt.localScale = EditorGUILayout.Vector3Field ("Local Scale", rt.localScale);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment