Пример #1
0
        void OnCollisionExit(Collision other)
        {
            inCollisionCount--;
            DragModifier dragModifier = other.gameObject.GetComponent <DragModifier>();

            if (dragModifier != null)
            {
                dragKStack.Remove(other.gameObject.GetInstanceID());
            }
            //   Debug.Log("collider = " + other.gameObject.name);
        }
Пример #2
0
        void OnCollisionEnter(Collision other)
        {
            inCollisionCount++;

            DragModifier dragModifier = other.gameObject.GetComponent <DragModifier>();

            if (dragModifier != null)
            {
                dragKStack[other.gameObject.GetInstanceID()] = dragModifier.dragK;
            }
            //   Debug.Log("collider = " + other.gameObject.name);
        }
Пример #3
0
        void OnTriggerExit(Collider other)
        {
            inCollisionCount--;
            DragModifier dragModifier = other.GetComponent <DragModifier>();

            if (dragModifier != null)
            {
                dragKStack.Remove(other.gameObject.GetInstanceID());
            }
            if (other.GetComponent <Water>() != null)
            {
                inWater--;
            }
        }
Пример #4
0
        void OnTriggerEnter(Collider other)
        {
            inCollisionCount++;
            // Debug.Log("collider = " + other.name);
            Hole hole = other.GetComponent <Hole>();

            if (hole != null)
            {
                GetComponent <Rigidbody>().velocity = Vector3.zero;
                ballHole.Dispatch();
            }

            DragModifier dragModifier = other.GetComponent <DragModifier>();

            if (dragModifier != null)
            {
                dragKStack[other.gameObject.GetInstanceID()] = dragModifier.dragK;
            }

            if (other.GetComponent <Water>() != null)
            {
                inWater++;
            }
        }