Releases: mfdeveloper/UnityPatterns
UPM package 0.0.2: Added missing .meta files
Added missing .meta files + add extra folders with ~ into ignore file
ADDED
- Added missing
Images.metaandREADME.md.metafiles
CHANGED
- Refactor
renameInvalidDirs()function in.github/scripts/functions.sh, in order to copy the content of regular "Samples" dir properly .gitignorefile in order to exclude copied folders and files from automation scripts.
Full Changelog: 0.2.1...0.2.2
UPM Package 0.2.1: Added Github package installation token requirement
Updated README.md files
CHANGED
- Updated
README.mdwith additional information regardingGITHUB_TOKENrequirement to download/install Github packages .gitignorefile in order to exclude copied folders and files from automation scripts.
Full Changelog: 0.2.0...0.2.1
UPM Package 0.2.0: Addressables async + Resources folder improvements
Addressables support
Use Unity Addressables UPM package in order to load ScriptableObjects .asset files asyncrounously
Github packages / OpenUPM registries
Changed Github actions CI scripts, in order to be called locally as well and automate the process to publish the UPM package to remote registries.
ADDED
- Added new methods
GetAsync<>,GetTask<>,FetchScriptableTask<>,FetchScriptableAsync<>methods to static classFactoryComponent, in order to load assets with Addressables - New EditorWindow class
PreloadScriptableAssetsthat automates the addition of Player Preloaded Assets files, specially for ScriptableObjects. - New static method
PreloadScriptableAssets.Initializethat runs on Unity Editor startup/recompilation, for missing.assetfiles on Preloaded Assets settings 😄
CHANGED
- Refactoring in
FactoryComponent.Get<>sync method with improvements to load assets withResources.Load().. - Refactoring
.github/scripts/functions,shshell scripts to be called locally as well, and automate the publish process to Github Packages and OpenUPM registries.
UPM Package 0.1.5
Github Actions
The main.yml was updated to allow publish the upm package directly from [upm-package-embedded]. Previously, maintain a separated [master] that updates a [upm] branch for release git tags was necessary, due to folder structure differences between UPM embedded package x release package. Now, only two braches on this repo are necessary:
- [master]: With the upm package for release. This branch is updated from Github Actions CI (create git tags from this branch)
- [upm-package-embedded]: Use this branch to develop, commit and testing on Unity Editor
SingletonPersistent
- Allow copy fields from a instance source => destination, configurable by
SingletonSettings.DestroyGameObjectproperty. Now you can choose thePersistentDestroyOrderenum types:PREVIOUSorNEXT
PS: You can see a complete running example on scripts under Tests/Runtime/Examples folder
UPM Package 0.1.4
- Updated Unity version to
2021.3.7f1on example project on branch [upm-package-embedded], and some dependencies on manifest.json
SingletonPersistent
-
Check which instance should be destroyed by enum
PersistentDestroyOrderwhen loads a new scene -
Added a new
C#attributeSingletonSettingsAttribute. Is it possible use this to configure the singletons better (for now, onlySingletonPersistentcheck this attribute:Example
namespace UnityPatterns.Examples { /// <summary> /// An usage example of <see cref="SingletonPersistent{T}"/> implementation /// </summary> [SingletonSettings(DestroyGameObject= PersistentDestroyOrder.PREVIOUS)] public class MySingletonUniquePersistent : SingletonPersistent<MySingletonUniquePersistent> { [SerializeField] protected GameObject gameObjReference; // ... continue the script implementation } }
PS: You can see a complete running example in:
MySingletonUniquePersistent .csfile, used inTests/Runtime/SingletonTest.cs
UPM Package 0.1.3
-
Updated Unity version to
2021.3.6f1on example project on branch [upm-package-embedded], and some dependencies on manifest.json -
Added support to use
FactoryComponent.Get<MyScriptable>()to get aScriptableObjectinstance from a generics class reference.This is useful to get a
ScriptableObjectinstance without attach any manual reference on Unity Editor inspector, and callMyScriptable.Init()method automatically (e.g loading a singletonGameManagerthats needs runInit()when the game starts)
UPM Package 0.1.2
Factory Method
Added a new automatic call to method Init() (if exists) from a loaded ScriptableObject returned by FactoryComponent.Get<>()
This is great if you wish add a initial execution for loaded ScriptableObject just once. Awake() Unity message is never called on Editor, only on builds (unlike of MonoBehaviours)
UPM Package 0.1.1
Added support to fetch a ScriptableObject that implements an C# interface. From this release, you can get this kind of object from the following conventions:
ScriptableObjectclass that implements an interface with the prefix"I", but their name match with the class name:
Example
// The name of the class is "MyScriptable" and the interface is the same,
// uut with the prefix: "I"
class MyScriptable : ScriptableObject, IMyScriptable
{
}- Any
ScriptableObjectstored in the folder:Resources/ScriptableObjectsthat implements an interface with any name. The methodFactoryComponent.Get<AnyInterface>()will return the first .asset from this path.
UPM Package 0.1.0
Main refactors in FactoryComponent.Get<>() to store a "cache" of component instances. This is great to don't search in the all scenes the same GameObject for each call of Get()
UPM Package 0.0.2
Added a new pattern based in Factory Method design pattern.
-
New Unit testing inside of
Tests/Editorfolder that run's more faster the Unity PlayMode tests -
Refactor one test case from
Tests/Runtime/SingletonTest.cstoTests/Editor/SingletonSimpleTest.cs. That's great to be a example of a test that doesn't requires to be of type PlayMode. -
Added static methods
FactoryComponent.Get<IMyInterface>()andFactoryComponent.GetAll<IMyInterface>()to retrieve instances in the scene that contains a script that implements a specific interface.TIP: That's great to find singleton MonoBehaviours managers :)