Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jun 25, 2023
1 parent 5762db9 commit af08255
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
16 changes: 12 additions & 4 deletions com.zigurous.physics/changelog/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,23 @@
<p>All notable changes to this project will be documented in this file.</p>
<p>The format is based on <a href="https://keepachangelog.com/en/1.0.0/" target="_blank" rel="nofollow noopener noreferrer">Keep a Changelog</a>,
and this project adheres to <a href="https://semver.org/spec/v2.0.0.html" target="_blank" rel="nofollow noopener noreferrer">Semantic Versioning</a>.</p>
<h2>[0.4.1] - 2022/10/30</h2>
<h2>[0.4.0] - 2023/06/25</h2>
<h3>Added</h3>
<ul>
<li>New classes for custom event types
<ul>
<li><code>CollisionEvent</code></li>
<li><code>CollisionEvent2D</code></li>
<li><code>ColliderEvent</code></li>
<li><code>ColliderEvent2D</code></li>
</ul>
</li>
<li>New <code>layerMask</code> property added to all event behaviors</li>
<li>Help URLs added to behaviors</li>
</ul>
<h2>[0.4.0] - 2021/09/15</h2>
<h3>Added</h3>
<h3>Changed</h3>
<ul>
<li>New <code>layerMask</code> property added to all collision event behaviors</li>
<li>Set namespace of all events to <code>Zigurous.Physics.Events</code></li>
</ul>
<h2>[0.3.1] - 2021/06/28</h2>
<h3>Changed</h3>
Expand Down
2 changes: 1 addition & 1 deletion com.zigurous.physics/manual/events/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="ie=edge"/><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/><meta data-react-helmet="true" name="twitter:title" content="Physics Utils • Manual"/><meta data-react-helmet="true" property="og:title" content="Physics Utils • Manual"/><meta name="theme-color" content="#000000"/><meta name="generator" content="Gatsby 4.17.1"/><link data-identity="gatsby-global-css" href="/com.zigurous.physics/styles.ef13b2f53a0efc66bd95.css" rel="stylesheet" type="text/css"/><link rel="icon" href="/com.zigurous.physics/favicon-32x32.png?v=dafff7ae44b92ebb72f2bd1e76273983" type="image/png"/><link rel="manifest" href="/com.zigurous.physics/manifest.webmanifest" crossorigin="anonymous"/><link rel="apple-touch-icon" sizes="48x48" href="/com.zigurous.physics/icons/icon-48x48.png?v=dafff7ae44b92ebb72f2bd1e76273983"/><link rel="apple-touch-icon" sizes="72x72" href="/com.zigurous.physics/icons/icon-72x72.png?v=dafff7ae44b92ebb72f2bd1e76273983"/><link rel="apple-touch-icon" sizes="96x96" href="/com.zigurous.physics/icons/icon-96x96.png?v=dafff7ae44b92ebb72f2bd1e76273983"/><link rel="apple-touch-icon" sizes="144x144" href="/com.zigurous.physics/icons/icon-144x144.png?v=dafff7ae44b92ebb72f2bd1e76273983"/><link rel="apple-touch-icon" sizes="192x192" href="/com.zigurous.physics/icons/icon-192x192.png?v=dafff7ae44b92ebb72f2bd1e76273983"/><link rel="apple-touch-icon" sizes="256x256" href="/com.zigurous.physics/icons/icon-256x256.png?v=dafff7ae44b92ebb72f2bd1e76273983"/><link rel="apple-touch-icon" sizes="384x384" href="/com.zigurous.physics/icons/icon-384x384.png?v=dafff7ae44b92ebb72f2bd1e76273983"/><link rel="apple-touch-icon" sizes="512x512" href="/com.zigurous.physics/icons/icon-512x512.png?v=dafff7ae44b92ebb72f2bd1e76273983"/><link rel="sitemap" type="application/xml" href="/com.zigurous.physics/sitemap/sitemap-index.xml"/><title data-react-helmet="true">Physics Utils • Manual</title><link rel="preconnect" href="https://fonts.googleapis.com"/><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="true"/><link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&amp;display=swap" rel="stylesheet"/><link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&amp;display=swap" rel="stylesheet"/><link href="https://fonts.googleapis.com/icon?family=Material+Icons&amp;display=block" rel="stylesheet"/></head><body><div id="___gatsby"><div style="outline:none" tabindex="-1" id="gatsby-focus-wrapper"><div class="app" id="root" data-theme="dark"><header class="app__header shadow-xs"><div class="layout"><div><div class="logo wordmark small"><button aria-label="Logo"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 596 192"><path d="M528.71,98.72a18.85,18.85,0,0,0-7.36-5.56,92.48,92.48,0,0,0-10.88-3.52A43,43,0,0,1,501.91,87a4.28,4.28,0,0,1-2.76-4,4.21,4.21,0,0,1,1.72-3.52,8.33,8.33,0,0,1,5-1.28A9.36,9.36,0,0,1,511.91,80a7.68,7.68,0,0,1,2.76,5.16h17c-.64-6.4-3.12-11.56-7.48-15.4S513.91,64,506.39,64a31,31,0,0,0-13.2,2.56,19.26,19.26,0,0,0-8.4,7A17.5,17.5,0,0,0,482,83.28q0,6.36,3.12,10.08a18.58,18.58,0,0,0,7.4,5.48,79.1,79.1,0,0,0,10.8,3.28A55.41,55.41,0,0,1,512,105a4.27,4.27,0,0,1,2.68,4,4.37,4.37,0,0,1-1.88,3.64,9,9,0,0,1-5.32,1.4,9.94,9.94,0,0,1-6.36-2,7.23,7.23,0,0,1-2.92-5.2H480a20.18,20.18,0,0,0,4,10.84,23.8,23.8,0,0,0,9.68,7.64,33.14,33.14,0,0,0,14,2.8,32.3,32.3,0,0,0,12.88-2.44A19.55,19.55,0,0,0,529,118.8a16.93,16.93,0,0,0,3-9.76C531.91,104.72,530.83,101.28,528.71,98.72Z"></path><polygon points="64 40.01 64 58.01 101.8 58.01 97.6 64.01 65.4 110.01 64 112.01 64 128.01 77.6 128.01 128 128.01 128 110.01 90.2 110.01 122.4 64.01 126.6 58.01 128 56.01 128 40.01 114.4 40.01 64 40.01"></polygon><path d="M368,64a32,32,0,1,0,32,32.16v-.24A32,32,0,0,0,368,64Zm0,48a16,16,0,1,1,16-16A16,16,0,0,1,368,112Z"></path><path d="M312,71.23V64H292v36.24a12,12,0,0,1-24,0V64H248v38a26,26,0,0,0,20,25.28,24.65,24.65,0,0,0,6,.72,25.92,25.92,0,0,0,18-7.24V128h20V96a16,16,0,0,1,16-16h4V64.07c-.68,0-1.32-.08-2-.08A25.92,25.92,0,0,0,312,71.23Z"></path><path d="M452,83.23v17a12,12,0,0,1-24,0V64H408v38a26,26,0,0,0,20,25.28,24.65,24.65,0,0,0,6,.72,25.92,25.92,0,0,0,18-7.24V128h20V64H452Z"></path><path d="M216,69.76A25.37,25.37,0,0,0,200,64c-15.48,0-28,14.32-28,32a35.72,35.72,0,0,0,3.4,15.32,30.58,30.58,0,0,0,10.4,12.24,24.93,24.93,0,0,0,28.4,0,18.85,18.85,0,0,0,1.8-1.32V130c0,7.72-7.16,14-16,14a17,17,0,0,1-10.4-3.4l-8.92,12.72a37.37,37.37,0,0,0,35.32,4c11.8-4.64,20-15.12,20-27.28V64H216ZM204,112a15.93,15.93,0,0,1-14.72-9.8A15.22,15.22,0,0,1,188,96a16,16,0,1,1,30.08,7.6,17.11,17.11,0,0,1-2.08,3A15.93,15.93,0,0,1,204,112Z"></path><rect x="140.01" y="64.01" width="20" height="64"></rect><path d="M150,36a11,11,0,0,0-10,6.16,9.83,9.83,0,0,0,0,8.64,11.16,11.16,0,0,0,20,0,9.83,9.83,0,0,0,0-8.64A11,11,0,0,0,150,36Z"></path></svg></button></div></div><div><div><div class="display-flex align-items-center container-md"><button aria-label="Open" class="sidedrawer__button"><i aria-hidden="true" class="icon icon--medium icon--active icon--material">menu</i></button><nav class="navbar"><ul><li><a aria-current="page" name="Manual" aria-label="Manual" href="/com.zigurous.physics/manual" class="active">Manual</a></li><li><a aria-current="false" name="Scripting API" aria-label="Scripting API" href="/com.zigurous.physics/api/Zigurous.Physics" class="">Scripting API</a></li><li><a aria-current="false" name="Changelog" aria-label="Changelog" href="/com.zigurous.physics/changelog" class="">Changelog</a></li><li><a aria-current="false" name="License" aria-label="License" href="/com.zigurous.physics/license" class="">License</a></li></ul></nav></div></div><div><button class="btn btn--default btn--rounded-corners btn--text btn--small"><span aria-hidden="true" class="icon-wrapper margin-right-md"><i aria-hidden="true" class="icon icon--inherit icon--active icon--material">light_mode</i></span>Light Mode</button></div></div></div></header><div class="app__content"><div class="layout"><div class="layout__left-container"><nav class="sidenav custom-scrollbar custom-scrollbar--auto-hide"><div class="sidenav__category"><h6 class="sidenav__title eyebrow">📌 Overview</h6><ul><li><a name="Getting Started" href="/com.zigurous.physics/manual" class="">Getting Started</a></li><li><a name="Installation" href="/com.zigurous.physics/installation" class="">Installation</a></li><li><a name="Changelog" href="/com.zigurous.physics/changelog" class="">Changelog</a></li><li><a name="License" href="/com.zigurous.physics/license" class="">License</a></li></ul></div><div class="sidenav__category"><h6 class="sidenav__title eyebrow">📖 Reference</h6><ul><li><a name="Behaviors" href="/com.zigurous.physics/manual/behaviors" class="">Behaviors</a></li><li><a aria-current="page" name="Event Callbacks" href="/com.zigurous.physics/manual/events" class="active">Event Callbacks</a></li><li><a name="Physics Materials" href="/com.zigurous.physics/manual/materials" class="">Physics Materials</a></li></ul></div><div class="sidenav__category"><h6 class="sidenav__title eyebrow">💬 Contact</h6><ul><li><a name="Discord" icon="launch" href="https://discord.gg/DdYyWVb" rel="noopener noreferrer" target="_blank" class="">Discord<i aria-hidden="true" class="icon icon--medium icon--active icon--material color-on-surface-medium">launch</i></a></li><li><a name="Twitter" icon="launch" href="https://twitter.com/zigurous" rel="noopener noreferrer" target="_blank" class="">Twitter<i aria-hidden="true" class="icon icon--medium icon--active icon--material color-on-surface-medium">launch</i></a></li></ul></div><div class="sidenav__category"><h6 class="sidenav__title eyebrow">🔗 Other Links</h6><ul><li><a name="GitHub" icon="launch" href="https://github.com/zigurous/unity-physics-utils" rel="noopener noreferrer" target="_blank" class="">GitHub<i aria-hidden="true" class="icon icon--medium icon--active icon--material color-on-surface-medium">launch</i></a></li><li><a name="Asset Store" icon="launch" href="https://assetstore.unity.com/publishers/51884" rel="noopener noreferrer" target="_blank" class="">Asset Store<i aria-hidden="true" class="icon icon--medium icon--active icon--material color-on-surface-medium">launch</i></a></li><li><a name="YouTube" icon="launch" href="https://youtube.com/c/zigurous?sub_confirmation=1" rel="noopener noreferrer" target="_blank" class="">YouTube<i aria-hidden="true" class="icon icon--medium icon--active icon--material color-on-surface-medium">launch</i></a></li><li><a name="Patreon" icon="launch" href="https://patreon.com/zigurous" rel="noopener noreferrer" target="_blank" class="">Patreon<i aria-hidden="true" class="icon icon--medium icon--active icon--material color-on-surface-medium">launch</i></a></li></ul></div></nav></div><div class="layout__right-container"><main class="container-md"><article class="markdown"><div class="markdown__content"><h1>Event Callbacks</h1>
<p>It is very common for scripts in Unity projects to respond to collision/trigger events using Unity's event callback functions, such as <code>OnCollisionEnter</code> and <code>OnTriggerEnter</code>. In such events, you might need to communicate a state change to another object. This often leads to a lot of boilerplate code and miscellaneous scripts.</p>
<p>The <strong>Physics Utils</strong> package comes with several behaviors that serialize event callbacks into the editor so all you have to do is pick the function you want to be called on any object on any script anywhere in your scene. It eliminates having to create entirely new scripts whenever you need a simple response to an event.</p>
<p>The <strong>Physics Utils</strong> package comes with several behaviors that serialize event callbacks into the editor so all you need to do is pick the function you want to be called on any object in your scene. It eliminates having to create entirely new scripts whenever you need a simple response to an event.</p>
<p>The great thing about Unity's event system is that it is not limited to only functions. You can also invoke property getters/setters, and you can even pass in arguments to functions. Let's say you want to damage your character's health when they enter an unsafe trigger zone, you could easily do that without writing any new code.</p>
<img src="/com.zigurous.physics/static/bdcaa35deb5f6feb2feb0cdfb59a7a09/event.png" width="480"/>
<br/>
Expand Down
2 changes: 1 addition & 1 deletion com.zigurous.physics/page-data/changelog/page-data.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"componentChunkName":"component---src-pages-markdown-remark-frontmatter-slug-js","path":"/changelog","result":{"data":{"markdownRemark":{"html":"<h1>Changelog</h1>\n<p>All notable changes to this project will be documented in this file.</p>\n<p>The format is based on <a href=\"https://keepachangelog.com/en/1.0.0/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Keep a Changelog</a>,\r\nand this project adheres to <a href=\"https://semver.org/spec/v2.0.0.html\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Semantic Versioning</a>.</p>\n<h2>[0.4.1] - 2022/10/30</h2>\n<h3>Added</h3>\n<ul>\n<li>Help URLs added to behaviors</li>\n</ul>\n<h2>[0.4.0] - 2021/09/15</h2>\n<h3>Added</h3>\n<ul>\n<li>New <code>layerMask</code> property added to all collision event behaviors</li>\n</ul>\n<h2>[0.3.1] - 2021/06/28</h2>\n<h3>Changed</h3>\n<ul>\n<li>[AddComponentMenu] attribute added to all behaviors</li>\n</ul>\n<h2>[0.3.0] - 2021/06/09</h2>\n<h3>Added</h3>\n<ul>\n<li>Collider event behaviors</li>\n</ul>\n<h2>[0.2.0] - 2021/05/29</h2>\n<h3>Added</h3>\n<ul>\n<li>Explosion script</li>\n</ul>\n<h3>Changed</h3>\n<ul>\n<li>Renamed physics materials</li>\n</ul>\n<h2>[0.1.0] - 2021/05/19</h2>\n<h3>Added</h3>\n<h4>Scripts</h4>\n<ul>\n<li>Magnet</li>\n<li>Magnetic</li>\n<li>LayerMask Extensions</li>\n</ul>\n<h4>Materials</h4>\n<ul>\n<li>Bouncy</li>\n<li>Bouncy Box (2D)</li>\n<li>Ice</li>\n<li>MaxFriction</li>\n<li>Metal</li>\n<li>Rubber</li>\n<li>Wood</li>\n<li>ZeroFriction</li>\n<li>Slippery (2D)</li>\n<li>Sticky (2D)</li>\n</ul>","frontmatter":{"slug":"/changelog","class":"changelog","title":""}}},"pageContext":{"id":"5cbc93b7-6d98-58e1-866e-ec43b81f62d7","frontmatter__slug":"/changelog","__params":{"frontmatter__slug":"changelog"}}},"staticQueryHashes":["1654257956","2011016986","3218290725"]}
{"componentChunkName":"component---src-pages-markdown-remark-frontmatter-slug-js","path":"/changelog","result":{"data":{"markdownRemark":{"html":"<h1>Changelog</h1>\n<p>All notable changes to this project will be documented in this file.</p>\n<p>The format is based on <a href=\"https://keepachangelog.com/en/1.0.0/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Keep a Changelog</a>,\r\nand this project adheres to <a href=\"https://semver.org/spec/v2.0.0.html\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Semantic Versioning</a>.</p>\n<h2>[0.4.0] - 2023/06/25</h2>\n<h3>Added</h3>\n<ul>\n<li>New classes for custom event types\n<ul>\n<li><code>CollisionEvent</code></li>\n<li><code>CollisionEvent2D</code></li>\n<li><code>ColliderEvent</code></li>\n<li><code>ColliderEvent2D</code></li>\n</ul>\n</li>\n<li>New <code>layerMask</code> property added to all event behaviors</li>\n<li>Help URLs added to behaviors</li>\n</ul>\n<h3>Changed</h3>\n<ul>\n<li>Set namespace of all events to <code>Zigurous.Physics.Events</code></li>\n</ul>\n<h2>[0.3.1] - 2021/06/28</h2>\n<h3>Changed</h3>\n<ul>\n<li>[AddComponentMenu] attribute added to all behaviors</li>\n</ul>\n<h2>[0.3.0] - 2021/06/09</h2>\n<h3>Added</h3>\n<ul>\n<li>Collider event behaviors</li>\n</ul>\n<h2>[0.2.0] - 2021/05/29</h2>\n<h3>Added</h3>\n<ul>\n<li>Explosion script</li>\n</ul>\n<h3>Changed</h3>\n<ul>\n<li>Renamed physics materials</li>\n</ul>\n<h2>[0.1.0] - 2021/05/19</h2>\n<h3>Added</h3>\n<h4>Scripts</h4>\n<ul>\n<li>Magnet</li>\n<li>Magnetic</li>\n<li>LayerMask Extensions</li>\n</ul>\n<h4>Materials</h4>\n<ul>\n<li>Bouncy</li>\n<li>Bouncy Box (2D)</li>\n<li>Ice</li>\n<li>MaxFriction</li>\n<li>Metal</li>\n<li>Rubber</li>\n<li>Wood</li>\n<li>ZeroFriction</li>\n<li>Slippery (2D)</li>\n<li>Sticky (2D)</li>\n</ul>","frontmatter":{"slug":"/changelog","class":"changelog","title":""}}},"pageContext":{"id":"5cbc93b7-6d98-58e1-866e-ec43b81f62d7","frontmatter__slug":"/changelog","__params":{"frontmatter__slug":"changelog"}}},"staticQueryHashes":["1654257956","2011016986","3218290725"]}
Loading

0 comments on commit af08255

Please sign in to comment.