Skip to content

Commit 4c5b73a

Browse files
authored
Merge pull request #1 from zigurous/release/0.4.0
Release/0.4.0
2 parents d1cf678 + 93269ba commit 4c5b73a

40 files changed

+684
-177
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.html linguist-detectable=false
2+
*.css linguist-detectable=false
3+
*.js linguist-detectable=false

.github/FUNDING.yml

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Generate Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
generate:
15+
name: Docs
16+
uses: zigurous/docs/.github/workflows/unity-package.yml@main
17+
with:
18+
package_title: "Physics Utils"
19+
package_base_path: com.zigurous.physics
20+
package_workflow: generate-docs.yml
21+
package_artifact: docs
22+
secrets:
23+
token: ${{ secrets.DOCS_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/**/obj/
2+
/**/obj.meta

.npmignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
./docs~/
2+
.github/
3+
.gitattributes
4+
.gitignore
5+
.gitmodules
6+
/**/obj/
7+
/**/obj.meta

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,22 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.4.0] - 2023/06/25
9+
10+
### Added
11+
12+
- New classes for custom event types
13+
- `CollisionEvent`
14+
- `CollisionEvent2D`
15+
- `ColliderEvent`
16+
- `ColliderEvent2D`
17+
- New `layerMask` property added to all event behaviors
18+
- Help URLs added to behaviors
19+
20+
### Changed
21+
22+
- Set namespace of all events to `Zigurous.Physics.Events`
23+
824
## [0.3.1] - 2021/06/28
925

1026
### Changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
slug: "/manual/behaviors"
3+
---
4+
5+
# Behaviors
6+
7+
The **Physics Utils** package includes a few scripts for simulating different physics behaviors. These scripts are flexible, customizable and can be used in many different situations.
8+
9+
<hr/>
10+
11+
## 💥 Explosion
12+
13+
It is very common for games to need to simulate explosion physics. The [Explosion](/api/Zigurous.Physics/Explosion) script simulates this behavior on rigidbodies by utilizing the `AddExplosionForce` function provided by Unity. The script detects the objects within a set radius and applies the force to each. You can customize how the explosion is triggered, the strength of the explosion, fuse time, and more.
14+
15+
<hr/>
16+
17+
## 🧲 Magnet
18+
19+
The [Magnet](/api/Zigurous.Physics/Magnet) script can be added to a game object that attracts other objects, and the [Magnetic](/api/Zigurous.Physics/Magnetic) script is added to those objects that can be attracted. This works with or without rigidbodies. A common use case is having the player character attract items or pickups on the ground. This allows the player to collect items from a slight distance as a quality of life improvement.

Documentation~/articles/events.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
slug: "/manual/events"
3+
---
4+
5+
# Event Callbacks
6+
7+
It is very common for scripts in Unity projects to respond to collision/trigger events using Unity's event callback functions, such as `OnCollisionEnter` and `OnTriggerEnter`. 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.
8+
9+
The **Physics Utils** 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.
10+
11+
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.
12+
13+
<img src="../images/event.png" width="480"/>
14+
<br/>
15+
<hr/>
16+
17+
## 📟 Available Classes
18+
19+
- [CollisionEnter](/api/Zigurous.Physics.Events/CollisionEnter)
20+
- [CollisionEnter2D](/api/Zigurous.Physics.Events/CollisionEnter2D)
21+
- [CollisionExit](/api/Zigurous.Physics.Events/CollisionExit)
22+
- [CollisionExit2D](/api/Zigurous.Physics.Events/CollisionExit2D)
23+
- [CollisionStay](/api/Zigurous.Physics.Events/CollisionStay)
24+
- [CollisionStay2D](/api/Zigurous.Physics.Events/CollisionStay2D)
25+
- [TriggerEnter](/api/Zigurous.Physics.Events/TriggerEnter)
26+
- [TriggerEnter2D](/api/Zigurous.Physics.Events/TriggerEnter2D)
27+
- [TriggerExit](/api/Zigurous.Physics.Events/TriggerExit)
28+
- [TriggerExit2D](/api/Zigurous.Physics.Events/TriggerExit2D)
29+
- [TriggerStay](/api/Zigurous.Physics.Events/TriggerStay)
30+
- [TriggerStay2D](/api/Zigurous.Physics.Events/TriggerStay2D)

Documentation~/articles/index.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
slug: "/manual"
3+
---
4+
5+
# Physics Utils
6+
7+
The **Physics Utils** package contains physics-related scripts and utilities for Unity projects. The package is still early in development, and more functionality will be added over time. Let us know what features you would like to see added.
8+
9+
<hr/>
10+
11+
## Overview
12+
13+
#### ⚙️ [Installation](/installation)
14+
15+
#### 🧰 [Scripting API](/api/Zigurous.Physics)
16+
17+
#### 📋 [Changelog](/changelog)
18+
19+
#### ⚖️ [License](/license)
20+
21+
<hr/>
22+
23+
## Reference
24+
25+
#### 🧲 [Behaviors](/manual/behaviors)
26+
27+
#### 📟 [Event Callbacks](/manual/events)
28+
29+
#### 🧊 [Physics Materials](/manual/materials)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
slug: "/installation"
3+
---
4+
5+
# Installation
6+
7+
Use the Unity [Package Manager](https://docs.unity3d.com/Manual/upm-ui.html) to install the **Physics Utils** package.
8+
9+
1. Open the Package Manager in `Window > Package Manager`
10+
2. Click the add (`+`) button in the status bar
11+
3. Select `Add package from git URL` from the add menu
12+
4. Enter the following Git URL in the text box and click Add:
13+
14+
```http
15+
https://github.com/zigurous/unity-physics-utils.git
16+
```
17+
18+
<hr/>
19+
20+
## 🏷️ Namespace
21+
22+
Import the package namespace in each script or file you want to use it. You may need to regenerate project files/assemblies first.
23+
24+
```csharp
25+
using Zigurous.Physics;
26+
```
27+
28+
<hr/>
29+
30+
## 💻 Source Code
31+
32+
The source code for the **Physics Utils** package is in the following repository:
33+
34+
- https://github.com/zigurous/unity-physics-utils

0 commit comments

Comments
 (0)