public override void OnInspectorGUI()
        {
            UpdatePrefabModifiedProperties();

            var defaultLabelStyle = EditorStyles.label.fontStyle;

            EditorStyles.label.fontStyle = viewModelPrefabModified ? FontStyle.Bold : defaultLabelStyle;

            ShowViewModelPropertyMenu(
                new GUIContent("View-model property", "Property on the view-model to bind to."),
                TypeResolver.FindBindableCollectionProperties(targetScript),
                updatedValue => targetScript.ViewModelPropertyName = updatedValue,
                targetScript.ViewModelPropertyName,
                property => true
                );

            EditorStyles.label.fontStyle = templatesRootPrefabModified ? FontStyle.Bold : defaultLabelStyle;

            UpdateProperty(
                updatedValue => targetScript.TemplatesRoot = updatedValue,
                targetScript.TemplatesRoot,
                (GameObject)EditorGUILayout.ObjectField(
                    new GUIContent("Collection templates", "Parent object for all templates to copy and bind to items in the collection."),
                    targetScript.TemplatesRoot,
                    typeof(GameObject),
                    true
                    ),
                "Set collection templates root"
                );

            EditorStyles.label.fontStyle = defaultLabelStyle;
        }
示例#2
0
        public override void OnInspectorGUI()
        {
            // Initialise everything
            var targetScript = (CollectionBinding)target;

            ShowViewModelPropertyMenu(
                new GUIContent("View-model property", "Property on the view-model to bind to."),
                TypeResolver.FindBindableCollectionProperties(targetScript),
                updatedValue => targetScript.viewModelPropertyName = updatedValue,
                targetScript.viewModelPropertyName,
                property => true
                );

            UpdateProperty(
                updatedValue => targetScript.templatesRoot = updatedValue,
                targetScript.templatesRoot,
                (GameObject)EditorGUILayout.ObjectField(
                    new GUIContent("Collection templates", "Object to create instances of for each item in the collection."),
                    targetScript.templatesRoot,
                    typeof(GameObject),
                    true
                    ),
                "Set collection templates root"
                );
        }
示例#3
0
        protected override void OnInspector()
        {
            UpdatePrefabModifiedProperties();

            EditorGUILayout.PropertyField(_templateInitialPoolCountProperty);
            EditorGUILayout.PropertyField(_itemsContainerProperty);
            EditorGUILayout.PropertyField(_templatesProperty, true);

            EditorStyles.label.fontStyle = _viewModelPrefabModified ? FontStyle.Bold : DefaultFontStyle;
            ShowViewModelPropertyMenu(
                new GUIContent("View-model property", "Property on the view-model to bind to."),
                TypeResolver.FindBindableCollectionProperties(_targetScript),
                updatedValue => _targetScript.ViewModelPropertyName = updatedValue,
                _targetScript.ViewModelPropertyName,
                property => true
                );
        }
        protected override void OnInspector()
        {
            UpdatePrefabModifiedProperties();

            EditorGUILayout.PropertyField(_templateInitialPoolCountProperty, new GUIContent("Initial Pool Count", "Initial count of items that will be populated at start."));
            EditorGUILayout.PropertyField(_itemsContainerProperty, new GUIContent("Items Container", "Container where items will be populated."));
            EditorGUILayout.PropertyField(_templatesProperty, new GUIContent("Templates", "Templates to select from when populating from the view-model collection."), true);
            EditorGUILayout.PropertyField(_supportSingleMembersProperty, new GUIContent("Support Single Members", "Whether to spawn templates if only a single member is in the collection."), true);

            EditorStyles.label.fontStyle = _viewModelPrefabModified ? FontStyle.Bold : DefaultFontStyle;
            ShowViewModelPropertyMenu(
                new GUIContent("View-Model Property", "Property on the view-model to bind to."),
                TypeResolver.FindBindableCollectionProperties(_targetScript),
                updatedValue => _targetScript.ViewModelPropertyName = updatedValue,
                _targetScript.ViewModelPropertyName,
                property => true
                );
        }