Ejemplo n.º 1
0
    void OnTriggerExit(Collider other)
    {
        SVRA_InteractiveObject component = ValidActiveComponent(other.gameObject);

        if (component == null)
        {
            return;
        }

        collidingObjects.Remove(component);
    }
Ejemplo n.º 2
0
    /* Determine if a GameObject contains the SVRA_InteractiveObject script */
    SVRA_InteractiveObject ValidInteractiveComponent(Transform transform)
    {
        if (transform == null)
        {
            return(null);
        }

        SVRA_InteractiveObject component = transform.GetComponent <SVRA_InteractiveObject>();

        if (component != null && component.enabled)
        {
            return(component);
        }

        return(null);
    }
Ejemplo n.º 3
0
    /* TODO: Look this code over and possibly make it recursive */

    /* Verify that a GameObject contains the SVRA_InteractiveObject script */
    SVRA_InteractiveObject ValidActiveComponent(GameObject gameObject)
    {
        // On Destroy() a GameObject may set to null occasionally so handle that case
        if (gameObject == null)
        {
            return(null);
        }

        SVRA_InteractiveObject component = ValidInteractiveComponent(gameObject.transform);

        if (component == null)
        {
            component = ValidInteractiveComponent(gameObject.transform.parent);
        }

        if (component != null)
        {
            return(component);
        }

        return(null);
    }