Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2015
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.72 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3. using UnityEditor;
  4.  
  5. [CustomEditor(typeof(DMMapShape))]
  6. public class DMMapShapeEditor : Editor {
  7.     public override void OnInspectorGUI() {
  8.         base.OnInspectorGUI();
  9.         if (GUILayout.Button("New point")) {
  10.             DMMapShape mms = (DMMapShape)target;
  11.             GameObject v = mms.NewPoint();
  12.             UnityEditor.Selection.activeGameObject = v;
  13.         }
  14.         if (GUILayout.Button("Restore Parent Shapes References")) {
  15.             DMMapShape mms = (DMMapShape)target;
  16.  
  17.             for (int i = 0; i < mms.verts.Count; i++) {
  18.                 mms.verts[i].GetComponent<DMMapPoint>().parentShape = mms;
  19.             }
  20.         }
  21.        
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement