Beispiel #1
0
        public static int LayerMaskPopup(Rect position, SerializedProperty property, PotentialFieldData plotData)
        {
            var valueProp = property.FindPropertyRelative("value");

            var labels = plotData.layers.Select(x => x.name).ToArray();

            valueProp.intValue = EditorGUI.MaskField(position, valueProp.intValue, labels);

            return(valueProp.intValue);
        }
Beispiel #2
0
        public static int LayerPopup(Rect position, SerializedProperty property, PotentialFieldData data)
        {
            var valueProp = property.FindPropertyRelative("value");

            var values = data.layers.Select(x => x.value).ToArray();
            var labels = data.layers.Select(x => new GUIContent(x.name)).ToArray();

            valueProp.intValue = EditorGUI.IntPopup(position, valueProp.intValue, labels, values);

            return(valueProp.intValue);
        }