Tanoda
ColorPickerPresetsEditor.cs
Go to the documentation of this file.
1using UnityEngine;
2using UnityEditor;
3
5{
6 [CustomEditor(typeof(ColorPickerPresets))]
7 public class ColorPickerPresetsEditor : Editor
8 {
9 public override void OnInspectorGUI()
10 {
11 base.OnInspectorGUI();
12
13 var colorPickerPresets = (ColorPickerPresets)target;
14 if (colorPickerPresets.saveMode != ColorPickerPresets.SaveType.JsonFile)
15 return;
16
17 string fileLocation = colorPickerPresets.JsonFilePath;
18
19 if (!System.IO.File.Exists(fileLocation))
20 return;
21
22 if (GUILayout.Button("Open JSON file."))
23 {
24 Application.OpenURL(fileLocation);
25 }
26 }
27 }
28}