コード例 #1
0
        /// <summary>
        /// Fetches the preset properties using the supplied <see cref="PresetFeatureType">PresetFeatureType</see>
        /// </summary>
        /// <param name="name">Name.</param>
        void FetchPresetProperties(object name)
        {
            PresetFeatureType featureType = ((PresetFeatureType)Enum.Parse(typeof(PresetFeatureType), name.ToString()));

            subLayerProperties = PresetSubLayerPropertiesFetcher.GetSubLayerProperties(featureType);
        }
コード例 #2
0
        void DrawLayerVisualizerProperties(VectorSourceType sourceType, SerializedProperty layerProperty, SerializedProperty property)
        {
            var subLayerCoreOptions = layerProperty.FindPropertyRelative("coreOptions");

            var subLayerName    = subLayerCoreOptions.FindPropertyRelative("sublayerName").stringValue;
            var visualizerLayer = subLayerCoreOptions.FindPropertyRelative("layerName").stringValue;
            var subLayerType    = PresetSubLayerPropertiesFetcher.GetPresetTypeFromLayerName(visualizerLayer);

            GUILayout.Space(-_lineHeight);
            layerProperty.FindPropertyRelative("presetFeatureType").intValue = (int)subLayerType;

            GUILayout.Space(_lineHeight);
            //*********************** LAYER NAME BEGINS ***********************************//
            VectorPrimitiveType primitiveTypeProp = (VectorPrimitiveType)subLayerCoreOptions.FindPropertyRelative("geometryType").enumValueIndex;

            var         serializedMapObject = property.serializedObject;
            AbstractMap mapObject           = (AbstractMap)serializedMapObject.targetObject;

            tileJsonData = mapObject.VectorData.GetTileJsonData();

            var layerDisplayNames = tileJsonData.LayerDisplayNames;

            EditorGUI.BeginChangeCheck();
            DrawLayerName(subLayerCoreOptions, layerDisplayNames);
            if (EditorGUI.EndChangeCheck())
            {
                EditorHelper.CheckForModifiedProperty(subLayerCoreOptions);
            }
            //*********************** LAYER NAME ENDS ***********************************//

            EditorGUI.indentLevel++;

            //*********************** FILTERS SECTION BEGINS ***********************************//
            var filterOptions = layerProperty.FindPropertyRelative("filterOptions");

            filterOptions.FindPropertyRelative("_selectedLayerName").stringValue = subLayerCoreOptions.FindPropertyRelative("layerName").stringValue;
            GUILayout.Space(-_lineHeight);
            EditorGUILayout.PropertyField(filterOptions, new GUIContent("Filters"));
            //*********************** FILTERS SECTION ENDS ***********************************//



            //*********************** MODELING SECTION BEGINS ***********************************//
            _modelingSectionDrawer.DrawUI(subLayerCoreOptions, layerProperty, primitiveTypeProp);
            //*********************** MODELING SECTION ENDS ***********************************//


            //*********************** TEXTURING SECTION BEGINS ***********************************//
            if (primitiveTypeProp != VectorPrimitiveType.Point && primitiveTypeProp != VectorPrimitiveType.Custom)
            {
                GUILayout.Space(-_lineHeight);
                EditorGUILayout.PropertyField(layerProperty.FindPropertyRelative("materialOptions"));
            }
            //*********************** TEXTURING SECTION ENDS ***********************************//


            //*********************** GAMEPLAY SECTION BEGINS ***********************************//
            _behaviorModifierSectionDrawer.DrawUI(layerProperty, primitiveTypeProp, sourceType);
            //*********************** GAMEPLAY SECTION ENDS ***********************************//

            EditorGUI.indentLevel--;
        }
        void DrawLayerVisualizerProperties(VectorSourceType sourceType, SerializedProperty layerProperty, SerializedProperty property)
        {
            var subLayerCoreOptions = layerProperty.FindPropertyRelative("coreOptions");
            //var layerName = layerProperty.FindPropertyRelative("coreOptions.layerName");
            //var roadLayerName = layerProperty.FindPropertyRelative("roadLayer");
            //var landuseLayerName = layerProperty.FindPropertyRelative("landuseLayer");


            var subLayerName    = subLayerCoreOptions.FindPropertyRelative("sublayerName").stringValue;
            var visualizerLayer = subLayerCoreOptions.FindPropertyRelative("layerName").stringValue;
            var subLayerType    = PresetSubLayerPropertiesFetcher.GetPresetTypeFromLayerName(visualizerLayer);

            //var maskValue = layerProperty.FindPropertyRelative("_maskValue");
            //var selectedTypes = layerProperty.FindPropertyRelative("selectedTypes");

            GUILayout.Space(-_lineHeight);
            layerProperty.FindPropertyRelative("presetFeatureType").intValue = (int)subLayerType;
            //EditorGUILayout.LabelField("Sub-type : " + "Highway", visualizerNameAndType);
            GUILayout.Space(_lineHeight);
            //*********************** LAYER NAME BEGINS ***********************************//
            VectorPrimitiveType primitiveTypeProp = (VectorPrimitiveType)subLayerCoreOptions.FindPropertyRelative("geometryType").enumValueIndex;

            var         serializedMapObject = property.serializedObject;
            AbstractMap mapObject           = (AbstractMap)serializedMapObject.targetObject;

            tileJsonData = mapObject.VectorData.LayerProperty.tileJsonData;

            var layerDisplayNames = tileJsonData.LayerDisplayNames;

            DrawLayerName(subLayerCoreOptions, layerDisplayNames);
            //*********************** LAYER NAME ENDS ***********************************//

            //*********************** TYPE DROPDOWN BEGINS ***********************************//
            //if (_streetsV7TileStats == null || subTypeValues == null)
            //{
            //	subTypeValues = GetSubTypeValues(layerProperty, visualizerLayer, sourceType);
            //}

            //if ((layerName.stringValue == roadLayerName.stringValue || layerName.stringValue == landuseLayerName.stringValue) && subTypeValues!=null)
            //{
            //	maskValue.intValue = EditorGUILayout.MaskField("Type",maskValue.intValue, subTypeValues);
            //	string selectedOptions = string.Empty;
            //	for (int i = 0; i < subTypeValues.Length; i++)
            //	{
            //		if ((maskValue.intValue & (1 << i)) == (1 << i))
            //		{
            //			if (string.IsNullOrEmpty(selectedOptions))
            //			{
            //				selectedOptions = subTypeValues[i];
            //				continue;
            //			}
            //			selectedOptions += "," + subTypeValues[i];
            //		}
            //	}
            //	selectedTypes.stringValue = selectedOptions;
            //}
            //*********************** TYPE DROPDOWN ENDS ***********************************//

            EditorGUI.indentLevel++;

            //*********************** FILTERS SECTION BEGINS ***********************************//
            var filterOptions = layerProperty.FindPropertyRelative("filterOptions");

            filterOptions.FindPropertyRelative("_selectedLayerName").stringValue = subLayerCoreOptions.FindPropertyRelative("layerName").stringValue;
            GUILayout.Space(-_lineHeight);
            EditorGUILayout.PropertyField(filterOptions, new GUIContent("Filters"));
            //*********************** FILTERS SECTION ENDS ***********************************//



            //*********************** MODELING SECTION BEGINS ***********************************//
            _modelingSectionDrawer.DrawUI(subLayerCoreOptions, layerProperty, primitiveTypeProp);
            //*********************** MODELING SECTION ENDS ***********************************//



            //*********************** TEXTURING SECTION BEGINS ***********************************//
            if (primitiveTypeProp != VectorPrimitiveType.Point && primitiveTypeProp != VectorPrimitiveType.Custom)
            {
                GUILayout.Space(-_lineHeight);
                EditorGUILayout.PropertyField(layerProperty.FindPropertyRelative("materialOptions"));
            }
            //*********************** TEXTURING SECTION ENDS ***********************************//


            //*********************** GAMEPLAY SECTION BEGINS ***********************************//
            _behaviorModifierSectionDrawer.DrawUI(layerProperty, primitiveTypeProp, sourceType);
            //*********************** GAMEPLAY SECTION ENDS ***********************************//

            EditorGUI.indentLevel--;
        }