예제 #1
0
        void OnCollisionEnter2D(Collision2D coll)
        {
            check_in_air(coll);

            if (coll.gameObject.layer != 9)             // check ground layer
            {
                return;
            }

            if (enable_relax && coll.relativeVelocity.sqrMagnitude > strength)
            {
                m_control.body_relax();
            }
        }
예제 #2
0
 // 1. схватиться за край
 void update__grab_to_plane()
 {
     if (gymnast.is_grabbed())
     {
         Physics2D.gravity     = _gravity.Rotate(100f);
         gymnast.is_user_input = false;
         gymnast.body_relax();
         gymnast.is_user_input = true;
         update_action_id      = 1;
         var m = air_door_joint.motor;
         m.motorSpeed         = -m.motorSpeed;
         air_door_joint.motor = m;
         StartCoroutine(show_help_grab());
     }
 }