void SwitchesCollider(Transform newObject) { if (currentEffect != null) { currentEffect.SetHighlighted(false); currentEffect = null; } currentObject = newObject; if (newObject == null) { return; } HighlightTrigger ht = newObject.GetComponent <HighlightTrigger>(); if (ht != null && ht.enabled) { return; } HighlightEffect otherEffect = newObject.GetComponent <HighlightEffect> (); currentEffect = otherEffect != null ? otherEffect : baseEffect; currentEffect.SetTarget(currentObject.transform); currentEffect.SetHighlighted(true); }
void OnEnable() { triggerMode = serializedObject.FindProperty("triggerMode"); raycastCamera = serializedObject.FindProperty("raycastCamera"); raycastSource = serializedObject.FindProperty("raycastSource"); trigger = (HighlightTrigger)target; trigger.Init(); }
void OnEnable() { triggerMode = serializedObject.FindProperty("triggerMode"); raycastCamera = serializedObject.FindProperty("raycastCamera"); raycastSource = serializedObject.FindProperty("raycastSource"); maxDistance = serializedObject.FindProperty("maxDistance"); volumeLayerMask = serializedObject.FindProperty("volumeLayerMask"); trigger = (HighlightTrigger)target; trigger.Init(); }
void SwitchesCollider(Transform newObject) { if (currentEffect != null) { currentEffect.SetHighlighted(false); currentEffect = null; } currentObject = newObject; if (newObject == null) { return; } HighlightTrigger ht = newObject.GetComponent <HighlightTrigger>(); if (ht != null && ht.enabled) { return; } HighlightEffect otherEffect = newObject.GetComponent <HighlightEffect> (); if (otherEffect == null) { // Check if there's a parent highlight effect that includes this object HighlightEffect parentEffect = newObject.GetComponentInParent <HighlightEffect>(); if (parentEffect != null && parentEffect.Includes(newObject)) { currentEffect = parentEffect; currentEffect.SetHighlighted(true); return; } } currentEffect = otherEffect != null ? otherEffect : baseEffect; currentEffect.SetTarget(currentObject); currentEffect.SetHighlighted(true); }