Beispiel #1
0
 private void OnTriggerStay(Collider collider)
 {
     if (enabled && !collider.GetComponent <VRTK_PlayerObject>() && ValidTarget(collider.transform))
     {
         parent.headsetColliding = true;
         parent.collidingWith    = collider;
         parent.OnHeadsetCollisionDetect(SetHeadsetCollisionEvent(collider, transform));
     }
 }
Beispiel #2
0
 protected virtual void OnTriggerStay(Collider collider)
 {
     if (enabled && !VRTK_PlayerObject.IsPlayerObject(collider.gameObject) && ValidTarget(collider.transform))
     {
         parent.headsetColliding = true;
         parent.collidingWith    = collider;
         parent.OnHeadsetCollisionDetect(SetHeadsetCollisionEvent(collider, transform));
     }
 }
        protected virtual void OnTriggerStay(Collider collider)
        {
            //当たり判定
            string layerName = LayerMask.LayerToName(collider.gameObject.layer);

            if (layerName == "Dead")
            {
                if (trg == false)
                {
                    Debug.Log("しんだ");
                    GameObject.Find("Decision").GetComponent <Decision>().gameOver("fireWall");
                    trg = true;
                }
            }

            if (layerName == "TutorialDead")
            {
                if (trg == false)
                {
                    Debug.Log("しんだ");
                    GameObject.Find("Decision").GetComponent <Decision>().TutorialDead();
                    trg = true;
                }
            }

            if (layerName == "Clear")
            {
                if (trg == false)
                {
                    Debug.Log("くりあー");
                    GameObject.Find("Decision").GetComponent <Decision>().gameClear();
                    trg = true;
                }
            }

            if (parent.ignoreTriggerColliders && collider != null && collider.isTrigger)
            {
                return;
            }

            if (enabled && !VRTK_PlayerObject.IsPlayerObject(collider.gameObject) && ValidTarget(collider.transform))
            {
                parent.headsetColliding = true;
                parent.collidingWith    = collider;
                parent.OnHeadsetCollisionDetect(SetHeadsetCollisionEvent(collider, transform));
            }
        }