23 lines
559 B
C#
23 lines
559 B
C#
using UnityEngine;
|
|||
|
|
using System.Collections;
|
||
|
|
using UnityEditor;
|
||
|
|
|
||
|
|
[CustomEditor(typeof(Transform))]
|
||
|
|
public class TransformEditor : Editor {
|
||
|
|
public override void OnInspectorGUI (){
|
||
|
|
|
||
|
|
base.OnInspectorGUI ();
|
||
|
|
EditorGUILayout.BeginHorizontal();
|
||
|
|
if (GUILayout.Button ("Reset rotaton")) {
|
||
|
|
(target as Transform).rotation = Quaternion.identity;
|
||
|
|
}
|
||
|
|
if (GUILayout.Button ("R +90")) {
|
||
|
|
(target as Transform).Rotate(0, 90, 0);
|
||
|
|
}
|
||
|
|
if (GUILayout.Button ("R -90")) {
|
||
|
|
(target as Transform).Rotate(0, -90, 0);
|
||
|
|
}
|
||
|
|
EditorGUILayout.EndHorizontal();
|
||
|
|
}
|
||
|
|
}
|