コード例 #1
0
        public override void OnInspectorGUI()
        {
            Undo.RecordObject(Target, Target.name);

            Utility.SetGUIColor(UltiDraw.Grey);
            using (new EditorGUILayout.VerticalScope("Box")) {
                Utility.ResetGUIColor();
                EditorGUILayout.HelpBox("Contacts", MessageType.None);
                Target.ShowContacts = EditorGUILayout.Toggle("Show Contacts", Target.ShowContacts);
                for (int i = 0; i < Target.Contacts.Length; i++)
                {
                    Target.Contacts[i] = (Transform)EditorGUILayout.ObjectField(Target.Contacts[i], typeof(Transform), true);
                }
                EditorGUILayout.BeginHorizontal();
                if (Utility.GUIButton("Add", UltiDraw.DarkGrey, UltiDraw.White))
                {
                    Target.AddContact();
                }
                if (Utility.GUIButton("Remove", UltiDraw.DarkGrey, UltiDraw.White))
                {
                    Target.RemoveContact();
                }
                EditorGUILayout.EndHorizontal();
            }

            if (GUI.changed)
            {
                EditorUtility.SetDirty(Target);
            }
        }