Ejemplo n.º 1
0
 // Landing on stuff
 private void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.tag == "ObjectHeadSlot" && !below)
     {
         other.enabled     = false;
         below             = other;
         rigid.isKinematic = true;
         belowPlayer       = other.transform.root.GetComponentInChildren <LandingLogic>();
         if (belowPlayer)
         {
             while (belowPlayer.above)
             {
                 belowPlayer = belowPlayer.above;
             }
             belowPlayer.above = this;
         }
         robot = other.transform.root.GetComponent <Robot>();
         if (robot)
         {
             if (above)
             {
                 above.Detach();
             }
             head.enabled = false;
         }
         transform.parent = other.transform;
     }
 }
Ejemplo n.º 2
0
 void OnTriggerEnter(Collider other)
 {
     if (!other.name.EndsWith("Projectile"))
     {
         return;
     }
     if (other.name.StartsWith(name))
     {
         return;
     }
     if (other.transform.root == this.transform.root)
     {
         return;
     }
     // Get Damage
     landingLogic.Detach();
     Stunned        = true;
     stunTimer      = StunTime;
     rigid.velocity = Vector3.zero;
     jumpThrowController.KnockBack   = other.transform.forward;
     jumpThrowController.KnockBack.y = 0;
     jumpThrowController.KnockBack   = Vector3.Normalize(jumpThrowController.KnockBack) * KnockBack;
     jumpThrowController.JumpThrow   = true;
     Debug.Log(name + " damaged by " + other.name);
 }
 // Update is called once per frame
 void Update()
 {
     if (JumpThrow)
     {
         lander.Detach();
         playerRigidbody.AddForce(Vector3.up * JumpForce + KnockBack);
         JumpThrow = false;
         KnockBack = Vector3.zero;
     }
 }