Exemple #1
0
    void OnTriggerExit(Collider coll)
    {
        var test = coll.gameObject.GetComponent <GrabbableScript>();

        if (test != null)
        {
            Debug.Log("grabbableObject leaving");
            if (GrabbablesAvailable.Any(c => c.GetInstanceID() == test.GetInstanceID()))
            {
                GrabbablesAvailable.Remove(test);
            }
        }
    }
Exemple #2
0
    private void OnTriggerEnter(Collider coll)
    {
        var test = coll.gameObject.GetComponent <GrabbableScript>();

        if (test != null)
        {
            Debug.Log("Detected grabbableObject");
            if (!GrabbablesAvailable.Any(c => c.GetInstanceID() == test.GetInstanceID()))
            {
                GrabbablesAvailable.Add(test);
            }
        }
    }