/// <summary> /// 高亮设备 /// </summary> /// <param name="isHighLightLastOff">是否关闭上一个物体的高亮</param> public virtual void HighlightOn(bool isHighLightLastOff = true) { Highlighter h = gameObject.AddMissingComponent <Highlighter>(); Color colorConstant = Color.green; //SetOcculuderState(false); h.ConstantOnImmediate(colorConstant); HighlightManage manager = HighlightManage.Instance; if (manager && isHighLightLastOff) { manager.SetHightLightDep(this); } }
/// <summary> /// 高亮设备 /// </summary> public virtual void HighlightOn() { Debug.Log("DevNode.HighlightOn:" + this); if (gameObject == null) { return; } var h = GetHighTarget().AddMissingComponent <Highlighter>(); Color colorConstant = Color.green; //h.ConstantOn(colorConstant); h.ConstantOnImmediate(colorConstant); h.seeThrough = false; HighlightManage manager = HighlightManage.Instance; if (manager) { manager.SetHightLightDev(this); } }
/// <summary> /// 设置粗模的mesh和高亮 /// </summary> private void SetNormalMeshHighlight(bool isOn) { if (meshRenderer) { meshRenderer.enabled = isOn; } Highlighter highLight = transform.GetComponent<Highlighter>(); if(highLight) { highLight.enabled = false; highLight.enabled = true; HighlightManage manager = HighlightManage.Instance; if (manager) { DevNode dev = manager.GetCurrentHighLightDev(); if(dev!=null&&dev.gameObject==gameObject) { dev.HighlightOn(); } } } }
// Use this for initialization void Start() { Instance = this; }