新增线框模式 边线宽度可自定义
This commit is contained in:
parent
06b0bac688
commit
90b1694ab8
@ -81,6 +81,10 @@ public class Body3DObjItem : MonoBehaviour
|
||||
if (t.shader != null)
|
||||
{
|
||||
GetComponent<Renderer>().material.shader = t.shader;
|
||||
if (body.lineModeWidth != 0)
|
||||
{
|
||||
GetComponent<Renderer>().material.SetFloat("_OutlineWidth", body.lineModeWidth);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -18,7 +18,8 @@ public class ObjectColorToggle : MonoBehaviour
|
||||
private void Awake()
|
||||
{
|
||||
mesh = gameObject.GetComponent<MeshRenderer>();
|
||||
isOffColor = mesh.material.color;
|
||||
isOffColor = mesh.material.color;
|
||||
savedTexture = mesh.material.mainTexture as Texture2D;
|
||||
}
|
||||
|
||||
public void SetColor(State state)
|
||||
@ -28,7 +29,6 @@ public class ObjectColorToggle : MonoBehaviour
|
||||
{
|
||||
case State.On:
|
||||
isOnColor.a = alpha;
|
||||
savedTexture = mesh.material.mainTexture as Texture2D;
|
||||
mesh.material.mainTexture = null;
|
||||
mesh.material.color = isOnColor;
|
||||
break;
|
||||
@ -39,7 +39,6 @@ public class ObjectColorToggle : MonoBehaviour
|
||||
break;
|
||||
case State.Hover:
|
||||
isHoverColor.a = alpha;
|
||||
savedTexture = mesh.material.mainTexture as Texture2D;
|
||||
mesh.material.mainTexture = null;
|
||||
mesh.material.color = isHoverColor;
|
||||
break;
|
||||
|
||||
@ -186,6 +186,7 @@ namespace XMLTool
|
||||
public Dictionary<string, Body> subBody { get; set; } = new Dictionary<string, Body>();
|
||||
|
||||
public Body parent;
|
||||
public float lineModeWidth = 0;
|
||||
//public Dictionary<string, Body> bodyList { get; set; } = new Dictionary<string, Body>();
|
||||
}
|
||||
|
||||
@ -440,6 +441,12 @@ namespace XMLTool
|
||||
body.subBody.Add(subBody.Name, subBody);
|
||||
}
|
||||
body.parent = parent;
|
||||
|
||||
var lineModeWidth = bodyElement.Attribute("lineModeWidth");
|
||||
if (lineModeWidth != null)
|
||||
{
|
||||
float.TryParse(lineModeWidth.Value, out body.lineModeWidth);
|
||||
}
|
||||
return body;
|
||||
}
|
||||
|
||||
|
||||
@ -12198,7 +12198,9 @@
|
||||
|
||||
</Body>
|
||||
|
||||
<Body name="胸内侧神经" englishName="Medial pectoral (C08,T01)" tip="胸内侧神经:发自臂丛内侧束,常与胸外侧神经分支联合,分布于胸小肌和部分胸大肌的神经。" path="Ren_NEW/SM_ShenJing/SM_nerve/SM_brachial_plexus/SM_left_brachial_plexus_and_its_branches/SM_branches_of_left_subclavian/SM_branches_of_left_medial_cord/XiongNeiCeShenJing">
|
||||
<Body name="胸内侧神经" englishName="Medial pectoral (C08,T01)" tip="胸内侧神经:发自臂丛内侧束,常与胸外侧神经分支联合,分布于胸小肌和部分胸大肌的神经。" path="Ren_NEW/SM_ShenJing/SM_nerve/SM_brachial_plexus/SM_left_brachial_plexus_and_its_branches/SM_branches_of_left_subclavian/SM_branches_of_left_medial_cord/XiongNeiCeShenJing"
|
||||
lineModeWidth="0.000003"
|
||||
>
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user