示例#1
0
    public override void OnInspectorGUI()
    {
        SharpMeshDecomposer obj = (SharpMeshDecomposer)target;

        // base.OnInspectorGUI();
        DecompositionMethodPopup(obj);
        DecompositionOptions(obj);
    }
示例#2
0
    // TODO Can Unity do some reflection stuff to clean this up as we add more
    // options?
    public void DecompositionOptions(SharpMeshDecomposer obj)
    {
        obj.options.precision = EditorGUILayout.FloatField("Precision", obj.options.precision);
        switch (obj.method)
        {
        case SharpMeshDecomposer.Method.Voxel:
            if (obj.options is SharpMeshDecomposer.VoxelOptions)
            {
                var opt = (SharpMeshDecomposer.VoxelOptions)obj.options;
                opt.resolution = EditorGUILayout.IntField("Resolution", opt.resolution);
            }
            break;

        default:
            GUILayout.Label("Unknown Method");
            break;
        }
    }
示例#3
0
 public void DecompositionMethodPopup(SharpMeshDecomposer obj)
 {
     obj.SetMethod((SharpMeshDecomposer.Method)EditorGUILayout.EnumPopup("Decomposition Method", obj.method));
 }