Esempio n. 1
0
    void OnTriggerEnter(Collider other)
    {
        if (!other.attachedRigidbody)
        {
            return;
        }
        if (other.attachedRigidbody.isKinematic)
        {
            return;
        }

        //Add caught object to the list
        SC_Caught caught = other.GetComponent <SC_Caught>();

        if (!caught)
        {
            caught = other.gameObject.AddComponent <SC_Caught>();
        }

        caught.Init(this, r, tornadoStrength);

        if (!caughtObject.Contains(caught))
        {
            caughtObject.Add(caught);
        }
    }
Esempio n. 2
0
    void OnTriggerExit(Collider other)
    {
        //Release caught object
        SC_Caught caught = other.GetComponent <SC_Caught>();

        if (caught)
        {
            caught.Release();

            if (caughtObject.Contains(caught))
            {
                caughtObject.Remove(caught);
            }
        }
    }