高亮bug
This commit is contained in:
parent
8626552a2e
commit
cb2634dc76
|
@ -10,6 +10,8 @@ public class HighLight_VR : MonoBehaviour
|
|||
[ContextMenu("Highlight")]
|
||||
public void Highlight()
|
||||
{
|
||||
Init();
|
||||
|
||||
wasHovering = isHovering;
|
||||
isHovering = true;
|
||||
|
||||
|
@ -69,21 +71,33 @@ public class HighLight_VR : MonoBehaviour
|
|||
}
|
||||
protected virtual bool ShouldIgnore(GameObject check)
|
||||
{
|
||||
if (hideHighlight == null) return false;
|
||||
for (int ignoreIndex = 0; ignoreIndex < hideHighlight.Length; ignoreIndex++)
|
||||
{
|
||||
if (check == hideHighlight[ignoreIndex])
|
||||
if (hideHighlight != null && check == hideHighlight[ignoreIndex])
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected virtual void Start()
|
||||
bool inited = false;
|
||||
|
||||
private void Init()
|
||||
{
|
||||
if (!inited)
|
||||
{
|
||||
inited = true;
|
||||
highlightMat = (Material)Resources.Load("SteamVR_HoverHighlight", typeof(Material));
|
||||
if (highlightMat == null)
|
||||
Debug.LogError("<b>[SteamVR Interaction]</b> Hover Highlight Material is missing. Please create a material named 'SteamVR_HoverHighlight' and place it in a Resources folder", this);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void Start()
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
protected virtual void CreateHighlightRenderers()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue