diff --git a/Base.meta b/Base.meta new file mode 100644 index 00000000..8dba0432 --- /dev/null +++ b/Base.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 57a599e04133d36409fd637130a3d17c +folderAsset: yes +timeCreated: 1443211432 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Base/Bindings.meta b/Base/Bindings.meta new file mode 100644 index 00000000..e9cc5d40 --- /dev/null +++ b/Base/Bindings.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: bb0957bbed9c5374985b5411148da730 +folderAsset: yes +timeCreated: 1443211432 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Base/Views.meta b/Base/Views.meta new file mode 100644 index 00000000..99aa0761 --- /dev/null +++ b/Base/Views.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 266104c98af9c244f856e2b518244034 +folderAsset: yes +timeCreated: 1443211432 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/UndoSystem.meta b/Editor/UndoSystem.meta new file mode 100644 index 00000000..3136e620 --- /dev/null +++ b/Editor/UndoSystem.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: d80b97c9e905dbe44960d72fc2365f60 +folderAsset: yes +timeCreated: 1443206888 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/uFrameEditors/GameManagerInspector.cs b/Editor/uFrameEditors/GameManagerInspector.cs index 7aa28c02..cd8c7ea6 100644 --- a/Editor/uFrameEditors/GameManagerInspector.cs +++ b/Editor/uFrameEditors/GameManagerInspector.cs @@ -30,12 +30,12 @@ public override void OnInspectorGUI() if (GUIHelpers.DoTriggerButton(new UFStyle() { Label = - string.Format("'{0}': {1}->{2}", instance.Name, instance.Base.Name, - instance.Instance.GetType().Name), + string.Format("'{0}': {1}->{2}", instance.Key.Item1, instance.Key.Item2, + instance.Value.GetType().Name), BackgroundStyle = ElementDesignerStyles.EventButtonStyleSmall })) { - Debug.Log(instance.Instance); + Debug.Log(instance.Value); } @@ -50,7 +50,7 @@ public override void OnInspectorGUI() if (GUIHelpers.DoTriggerButton(new UFStyle() { BackgroundStyle = ElementDesignerStyles.EventButtonStyleSmall, - Label = string.Format("{0}: {1}->{2}", instance.Name, instance.From.Name, instance.To.Name) + Label = string.Format("{0}: {1}->{2}", instance.Key.Item2, instance.Key.Item1.Name, instance.Value.Name) })) { diff --git a/Editor/uFrameEditors/uFrameMVVMKernelInspector.cs b/Editor/uFrameEditors/uFrameMVVMKernelInspector.cs index ae2e8dc7..b48e96f8 100644 --- a/Editor/uFrameEditors/uFrameMVVMKernelInspector.cs +++ b/Editor/uFrameEditors/uFrameMVVMKernelInspector.cs @@ -104,12 +104,12 @@ public override void OnInspectorGUI() if (GUIHelpers.DoTriggerButton(new UFStyle() { Label = - string.Format("'{0}': {1}->{2}", instance.Name, instance.Base.Name, - instance.Instance.GetType().Name), + string.Format("'{0}': {1}->{2}", instance.Key.Item1, instance.Key.Item2, + instance.Value.GetType().Name), BackgroundStyle = ElementDesignerStyles.EventButtonStyleSmall })) { - Debug.Log(instance.Instance); + Debug.Log(instance.Value); } @@ -124,7 +124,7 @@ public override void OnInspectorGUI() if (GUIHelpers.DoTriggerButton(new UFStyle() { BackgroundStyle = ElementDesignerStyles.EventButtonStyleSmall, - Label = string.Format("{0}: {1}->{2}", instance.Name, instance.From.Name, instance.To.Name) + Label = string.Format("{0}: {1}->{2}", instance.Key.Item2, instance.Key.Item1.Name, instance.Value.Name) })) { } diff --git a/Kernel.meta b/Kernel.meta new file mode 100644 index 00000000..6b4f4cac --- /dev/null +++ b/Kernel.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: c560638bd5b108a4dac07c8ab0770843 +folderAsset: yes +timeCreated: 1439161354 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Kernel/Serialization.meta b/Kernel/Serialization.meta new file mode 100644 index 00000000..bdebb7f0 --- /dev/null +++ b/Kernel/Serialization.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: b9e98545f3d6d9840bec3a30dbd7ceaa +folderAsset: yes +timeCreated: 1439161354 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Kernel/Serialization/Json.meta b/Kernel/Serialization/Json.meta new file mode 100644 index 00000000..8c0954d0 --- /dev/null +++ b/Kernel/Serialization/Json.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: f46caa1d61f137049ba79c99c7303b68 +folderAsset: yes +timeCreated: 1439161354 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Kernel/Serialization/Storage.meta b/Kernel/Serialization/Storage.meta new file mode 100644 index 00000000..594028e4 --- /dev/null +++ b/Kernel/Serialization/Storage.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 2d9d0c852d237754c80b6ce50c28fe09 +folderAsset: yes +timeCreated: 1439161354 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/MVVM/Services/ViewService.cs b/MVVM/Services/ViewService.cs index 2639f8e1..b2b06ecc 100644 --- a/MVVM/Services/ViewService.cs +++ b/MVVM/Services/ViewService.cs @@ -35,8 +35,8 @@ public override void Setup() this.OnEvent() .Subscribe(ViewDestroyed); - - this.OnEvent() + + this.OnEvent() .Subscribe(ViewModelDestroyed); } @@ -99,7 +99,7 @@ protected virtual void ViewCreated(ViewCreatedEvent viewCreatedEvent) if (view.ViewModelObject == null && view.BindOnStart) { var viewModel = FetchViewModel(viewCreatedEvent.View); - + } Views.Add(view); } @@ -116,14 +116,13 @@ protected virtual void ViewDestroyed(ViewDestroyedEvent data) }); } } - - protected virtual void ViewModelDestroyed(ViewModelDestroyedEvent data) + + protected virtual void ViewModelDestroyed(ViewModelDestroyedEvent data) { - var instanceIndex = uFrameKernel.Container.Instances.FindIndex(x => x.Name == data.ViewModel.Identifier); - if (instanceIndex >= 0) - { - uFrameKernel.Container.Instances.RemoveAt(instanceIndex); - } + var instanceIndex = uFrameKernel.Container.Instances.FirstOrDefault(x => x.Key.Item2 == data.ViewModel.Identifier); + + uFrameKernel.Container.Instances.Remove(instanceIndex.Key); + } /// @@ -138,7 +137,7 @@ public static ViewModel FetchViewModel(ViewBase viewBase) { return viewBase.ViewModelObject; } - + // Attempt to resolve it by the identifier //var contextViewModel = uFrameMVVMKernel.Container.Resolve(viewBase.Identifier); // It now only registers under the viewmodeltype to allow multip different view-models with the same identifier @@ -174,7 +173,7 @@ public static ViewModel FetchViewModel(ViewBase viewBase) } return viewBase.ViewModelObject = contextViewModel; } - + return contextViewModel; }