void Handle(SetOnGroundEvent e) { constraint.ForEachGameObject((egoComponent, sfx, actor) => { if (actor.guid == e.actorGuid) { sfx.footFloorSound.pitch = Random.Range(0.9f, 1.1f); sfx.footFloorSound.Play(); } }); }
void Handle(TouchGroundEvent e) { constraint.ForEachGameObject((egoComponent, rigidbody, input, movement, actor) => { if (e.actorGuid == actor.guid) { if (e.isTouchingGround && movement.velocity.y <= 0f) { SetOnGround(movement); var setOnGroundEvent = new SetOnGroundEvent(actor.guid); EgoEvents <SetOnGroundEvent> .AddEvent(setOnGroundEvent); } else { movement.onGround = false; } } }); }