diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a34da3e..b1957b3 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -6,6 +6,8 @@ on: - 'master' - 'develop' - 'release/*' + - 'feature/*' + - 'fix/*' jobs: build: @@ -36,6 +38,11 @@ jobs: then git remote set-url origin https://$RUNNER_USERNAME:$PAT_TOKEN@${REPO_URL:6} CURRENT_TAG_VERSION=$(python3 getVersion.py ./VERSION $UMVVM_BUILD_DATA_PATH/buildVersionV1.txt) + CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) + if [[ $CURRENT_BRANCH == feature* || $CURRENT_BRANCH == fix* ]]; + then + CURRENT_TAG_VERSION=$CURRENT_TAG_VERSION-raw + fi git tag $CURRENT_TAG_VERSION git push origin --tags fi diff --git a/MvvmUnityProj/CCG/Assets/Code/Core/CoreInstaller.cs b/MvvmUnityProj/CCG/Assets/Code/Core/CoreInstaller.cs index 34cadf0..d16a51d 100644 --- a/MvvmUnityProj/CCG/Assets/Code/Core/CoreInstaller.cs +++ b/MvvmUnityProj/CCG/Assets/Code/Core/CoreInstaller.cs @@ -1,4 +1,5 @@ using CCG.Core.Camera; +using CCG.Core.CustomViewManager; using CCG.Core.Installers; using CCG.Core.Screen; using CCG.Models.Hand.Model; @@ -21,6 +22,7 @@ using SurvivedWarrior.MVVM.Models.Time; using UnityEngine; using UnityMVVM.DI; +using UnityMVVM.ViewManager; using UnityMVVM.ViewModelCore; using Zenject; @@ -30,6 +32,9 @@ public class CoreInstaller : Installer { public override void InstallBindings() { + + Container.Decorate().With(); + Container.InstallPoolableView(ViewNames.MainScreen, () => Resources.Load("Prefabs/Views/MainScreenView")); Container.InstallView(ViewNames.MainScreen3d, diff --git a/MvvmUnityProj/CCG/Assets/Code/Core/CustomViewManager.meta b/MvvmUnityProj/CCG/Assets/Code/Core/CustomViewManager.meta new file mode 100644 index 0000000..04fce50 --- /dev/null +++ b/MvvmUnityProj/CCG/Assets/Code/Core/CustomViewManager.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: d457b224787c4302b2c2726e00a9deba +timeCreated: 1733066531 \ No newline at end of file diff --git a/MvvmUnityProj/CCG/Assets/Code/Core/CustomViewManager/LogViewManagerDecorator.cs b/MvvmUnityProj/CCG/Assets/Code/Core/CustomViewManager/LogViewManagerDecorator.cs new file mode 100644 index 0000000..f2bdea2 --- /dev/null +++ b/MvvmUnityProj/CCG/Assets/Code/Core/CustomViewManager/LogViewManagerDecorator.cs @@ -0,0 +1,86 @@ +using System; +using System.Collections.Generic; +using AsyncReactAwait.Bindable; +using AsyncReactAwait.Promises; +using UnityEngine; +using UnityMVVM.ViewManager; +using UnityMVVM.ViewManager.ViewLayer; +using UnityMVVM.ViewModelCore; + +namespace CCG.Core.CustomViewManager +{ + public class LogViewManagerDecorator : IViewManager + { + + public event Action<(string layerId, string viewName, IPayload viewPayload)> ViewOpened + { + add => _viewManager.ViewOpened += value; + remove => _viewManager.ViewOpened -= value; + } + + public event Action<(string layerId, string viewName)> ViewClosedImplicitly + { + add => _viewManager.ViewClosedImplicitly += value; + remove => _viewManager.ViewClosedImplicitly -= value; + } + + private readonly IViewManager _viewManager; + + public IBindable HighestBusyLayer => _viewManager.HighestBusyLayer; + + public LogViewManagerDecorator(IViewManager viewManager) + { + _viewManager = viewManager; + } + + public IReadOnlyList GetLayerIds() => _viewManager.GetLayerIds(); + + public IViewModel Create(IViewModel parent, string viewName, Transform container, IPayload payload = null) + { + Debug.Log("View was created!"); + return _viewManager.Create(parent, viewName, container, payload); + } + + public IPromise Open(string viewLayerId, string viewName, IPayload payload = null) + { + Debug.Log("View was opened!"); + return _viewManager.Open(viewLayerId, viewName, payload); + } + + public IPromise OpenExact(string viewLayerId, string viewName, IPayload payload = null) + { + Debug.Log("View was opened on exact layer!"); + return _viewManager.OpenExact(viewLayerId, viewName, payload); + } + + public IPromise CloseExact(string viewLayerId) + { + Debug.Log("View was closed on exact layer!"); + return _viewManager.CloseExact(viewLayerId); + } + + public IPromise Close(string viewLayerId) + { + Debug.Log("View was closed!"); + return _viewManager.Close(viewLayerId); + } + + public string GetViewName(string viewLayerId) + { + Debug.Log("View name was got!"); + return _viewManager.GetViewName(viewLayerId); + } + + public IViewLayer GetLayer(string viewLayerId) + { + Debug.Log("Layer was got!"); + return _viewManager.GetLayer(viewLayerId); + } + + public IViewModel GetView(string viewLayerId) + { + Debug.Log("View was got!"); + return _viewManager.GetView(viewLayerId); + } + } +} \ No newline at end of file diff --git a/MvvmUnityProj/CCG/Assets/Code/Core/CustomViewManager/LogViewManagerDecorator.cs.meta b/MvvmUnityProj/CCG/Assets/Code/Core/CustomViewManager/LogViewManagerDecorator.cs.meta new file mode 100644 index 0000000..20bc12f --- /dev/null +++ b/MvvmUnityProj/CCG/Assets/Code/Core/CustomViewManager/LogViewManagerDecorator.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 530959aed4694e4ead761eaee4211e23 +timeCreated: 1733066545 \ No newline at end of file diff --git a/MvvmUnityProj/CCG/Assets/Packages/com.kekchpek.umvvm/UnityMVVM.dll b/MvvmUnityProj/CCG/Assets/Packages/com.kekchpek.umvvm/UnityMVVM.dll index 4d509ef..00df3b5 100644 Binary files a/MvvmUnityProj/CCG/Assets/Packages/com.kekchpek.umvvm/UnityMVVM.dll and b/MvvmUnityProj/CCG/Assets/Packages/com.kekchpek.umvvm/UnityMVVM.dll differ diff --git a/MvvmUnityProj/QuickStartUnityMVVM/Assets/Libs/UnityMVVM.dll b/MvvmUnityProj/QuickStartUnityMVVM/Assets/Libs/UnityMVVM.dll index 4d509ef..00df3b5 100644 Binary files a/MvvmUnityProj/QuickStartUnityMVVM/Assets/Libs/UnityMVVM.dll and b/MvvmUnityProj/QuickStartUnityMVVM/Assets/Libs/UnityMVVM.dll differ diff --git a/src/UnityMVVM/DI/DiContainerExtensions.cs b/src/UnityMVVM/DI/DiContainerExtensions.cs index 3718257..0ff640e 100644 --- a/src/UnityMVVM/DI/DiContainerExtensions.cs +++ b/src/UnityMVVM/DI/DiContainerExtensions.cs @@ -358,7 +358,7 @@ public static void FastBind(this DiContainer container, IReadOnlyCollecti commonAccessInterfaces = modelAccessInterfaces; } env.ViewsModelsContainerAdapter.Container.Bind(commonAccessInterfaces) - .FromMethod(_ => (TImpl)container.Resolve(modelAccessInterfaces.First())).AsSingle(); + .FromMethodUntyped(_ => container.Resolve(modelAccessInterfaces.First())).AsSingle(); } ///