Skip to content

Commit 423874d

Browse files
committed
Update package documentation
1 parent 3d02c1d commit 423874d

21 files changed

+570
-15
lines changed
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: "Architecture Toolkit"
19+
package_base_path: com.zigurous.architecture
20+
package_workflow: generate-docs.yml
21+
package_artifact: docs
22+
secrets:
23+
token: ${{ secrets.DOCS_TOKEN }}

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ 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-
## [1.0.0] - 2022/10/30
8+
## [1.0.0] - TBD
99

1010
- Initial release

Documentation~/.gitkeep

Whitespace-only changes.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
slug: "/manual/attributes"
3+
---
4+
5+
# Attributes
6+
7+
The **Architecture Toolkit** includes a few different C# attributes that are useful to customize the editor interface for custom data structures and behaviours without needing to write custom editor scripts.
8+
9+
<br/>
10+
11+
### [[ConditionalShow]](/api/Zigurous.Architecture/ConditionalShowAttribute)
12+
13+
Shows the field in the editor based on the state of another field.
14+
15+
```csharp
16+
// boolean condition
17+
public bool useCustomValue;
18+
[ConditionalShow(nameof(useCustomValue))]
19+
public float customValue;
20+
21+
// enum condition
22+
public Axis axis;
23+
[ConditionalShow(nameof(axis), (int)Axis.X)]
24+
public float x;
25+
[ConditionalShow(nameof(axis), (int)Axis.Y)]
26+
public float y;
27+
[ConditionalShow(nameof(axis), (int)Axis.Z)]
28+
public float z;
29+
```
30+
31+
<hr/>
32+
33+
### [[ConditionalHide]](/api/Zigurous.Architecture/ConditionalHideAttribute)
34+
35+
Hides the field in the editor based on the state of another field.
36+
37+
```csharp
38+
// boolean condition
39+
public bool useDefaultValue;
40+
[ConditionalHide(nameof(useDefaultValue))]
41+
public float customValue;
42+
43+
// enum condition
44+
public Option option;
45+
[ConditionalHide(nameof(option), (int)Option.B)]
46+
public float a;
47+
[ConditionalHide(nameof(option), (int)Option.A)]
48+
public float b;
49+
```
50+
51+
<hr/>
52+
53+
### [[ReadOnly]](/api/Zigurous.Architecture/ReadOnlyAttribute)
54+
55+
Prevents the field from being modified in the editor.
56+
57+
```csharp
58+
[ReadOnly]
59+
public string info;
60+
```
61+
62+
<hr/>
63+
64+
### [[Rename]](/api/Zigurous.Architecture/RenameAttribute)
65+
66+
Renames the field in the editor.
67+
68+
```csharp
69+
[Rename("Custom Toggle")]
70+
public bool toggle;
71+
```
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
slug: "/manual/behaviours"
3+
---
4+
5+
# Behaviours
6+
7+
The **Architecture Toolkit** includes several behaviours that can be used across an application. All of the behaviours derive from `MonoBehaviour`.
8+
9+
<br/>
10+
11+
### [CursorLockState](/api/Zigurous.Architecture/CursorLockState)
12+
13+
Sets the lock state of the cursor when the behaviour is enabled and disabled.
14+
15+
<hr/>
16+
17+
### [CursorVisibility](/api/Zigurous.Architecture/CursorVisibility)
18+
19+
Sets the visibility of the cursor when the behaviour is enabled and disabled.
20+
21+
<hr/>
22+
23+
### [LoadScene](/api/Zigurous.Architecture/LoadScene)
24+
25+
Loads a scene using a specified set of options.
26+
27+
<hr/>
28+
29+
### [Singleton\<T\>](/api/Zigurous.Architecture/Singleton-1)
30+
31+
Ensures only a single instance of a specified type is instantiated in the scene. The singleton will be destroyed when the scene is unloaded.
32+
33+
<hr/>
34+
35+
### [SingletonPersistent\<T\>](/api/Zigurous.Architecture/SingletonPersistent-1)
36+
37+
Ensures only a single instance of a specified type is instantiated in the scene. The singleton will not be destroyed when changing scenes, thus making it persistent.
38+
39+
<hr/>
40+
41+
### [TargetFrameRate](/api/Zigurous.Architecture/TargetFrameRate)
42+
43+
Sets the target frame rate of the application.
44+
45+
<hr/>
46+
47+
### [TimerBehaviour](/api/Zigurous.Architecture/TimerBehaviour)
48+
49+
Invokes timed events at a set interval and/or duration.
50+
51+
<hr/>
52+
53+
### [UpdateBehaviour](/api/Zigurous.Architecture/UpdateBehaviour)
54+
55+
An abstract class to derive from that can run in any update mode. The update mode can be changed as needed without occuring any additional performance cost.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
slug: "/manual/data-structures"
3+
---
4+
5+
# Data Structures
6+
7+
The **Architecture Toolkit** contains various data structures that may be useful throughout a project. All of the following data structures are available in the package:
8+
9+
## Accumulators
10+
11+
Accumulators work like a reducer function by accumulating a set of values into a single total value except you can store the values using identifiers. This is useful to accumulate values over time while adding and removing values as needed. The total value is updated automatically any time a value is added or removed.
12+
13+
Supported types:
14+
15+
- [Double](/api/Zigurous.Architecture/DoubleAccumulator)
16+
- [Float](/api/Zigurous.Architecture/FloatAccumulator)
17+
- [Int](/api/Zigurous.Architecture/IntAccumulator)
18+
- [Quaternion](/api/Zigurous.Architecture/QuaternionAccumulator)
19+
- [Vector2](/api/Zigurous.Architecture/Vector2Accumulator)
20+
- [Vector2Int](/api/Zigurous.Architecture/Vector2IntAccumulator)
21+
- [Vector3](/api/Zigurous.Architecture/Vector3Accumulator)
22+
- [Vector3Int](/api/Zigurous.Architecture/Vector3IntAccumulator)
23+
- [Vector4](/api/Zigurous.Architecture/Vector4Accumulator)
24+
25+
## Ranges
26+
27+
Ranges allow you to specify a lower and upper bound which can then be used for a multitude of purposes including clamping values, interpolating numbers, generating random values, and more.
28+
29+
Included types:
30+
31+
- [Range\<T\>](/api/Zigurous.Architecture/Range-1)
32+
- [ClampedRange](/api/Zigurous.Architecture/ClampedRange)
33+
- [ColorRange](/api/Zigurous.Architecture/ColorRange)
34+
- [DoubleRange](/api/Zigurous.Architecture/DoubleRange)
35+
- [EulerRange](/api/Zigurous.Architecture/EulerRange)
36+
- [FloatRange](/api/Zigurous.Architecture/FloatRange)
37+
- [IntRange](/api/Zigurous.Architecture/IntRange)
38+
- [UIntRange](/api/Zigurous.Architecture/UIntRange)
39+
- [UnitIntervalRange](/api/Zigurous.Architecture/UnitIntervalRange)
40+
- [Vector2Range](/api/Zigurous.Architecture/Vector2Range)
41+
- [Vector2IntRange](/api/Zigurous.Architecture/Vector2IntRange)
42+
- [Vector3Range](/api/Zigurous.Architecture/Vector3Range)
43+
- [Vector3IntRange](/api/Zigurous.Architecture/Vector3IntRange)
44+
- [Vector4Range](/api/Zigurous.Architecture/Vector4Range)
45+
46+
## Misc
47+
48+
- [Bitmask](/api/Zigurous.Architecture/Bitmask) - A bitmask representation that can be used for bitwise operations.
49+
- [Bool3](/api/Zigurous.Architecture/Bool3) - Stores a tuple of 3 booleans
50+
- [GridSize](/api/Zigurous.Architecture/GridSize) - Stores the size of a grid as rows and columns.
51+
- [Quantity\<T\>](/api/Zigurous.Architecture/Quantity-1) - Stores a quantity of a given entity type
52+
- [Registry\<T\>](/api/Zigurous.Architecture/RegisteredList-1) - Manages a list of unique items and invokes callbacks when an item is added or removed from the list.
53+
- [RuntimeSet\<T\>](/api/Zigurous.Architecture/RuntimeSet-1) - A ScriptableObject that stores a list of items. A project asset can be created for the runtime set so it can be referenced throughout the application, but the items are added and removed at runtime.
54+
- [Size](/api/Zigurous.Architecture/Size) - Stores the size of an entity as a width and height

