Spacepuppy Unity Framework

by lordofduct
+

A framework of reusable objects with the Unity game engine version 5.x.

( Updated 3 minutes ago )

spacepuppy-unity-framework

A framework of reusable objects with the Unity game engine version 5.x.

This project is intended to be compiled in Visual Studio and then place the compiled dll's into the project. When compiling you will need to ensure you reference the UnityEngine and UnityEditor dll's for your version of unity. I include a version list in the Resources folder for the version of unity I'm currently using.

Quick Import

Select the latest stable version from the builds section of the git page. Or if you want the bleeding edge build locate the files in the Builds/OpenSource directory of the repo.

Drag the contents of this into a folder anywhere in your project and it'll work out of the box, I prefer the 'Assets/3rdParty/SpacepuppyUnityFramework' folder. The included meta file configures the scripts execution order automatically. Caution, this meta file's guid is what controls the references to scripts in the library, deleting or modifying it will ruin any script references.

Once added make sure to go to "Spacepuppy->Settings->Sync TagData".

This will add the required 'MultiTag' and 'Root' tags, as well as sync any of your existing tags to a resource that can be read at runtime. Any time you add new tags you must sync the tag data again by either clicking this same menu item, or going into /Assets/Resources/TagData and clicking "Sync TagData" in the inspector there.

Earlier version (1.0 and earlier) will require adding these tags manually before syncing.

Custom Building

You'll need to create a folder in Assets for the dll's, I personally use Assets/3rdParty/SpaceuppyUnityFramework. The SpacepuppyUnityFramework dll and .pdb go in there (a .mdb will also be generated by unity, this will allow for code stepping when debugging). I then create a folder Assets/3rdParty/SpaceuppyUnityFramework/Editor and place the SpacepuppyUnityFrameworkEditor dll and .pdb there.

You will also want to go to the PlayerSettings and set the Api compatability level to .Net 2.0, and not 2.0 subset.

Next you'll want to set the execution order of 3 classes in the framework. Of course, if you have meta files turned on, you could just include the supplied SpacepuppyUnityFramework.dll.meta file instead (found in the Resources folder, just place in the same folder as the dll). Those 3 classes are:

com.spacepuppy.GameLoopEntry : -32000

com.spacepuppy.Hooks.EarlyExecutionUpdateEventHooks : -31990

com.spacepuppy.Utils.SpecializedCoponents.EarlyParentSetter : -31980

com.spacepuppy.Hooks.TardyExecutionUpdateEventHooks : 32000

Lastly, make sure to go to "Spacepuppy->Settings->Sync TagData".

This will add the required 'MultiTag' and 'Root' tags, as well as sync any of your existing tags to a resource that can be read at runtime. Any time you add new tags you must sync the tag data again by either clicking this same menu item, or going into /Assets/Resources/TagData and clicking "Sync TagData" in the inspector there.

Now you're fully set up.

Future Plans

I've updated Spacepuppy Framework to work with Unity 5. A final version of 4.6.x support exists as a tagged branch of the project as 1.0.0.198, and is also included as a build in the builds section of the git page. You can fork off this branch to continue work in a 4.6.x setting if you want. All future versions will be number 2.x and will be Unity 5 exclusive.

A unitypackage is still a possibility, but really all it would do is paste the dll's into the folder as described in 'Quick Import', so really, I don't see the need for it.

License

Copyright (c) 2015, Dylan Engelman, Jupiter Lighthouse Studio

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.