public void forceback(Vector2 vector2) //武器的物理击退,将会反馈给武器的主人 { move mover = parent.GetComponent <move>(); //如果父物体有move if (mover != null && back) { Vector2 back = new Vector2();//将得到的力反过来作为反冲力 back.x = -vector2.x; back.y = -vector2.y; mover.AddSpeeds(back * backer);//将向量传递给move } }
private void FixedUpdate() { if (move.rispeed().y < -0.01) { jumping = false; } if (move.rispeed().y < -0.0001f && move.isgroundcharater() && bounch) { Vector2 a = Vector2.zero; a.x = 0; a.y = jumpspeed * 3 / 5; move.AddSpeeds(a); } }