Documentation~/articles/events.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
slug: "/manual/events"
3+
---
4+
5+
# Events
6+
7+
Events are powerful tool provided by Unity. The **Architecture Toolkit** extends this system by allowing events to be saved as ScriptableObjects. This means the same event can be referenced and listened to by multiple systems throughout the project.
8+
9+
### Game Event
10+
11+
An event can be created through the Asset menu, `Zigurous > Events > Game Event`. There are no properties on an event, but they can be extended further with subclasses if needed. See the [GameEvent](/api/Zigurous.Architecture/GameEvent) Scripting API.
12+
13+
### Game Event Listener
14+
15+
A [GameEventListener](/api/Zigurous.Architecture/GameEventListener) component can be added to any game object that needs to listen for an event. This is a class that derives from `MonoBehaviour` and will register and unregister itself as a listener for the specified event. The listener also declares a standard `UnityEvent` response property that is invoked when the event is raised.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
slug: "/manual/extensions"
3+
---
4+
5+
# Extension Methods
6+
7+
The **Architecture Toolkit** contains hundreds of extension methods that provide enhanced support for common container types and Unity classes. Extension methods are available for the following types:
8+
9+
#### [Array](/api/Zigurous.Architecture/ArrayExtensions)
10+
11+
#### [Behaviour](/api/Zigurous.Architecture/BehaviourExtensions)
12+
13+
#### [Comparable](/api/Zigurous.Architecture/ComparableExtensions)
14+
15+
#### [Dictionary](/api/Zigurous.Architecture/DictionaryExtensions)
16+
17+
#### [GameObject](/api/Zigurous.Architecture/GameObjectExtensions)
18+
19+
#### [HashSet](/api/Zigurous.Architecture/HashSetExtensions)
20+
21+
#### [List](/api/Zigurous.Architecture/ListExtensions)
22+
23+
#### [MonoBehaviour](/api/Zigurous.Architecture/MonoBehaviourExtensions)
24+
25+
#### [Object](/api/Zigurous.Architecture/ObjectExtensions)
26+
27+
#### [SortedSet](/api/Zigurous.Architecture/SortedSetExtensions)
28+
29+
#### [String](/api/Zigurous.Architecture/StringExtensions)
30+
31+
#### [Transform](/api/Zigurous.Architecture/TransformExtensions)

