Skip to content

Releases: mfdeveloper/UnityPatterns

UPM package 0.0.2: Added missing .meta files

15 Feb 14:44

Choose a tag to compare

Added missing .meta files + add extra folders with ~ into ignore file

ADDED

  • Added missing Images.meta and README.md.meta files

CHANGED

  • Refactor renameInvalidDirs() function in .github/scripts/functions.sh, in order to copy the content of regular "Samples" dir properly
  • .gitignore file 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

14 Feb 20:21

Choose a tag to compare

Updated README.md files

CHANGED

  • Updated README.md with additional information regarding GITHUB_TOKEN requirement to download/install Github packages
  • .gitignore file 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

17 Nov 10:53

Choose a tag to compare

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 class FactoryComponent, in order to load assets with Addressables
  • New EditorWindow class PreloadScriptableAssets that automates the addition of Player Preloaded Assets files, specially for ScriptableObjects.
  • New static method PreloadScriptableAssets.Initialize that runs on Unity Editor startup/recompilation, for missing .asset files on Preloaded Assets settings 😄

CHANGED

  • Refactoring in FactoryComponent.Get<> sync method with improvements to load assets with Resources.Load()..
  • Refactoring .github/scripts/functions,sh shell scripts to be called locally as well, and automate the publish process to Github Packages and OpenUPM registries.

UPM Package 0.1.5

06 Sep 16:41

Choose a tag to compare

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.DestroyGameObject property. Now you can choose the PersistentDestroyOrder enum types: PREVIOUS or NEXT

PS: You can see a complete running example on scripts under Tests/Runtime/Examples folder

UPM Package 0.1.4

10 Aug 14:11

Choose a tag to compare

  • Updated Unity version to 2021.3.7f1 on example project on branch [upm-package-embedded], and some dependencies on manifest.json

SingletonPersistent

  • Check which instance should be destroyed by enum PersistentDestroyOrder when loads a new scene

  • Added a new C# attribute SingletonSettingsAttribute. Is it possible use this to configure the singletons better (for now, only SingletonPersistent check 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 .cs file, used in Tests/Runtime/SingletonTest.cs

UPM Package 0.1.3

25 Jul 18:24

Choose a tag to compare

  • Updated Unity version to 2021.3.6f1 on example project on branch [upm-package-embedded], and some dependencies on manifest.json

  • Added support to use FactoryComponent.Get<MyScriptable>() to get a ScriptableObject instance from a generics class reference.

    This is useful to get a ScriptableObject instance without attach any manual reference on Unity Editor inspector, and call MyScriptable.Init() method automatically (e.g loading a singleton GameManager thats needs run Init() when the game starts)

UPM Package 0.1.2

09 Jun 13:58

Choose a tag to compare

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

13 May 11:29

Choose a tag to compare

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:

  • ScriptableObject class 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 ScriptableObject stored in the folder: Resources/ScriptableObjects that implements an interface with any name. The method FactoryComponent.Get<AnyInterface>() will return the first .asset from this path.

UPM Package 0.1.0

29 Apr 23:04

Choose a tag to compare

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

26 Apr 09:38

Choose a tag to compare

Added a new pattern based in Factory Method design pattern.

  • New Unit testing inside of Tests/Editor folder that run's more faster the Unity PlayMode tests

  • Refactor one test case from Tests/Runtime/SingletonTest.cs to Tests/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>() and FactoryComponent.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 :)