1
This commit is contained in:
40
Assets/Plugins/MeshCombineStudio/Editor/ReadMeEditor.cs
Normal file
40
Assets/Plugins/MeshCombineStudio/Editor/ReadMeEditor.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System.Collections;
|
||||
|
||||
namespace MeshCombineStudio
|
||||
{
|
||||
[CustomEditor (typeof(ReadMe))]
|
||||
public class ReadMeEditor : Editor
|
||||
{
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
ReadMe r = (ReadMe)target;
|
||||
|
||||
Event eventCurrent = Event.current;
|
||||
|
||||
GUI.changed = false;
|
||||
|
||||
if (eventCurrent.control && eventCurrent.shift && eventCurrent.keyCode == KeyCode.E && eventCurrent.type == EventType.KeyDown)
|
||||
{
|
||||
r.buttonEdit = !r.buttonEdit;
|
||||
GUI.changed = true;
|
||||
}
|
||||
|
||||
GUILayout.Space(5);
|
||||
|
||||
if (r.buttonEdit)
|
||||
{
|
||||
EditorGUILayout.LabelField("EDIT MODE");
|
||||
r.readme = EditorGUILayout.TextArea(r.readme);
|
||||
}
|
||||
else
|
||||
{
|
||||
EditorGUILayout.TextArea(r.readme);
|
||||
}
|
||||
|
||||
if (GUI.changed) EditorUtility.SetDirty(target);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user