{"repo":"codewriter-packages/Morpeh.Events","free":true,"listed":false,"github":"https://github.com/codewriter-packages/Morpeh.Events","clone":"git clone https://github.com/codewriter-packages/Morpeh.Events.git","description":"Lightweight events for Morpeh","language":"C#","stars":32,"topics":["ecs","entity-component-system","unity","unity3d"],"license":"MIT","category":"game-templates","readme_excerpt":"Morpeh.Events Lightweight events and requests for Morpeh :receipt: Core Concepts :bookmark: Request is a queued command that can consumed in the same frame in which it was sent. A request can be sent from multiple systems, but only one system must handle it. [!IMPORTANT] If you publish requests but do not consume them this may lead to a memory leak because all requests are stored until they are consumed. :bookmark: Event is a one-frame action that is processed on the next frame after it is sent. An event can be processed in many systems. Good practice is to send events only from one system. [!IMPORTANT] Events live only for one frame so it is necessary to process events every frame otherwise some events may be lost. :thought balloon: How to use? Assume that the game has a damage mechanics. So we create DamageRequest and DamageEvent . Damage request can be sent from AttackSystem , ExplosionSystem and so on. Then DamageSystem handles that request and send damage event. Damage event can be handled in PlaySoundOnDamageSystem , ExplodeOnDeathSystem and others. Click to show demo code :open book: How to Install Library distributed as git package (How to install package from git URL) Git URL: https://github.com/codewriter-packages/Morpeh.Events.git :green book: License Morpeh.Events is MIT licensed.","default_branch":null,"files":null,"tree":[],"storefront":"/r/codewriter-packages","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/codewriter-packages/Morpeh.Events/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}