You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-6Lines changed: 14 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,7 @@ This package contains a collection of classes and interfaces to allow for quick
3
3
4
4
## Installation
5
5
### Through GitHub (Recommended)
6
+
#### Stable Installation
6
7
To install this package in your Unity project, select the "window/Package Manager" entry in the Unity Inspector toolbar. Then, select the "+" icon in the upper left corner of the opened window, and select "Add package from git url." Paste the following:
7
8
8
9
https://github.com/cmwedin/CommandPattern.git
@@ -11,22 +12,29 @@ Once you see this package show up in the Package Manager window, it has been suc
11
12
12
13
You can automatically update the package by clicking the "update," button in the bottom right corner of the package manager window. This will retrieve any changes on main branch on this repository since installation or your last update.
13
14
14
-
#### Advanced installation (Not Recommended)
15
+
#### Bleeding-Edge Installation
15
16
You can install the experimental version of this package instead by adding #Development-Branch to the end of the Github url above. This will make your installation use the most up to date version possible, even before changes are merged onto the main branch.
16
17
17
18
### Through Itch.io
18
-
**This package will be available on Itch.io after 1.0.0 is released in the coming days, this section is currently a placeholder**
19
+
When installing this package through Itch.io you will need to update the package manually. There are two methods to download the package through Itch, you can either install it with the rest of your packages, leaving your asset folder less cluttered, but preventing modifications to the packages files; or you can install it as an asset, placing all of the scripts within your asset folder and allowing you to modify them. Modifications to this packages scripts are recommended only for user very confident in what they are doing.
19
20
20
-
Download this package's archive from its Itch.io page [here](https://github.com/cmwedin/CommandPattern)**(link currently a placeholder)**. Once downloaded, extract the folder contained within to your desired installation location for the package. Note that deleting this folder will break your package installation, even after adding the package to a unity project.
21
+
#### Installing as a Package
22
+
Download this package's archive from its <ahref="https://sadsapphic.itch.io/command-pattern"target="_blank">Itch.io page</a>. Once downloaded, extract the "CommandPattern" folder contained within to your desired installation location. Note that deleting this folder will break your package installation, even after adding the package to a Unity project.
21
23
22
24
After you have downloaded and unzipped the package, open the Unity project you wish to add this package too. Open the package manager window, and select the "+" icon in the upper left corner. Then, select the "Add package from disk" option. Navigate to your installation location and select the "package.json" file. Once you see this package show up in the Package Manager window, it has been successfully installed.
23
25
24
-
**Note that installing the package through this method will require you to update it manually**
26
+
#### Installing as an Asset
27
+
Download the .unitypackage file from this packages <ahref="https://sadsapphic.itch.io/command-pattern"target="_blank">Itch.io page</a>. Once downloaded, open the Unity project you wish to add this package to. Select "Assets" from the Unity Editor's toolbar, an from the "Import Package" menu select "Custom Package". In the window that pops up navigate to the .unitypackage file you downloaded and select it. The package will be added to your assets folder in the "/Packages/CommandPattern/" directory.
25
28
26
-
**The above process is a placeholder and may be changed before the release of version 1.0.0 and upload to Itch.io**
29
+
### Updating the Package
30
+
If you installed the package through GitHub, you can automatically update it to its newest version by clicking the "update" button in the bottom right corner of its entry in the package manager window. If not, you will need to update it manually. In addition, there may be steps needed to migrate your code to the newer version of the package. If there are, these will be added to this section when the update has been released.
31
+
#### Manual Updating as a package
32
+
If you installed the package using the local package installation through the Unity package manager to update it you will need to download the archive for the updated version from the packages Itch.io page. Once you've done this, remove the old package in the package manager, delete the old installation and extract the inner folder from the new archive. If you plan to install the updated package with the same path, you may be able to skip removing the old package, but it is recommended you do so regardless. Once you have completed this, add the updated version of the package through the same installation progress you followed above.
33
+
#### Manual Updating as an Asset
34
+
If you installed the package as an asset using the .unitypackage file, simply download the updated .unitypackage file, delete you old installation in your assets folder, and follow the installation process above using the new .unitypackage file.
27
35
28
36
### Installing the Package Demo
29
-
This package includes a demo showcasing how to use the command pattern along with many scripts you may find helpful to reference when implementing your own commands. Once the package is installed, this demo can easily be added by opening the "Samples" dropdown, and clicking the "import" button next to the "Simple Demo" entry. Once this demo has been imported, you can open it by navigating to the newly created "Samples/CommandPattern/[Current Version]/SimpleDemo" folder and opening the "SimpleDemo.Unity" scene. You may need to enter play-mode and resize your game window for the scene's ui elements to display properly.
37
+
This package includes a demo showcasing how to use the command pattern along with many scripts you may find helpful to reference when implementing your own commands. If you installed the package as an asset the demo will be included by default within the "Demos/SimpleDemo" directory. Once the package is installed, this demo can easily be added by opening the "Samples" dropdown, and clicking the "import" button next to the "Simple Demo" entry. Once this demo has been imported, you can open it by navigating to the newly created "Samples/CommandPattern/[Current Version]/SimpleDemo" folder and opening the "SimpleDemo.Unity" scene. You may need to enter play-mode and resize your game window for the scene's ui elements to display properly.
30
38
31
39
## Using this package
32
40
Full documentation of this package can be found [here](https://cmwedin.github.io/CommandPatternDocumentation/annotated.html)
/// Bypass the CommandStream's queue and immediately attempt to execute an IUndoable's undo command if the IUndoable is in the CommandStream's history
205
+
/// </summary>
206
+
/// <param name="undoable">the IUndoable to execute the undo command of</param>
207
+
/// <returns>The ExecuteCode of the attempt to execute the undo command of the IUndoable, Execute.Failure if the IUndoable was not in the CommandStream's history </returns>
/// Bypass the command queue and immediately attempt to execute an IUndoable's undo command, regardless of wether the IUndoable is in the CommandStream's history
213
+
/// </summary>
214
+
/// <param name="undoable">the IUndoable to execute the undo command of</param>
215
+
/// <returns>The ExecuteCode of the attempt to execute the undo command of the IUndoable</returns>
/// The base scriptable object for the data of projectile behavior
9
9
/// </summary>
10
10
publicabstractclassProjSO:ScriptableObject{
11
+
/// <summary>
12
+
/// The bounds of a projectile
13
+
/// </summary>
14
+
protectedstructProjBounds{
15
+
/// <summary>
16
+
/// The max x position
17
+
/// </summary>
18
+
publicfloatxMax;
19
+
/// <summary>
20
+
/// The max y position
21
+
/// </summary>
22
+
publicfloatyMax;
23
+
/// <summary>
24
+
/// The min x position
25
+
/// </summary>
26
+
publicfloatxMin;
27
+
/// <summary>
28
+
/// The min y position
29
+
/// </summary>
30
+
publicfloatyMin;
31
+
32
+
/// <summary>
33
+
/// Constructs a ProjBounds struct from a rect transform
34
+
/// </summary>
35
+
/// <param name="rectTransform"></param>
36
+
publicProjBounds(RectTransformrectTransform)
37
+
{
38
+
varcorners=rectTransform.GetWorldCorners();
39
+
xMax=corners[2].x;
40
+
yMax=corners[2].y;
41
+
xMin=corners[0].x;
42
+
yMin=corners[0].y;
43
+
}
44
+
}
11
45
/// <summary>
12
46
/// The prefab object to instantiate as the visual base for the projectile
13
47
/// </summary>
@@ -18,11 +52,6 @@ public abstract class ProjSO : ScriptableObject {
18
52
/// </summary>
19
53
[SerializeField]protectedfloatspeed;
20
54
21
-
/// <summary>
22
-
/// The box that should bound the projectiles movement
23
-
/// </summary>
24
-
publicabstractRectTransformBoundingBox{set;}
25
-
26
55
/// <summary>
27
56
/// Invoked in the projectile FixedUpdate method to determine where it should move to next based on where it currently is, where it started, and what direction it was last moving in
28
57
/// Some projectile types may not use all of this information
@@ -32,7 +61,7 @@ public abstract class ProjSO : ScriptableObject {
32
61
/// <param name="prevDirection">the previous direction the projectile moved in</param>
33
62
/// <param name="newDirection">the direction the projectile is moving in now</param>
34
63
/// <returns> The new position of the projectile </returns>
0 commit comments