Ejemplo n.º 1
0
 public IEnumerator Keep()
 {
     for (;;)
     {
         CameraFade.StartAlphaFade(underwater, true, 1f, 1f);
     }
 }
Ejemplo n.º 2
0
 void OnTriggerExit(Collider other)
 {
     if (other.gameObject.CompareTag("Player"))
     {
         CameraFade.StartAlphaFade(underwater, true, 0.25f, 0.25f);
         var temp = other.gameObject;
         foreach (var elem in temp.GetComponentsInChildren <Rigidbody>())
         {
             elem.drag = initDrag;
             //				elem.angularDrag = 64f;
         }
     }
 }
Ejemplo n.º 3
0
 void OnTriggerEnter(Collider other)
 {
     if (other.transform.parent && other.transform.parent.CompareTag("MainPlayer"))
     {
         CameraFade.StartAlphaFade(underwater, false, 0.25f, 0.125f,
                                   () => { StartCoroutine(Keep(underwater)); });
         var temp = other.gameObject.GetComponentInChildren <mvmt::ThirdPersonController>();
         if (temp)
         {
             temp.dead = true;
             var rbTemp = temp.GetComponentsInChildren <Rigidbody>();
             if (rbTemp != null)
             {
                 foreach (var elem in rbTemp)
                 {
                     //initDrag = elem.drag;
                     elem.drag = drag;
                     //elem.angularDrag = drag;
                 }
             }
         }
     }
     else                //if (other.gameObject.CompareTag("Player")) {
     {
         var rbs = other.gameObject.GetComponentsInChildren <Rigidbody>();
         if (rbs != null)
         {
             foreach (var elem in rbs)
             {
                 //initDrag = elem.drag;
                 elem.drag = drag;
                 //elem.angularDrag = drag;
             }
         }
     }
 }