├── README.md ├── UnityNotes ├── Editor │ └── NoteEditor.cs └── Scripts │ └── Note.cs └── images └── UnityNotes.png /README.md: -------------------------------------------------------------------------------- 1 | Unity Notes 2 | =========== 3 | 4 | Unity Notes adds a Note component that can be addded to any GameObject in order to hold a note about it. 5 | 6 | ![Unity Note](https://raw.github.com/derosa/Unity-Notes/master/images/UnityNotes.png) 7 | 8 | Installation 9 | ============ 10 | 11 | Copy UnityNotes into your assets folder 12 | 13 | How to use Unity Notes 14 | ===================== 15 | 16 | 1. Select the object you want to add a note to. 17 | 2. Go to Component/Note/Add Note 18 | 3. Write your note! 19 | 20 | Developed By 21 | ============ 22 | 23 | * David Erosa - 24 | 25 | License 26 | ======= 27 | 28 | Copyright (c) 2012, David Erosa 29 | 30 | Do whatever you want with this :) 31 | 32 | -------------------------------------------------------------------------------- /UnityNotes/Editor/NoteEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using UnityEditor; 4 | 5 | [CustomEditor(typeof(Note))] 6 | public class NoteEditor : Editor { 7 | private SerializedProperty noteContent; 8 | private SerializedProperty noteTitle; 9 | private bool editable = false; 10 | private GUILayoutOption[] options = { 11 | GUILayout.ExpandWidth (true), 12 | GUILayout.ExpandHeight (true) 13 | }; 14 | 15 | private void OnEnable () 16 | { 17 | noteContent = serializedObject.FindProperty ("note"); 18 | noteTitle = serializedObject.FindProperty ("title"); 19 | editable = false; 20 | } 21 | 22 | public override void OnInspectorGUI () 23 | { 24 | serializedObject.Update (); 25 | 26 | GUIStyle textAreaStyle = new GUIStyle(GUI.skin.GetStyle ("textArea")); 27 | textAreaStyle.wordWrap = true; 28 | textAreaStyle.stretchWidth = true; 29 | textAreaStyle.fixedHeight = 0; 30 | textAreaStyle.stretchHeight = true; 31 | 32 | GUIStyle labelStyle = new GUIStyle(GUI.skin.GetStyle ("label")); 33 | labelStyle.wordWrap = true; 34 | labelStyle.stretchWidth = true; 35 | labelStyle.fontStyle = FontStyle.Normal; 36 | 37 | GUIStyle labelBoldStyle = new GUIStyle (GUI.skin.GetStyle ("label")); 38 | labelBoldStyle.fontStyle = FontStyle.Bold; 39 | 40 | if (GUILayout.Button (editable ? "Lock note" : "Edit note")) { 41 | editable = !editable; 42 | } 43 | 44 | if (editable) { 45 | GUILayout.Label ("Title", labelBoldStyle); 46 | noteTitle.stringValue = EditorGUILayout.TextField (noteTitle.stringValue); 47 | GUILayout.Label ("Note", labelBoldStyle); 48 | noteContent.stringValue = EditorGUILayout.TextArea (noteContent.stringValue, 49 | textAreaStyle, 50 | options); 51 | } else { 52 | GUILayout.Label ("Title", labelBoldStyle); 53 | EditorGUILayout.LabelField (noteTitle.stringValue, labelStyle); 54 | GUILayout.Label ("Note", labelBoldStyle); 55 | EditorGUILayout.LabelField (noteContent.stringValue, 56 | labelStyle, 57 | options); 58 | } 59 | 60 | serializedObject.ApplyModifiedProperties (); 61 | } 62 | } -------------------------------------------------------------------------------- /UnityNotes/Scripts/Note.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | [AddComponentMenu("Note/Add Note")] 4 | public class Note: MonoBehaviour { 5 | public string title = "Note title"; 6 | public string note ="Your note here!"; 7 | } -------------------------------------------------------------------------------- /images/UnityNotes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/derosa/Unity-Notes/ceb976210364b6d49f212542fc73c030052aa542/images/UnityNotes.png --------------------------------------------------------------------------------