Пример #1
0
 private void LateUpdate()
 {
     if (!this.isGroundHit)
     {
         if (this.objhit == MetaCollider.Hit.hit)
         {
             if (this.objnowhit == MetaCollider.Hit.air || this.objnowhit == MetaCollider.Hit.exit)
             {
                 this.objnowhit = MetaCollider.Hit.hit;
                 this.rigid.set_drag(this.dragHit);
             }
             else if (this.objnowhit == MetaCollider.Hit.hit)
             {
                 this.objnowhit = MetaCollider.Hit.stay;
             }
         }
         else if (this.objnowhit == MetaCollider.Hit.stay || this.objnowhit == MetaCollider.Hit.hit)
         {
             this.objnowhit    = MetaCollider.Hit.exit;
             this.dragTempAir  = this.dragHit;
             this.timeLerpDrag = 0.0f;
         }
         if ((this.objnowhit == MetaCollider.Hit.air || this.objnowhit == MetaCollider.Hit.exit) && (this.nowhit == MetaCollider.Hit.air && this.isEndGravity) && (Object.op_Implicit((Object)this.rigid) && !this.rigid.get_useGravity()))
         {
             this.rigid.set_useGravity(true);
         }
     }
     this.objhit = MetaCollider.Hit.air;
 }
Пример #2
0
 private void OnCollisionExit(Collision col)
 {
     if (!this.judgeWaitTags.Contains(col.get_gameObject().get_tag()))
     {
         return;
     }
     this.nowhit       = MetaCollider.Hit.air;
     this.timeLerpDrag = 0.0f;
     this.dragTempAir  = this.dragHit;
 }
Пример #3
0
 private void OnCollisionEnter(Collision col)
 {
     if (col.get_gameObject().get_layer() == 13 || col.get_gameObject().get_layer() == 17)
     {
         return;
     }
     if (this.isEndGravity && Object.op_Implicit((Object)this.rigid) && this.rigid.get_useGravity())
     {
         this.rigid.set_useGravity(false);
     }
     if (this.judgeTags.Contains(col.get_gameObject().get_tag()))
     {
         this.isGroundHit = true;
         ((Component)this).get_gameObject().set_layer(LayerMask.NameToLayer(this.nameChangeLayer));
         if (Object.op_Implicit((Object)this.rigid))
         {
             this.rigid.set_mass(1f);
             this.rigid.set_useGravity(true);
             this.rigid.set_drag(this.dragWait);
         }
         if (Object.op_Implicit((Object)this.metajoint))
         {
             Object.Destroy((Object)this.metajoint);
         }
         if (Object.op_Implicit((Object)this.joint))
         {
             Object.Destroy((Object)this.joint);
         }
     }
     if (this.judgeWaitTags.Contains(col.get_gameObject().get_tag()))
     {
         this.nowhit = MetaCollider.Hit.hit;
         if (Object.op_Implicit((Object)this.rigid))
         {
             this.rigid.set_drag(this.dragHit);
         }
         this.Constraint(col);
     }
     this.ChangeJoint();
     this.NextAddForce();
     if (!(col.get_gameObject().get_tag() == this.nameBodytagName))
     {
         return;
     }
     this.objhit = MetaCollider.Hit.hit;
 }