private Color getBlobColor(ScriptableNode node)
 {
     return(node.Color);
     //switch (node.Type)
     //{
     //    case ScriptableNodeType.Text:
     //        return new Color(0, 1, 1, 0.5f);
     //    default:
     //        return Color.white * 0.95f;
     //}
 }
 private void onGroupClick(ScriptableNode node)
 {
     if (_model.EditedNodeId == node.Id)
     {
         _model.EditedNodeId      = 0;
         _model.SelectedNodeIndex = -1;
     }
     else
     {
         _model.EditedNodeId = node.Id;
     }
 }
        private GUIStyle formatStyle(GUIStyle style, ScriptableNode node)
        {
            switch (node.Type)
            {
            case ScriptableNodeType.Text:
            case ScriptableNodeType.EndOfLine:
                style.normal.textColor = node.TextColor;
                break;

            default:
                style.normal.textColor = Color.white * 0.25f;
                break;
            }
            return(style);
        }
        private GUIContent getBlobContent(ScriptableNode node)
        {
            var hexColor = ColorUtility.ToHtmlStringRGB(node.TextColor);

            switch (node.Type)
            {
            case ScriptableNodeType.Text:
                if (string.IsNullOrEmpty(node.Pattern))
                {
                    return(new GUIContent($"<color=#{hexColor}>Text: <i>None</i></color>"));
                }
                else
                {
                    return(new GUIContent($"<color=#{hexColor}>Text: {node.Pattern}</color>"));
                }

            case ScriptableNodeType.EndOfLine:
                return(new GUIContent($"<color=#{hexColor}><i>End of line</i></color>"));

            case ScriptableNodeType.Name:
                return(new GUIContent($"<color=#{hexColor}><b>Name</b></color>"));

            case ScriptableNodeType.Group:
                return(new GUIContent($"<color=#{hexColor}><b>Group</b></color>"));

            case ScriptableNodeType.X:
                return(new GUIContent($"<color=#{hexColor}><b>X</b></color>"));

            case ScriptableNodeType.Y:
                return(new GUIContent($"<color=#{hexColor}><b>Y</b></color>"));

            case ScriptableNodeType.Width:
                return(new GUIContent($"<color=#{hexColor}><b>Width</b></color>"));

            case ScriptableNodeType.Height:
                return(new GUIContent($"<color=#{hexColor}><b>Height</b></color>"));

            case ScriptableNodeType.PivotX:
                return(new GUIContent($"<color=#{hexColor}><b>Pivot X</b></color>"));

            case ScriptableNodeType.PivotY:
                return(new GUIContent($"<color=#{hexColor}><b>Pivot Y</b></color>"));

            default:
                throw new ApplicationException($"Unknown node type: {node.Type}");
            }
        }
 private GUIStyle getBlobStyle(ScriptableNode node) => formatStyle(_blobStyle, node);
 private GUIStyle getSelectedBlobStyle(ScriptableNode node) => formatStyle(_selectedBlobStyle, node);