添加插件
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
using UnityEditor;
|
||||
|
||||
namespace Obi
|
||||
{
|
||||
public class ObiBlueprintRenderModeMesh : ObiBlueprintRenderMode
|
||||
{
|
||||
public override string name
|
||||
{
|
||||
get { return "Mesh"; }
|
||||
}
|
||||
|
||||
public ObiMeshBasedActorBlueprintEditor meshBasedEditor
|
||||
{
|
||||
get { return editor as ObiMeshBasedActorBlueprintEditor; }
|
||||
}
|
||||
|
||||
public ObiBlueprintRenderModeMesh(ObiMeshBasedActorBlueprintEditor editor) : base(editor)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnSceneRepaint(SceneView sceneView)
|
||||
{
|
||||
if (meshBasedEditor.currentTool is ObiPaintBrushEditorTool)
|
||||
{
|
||||
ObiPaintBrushEditorTool paintTool = (ObiPaintBrushEditorTool)meshBasedEditor.currentTool;
|
||||
|
||||
float[] weights = new float[ObiActorBlueprintEditor.selectionStatus.Length];
|
||||
for (int i = 0; i < weights.Length; i++)
|
||||
{
|
||||
if (paintTool.selectionMask && !ObiActorBlueprintEditor.selectionStatus[i])
|
||||
weights[i] = 0;
|
||||
else
|
||||
weights[i] = 1;
|
||||
}
|
||||
|
||||
float[] wireframeWeights = new float[paintTool.paintBrush.weights.Length];
|
||||
for (int i = 0; i < wireframeWeights.Length; i++)
|
||||
wireframeWeights[i] = paintTool.paintBrush.weights[i];
|
||||
|
||||
meshBasedEditor.DrawGradientMesh(weights, wireframeWeights);
|
||||
}
|
||||
else
|
||||
meshBasedEditor.DrawGradientMesh();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user