// Start is called before the first frame update private void OnEnable() { // String value parsing levelName.onValueChanged.AddListener(LevelNameChanged); star3.onValueChanged.AddListener(SetGoldValue); star2.onValueChanged.AddListener(SetSilverValue); // Button hooking up clearAll.onClick.AddListener(() => { editor.Clear(); UpdateToEditorContent(); }); saveAll.onClick.AddListener(() => { editor.SaveToFile(); UpdateToEditorContent(); }); toClipboard.onClick.AddListener(() => { editor.SaveToClipboard(compressed: false); }); // Initial reset UpdateToEditorContent(); }
public override void OnInspectorGUI() { GameEditorUtility util = (GameEditorUtility)this.target; if (GUILayout.Button("Save As")) { util.SaveToFile(); } if (GUILayout.Button("Clear All")) { util.Clear(); } if (GUILayout.Button("Copy to Clipboard")) { util.SaveToClipboard(); } DrawDefaultInspector(); }