Ejemplo n.º 1
0
    void DestructionTypesUpdate(Destruction2DController script)
    {
        Destruction2DVisuals visuals = script.visuals;

        switch (script.destructionType)
        {
        case Destruction2DController.DestructionType.LinearCut:
            foldout = EditorGUILayout.Foldout(foldout, "Linear Cut");
            if (foldout)
            {
                EditorLinearCut(script.linearCutControlelrObject);
            }
            break;

        case Destruction2DController.DestructionType.ComplexCut:
            foldout = EditorGUILayout.Foldout(foldout, "Complex Cut");
            if (foldout)
            {
                EditorComplexCut(script.complexCutControllerObject);
                visuals.minVertexDistance = EditorGUILayout.FloatField("Min Vertex Size", visuals.minVertexDistance);
            }
            break;

        case Destruction2DController.DestructionType.Polygon:
            foldout = EditorGUILayout.Foldout(foldout, "Polygon Cut");
            if (foldout)
            {
                EditorPolygon(script.polygonControllerObject);
                visuals.minVertexDistance = EditorGUILayout.FloatField("Min Vertex Size", visuals.minVertexDistance);
            }
            break;

        case Destruction2DController.DestructionType.PolygonBrush:
            foldout = EditorGUILayout.Foldout(foldout, "Polygon Brush");
            if (foldout)
            {
                EditorPolygonBrush(script.polygonBrushControllerObject);
                visuals.minVertexDistance = EditorGUILayout.FloatField("Min Vertext Size", visuals.minVertexDistance);
            }
            break;

        case Destruction2DController.DestructionType.ComplexBrush:
            foldout = EditorGUILayout.Foldout(foldout, "Complex Brush");
            if (foldout)
            {
                EditorComplexBrush(script.complexBrushControllerObject);
                visuals.minVertexDistance = EditorGUILayout.FloatField("Min Vertex Size", visuals.minVertexDistance);
            }
            break;
        }
    }
Ejemplo n.º 2
0
    void EditorVisuals(Destruction2DVisuals id)
    {
        EditorGUI.indentLevel = EditorGUI.indentLevel + 1;
        id.drawVisuals        = EditorGUILayout.Toggle("Enable Visuals", id.drawVisuals);

        if (id.drawVisuals == true)
        {
            id.zPosition         = EditorGUILayout.FloatField("Z Position", id.zPosition);
            id.destructionColor  = (Color)EditorGUILayout.ColorField("Color", id.destructionColor);
            id.visualScale       = EditorGUILayout.Slider("Scale", id.visualScale, 1f, 50f);
            id.lineBorder        = EditorGUILayout.Toggle("Border", id.lineBorder);
            id.borderScale       = EditorGUILayout.Slider("Border Scale", id.borderScale, 1f, 5f);
            id.lineWidth         = EditorGUILayout.Slider("Width", id.lineWidth, 0.01f, 5f);
            id.lineEndWidth      = EditorGUILayout.Slider("Line End Width", id.lineEndWidth, 0.01f, 5f);
            id.minVertexDistance = EditorGUILayout.Slider("Min Vertex Distance", id.minVertexDistance, 0.1f, 5f);
        }

        EditorGUI.indentLevel = EditorGUI.indentLevel - 1;
    }
Ejemplo n.º 3
0
 public void SetController(Destruction2DVisuals visualsSettings, Destruction2DLayer layerObject)
 {
     visuals          = visualsSettings;
     destructionLayer = layerObject;
 }