Ejemplo n.º 1
0
        protected void DrawViewModelInfo()
        {
            if (viewModelComponent.ExpectedType != null)
            {
                var style = GUI.skin.GetStyle("helpbox");
                GUILayout.BeginVertical(style);

                EditorGUI.indentLevel++;

                showViewModelInfo = EditorGUI.Foldout(
                    EditorGUILayout.GetControlRect(),
                    showViewModelInfo,
                    viewModelComponent.ExpectedType.GetPrettifiedName(),
                    true);

                if (showViewModelInfo)
                {
                    GUILayout.Box("", new[] { GUILayout.ExpandWidth(true), GUILayout.Height(1) });

                    foreach (BindingEntry entry in BindingUtils.GetAllBindings(viewModelComponent.ExpectedType, viewModelComponent))
                    {
                        string propertyType = GetPropertyTypeString(entry);
                        EditorGUILayout.LabelField(entry.PropertyName, propertyType);
                    }
                }

                EditorGUI.indentLevel--;

                GUILayout.EndVertical();
            }
        }