Ejemplo n.º 1
0
    public void CommonModParamsBasic(MegaModifier mod)
    {
        EditorGUILayout.PropertyField(labelProp, new GUIContent("Label"));
        EditorGUILayout.PropertyField(maxlodProp, new GUIContent("MaxLOD"));
        EditorGUILayout.PropertyField(modenabledProp, new GUIContent("Mod Enabled"));
        EditorGUILayout.PropertyField(displaygizmoProp, new GUIContent("Display Gizmo"));
        int order = mod.Order;

        EditorGUILayout.PropertyField(orderProp, new GUIContent("Order"));
        if (order != mod.Order)
        {
            mod.Order = order;

            MegaModifiers context = mod.GetComponent <MegaModifiers>();

            if (context != null)
            {
                context.BuildList();
            }
        }

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("Gizmo Col");
        EditorGUILayout.PropertyField(gizcol1Prop, GUIContent.none, true);              //, new GUIContent("Display Gizmo"));
        EditorGUILayout.PropertyField(gizcol2Prop, GUIContent.none, true);              //, new GUIContent("Display Gizmo"));
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.PropertyField(gizmodetailProp, new GUIContent("Gizmo Detail"));         //, new GUIContent("Display Gizmo"));
    }
Ejemplo n.º 2
0
    //bool showweight = true;

    //private static GUILayoutOption colWidth = GUILayout.MaxWidth(75.0f);

#if true
    public void CommonModParamsBasic(MegaModifier mod)
    {
        // Basic mod stuff
        //showmodparams = EditorGUILayout.Foldout(showmodparams, "Modifier Common Params");

        //if ( showmodparams )
        //{
        mod.Label        = EditorGUILayout.TextField("Label", mod.Label);
        mod.MaxLOD       = EditorGUILayout.IntField("MaxLOD", mod.MaxLOD);
        mod.ModEnabled   = EditorGUILayout.Toggle("Mod Enabled", mod.ModEnabled);
        mod.useUndo      = EditorGUILayout.Toggle("Use Undo", mod.useUndo);
        mod.DisplayGizmo = EditorGUILayout.Toggle("Display Gizmo", mod.DisplayGizmo);
        int order = EditorGUILayout.IntField("Order", mod.Order);

        if (order != mod.Order)
        {
            mod.Order = order;

            MegaModifiers context = mod.GetComponent <MegaModifiers>();

            if (context != null)
            {
                context.BuildList();
            }
        }

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("Gizmo Col");
        //mod.gizCol1 = EditorGUILayout.ColorField("Giz Col 1", mod.gizCol1, colWidth);
        //mod.gizCol2 = EditorGUILayout.ColorField("Giz Col 2", mod.gizCol2, colWidth);
        mod.gizCol1 = EditorGUILayout.ColorField(mod.gizCol1);                  //, colWidth);
        mod.gizCol2 = EditorGUILayout.ColorField(mod.gizCol2);                  //, colWidth);
        EditorGUILayout.EndHorizontal();

        mod.steps = EditorGUILayout.IntField("Gizmo Detail", mod.steps);
        if (mod.steps < 1)
        {
            mod.steps = 1;
        }
        //}

        //mod.useWeights = EditorGUILayout.Toggle("Use Weights", mod.useWeights);

        //if ( mod.useWeights )
        //	mod.weightChannel = (MegaWeightChannel)EditorGUILayout.EnumPopup("Weight Channel", mod.weightChannel);
    }
    public override bool Inspector()
    {
        MegaMultiVolSelect mod = (MegaMultiVolSelect)target;

#if !UNITY_5 && !UNITY_2017 && !UNITY_2018 && !UNITY_2019
        EditorGUIUtility.LookLikeControls();
#endif
        mod.Label      = EditorGUILayout.TextField("Label", mod.Label);
        mod.MaxLOD     = EditorGUILayout.IntField("MaxLOD", mod.MaxLOD);
        mod.ModEnabled = EditorGUILayout.Toggle("Enabled", mod.ModEnabled);
        int order = EditorGUILayout.IntField("Order", mod.Order);
        if (order != mod.Order)
        {
            mod.Order = order;

            MegaModifiers context = mod.GetComponent <MegaModifiers>();

            if (context != null)
            {
                context.BuildList();
            }
        }

        mod.freezeSelection = EditorGUILayout.Toggle("Freeze Selection", mod.freezeSelection);
        mod.useCurrentVerts = EditorGUILayout.Toggle("Use Stack Verts", mod.useCurrentVerts);

        mod.displayWeights = EditorGUILayout.Toggle("Show Weights", mod.displayWeights);
        mod.gizCol         = EditorGUILayout.ColorField("Gizmo Col", mod.gizCol);
        mod.gizSize        = EditorGUILayout.FloatField("Gizmo Size", mod.gizSize);

        if (GUILayout.Button("Add Volume"))
        {
            mod.volumes.Add(MegaVolume.Create());
            EditorUtility.SetDirty(target);
        }

        for (int v = 0; v < mod.volumes.Count; v++)
        {
            MegaVolume vol = mod.volumes[v];

            vol.enabled = EditorGUILayout.BeginToggleGroup("Enabled", vol.enabled);
            vol.volType = (MegaVolumeType)EditorGUILayout.EnumPopup("Type", vol.volType);

            if (vol.volType == MegaVolumeType.Sphere)
            {
                vol.radius = EditorGUILayout.FloatField("Radius", vol.radius);
            }
            else
            {
                vol.boxsize = EditorGUILayout.Vector3Field("Size", vol.boxsize);
            }

            vol.weight  = EditorGUILayout.Slider("Weight", vol.weight, 0.0f, 1.0f);
            vol.falloff = EditorGUILayout.FloatField("Falloff", vol.falloff);
            vol.origin  = EditorGUILayout.Vector3Field("Origin", vol.origin);
            vol.target  = (Transform)EditorGUILayout.ObjectField("Target", vol.target, typeof(Transform), true);
            vol.inverse = EditorGUILayout.Toggle("Inverse", vol.inverse);

            EditorGUILayout.EndToggleGroup();

            if (GUILayout.Button("Delete Volume"))
            {
                mod.volumes.RemoveAt(v);
                v--;
                EditorUtility.SetDirty(target);
            }
        }

        return(false);
    }
