Ejemplo n.º 1
0
        public static void DrawLayoutInkLine(InkFile inkFile, int lineNumber, string label)
        {
            GUILayout.BeginHorizontal();
            GUILayout.Label(label);
            string openLabel = "Open" + (lineNumber == -1 ? "" : " (" + lineNumber + ")");

            if (GUILayout.Button(openLabel, GUILayout.Width(80)))
            {
                InkEditorUtils.OpenInEditor(inkFile.filePath, null, lineNumber);
            }
            GUILayout.EndHorizontal();
        }
Ejemplo n.º 2
0
 void CreateTodoList()
 {
     todosList = new ReorderableList(inkFile.todos, typeof(string), false, true, false, false);
     todosList.elementHeight      = 18;
     todosList.drawHeaderCallback = (Rect rect) => {
         EditorGUI.LabelField(rect, "To do");
     };
     todosList.drawElementCallback = (Rect rect, int index, bool isActive, bool isFocused) => {
         Rect           labelRect  = new Rect(rect.x, rect.y, rect.width - 80, rect.height);
         Rect           buttonRect = new Rect(labelRect.xMax, rect.y, 80, rect.height - 2);
         InkCompilerLog log        = ((List <InkCompilerLog>)todosList.list)[index];
         string         label      = log.content;
         GUI.Label(labelRect, label);
         string openLabel = "Open" + (log.lineNumber == -1 ? "" : " (" + log.lineNumber + ")");
         if (GUI.Button(buttonRect, openLabel))
         {
             InkEditorUtils.OpenInEditor(inkFile, log);
         }
     };
 }