private void OnDrawSelectFeatureID()
    {
        FeatureClasses oldSelected = selectedFeatureClass;

        selectedFeatureClass = (FeatureClasses)EditorGUILayout.EnumPopup("Feature Class", selectedFeatureClass);

        if (oldSelected != selectedFeatureClass)
        {
            var classFeatures = FeatureCollection.GetClassFeatures(selectedFeatureClass);
            selectedFeatureNames = classFeatures.Values.ToList();
            feature.FeatureClass = selectedFeatureClass;
            EditorUtility.SetDirty(feature);
        }

        int oldFeatureID = selectedFeatureID;

        selectedFeatureID = EditorGUILayout.Popup("Feature Name", selectedFeatureID, selectedFeatureNames.ToArray());

        if (oldFeatureID != selectedFeatureID)
        {
            var featureName   = selectedFeatureNames[selectedFeatureID];
            var classFeatures = FeatureCollection.GetClassFeatures(selectedFeatureClass);
            feature.FeatureID = classFeatures.FirstOrDefault(x => x.Value == featureName).Key;
            EditorUtility.SetDirty(feature);
        }

        var oldTiming = feature.FeatureTiming;

        feature.FeatureTiming = (FeatureTiming)EditorGUILayout.EnumPopup("Feature Timing", feature.FeatureTiming);
        if (feature.FeatureTiming != oldTiming)
        {
            EditorUtility.SetDirty(feature);
        }
    }
示例#2
0
    private void Start()
    {
        FeatureClassName.text = AssignedFeature.FeatureClass.ToString();
        var features = FeatureCollection.GetClassFeatures(AssignedFeature.FeatureClass);

        FeatureName.text = features[AssignedFeature.FeatureID];
    }
    private void InitializeFeatureIDSelection()
    {
        selectedFeatureClass = featureCondition.FeatureClass;

        var classFeatures = FeatureCollection.GetClassFeatures(selectedFeatureClass);

        selectedFeatureNames = classFeatures.Values.ToList();
        var currentSelectedFeatureID = classFeatures[featureCondition.FeatureID];

        selectedFeatureID = selectedFeatureNames.IndexOf(currentSelectedFeatureID);
    }