Exemplo n.º 1
0
 private void OnGUI()
 {
     target = EditorGUILayout.ObjectField(target, typeof(GameObject), true) as GameObject;
     if (target != null)
     {
         target.transform.position   = EditorGUILayout.Vector3Field("Position: ", target.transform.position);
         target.transform.rotation   = Quaternion.Euler(EditorGUILayout.Vector3Field("Rotation: ", target.transform.rotation.eulerAngles));
         target.transform.localScale = EditorGUILayout.Vector3Field("Scale: ", target.transform.localScale);
         style.fontSize = 15;
         a = EditorGUILayout.BeginScrollView(a);
         EditorGUILayout.Space();
         EditorGUILayout.LabelField("Translation matrix", style);
         DrawMatrix(M4x4.Translate(target.transform.position));
         DrawMatrix(M4x4.Translate(target.transform.position));
         EditorGUILayout.Space();
         EditorGUILayout.LabelField("Rotation matrix", style);
         DrawMatrix(M4x4.Rotate(target.transform.rotation));
         EditorGUILayout.Space();
         EditorGUILayout.LabelField("Scale matrix", style);
         DrawMatrix(M4x4.Scale(target.transform.localScale));
         EditorGUILayout.Space();
         EditorGUILayout.LabelField("TRS matrix", style);
         DrawMatrix(M4x4.TRS(target.transform.position, target.transform.rotation, target.transform.localScale));
         EditorGUILayout.Space();
         EditorGUILayout.LabelField("Translation matrix", style);
         DrawMatrix(Matrix4x4.Translate(target.transform.position));
         DrawMatrix(Matrix4x4.Translate(target.transform.position));
         EditorGUILayout.Space();
         EditorGUILayout.LabelField("Rotation matrix", style);
         DrawMatrix(Matrix4x4.Rotate(target.transform.rotation));
         EditorGUILayout.Space();
         EditorGUILayout.LabelField("Scale matrix", style);
         DrawMatrix(Matrix4x4.Scale(target.transform.localScale));
         EditorGUILayout.Space();
         EditorGUILayout.LabelField("TRS matrix", style);
         DrawMatrix(Matrix4x4.TRS(target.transform.position, target.transform.rotation, target.transform.localScale));
         EditorGUILayout.EndScrollView();
     }
 }