Exemplo n.º 1
0
        public override void OnInspectorGUI()
        {
            GUILayout.Label("warning, all changes are destructive and there is no undo");
            if (values == null)
            {
                Refresh();
            }

            EditorGUI.BeginChangeCheck();
            isFoldOut = EditorGUILayout.Foldout(isFoldOut, "Expand values");
            if (isFoldOut)
            {
                DrawFoldoutEditor();
            }

            if (selectedPresetName == null && Selection.activeObject != null)
            {
                if (GUILayout.Button("Add Syncer"))
                {
                    foreach (var g in Selection.objects)
                    {
                        GameObject thisGameObject = g as GameObject;
                        if (thisGameObject != null)
                        {
                            palette.AddSyncer(thisGameObject);
                        }
                    }
                }
            }
            if (EditorGUI.EndChangeCheck())
            {
//                Debug.Log("appliting props");
                serializedObject.ApplyModifiedProperties();
                palette.OnValidate();
            }
            if (selectedPresetName == null)
            {
                GUILayout.Label("Selected object has no syncer assigned");
            }
            else
            {
                GUILayout.Label("Selected object picks :" + selectedPresetName);
            }
        }