增加空判断
This commit is contained in:
parent
81246b1a1b
commit
d15534a004
@ -47,9 +47,17 @@ public class DeviceItem : MonoBehaviour
|
|||||||
bool isActive = true;
|
bool isActive = true;
|
||||||
bool.TryParse(obj[0], out isActive);
|
bool.TryParse(obj[0], out isActive);
|
||||||
if (obj.Length == 1 || (obj.Length > 1 && obj[1] == device.Name))
|
if (obj.Length == 1 || (obj.Length > 1 && obj[1] == device.Name))
|
||||||
|
{
|
||||||
|
var high = gameObject.GetComponent<HighlightTrigger>();
|
||||||
|
if (high != null)
|
||||||
{
|
{
|
||||||
gameObject.GetComponent<HighlightTrigger>().enabled = isActive;
|
gameObject.GetComponent<HighlightTrigger>().enabled = isActive;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.LogError(device.Name + "身上没有高亮组件");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user