/**在编辑器更改碰撞器Trigger时*/ private void onEditColliderTrigger(object[] args) { Collider2D collider = (Collider2D)args [0]; bool isTrigger = (bool)args [1]; b2Fixture[] fixtures = _fixtureDict[collider]; if (fixtures != null) { for (int i = 0; i < fixtures.Length; i++) { b2Fixture fixture = fixtures[i]; fixture.SetSensor(isTrigger); } _body.SetAwake(true); } }