/spacepuppy-unity-framework

This framework is considered obsolete, please see new version at:

Primary LanguageC#

TODO OBSOLETE - See Spacepuppy Unity Framework 3.0

https://github.com/lordofduct/spacepuppy-unity-framework-3.0

Over the years of working with Unity this framework has gathered up a lot of obsoleted code or features that proved unnecessary. That combined with the release of Unity2017 and its heavy revamp to the API and support for .Net 4.6; I'm going to be slowly stripping down and releasing a new version of Spacepuppy Unity Framework in a new repository.

This framework will remain for posterity sake, but will receive no new updates once we make the transition to the new Unity version (we're currently version frozen for a game release, our complete migration should be June 2018).

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

com.spacepuppy.SPEntity: 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.

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.