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();
 }
示例#3
0
 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();
 }
示例#4
0
        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);
        }