有些同学遇到的中间道路也变色的话 可以给中间的加上Way标签 然后用如下的代码
void OnMouseEnter() {
if (turretGo == null && EventSystem.current.IsPointerOverGameObject()==false && this.tag !="Way") {
renderer.material.color = Color.red;
}
}
void OnMouseExit() {
if (turretGo == null && EventSystem.current.IsPointerOverGameObject() == false && this.tag != "Way") {
renderer.material.color = Color.white;
}
}