Documentation~/articles/index.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
slug: "/manual"
3+
---
4+
5+
# Architecture Toolkit
6+
7+
The **Architecture Toolkit** contains data structures, design patterns, extensions, and utilities to help solve common architectural problems in Unity projects or simply make common programming tasks easier to manage.
8+
9+
<hr/>
10+
11+
## Overview
12+
13+
#### ⚙️ [Installation](/installation)
14+
15+
#### 🧰 [Scripting API](/api/Zigurous.Architecture)
16+
17+
#### 📋 [Changelog](/changelog)
18+
19+
#### ⚖️ [License](/license)
20+
21+
<hr/>
22+
23+
## Reference
24+
25+
#### 🧬 [Attributes](/manual/attributes)
26+
27+
#### 🃏 [Behaviours](/manual/behaviours)
28+
29+
#### 💾 [Data Structures](/manual/data-structures)
30+
31+
#### 📅 [Events](/manual/events)
32+
33+
#### 🔌 [Extensions](/manual/extensions)
34+
35+
#### 📜 [Scriptable Variables](/manual/scriptable-variables)
36+
37+
#### 🛠️ [Utilities](/manual/utilities)
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 **Architecture Toolkit** 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-architecture-toolkit.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.Architecture;
26+
```
27+
28+
<hr/>
29+
30+
## 💻 Source Code
31+
32+
The source code for the **Architecture Toolkit** package is in the following repository:
33+
34+
- https://github.com/zigurous/unity-architecture-toolkit

0 commit comments

Comments
 (0)