-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
219 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
86 changes: 86 additions & 0 deletions
86
MvvmUnityProj/CCG/Assets/Code/Core/CustomViewManager/LogViewManagerDecorator.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<string> HighestBusyLayer => _viewManager.HighestBusyLayer; | ||
|
||
public LogViewManagerDecorator(IViewManager viewManager) | ||
{ | ||
_viewManager = viewManager; | ||
} | ||
|
||
public IReadOnlyList<string> 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<IViewModel> 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); | ||
} | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
MvvmUnityProj/CCG/Assets/Code/Core/CustomViewManager/LogViewManagerDecorator.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
using UnityEngine; | ||
using UnityMVVM.DI; | ||
using UnityMVVM.DI.Config; | ||
using Zenject; | ||
|
||
namespace CCG.Core | ||
|
13 changes: 13 additions & 0 deletions
13
MvvmUnityProj/CCG/Assets/Code/Core/ResourcesPrefabProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using UnityEngine; | ||
using UnityMVVM.ViewModelCore.PrefabsProvider; | ||
|
||
namespace CCG.Core | ||
{ | ||
public class ResourcesPrefabProvider : IViewsPrefabsProvider | ||
{ | ||
public GameObject GetViewPrefab(string viewName) | ||
{ | ||
return Resources.Load<GameObject>($"Prefabs/Views/{viewName}View"); | ||
} | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
MvvmUnityProj/CCG/Assets/Code/Core/ResourcesPrefabProvider.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file modified
BIN
+512 Bytes
(100%)
MvvmUnityProj/CCG/Assets/Packages/com.kekchpek.umvvm/UnityMVVM.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion
2
MvvmUnityProj/CCG/Assets/Packages/com.kekchpek.umvvm/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+512 Bytes
(100%)
MvvmUnityProj/QuickStartUnityMVVM/Assets/Libs/UnityMVVM.dll
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.16.0 | ||
0.17.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
using System; | ||
using UnityEngine; | ||
using UnityMVVM.DI.Mapper; | ||
|
||
namespace UnityMVVM.DI.Environment | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
using System; | ||
using UnityEngine; | ||
using UnityMVVM.DI.Mapper; | ||
|
||
namespace UnityMVVM.DI.Environment | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.