Ejemplo n.º 4
0
    public void CommonModParams(MegaModifier mod)
    {
        showmodparams = EditorGUILayout.Foldout(showmodparams, "Modifier Common Params");

        if (showmodparams)
        {
            EditorGUILayout.BeginHorizontal();

            if (GUILayout.Button("Rst Off"))
            {
                mod.Offset = Vector3.zero;
                EditorUtility.SetDirty(target);
            }

            if (GUILayout.Button("Rst Pos"))
            {
                mod.gizmoPos = Vector3.zero;
                EditorUtility.SetDirty(target);
            }

            if (GUILayout.Button("Rst Rot"))
            {
                mod.gizmoRot = Vector3.zero;
                EditorUtility.SetDirty(target);
            }

            if (GUILayout.Button("Rst Scl"))
            {
                mod.gizmoScale = Vector3.one;
                EditorUtility.SetDirty(target);
            }
            EditorGUILayout.EndHorizontal();

            mod.Offset     = EditorGUILayout.Vector3Field("Offset", mod.Offset);
            mod.gizmoPos   = EditorGUILayout.Vector3Field("Gizmo Pos", mod.gizmoPos);
            mod.gizmoRot   = EditorGUILayout.Vector3Field("Gizmo Rot", mod.gizmoRot);
            mod.gizmoScale = EditorGUILayout.Vector3Field("Gizmo Scale", mod.gizmoScale);
            CommonModParamsBasic(mod);
#if false
            mod.ModEnabled   = EditorGUILayout.Toggle("Mod Enabled", mod.ModEnabled);
            mod.DisplayGizmo = EditorGUILayout.Toggle("Display Gizmo", mod.DisplayGizmo);

            int order = EditorGUILayout.IntField("Order", mod.Order);

            if (order != mod.Order)
            {
                mod.Order = order;

                MegaModifiers context = mod.GetComponent <MegaModifiers>();

                if (context != null)
                {
                    context.BuildList();
                }
            }

            mod.gizCol1 = EditorGUILayout.ColorField("Giz Col 1", mod.gizCol1);
            mod.gizCol2 = EditorGUILayout.ColorField("Giz Col 2", mod.gizCol2);

            //showweight = EditorGUILayout.Foldout(showweight, "Modifier Weight Params");

            //if ( showweight )
            {
                //mod.useWeights = EditorGUILayout.Toggle("Use Weights", mod.useWeights);

                //if ( mod.useWeights )
                //{
                //mod.weightChannel = (MegaWeightChannel)EditorGUILayout.EnumPopup("Weight Channel", mod.weightChannel);
                //}
            }
#endif
        }
    }