コード例 #1
0
    void OnTriggerEnter(Collider col)
    {
        if (col.gameObject.CompareTag("PlayerHand"))
        {
            string    hirechy = "";
            Transform obj     = col.transform;
            while (obj != null)
            {
                hirechy += obj.name + " <- ";
                obj      = obj.parent;
            }
            hirechy += "null";

            bool isLeftHand = hirechy.Contains("Left");

            if (isLeftHand == m_LeftHanded)
            {
                if (m_Owner != null)
                {
                    m_Owner.CheckTrackerCollision(this);
                }
                else
                {
                    GestureDetector.instance.TrackerCollisionCheck(this);
                }
            }
        }
        else
        {
            string    hirechy = "";
            Transform obj     = col.transform;
            while (obj != null)
            {
                hirechy += obj.name + " <- ";
                obj      = obj.parent;
            }
            hirechy += "null";
            //Debug.Log(m_ID + ": Collided with " + col.gameObject.name + " tagged as " + col.tag);
            //Debug.Log(m_ID + ": " + hirechy);
        }
    }