├── .gitignore ├── LICENSE ├── MVI4Unity ├── .vsconfig ├── Assets │ ├── Core.meta │ ├── Core │ │ ├── ListCalculator.meta │ │ ├── ListCalculator │ │ │ ├── ListCalculator.cs │ │ │ ├── ListCalculator.cs.meta │ │ │ ├── ListCalculatorAlignment.meta │ │ │ ├── ListCalculatorAlignment │ │ │ │ ├── ListCalculatorAlignmentHor.cs │ │ │ │ ├── ListCalculatorAlignmentHor.cs.meta │ │ │ │ ├── ListCalculatorAlignmentHorCenter.cs │ │ │ │ ├── ListCalculatorAlignmentHorCenter.cs.meta │ │ │ │ ├── ListCalculatorAlignmentHorLeft.cs │ │ │ │ ├── ListCalculatorAlignmentHorLeft.cs.meta │ │ │ │ ├── ListCalculatorAlignmentHorRight.cs │ │ │ │ ├── ListCalculatorAlignmentHorRight.cs.meta │ │ │ │ ├── ListCalculatorAlignmentVer.cs │ │ │ │ ├── ListCalculatorAlignmentVer.cs.meta │ │ │ │ ├── ListCalculatorAlignmentVerLower.cs │ │ │ │ ├── ListCalculatorAlignmentVerLower.cs.meta │ │ │ │ ├── ListCalculatorAlignmentVerMiddle.cs │ │ │ │ ├── ListCalculatorAlignmentVerMiddle.cs.meta │ │ │ │ ├── ListCalculatorAlignmentVerUpper.cs │ │ │ │ └── ListCalculatorAlignmentVerUpper.cs.meta │ │ │ ├── ListCalculatorConstraint.meta │ │ │ ├── ListCalculatorConstraint │ │ │ │ ├── ListCalculatorColumnRowCount.cs │ │ │ │ ├── ListCalculatorColumnRowCount.cs.meta │ │ │ │ ├── ListCalculatorConstraint.cs │ │ │ │ ├── ListCalculatorConstraint.cs.meta │ │ │ │ ├── ListCalculatorConstraintFixedColumnCount.cs │ │ │ │ ├── ListCalculatorConstraintFixedColumnCount.cs.meta │ │ │ │ ├── ListCalculatorConstraintFixedRowCount.cs │ │ │ │ └── ListCalculatorConstraintFixedRowCount.cs.meta │ │ │ ├── ListCalculatorElementRecordVo.cs │ │ │ ├── ListCalculatorElementRecordVo.cs.meta │ │ │ ├── ListCalculatorElementVo.cs │ │ │ ├── ListCalculatorElementVo.cs.meta │ │ │ ├── ListCalculatorSetting.meta │ │ │ ├── ListCalculatorSetting │ │ │ │ ├── ListCalculatorSettingPadding.cs │ │ │ │ ├── ListCalculatorSettingPadding.cs.meta │ │ │ │ ├── ListCalculatorSettingSpacing.cs │ │ │ │ └── ListCalculatorSettingSpacing.cs.meta │ │ │ ├── ListCalculatorStartCorner.meta │ │ │ └── ListCalculatorStartCorner │ │ │ │ ├── ListCalculatorStartCornerHor.cs │ │ │ │ ├── ListCalculatorStartCornerHor.cs.meta │ │ │ │ ├── ListCalculatorStartCornerHorLeft.cs │ │ │ │ ├── ListCalculatorStartCornerHorLeft.cs.meta │ │ │ │ ├── ListCalculatorStartCornerHorRight.cs │ │ │ │ ├── ListCalculatorStartCornerHorRight.cs.meta │ │ │ │ ├── ListCalculatorStartCornerVer.cs │ │ │ │ ├── ListCalculatorStartCornerVer.cs.meta │ │ │ │ ├── ListCalculatorStartCornerVerLower.cs │ │ │ │ ├── ListCalculatorStartCornerVerLower.cs.meta │ │ │ │ ├── ListCalculatorStartCornerVerUpper.cs │ │ │ │ └── ListCalculatorStartCornerVerUpper.cs.meta │ │ ├── Pool.meta │ │ ├── Pool │ │ │ ├── IPoolEle.cs │ │ │ ├── IPoolEle.cs.meta │ │ │ ├── IPoolEleCountLimit.cs │ │ │ ├── IPoolEleCountLimit.cs.meta │ │ │ ├── IPoolStorage.cs │ │ │ ├── IPoolStorage.cs.meta │ │ │ ├── PoolExtend.cs │ │ │ ├── PoolExtend.cs.meta │ │ │ ├── PoolMgr.cs │ │ │ ├── PoolMgr.cs.meta │ │ │ ├── PoolRealContainer4AWindow.cs │ │ │ ├── PoolRealContainer4AWindow.cs.meta │ │ │ ├── PoolStorage.cs │ │ │ ├── PoolStorage.cs.meta │ │ │ ├── PoolType.cs │ │ │ └── PoolType.cs.meta │ │ ├── StateManager.meta │ │ ├── StateManager │ │ │ ├── Reducer.meta │ │ │ ├── Reducer │ │ │ │ ├── IReducer.cs │ │ │ │ ├── IReducer.cs.meta │ │ │ │ ├── Reducer.cs │ │ │ │ ├── Reducer.cs.meta │ │ │ │ ├── ReducerFuncInfoAttribute.cs │ │ │ │ └── ReducerFuncInfoAttribute.cs.meta │ │ │ ├── State.meta │ │ │ ├── State │ │ │ │ ├── AStateBase.cs │ │ │ │ └── AStateBase.cs.meta │ │ │ ├── Store.meta │ │ │ └── Store │ │ │ │ ├── IStore.cs │ │ │ │ ├── IStore.cs.meta │ │ │ │ ├── SimpleStoreFactory.cs │ │ │ │ ├── SimpleStoreFactory.cs.meta │ │ │ │ ├── Store.cs │ │ │ │ └── Store.cs.meta │ │ ├── Utils.meta │ │ ├── Utils │ │ │ ├── SafeSingleton.cs │ │ │ ├── SafeSingleton.cs.meta │ │ │ ├── SingletonMonoBehaviour.cs │ │ │ ├── SingletonMonoBehaviour.cs.meta │ │ │ ├── UtilGameObject.cs │ │ │ ├── UtilGameObject.cs.meta │ │ │ ├── UtilGeneral.cs │ │ │ └── UtilGeneral.cs.meta │ │ ├── Windows.meta │ │ └── Windows │ │ │ ├── AWindow.cs │ │ │ ├── AWindow.cs.meta │ │ │ ├── AWindowComAttribute.cs │ │ │ ├── AWindowComAttribute.cs.meta │ │ │ ├── Node.meta │ │ │ ├── Node │ │ │ ├── WindowNode.cs │ │ │ ├── WindowNode.cs.meta │ │ │ ├── WindowNodeDisputeResolve.cs │ │ │ ├── WindowNodeDisputeResolve.cs.meta │ │ │ ├── WindowNodeType.cs │ │ │ └── WindowNodeType.cs.meta │ │ │ ├── ObjectBindingData.cs │ │ │ ├── ObjectBindingData.cs.meta │ │ │ ├── RootNodeContainer.cs │ │ │ ├── RootNodeContainer.cs.meta │ │ │ ├── UIWinMgr.cs │ │ │ └── UIWinMgr.cs.meta │ ├── Plugins.meta │ ├── Plugins │ │ ├── LitJson.meta │ │ └── LitJson │ │ │ ├── IJsonWrapper.cs │ │ │ ├── IJsonWrapper.cs.meta │ │ │ ├── JsonData.cs │ │ │ ├── JsonData.cs.meta │ │ │ ├── JsonException.cs │ │ │ ├── JsonException.cs.meta │ │ │ ├── JsonMapper.cs │ │ │ ├── JsonMapper.cs.meta │ │ │ ├── JsonMockWrapper.cs │ │ │ ├── JsonMockWrapper.cs.meta │ │ │ ├── JsonReader.cs │ │ │ ├── JsonReader.cs.meta │ │ │ ├── JsonWriter.cs │ │ │ ├── JsonWriter.cs.meta │ │ │ ├── Lexer.cs │ │ │ ├── Lexer.cs.meta │ │ │ ├── Netstandard15Polyfill.cs │ │ │ ├── Netstandard15Polyfill.cs.meta │ │ │ ├── ParserToken.cs │ │ │ └── ParserToken.cs.meta │ ├── Resources.meta │ ├── Resources │ │ ├── CertainView.prefab │ │ ├── CertainView.prefab.meta │ │ ├── RootNodeContainer.prefab │ │ ├── RootNodeContainer.prefab.meta │ │ ├── TipView.prefab │ │ ├── TipView.prefab.meta │ │ ├── UIContent.prefab │ │ ├── UIContent.prefab.meta │ │ ├── Windown01.prefab │ │ ├── Windown01.prefab.meta │ │ ├── WindownItem.prefab │ │ ├── WindownItem.prefab.meta │ │ ├── image.meta │ │ └── image │ │ │ ├── bottom_05_v3.png │ │ │ └── bottom_05_v3.png.meta │ ├── Sample.meta │ └── Sample │ │ ├── Scenes.meta │ │ ├── Scenes │ │ ├── Start.unity │ │ └── Start.unity.meta │ │ ├── Script.meta │ │ └── Script │ │ ├── CertainView.cs │ │ ├── CertainView.cs.meta │ │ ├── OpenViewMgr.cs │ │ ├── OpenViewMgr.cs.meta │ │ ├── StartDemo.cs │ │ ├── StartDemo.cs.meta │ │ ├── TipView.cs │ │ ├── TipView.cs.meta │ │ ├── UIContent.cs │ │ ├── UIContent.cs.meta │ │ ├── Window01.cs │ │ └── Window01.cs.meta ├── GlobalSuppressions.cs ├── ProjectSettings │ ├── AudioManager.asset │ ├── AutoStreamingSettings.asset │ ├── ClusterInputManager.asset │ ├── DynamicsManager.asset │ ├── EditorBuildSettings.asset │ ├── EditorSettings.asset │ ├── GraphicsSettings.asset │ ├── InputManager.asset │ ├── MemorySettings.asset │ ├── NavMeshAreas.asset │ ├── NetworkManager.asset │ ├── PackageManagerSettings.asset │ ├── Physics2DSettings.asset │ ├── PresetManager.asset │ ├── ProjectSettings.asset │ ├── ProjectVersion.txt │ ├── QualitySettings.asset │ ├── SceneTemplateSettings.json │ ├── TagManager.asset │ ├── TimeManager.asset │ ├── UnityConnectSettings.asset │ ├── VFXManager.asset │ ├── VersionControlSettings.asset │ └── XRSettings.asset └── UserSettings │ ├── EditorUserSettings.asset │ └── Layouts │ └── default-2022.dwlt └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # This .gitignore file should be placed at the root of your Unity project directory 2 | # 3 | # Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore 4 | # 5 | /[Ll]ibrary/ 6 | /[Tt]emp/ 7 | /[Oo]bj/ 8 | /[Bb]uild/ 9 | /[Bb]uilds/ 10 | /[Ll]ogs/ 11 | /[Mm]emoryCaptures/ 12 | 13 | # Asset meta data should only be ignored when the corresponding asset is also ignored 14 | !/[Aa]ssets/**/*.meta 15 | 16 | # Uncomment this line if you wish to ignore the asset store tools plugin 17 | # /[Aa]ssets/AssetStoreTools* 18 | 19 | # Autogenerated Jetbrains Rider plugin 20 | [Aa]ssets/Plugins/Editor/JetBrains* 21 | 22 | # Visual Studio cache directory 23 | .vs/ 24 | 25 | # Gradle cache directory 26 | .gradle/ 27 | 28 | # Autogenerated VS/MD/Consulo solution and project files 29 | ExportedObj/ 30 | .consulo/ 31 | *.csproj 32 | *.unityproj 33 | *.sln 34 | *.suo 35 | *.tmp 36 | *.user 37 | *.userprefs 38 | *.pidb 39 | *.booproj 40 | *.svd 41 | *.pdb 42 | *.mdb 43 | *.opendb 44 | *.VC.db 45 | 46 | # Unity3D generated meta files 47 | *.pidb.meta 48 | *.pdb.meta 49 | *.mdb.meta 50 | 51 | # Unity3D generated file on crash reports 52 | sysinfo.txt 53 | 54 | # Builds 55 | *.apk 56 | *.unitypackage 57 | 58 | # Crashlytics generated file 59 | crashlytics-build.properties 60 | 61 | MVI4Unity/Library/ 62 | MVI4Unity/Logs/ 63 | MVI4Unity/Temp/ 64 | MVI4Unity/Packages/ 65 | MVI4Unity/obj/ 66 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Wilson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /MVI4Unity/.vsconfig: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0", 3 | "components": [ 4 | "Microsoft.VisualStudio.Workload.ManagedGame" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b85bdc1f88f99ea429132473efca7082 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 797916c6a2a60c74aa92c53f4fcbcf14 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculator.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace MVI4Unity 4 | { 5 | public class ListCalculator 6 | { 7 | public SortedDictionary recDict = new SortedDictionary (); 8 | } 9 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 24d4116d7b81f1e43b8ba781cb8ab0e8 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorAlignment.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7f27300de2f2a904e948812e69f0d425 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorAlignment/ListCalculatorAlignmentHor.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wilson403/MVI4Unity/0536c64469b831b880d6c1ed5413d4a9061a960c/MVI4Unity/Assets/Core/ListCalculator/ListCalculatorAlignment/ListCalculatorAlignmentHor.cs -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorAlignment/ListCalculatorAlignmentHor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1af47a1bb19863b46a613f3efaf4c245 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorAlignment/ListCalculatorAlignmentHorCenter.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wilson403/MVI4Unity/0536c64469b831b880d6c1ed5413d4a9061a960c/MVI4Unity/Assets/Core/ListCalculator/ListCalculatorAlignment/ListCalculatorAlignmentHorCenter.cs -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorAlignment/ListCalculatorAlignmentHorCenter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 917bbc3093b39f14eb17b637ed87d48a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorAlignment/ListCalculatorAlignmentHorLeft.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wilson403/MVI4Unity/0536c64469b831b880d6c1ed5413d4a9061a960c/MVI4Unity/Assets/Core/ListCalculator/ListCalculatorAlignment/ListCalculatorAlignmentHorLeft.cs -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorAlignment/ListCalculatorAlignmentHorLeft.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 593232f61640c9741b84c93c6ad46b2d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorAlignment/ListCalculatorAlignmentHorRight.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wilson403/MVI4Unity/0536c64469b831b880d6c1ed5413d4a9061a960c/MVI4Unity/Assets/Core/ListCalculator/ListCalculatorAlignment/ListCalculatorAlignmentHorRight.cs -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorAlignment/ListCalculatorAlignmentHorRight.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6a69c1636b69d8743a2953ad6a7a8050 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorAlignment/ListCalculatorAlignmentVer.cs: -------------------------------------------------------------------------------- 1 | namespace MVI4Unity 2 | { 3 | /// 4 | /// 元素排版的垂直倾向 5 | /// 6 | public abstract class ListCalculatorAlignmentVer 7 | { 8 | /// 9 | /// 计算出 y 的应当坐标 10 | /// 11 | /// 12 | /// 13 | /// 14 | public abstract float GetPositionY (float gridHeight , float eleHeight); 15 | } 16 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorAlignment/ListCalculatorAlignmentVer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 35a8b87eb0851a14596d21eb56dbbe25 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorAlignment/ListCalculatorAlignmentVerLower.cs: -------------------------------------------------------------------------------- 1 | namespace MVI4Unity 2 | { 3 | /// 4 | /// 元素排版的垂直倾向-下 5 | /// 6 | public class ListCalculatorAlignmentVerLower : ListCalculatorAlignmentVer 7 | { 8 | public override float GetPositionY (float gridHeight , float eleHeight) 9 | { 10 | return 0; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorAlignment/ListCalculatorAlignmentVerLower.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 332216a722e4bb1468118357c8f701fe 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorAlignment/ListCalculatorAlignmentVerMiddle.cs: -------------------------------------------------------------------------------- 1 | namespace MVI4Unity 2 | { 3 | /// 4 | /// 元素排版的垂直倾向-中 5 | /// 6 | public class ListCalculatorAlignmentVerMiddle : ListCalculatorAlignmentVer 7 | { 8 | public override float GetPositionY (float gridHeight , float eleHeight) 9 | { 10 | return ( gridHeight - eleHeight ) / 2; 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorAlignment/ListCalculatorAlignmentVerMiddle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c8ff86a10203c154cbd018e4c0b2feef 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorAlignment/ListCalculatorAlignmentVerUpper.cs: -------------------------------------------------------------------------------- 1 | namespace MVI4Unity 2 | { 3 | /// 4 | /// 元素排版的垂直倾向-上 5 | /// 6 | public class ListCalculatorAlignmentVerUpper : ListCalculatorAlignmentVer 7 | { 8 | public override float GetPositionY (float gridHeight , float eleHeight) 9 | { 10 | return gridHeight - eleHeight; 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorAlignment/ListCalculatorAlignmentVerUpper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e1b5afc082be15a47ad86c009f6ade3a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorConstraint.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 689c123188e3ff2439d4fdca6026613e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorConstraint/ListCalculatorColumnRowCount.cs: -------------------------------------------------------------------------------- 1 | namespace MVI4Unity 2 | { 3 | /// 4 | /// 行列数 5 | /// 6 | public class ListCalculatorColumnRowCount 7 | { 8 | /// 9 | /// 列数 10 | /// 11 | public readonly int columnCount; 12 | 13 | /// 14 | /// 行数 15 | /// 16 | public readonly int rowCount; 17 | 18 | public ListCalculatorColumnRowCount (int columnCount , int rowCount) 19 | { 20 | this.columnCount = columnCount; 21 | this.rowCount = rowCount; 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorConstraint/ListCalculatorColumnRowCount.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5803d2972db0c2145bf9b5ffff2f1902 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorConstraint/ListCalculatorConstraint.cs: -------------------------------------------------------------------------------- 1 | namespace MVI4Unity 2 | { 3 | /// 4 | /// 列表的约束 5 | /// 6 | public abstract class ListCalculatorConstraint 7 | { 8 | /// 9 | /// 重新对元素进行排版 10 | /// 11 | /// 12 | public abstract ListCalculatorColumnRowCount GetColumnRowCount (ListCalculator holaList); 13 | } 14 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorConstraint/ListCalculatorConstraint.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0058ebe9c85fe4341861cf737777cc8d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorConstraint/ListCalculatorConstraintFixedColumnCount.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MVI4Unity 4 | { 5 | /// 6 | /// @创建者: 江选辉 7 | /// @创建日期: 2021/04/28 20.02 8 | /// @功能描述: 使用列的数量来进行约束 9 | /// @修改者: 10 | /// @修改日期: 11 | /// @修改描述: 12 | /// 13 | public class ListCalculatorConstraintFixedColumnCount : ListCalculatorConstraint 14 | { 15 | /// 16 | /// 约束的数量 17 | /// 18 | public int constraintCount; 19 | 20 | /// 21 | /// 最小行数 22 | /// 23 | public int minRowCount; 24 | 25 | public ListCalculatorConstraintFixedColumnCount (int constraintCount , int minRowCount) 26 | { 27 | this.constraintCount = constraintCount; 28 | this.minRowCount = minRowCount; 29 | } 30 | 31 | /// 32 | /// 重新对元素进行排版 33 | /// 34 | /// 35 | public override ListCalculatorColumnRowCount GetColumnRowCount (ListCalculator holaList) 36 | { 37 | // 列数 38 | int columnCount = constraintCount; 39 | 40 | // 行数 41 | int rowCount = ( int ) Math.Ceiling (( decimal ) holaList.recDict.Count / columnCount); 42 | 43 | // 被最小行数约束 44 | if ( rowCount < minRowCount ) 45 | { 46 | rowCount = minRowCount; 47 | } 48 | 49 | return new ListCalculatorColumnRowCount (columnCount , rowCount); 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorConstraint/ListCalculatorConstraintFixedColumnCount.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 81fbb9ddcdefbf249a77f812d2ad3b6f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorConstraint/ListCalculatorConstraintFixedRowCount.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MVI4Unity 4 | { 5 | /// 6 | /// @创建者: 江选辉 7 | /// @创建日期: 2021/04/28 20.02 8 | /// @功能描述: 使用行的数量进行约束 9 | /// @修改者: 10 | /// @修改日期: 11 | /// @修改描述: 12 | /// 13 | public class ListCalculatorConstraintFixedRowCount : ListCalculatorConstraint 14 | { 15 | /// 16 | /// 约束的数量 17 | /// 18 | public int constraintCount; 19 | /// 20 | /// 最小列数 21 | /// 22 | public int minColumnCount; 23 | 24 | public ListCalculatorConstraintFixedRowCount (int constraintCount , int minColumnCount) 25 | { 26 | this.constraintCount = constraintCount; 27 | this.minColumnCount = minColumnCount; 28 | } 29 | 30 | public override ListCalculatorColumnRowCount GetColumnRowCount (ListCalculator holaList) 31 | { 32 | // 行数 33 | int rowCount = constraintCount; 34 | 35 | // 列数 36 | int columnCount = ( int ) Math.Ceiling (( decimal ) holaList.recDict.Count / rowCount); 37 | 38 | // 被最小列数约束 39 | if ( columnCount < minColumnCount ) 40 | { 41 | columnCount = minColumnCount; 42 | } 43 | 44 | return new ListCalculatorColumnRowCount (columnCount: columnCount , rowCount: rowCount); 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorConstraint/ListCalculatorConstraintFixedRowCount.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 03c64423fd84a5b4284091bb3cc87ae3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorElementRecordVo.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wilson403/MVI4Unity/0536c64469b831b880d6c1ed5413d4a9061a960c/MVI4Unity/Assets/Core/ListCalculator/ListCalculatorElementRecordVo.cs -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorElementRecordVo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7a865fc2e53597f42bd5e152216c2027 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorElementVo.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wilson403/MVI4Unity/0536c64469b831b880d6c1ed5413d4a9061a960c/MVI4Unity/Assets/Core/ListCalculator/ListCalculatorElementVo.cs -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorElementVo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ea9c40201986e9c43825d795dbc33353 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorSetting.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 827cfe5702bdecf42a34ce6ebac99a08 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorSetting/ListCalculatorSettingPadding.cs: -------------------------------------------------------------------------------- 1 | namespace MVI4Unity 2 | { 3 | /// 4 | /// 列表内边距 5 | /// 6 | public class ListCalculatorSettingPadding 7 | { 8 | /// 9 | /// 上 10 | /// 11 | public float top; 12 | /// 13 | /// 右 14 | /// 15 | public float right; 16 | /// 17 | /// 下 18 | /// 19 | public float bottom; 20 | /// 21 | /// 左 22 | /// 23 | public float left; 24 | 25 | public ListCalculatorSettingPadding (float top , float right , float bottom , float left) 26 | { 27 | this.top = top; 28 | this.right = right; 29 | this.bottom = bottom; 30 | this.left = left; 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorSetting/ListCalculatorSettingPadding.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 12fa9234fbba5354fbcc1e2a5e8e78b0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorSetting/ListCalculatorSettingSpacing.cs: -------------------------------------------------------------------------------- 1 | namespace MVI4Unity 2 | { 3 | /// 4 | /// 列表元素的间距 5 | /// 6 | public class ListCalculatorSettingSpacing 7 | { 8 | /// 9 | /// 列间距 10 | /// 11 | public float column; 12 | /// 13 | /// 行间距 14 | /// 15 | public float row; 16 | 17 | public ListCalculatorSettingSpacing (float column , float row) 18 | { 19 | this.column = column; 20 | this.row = row; 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorSetting/ListCalculatorSettingSpacing.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9feb682406ea7d44496fc091edb1bf10 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorStartCorner.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fed9bec697d103d4eb4a9936e83c2624 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorStartCorner/ListCalculatorStartCornerHor.cs: -------------------------------------------------------------------------------- 1 | namespace MVI4Unity 2 | { 3 | /// 4 | /// 列表的起始角-水平 5 | /// 6 | public abstract class ListCalculatorStartCornerHor 7 | { 8 | public abstract int ParseColumnIndex (int columnCount , int columnIndex); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorStartCorner/ListCalculatorStartCornerHor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 926876d2982d84947bbf3a55525ec294 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorStartCorner/ListCalculatorStartCornerHorLeft.cs: -------------------------------------------------------------------------------- 1 | namespace MVI4Unity 2 | { 3 | /// 4 | /// 列表的起始角-水平-左 5 | /// 6 | public class ListCalculatorStartCornerHorLeft : ListCalculatorStartCornerHor 7 | { 8 | public override int ParseColumnIndex (int columnCount , int columnIndex) 9 | { 10 | return columnIndex; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorStartCorner/ListCalculatorStartCornerHorLeft.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2b21cee163ae33d4e8d3deee22312d73 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorStartCorner/ListCalculatorStartCornerHorRight.cs: -------------------------------------------------------------------------------- 1 | namespace MVI4Unity 2 | { 3 | /// 4 | /// 列表的起始角-水平-右 5 | /// 6 | public class ListCalculatorStartCornerHorRight : ListCalculatorStartCornerHor 7 | { 8 | public override int ParseColumnIndex (int columnCount , int columnIndex) 9 | { 10 | return columnCount - columnIndex - 1; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorStartCorner/ListCalculatorStartCornerHorRight.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4846d9aa092a2174dabe343ee155d605 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorStartCorner/ListCalculatorStartCornerVer.cs: -------------------------------------------------------------------------------- 1 | namespace MVI4Unity 2 | { 3 | /// 4 | /// 列表的起始角-垂直 5 | /// 6 | public abstract class ListCalculatorStartCornerVer 7 | { 8 | public abstract int ParseRowIndex (int rowCount , int rowIndex); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorStartCorner/ListCalculatorStartCornerVer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a59a0be7c8471e8498ec1be6de134c0f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorStartCorner/ListCalculatorStartCornerVerLower.cs: -------------------------------------------------------------------------------- 1 | namespace MVI4Unity 2 | { 3 | /// 4 | /// 列表的起始角-垂直-下 5 | /// 6 | public class ListCalculatorStartCornerVerLower : ListCalculatorStartCornerVer 7 | { 8 | public override int ParseRowIndex (int rowCount , int rowIndex) 9 | { 10 | return rowIndex; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorStartCorner/ListCalculatorStartCornerVerLower.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a891e0985a70b6d4e9dbd5c70b6a2ad3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorStartCorner/ListCalculatorStartCornerVerUpper.cs: -------------------------------------------------------------------------------- 1 | namespace MVI4Unity 2 | { 3 | /// 4 | /// 列表的起始角-垂直-上 5 | /// 6 | public class ListCalculatorStartCornerVerUpper : ListCalculatorStartCornerVer 7 | { 8 | public override int ParseRowIndex (int rowCount , int rowIndex) 9 | { 10 | return rowCount - rowIndex - 1; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/ListCalculator/ListCalculatorStartCorner/ListCalculatorStartCornerVerUpper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ef351b63fdfeeed43a7e9324dab5c963 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Pool.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c478de042b6b49e4bb1ee28a22a31473 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Pool/IPoolEle.cs: -------------------------------------------------------------------------------- 1 | namespace MVI4Unity 2 | { 3 | public interface IPoolItem 4 | { 5 | void OnPush(); 6 | void OnPop(); 7 | } 8 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Pool/IPoolEle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 389bc308c5541594e92299f36814a374 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Pool/IPoolEleCountLimit.cs: -------------------------------------------------------------------------------- 1 | namespace MVI4Unity 2 | { 3 | public interface IPoolEleCountLimit 4 | { 5 | /// 6 | /// 获取池中元素数量的最大限制 7 | /// 8 | int GetPoolEleMaxCount (); 9 | 10 | /// 11 | /// 回收失败时的处理 12 | /// 13 | void OnPushFail (); 14 | } 15 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Pool/IPoolEleCountLimit.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4d82f4b19538adb42b9e295b76079519 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Pool/IPoolStorage.cs: -------------------------------------------------------------------------------- 1 | namespace MVI4Unity 2 | { 3 | public interface IPoolStorage 4 | { 5 | /// 6 | /// 获取一个对象 7 | /// 8 | /// 9 | object Pop (); 10 | 11 | /// 12 | /// 回收一个对象 13 | /// 14 | /// 15 | void Push (object item); 16 | 17 | /// 18 | /// 获取存储数量 19 | /// 20 | /// 21 | int GetStoragedCount (); 22 | } 23 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Pool/IPoolStorage.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9d4a72a1322ba1a4fb3bd27b44a297de 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Pool/PoolExtend.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace MVI4Unity 4 | { 5 | /// 6 | /// 针对Pool的扩展 7 | /// 8 | public static class PoolExtend 9 | { 10 | public static T Pop (this PoolType poolType) 11 | { 12 | return PoolMgr.Ins.Pop (poolType); 13 | } 14 | 15 | public static void Push (this IPoolType poolType , T item) 16 | { 17 | PoolMgr.Ins.Push (poolType , item); 18 | } 19 | 20 | public static void Push (this List poolType) 21 | { 22 | PoolMgr.Ins.GetList ().Push (poolType); 23 | } 24 | 25 | public static void Push (this Dictionary poolType) 26 | { 27 | PoolMgr.Ins.GetDict ().Push (poolType); 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Pool/PoolExtend.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 05a78ec4afd0751438a27004a5b2c168 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Pool/PoolMgr.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace MVI4Unity 6 | { 7 | public class PoolMgr : SafeSingleton 8 | { 9 | private readonly Dictionary _type2PoolType = new Dictionary (); 10 | private readonly Dictionary _str2PoolType = new Dictionary (); 11 | private readonly Dictionary _storageDict = new Dictionary (); 12 | 13 | /// 14 | /// 池中弹出 15 | /// 16 | /// 17 | /// 18 | /// 19 | public T Pop (IPoolType poolType) 20 | { 21 | var storage = GetStorage (poolType); 22 | if ( storage.GetStoragedCount () > 0 ) 23 | { 24 | return ( T ) storage.Pop (); 25 | } 26 | else 27 | { 28 | return ( T ) poolType.Create (); 29 | } 30 | } 31 | 32 | /// 33 | /// 回收 34 | /// 35 | /// 36 | /// 37 | /// 38 | public void Push (IPoolType poolType , T item) 39 | { 40 | GetStorage (poolType).Push (item); 41 | } 42 | 43 | /// 44 | /// 尝试获取一个对象池类型 45 | /// 46 | /// 47 | /// 48 | /// 49 | public bool TryGetPoolType (out IPoolType pooltype) 50 | { 51 | return _type2PoolType.TryGetValue (typeof (T) , out pooltype); 52 | } 53 | 54 | /// 55 | /// 获取实际存储的仓库 56 | /// 57 | /// 58 | /// 59 | /// 60 | private IPoolStorage GetStorage (IPoolType poolType) 61 | { 62 | if ( !_storageDict.ContainsKey (poolType) ) 63 | { 64 | _storageDict.Add (poolType , new PoolStorage (poolType)); 65 | } 66 | return _storageDict [poolType]; 67 | } 68 | 69 | #region 集合对象池,集合实例回收利用,进行Clear而不是重新New,减少GC,比如List,Stack等都是一个道理 70 | 71 | /// 72 | /// 针对List的池 73 | /// 74 | /// 75 | /// 76 | public PoolType> GetList () 77 | { 78 | if ( !_type2PoolType.ContainsKey (typeof (List)) ) 79 | { 80 | _type2PoolType [typeof (List)] = new PoolType> ( 81 | onCreate: () => 82 | { 83 | return new List (0); 84 | } , 85 | onPush: (t) => 86 | { 87 | t.Clear (); 88 | }); 89 | } 90 | return _type2PoolType [typeof (List)] as PoolType>; 91 | } 92 | 93 | /// 94 | /// 针对Dict的池 95 | /// 96 | /// 97 | /// 98 | /// 99 | public PoolType> GetDict () 100 | { 101 | if ( !_type2PoolType.ContainsKey (typeof (Dictionary)) ) 102 | { 103 | _type2PoolType [typeof (Dictionary)] = new PoolType> ( 104 | onCreate: () => 105 | { 106 | return new Dictionary (); 107 | } , 108 | onPush: (t) => 109 | { 110 | t.Clear (); 111 | }); 112 | } 113 | return _type2PoolType [typeof (Dictionary)] as PoolType>; 114 | } 115 | 116 | #endregion 117 | 118 | #region AWindow对象池 119 | 120 | /// 121 | /// 弹出窗口 122 | /// 123 | /// 124 | /// 125 | /// 126 | public AWindow PopAWindow (string windowPath) where T : AWindow 127 | { 128 | return GetAWindowPool (windowPath).Pop (); 129 | } 130 | 131 | /// 132 | /// 回收窗口到池里 133 | /// 134 | /// 135 | /// 136 | public void PushAWindow (T window) where T : AWindow 137 | { 138 | if ( !string.IsNullOrEmpty (window.assetPath) && _str2PoolType.TryGetValue (window.assetPath , out IPoolType poolType) ) 139 | { 140 | poolType.Push (window); 141 | return; 142 | } 143 | Debug.LogWarning ($"无法回收{window}"); 144 | } 145 | 146 | /// 147 | /// 获取窗口对象池 148 | /// 149 | /// 该泛型类型被限制为AWindow 150 | /// 窗口预制体路径 151 | /// 152 | public PoolType GetAWindowPool (string windowPath) where T : AWindow 153 | { 154 | Type windowType = typeof (T); 155 | if ( !_str2PoolType.ContainsKey (windowPath) ) 156 | { 157 | _str2PoolType [windowPath] = new PoolType ( 158 | onCreate: () => 159 | { 160 | return UIWinMgr.Ins.Create (windowPath , null); 161 | } , 162 | onPop: PoolRealContainer4AWindow.Ins.Pop , 163 | onPush: PoolRealContainer4AWindow.Ins.Push); 164 | } 165 | return _str2PoolType [windowPath] as PoolType; 166 | } 167 | 168 | /// 169 | /// 获取窗口对象池 170 | /// 171 | /// 该泛型类型被限制为AWindow 172 | /// 窗口预制体路径 173 | /// 创建方式(替换默认方式 174 | /// 弹出监听 175 | /// 回收监听 176 | /// 177 | public PoolType GetAWindowPool (string windowPath , Func onCreate = null , Action onPop = null , Action onPush = null) where T : AWindow 178 | { 179 | Type windowType = typeof (T); 180 | onCreate = onCreate ?? ( () => { return UIWinMgr.Ins.Create (windowPath , null); } ); 181 | if ( !_str2PoolType.ContainsKey (windowPath) ) 182 | { 183 | _str2PoolType [windowPath] = new PoolType ( 184 | onCreate: onCreate , 185 | onPop: (t) => 186 | { 187 | PoolRealContainer4AWindow.Ins.Pop (t); 188 | onPop?.Invoke (); 189 | } , 190 | onPush: (t) => 191 | { 192 | PoolRealContainer4AWindow.Ins.Push (t); 193 | onPush?.Invoke (t); 194 | }); 195 | } 196 | return _str2PoolType [windowPath] as PoolType; 197 | } 198 | 199 | #endregion 200 | 201 | #region WindowNode对象池 202 | 203 | /// 204 | /// 获取窗口节点对象池 205 | /// 206 | /// 207 | public PoolType GetWindowNodePool () 208 | { 209 | Type type = typeof (WindowNode); 210 | if ( !_type2PoolType.ContainsKey (typeof (WindowNode)) ) 211 | { 212 | _type2PoolType [type] = new PoolType ( 213 | onCreate: () => { return new WindowNode (); } , 214 | onPop: default , 215 | onPush: (node) => 216 | { 217 | node.childNodeGroup.Clear (); 218 | }); 219 | } 220 | return _type2PoolType [type] as PoolType; 221 | } 222 | 223 | /// 224 | /// 获取窗口节点对象池 225 | /// 226 | /// 227 | /// 228 | /// 229 | /// 230 | public PoolType> GetWindowNodePool () where A : AWindow where S : AStateBase 231 | { 232 | Type type = typeof (WindowNode); 233 | if ( !_type2PoolType.ContainsKey (typeof (WindowNode)) ) 234 | { 235 | _type2PoolType [type] = new PoolType> ( 236 | onCreate: () => { return new WindowNode (); } , 237 | onPop: default , 238 | onPush: (node) => 239 | { 240 | node.childNodeGroup.Clear (); 241 | }); 242 | } 243 | return _type2PoolType [type] as PoolType>; 244 | } 245 | 246 | #endregion 247 | } 248 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Pool/PoolMgr.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d4a6bf389e941ce4ea5fe36997011112 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Pool/PoolRealContainer4AWindow.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using MVI4Unity; 4 | using UnityEngine; 5 | using Zero; 6 | 7 | public class PoolRealContainer4AWindow : SingletonMonoBehaviour 8 | { 9 | 10 | private readonly Dictionary> _cacheTransform = new Dictionary> (); 11 | 12 | /// 13 | /// 回收实际的Gameobject 14 | /// 15 | /// 16 | /// 17 | public void Push (T window) where T : AWindow 18 | { 19 | Type type = typeof (T); 20 | CertainInitCacheDictKey (type); 21 | window.RemoveAllListeners (); 22 | window.SetParent (transform); 23 | window.SetActive (false); 24 | _cacheTransform [type].Add (window.GameObject); 25 | } 26 | 27 | /// 28 | /// 弹出一个实际的GameObject 29 | /// 30 | /// 31 | /// 32 | public void Pop (T window) where T : AWindow 33 | { 34 | Type type = typeof (T); 35 | CertainInitCacheDictKey (type); 36 | window.SetActive (true); 37 | if ( _cacheTransform [type].Contains (window.GameObject) ) 38 | { 39 | _cacheTransform [type].Remove (window.GameObject); 40 | } 41 | } 42 | 43 | /// 44 | /// 确保字典Key存在 45 | /// 46 | /// 47 | void CertainInitCacheDictKey (Type type) 48 | { 49 | if ( !_cacheTransform.ContainsKey (type) ) 50 | { 51 | _cacheTransform [type] = new List (0); 52 | } 53 | } 54 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Pool/PoolRealContainer4AWindow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 83c221ac246ad004c9a1d87eccc7a844 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Pool/PoolStorage.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace MVI4Unity 4 | { 5 | public class PoolStorage : IPoolStorage 6 | { 7 | private readonly List _storage = new List (); 8 | private readonly PoolType _poolType; 9 | 10 | public PoolStorage (IPoolType poolType) 11 | { 12 | _poolType = poolType as PoolType; 13 | } 14 | 15 | public int GetStoragedCount () 16 | { 17 | return _storage.Count; 18 | } 19 | 20 | public object Pop () 21 | { 22 | object item = _storage [_storage.Count - 1]; 23 | _storage.RemoveAt (_storage.Count - 1); 24 | _poolType.onPop?.Invoke (( T ) item); 25 | if ( item is IPoolItem poolItem ) 26 | { 27 | poolItem.OnPop (); 28 | } 29 | return item; 30 | } 31 | 32 | public void Push (object item) 33 | { 34 | if ( item == null ) 35 | { 36 | return; 37 | } 38 | 39 | if ( _storage.Contains (item) ) 40 | { 41 | return; 42 | } 43 | 44 | //如果超出缓存的最大限制,不回收了 45 | if ( item is IPoolEleCountLimit limit && limit.GetPoolEleMaxCount () >= 0 && _storage.Count >= limit.GetPoolEleMaxCount () ) 46 | { 47 | limit.OnPushFail (); 48 | return; 49 | } 50 | 51 | _storage.Add (item); 52 | _poolType.onPush?.Invoke (( T ) item); 53 | 54 | //执行回收单元自带的回调 55 | if ( item is IPoolItem poolItem ) 56 | { 57 | poolItem.OnPush (); 58 | } 59 | } 60 | } 61 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Pool/PoolStorage.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 99892760cdee61d4f91e36e3049697f7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Pool/PoolType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MVI4Unity 4 | { 5 | public interface IPoolType 6 | { 7 | object Create (); 8 | } 9 | 10 | public class PoolType : IPoolType 11 | { 12 | public readonly Func onCreate; 13 | public readonly Action onPop; 14 | public readonly Action onPush; 15 | 16 | public PoolType (Func onCreate , Action onPop = null , Action onPush = null) 17 | { 18 | this.onCreate = onCreate; 19 | this.onPop = onPop; 20 | this.onPush = onPush; 21 | } 22 | 23 | public T Create () 24 | { 25 | return onCreate.Invoke (); 26 | } 27 | 28 | object IPoolType.Create () 29 | { 30 | return Create (); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Pool/PoolType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f84d329db8b1b7741bb35778a7bab214 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/StateManager.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0667f9d3e63a6b946b523e0128538f95 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/StateManager/Reducer.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bb06dc43c00ce0943b8d0013d5b49e4d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/StateManager/Reducer/IReducer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | 5 | namespace MVI4Unity 6 | { 7 | public interface IReducer 8 | { 9 | /// 10 | /// 获取函数类型 11 | /// 12 | /// 13 | /// 14 | ReducerExecuteType GetReducerExecuteType (Enum tag); 15 | 16 | /// 17 | /// 执行回调 18 | /// 19 | /// 20 | /// 21 | /// 22 | /// 23 | void ExecuteCallback (Enum tag , object lastState , object @param , Action setNewState); 24 | 25 | /// 26 | /// 执行异步方法 27 | /// 28 | /// 29 | /// 30 | /// 31 | /// 32 | Task AsyncExecute (Enum tag , object lastState , object @param); 33 | 34 | /// 35 | /// 执行同步方法 36 | /// 37 | /// 38 | /// 39 | /// 40 | /// 41 | object Execute (Enum tag , object lastState , object @param); 42 | 43 | /// 44 | /// 获取自动执行字典 45 | /// 46 | /// 47 | Dictionary GetFirstAutoExecuteDict (); 48 | } 49 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/StateManager/Reducer/IReducer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9efaad029270dd545a6c9b5ba0651dd9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/StateManager/Reducer/Reducer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Reflection; 4 | using System.Threading.Tasks; 5 | using UnityEngine; 6 | 7 | namespace MVI4Unity 8 | { 9 | public enum ReducerExecuteType 10 | { 11 | None = 0, 12 | 13 | /// 14 | /// 同步 15 | /// 16 | Synchronize = 1, 17 | 18 | /// 19 | /// 异步 20 | /// 21 | Async = 2, 22 | 23 | /// 24 | /// 回调 25 | /// 26 | CallBack = 3, 27 | } 28 | 29 | /// 30 | /// 内部通用函数 31 | /// 32 | public enum ReducerCommonFunType 33 | { 34 | Close = 999999999, 35 | } 36 | 37 | /// 38 | /// Reducer: 无状态设计,相当于一个函数容器,同类型的Reducer整个生命周期只需创建一次 39 | /// 40 | /// 41 | /// 42 | public abstract class Reducer : IReducer where S : AStateBase where E : Enum 43 | { 44 | private readonly Dictionary.Reducer> _tag2Method = new Dictionary.Reducer> (); 45 | private readonly Dictionary.AsyncReducer> _tag2AsyncMethod = new Dictionary.AsyncReducer> (); 46 | private readonly Dictionary.CallbackReducer> _tag2Callback = new Dictionary.CallbackReducer> (); 47 | private readonly Dictionary _firstAutoExecuteDict = new Dictionary (); 48 | 49 | public Reducer () 50 | { 51 | RegisterFunc (); 52 | } 53 | 54 | /// 55 | /// 注册函数 56 | /// 57 | private void RegisterFunc () 58 | { 59 | //通过反射的形式添加派生类的函数 60 | MethodInfo [] methods = GetType ().GetMethods (BindingFlags.DeclaredOnly | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance); 61 | for ( int i = 0 ; i < methods.Length ; i++ ) 62 | { 63 | MethodInfo method = methods [i]; 64 | ReducerMethodAttribute attr = method.GetCustomAttribute (); 65 | if ( attr != null ) 66 | { 67 | Enum tag = Enum.ToObject (typeof (E) , attr.methodTag) as Enum; 68 | ReducerExecuteType reducerExecuteType = ReducerExecuteType.None; 69 | 70 | if ( UtilGeneral.Ins.Method2Delegate (method , this , out Store.Reducer reducer) ) 71 | { 72 | AddMethod (tag , reducer); 73 | reducerExecuteType = ReducerExecuteType.Synchronize; 74 | } 75 | 76 | else if ( UtilGeneral.Ins.Method2Delegate (method , this , out Store.AsyncReducer asyncReducer) ) 77 | { 78 | AddAsyncMethod (tag , asyncReducer); 79 | reducerExecuteType = ReducerExecuteType.Async; 80 | } 81 | 82 | else if ( UtilGeneral.Ins.Method2Delegate (method , this , out Store.CallbackReducer callback) ) 83 | { 84 | AddCallBack (tag , callback); 85 | reducerExecuteType = ReducerExecuteType.CallBack; 86 | } 87 | 88 | else 89 | { 90 | Debug.LogError ($"[{attr.methodTag}] Register fail"); 91 | } 92 | 93 | if ( attr.firstAutoExecute ) 94 | { 95 | GetFirstAutoExecuteDict ().Add (tag , reducerExecuteType); 96 | } 97 | } 98 | } 99 | 100 | //添加内部的函数 101 | AddMethod (ReducerCommonFunType.Close , Close); 102 | } 103 | 104 | private string GetEnumName (Enum tag) 105 | { 106 | return tag.ToString (); 107 | } 108 | 109 | /// 110 | /// 添加同步方法 111 | /// 112 | /// 113 | /// 114 | private void AddMethod (Enum tag , Store.Reducer reducer) 115 | { 116 | string @enum = GetEnumName (tag); 117 | if ( _tag2Method.ContainsKey (@enum) ) 118 | { 119 | Debug.LogError ($"Repeat key: [{@enum}]"); 120 | return; 121 | } 122 | _tag2Method [@enum] = reducer; 123 | } 124 | 125 | /// 126 | /// 添加异步方法 127 | /// 128 | /// 129 | /// 130 | private void AddAsyncMethod (Enum tag , Store.AsyncReducer asyncReducer) 131 | { 132 | string @enum = GetEnumName (tag); 133 | if ( _tag2AsyncMethod.ContainsKey (@enum) ) 134 | { 135 | Debug.LogError ($"Repeat key: [{@enum}]"); 136 | return; 137 | } 138 | _tag2AsyncMethod [@enum] = asyncReducer; 139 | } 140 | 141 | /// 142 | /// 添加回调方法 143 | /// 144 | /// 145 | /// 146 | private void AddCallBack (Enum tag , Store.CallbackReducer asyncReducer) 147 | { 148 | string @enum = GetEnumName (tag); 149 | if ( _tag2Callback.ContainsKey (@enum) ) 150 | { 151 | Debug.LogError ($"Repeat key: [{@enum}]"); 152 | return; 153 | } 154 | _tag2Callback [@enum] = asyncReducer; 155 | } 156 | 157 | public void ExecuteCallback (Enum tag , object lastState , object param , Action setNewState) 158 | { 159 | string @enum = GetEnumName (tag); 160 | if ( _tag2Callback.TryGetValue (@enum , out Store.CallbackReducer method) ) 161 | { 162 | method?.Invoke (lastState as S , param , setNewState); 163 | } 164 | } 165 | 166 | async public Task AsyncExecute (Enum tag , object lastState , object param) 167 | { 168 | string @enum = GetEnumName (tag); 169 | if ( _tag2AsyncMethod.TryGetValue (@enum , out Store.AsyncReducer method) ) 170 | { 171 | return await method?.Invoke (lastState as S , param); 172 | } 173 | return null; 174 | } 175 | 176 | public object Execute (Enum tag , object lastState , object param) 177 | { 178 | string @enum = GetEnumName (tag); 179 | if ( _tag2Method.TryGetValue (@enum , out Store.Reducer method) ) 180 | { 181 | return method?.Invoke (lastState as S , param); 182 | } 183 | return null; 184 | } 185 | 186 | public Dictionary GetFirstAutoExecuteDict () 187 | { 188 | return _firstAutoExecuteDict; 189 | } 190 | 191 | public ReducerExecuteType GetReducerExecuteType (Enum tag) 192 | { 193 | var @enum = GetEnumName (tag); 194 | if ( _tag2Method.ContainsKey (@enum) ) 195 | { 196 | return ReducerExecuteType.Synchronize; 197 | } 198 | else if ( _tag2AsyncMethod.ContainsKey (@enum) ) 199 | { 200 | return ReducerExecuteType.Async; 201 | } 202 | else if ( _tag2Callback.ContainsKey (@enum) ) 203 | { 204 | return ReducerExecuteType.CallBack; 205 | } 206 | return ReducerExecuteType.None; 207 | } 208 | 209 | #region 通用状态变更函数的注册 210 | 211 | [ReducerMethod (( int ) ReducerCommonFunType.Close)] 212 | #pragma warning disable IDE0051 213 | S Close (S oldState , object @param) 214 | { 215 | oldState.shouldDestroy = true; 216 | return oldState; 217 | } 218 | 219 | #endregion 220 | } 221 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/StateManager/Reducer/Reducer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6a25c2945f719a5469b44ecb9c195da9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/StateManager/Reducer/ReducerFuncInfoAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MVI4Unity 4 | { 5 | [AttributeUsage (AttributeTargets.Method , AllowMultiple = false)] 6 | internal class ReducerMethodAttribute : Attribute 7 | { 8 | /// 9 | /// 方法标识 10 | /// 11 | public int methodTag; 12 | 13 | /// 14 | /// 首次自动执行 15 | /// 16 | public bool firstAutoExecute; 17 | 18 | public ReducerMethodAttribute (int funcTag , bool firstAutoExecute = false) 19 | { 20 | this.methodTag = funcTag; 21 | this.firstAutoExecute = firstAutoExecute; 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/StateManager/Reducer/ReducerFuncInfoAttribute.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1dd8a2cd42b63364781156d386b371e7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/StateManager/State.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2dc3c757d9a18e349b16a7ec1c397092 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/StateManager/State/AStateBase.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace MVI4Unity 4 | { 5 | public abstract class AStateBase 6 | { 7 | /// 8 | /// 当前触发状态变更的函数标签 9 | /// 10 | public int currentFunTag; 11 | 12 | /// 13 | /// 无效的函数标签 14 | /// 请避免使用这个值来作为枚举值 15 | /// 16 | const int INVAILD_FUN_TAG = -999999999; 17 | 18 | /// 19 | /// 是否销毁 20 | /// 21 | public bool shouldDestroy; 22 | 23 | public AStateBase () 24 | { 25 | shouldDestroy = false; 26 | currentFunTag = INVAILD_FUN_TAG; 27 | } 28 | 29 | public T Clone () where T : AStateBase 30 | { 31 | return JsonConvert.DeserializeObject (JsonConvert.SerializeObject (this)); 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/StateManager/State/AStateBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 72fc2691c3e0f214bbaa03ea8b61a253 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/StateManager/Store.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1501d4b61518a2e4b8bcb62adfc6808e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/StateManager/Store/IStore.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MVI4Unity 4 | { 5 | public interface IStore 6 | { 7 | /// 8 | /// 派发 9 | /// 10 | /// 11 | /// 12 | void DisPatch (Enum tag , object @param = null); 13 | } 14 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/StateManager/Store/IStore.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cd9cbb9c0b25d8745ac0fbacffde1401 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/StateManager/Store/SimpleStoreFactory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace MVI4Unity 5 | { 6 | /// 7 | /// Store简单工厂 8 | /// 9 | public class SimpleStoreFactory : SafeSingleton 10 | { 11 | readonly Dictionary _type2Reducer = new Dictionary (); 12 | 13 | IReducer GetReducer () where R : IReducer 14 | { 15 | var reducerRealType = typeof (R); 16 | if ( !_type2Reducer.ContainsKey (reducerRealType) ) 17 | { 18 | _type2Reducer [reducerRealType] = Activator.CreateInstance (); 19 | } 20 | return _type2Reducer [reducerRealType]; 21 | } 22 | 23 | public Store CreateStore () where S : AStateBase where R : IReducer 24 | { 25 | Store store = new Store (); 26 | store.AddReducer (GetReducer ()); 27 | return store; 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/StateManager/Store/SimpleStoreFactory.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 628eaebc9ab4ba54bb5506f2bb308c1c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/StateManager/Store/Store.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | using UnityEngine; 5 | 6 | namespace MVI4Unity 7 | { 8 | 9 | public class Store : IStore where S : AStateBase 10 | { 11 | private IReducer _reducer; 12 | 13 | /// 14 | /// 回调集合 15 | /// 16 | private readonly List> _callbackList = new List> (); 17 | 18 | /// 19 | /// 同步委托 20 | /// 21 | /// 22 | /// 23 | /// 24 | public delegate S Reducer (S lastState , object @param); 25 | 26 | /// 27 | /// 异步委托 28 | /// 29 | /// 30 | /// 31 | /// 32 | public delegate Task AsyncReducer (S lastState , object @param); 33 | 34 | /// 35 | /// 回调委托 36 | /// 37 | /// 38 | /// 39 | /// 40 | public delegate void CallbackReducer (S lastState , object @param , Action setNewState); 41 | 42 | /// 43 | /// 添加Reducer 44 | /// 45 | /// 46 | public void AddReducer (IReducer reducer) 47 | { 48 | _reducer = reducer; 49 | } 50 | 51 | async public void DisPatch (Enum tag , object @param) 52 | { 53 | ReducerExecuteType funcType = _reducer.GetReducerExecuteType (tag); 54 | switch ( funcType ) 55 | { 56 | case ReducerExecuteType.Synchronize: 57 | { 58 | S lastState = GetCurrentState (); 59 | S newState = _reducer.Execute (tag , lastState , param) as S; 60 | SetNewState (tag , newState); 61 | } 62 | break; 63 | 64 | case ReducerExecuteType.Async: 65 | { 66 | S lastState = GetCurrentState (); 67 | S newState = await _reducer.AsyncExecute (tag , lastState , param) as S; 68 | SetNewState (tag , newState); 69 | } 70 | break; 71 | 72 | case ReducerExecuteType.CallBack: 73 | { 74 | S lastState = GetCurrentState (); 75 | _reducer.ExecuteCallback (tag , lastState , param , (newState) => 76 | { 77 | SetNewState (tag , newState as S); 78 | }); 79 | } 80 | break; 81 | 82 | default: 83 | Debug.LogError ($"Not Permission:[{funcType}]"); 84 | break; 85 | } 86 | } 87 | 88 | /// 89 | /// 订阅 90 | /// 91 | /// 92 | public void Subscribe (Action callback) 93 | { 94 | _callbackList.Add (callback); 95 | } 96 | 97 | /// 98 | /// 触发回调 99 | /// 100 | /// 101 | private void TriggerCallback (Enum tag) 102 | { 103 | for ( int i = 0 ; i < _callbackList.Count ; i++ ) 104 | { 105 | Action callback = _callbackList [i]; 106 | _currentState ??= Activator.CreateInstance (); 107 | _currentState.currentFunTag = tag != default ? tag.GetHashCode () : _currentState.currentFunTag; 108 | callback?.Invoke (_currentState); 109 | } 110 | } 111 | 112 | #region State管理 113 | 114 | const int MAX_STATE_COUNT = 20; 115 | readonly Queue _cache4State = new Queue (MAX_STATE_COUNT); 116 | S _currentState; 117 | 118 | /// 119 | /// 设置新状态 120 | /// 121 | /// 122 | /// 123 | private void SetNewState (Enum tag , S newState) 124 | { 125 | if ( _cache4State.Count >= MAX_STATE_COUNT ) 126 | { 127 | _cache4State.Dequeue (); 128 | } 129 | _cache4State.Enqueue (newState); 130 | _currentState = newState; 131 | TriggerCallback (tag); 132 | } 133 | 134 | /// 135 | /// 获取当前的State 136 | /// 137 | /// 138 | private S GetCurrentState () 139 | { 140 | return _currentState; 141 | } 142 | 143 | /// 144 | /// 是否初始化了状态 145 | /// 146 | private bool _isInitState = false; 147 | 148 | /// 149 | /// 初始化状态 150 | /// 151 | public void InitState () 152 | { 153 | if ( _isInitState ) 154 | { 155 | return; 156 | } 157 | _isInitState = true; 158 | 159 | bool isForceInitState = true; 160 | //执行初始函数来初始化状态实例 161 | foreach ( var item in _reducer.GetFirstAutoExecuteDict () ) 162 | { 163 | DisPatch (item.Key , default); 164 | if ( item.Value == ReducerExecuteType.Synchronize ) 165 | { 166 | isForceInitState = false; 167 | } 168 | } 169 | 170 | //如果一个初始函数为能及时提供状态刷新,则需要强制刷新一次状态 171 | if ( isForceInitState ) 172 | { 173 | SetNewState (default , Activator.CreateInstance ()); 174 | return; 175 | } 176 | } 177 | 178 | /// 179 | /// 销毁 180 | /// 181 | public void Destroy () 182 | { 183 | var state = _currentState ?? Activator.CreateInstance (); 184 | state.shouldDestroy = true; 185 | SetNewState (default , state); 186 | } 187 | 188 | #endregion 189 | } 190 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/StateManager/Store/Store.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ca23e652f6bbd0145a567b7ea87a2cf5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Utils.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b3f507cac9b18bf4faf73a5959415a05 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Utils/SafeSingleton.cs: -------------------------------------------------------------------------------- 1 | namespace MVI4Unity 2 | { 3 | /// 4 | /// 单件 5 | /// 6 | /// 7 | public abstract class SafeSingleton where T : new() 8 | { 9 | /// 10 | /// 单件实例 11 | /// 12 | private static T _singleton = default; 13 | 14 | /// 15 | /// 安全锁 16 | /// 17 | private static readonly object _safelock = new object (); 18 | 19 | /// 20 | /// 保护构造 21 | /// 22 | protected SafeSingleton () { } 23 | 24 | /// 25 | /// 创建单例 26 | /// 27 | /// 28 | public static T CreateSingleton () 29 | { 30 | if (_singleton == null) 31 | { 32 | lock ( _safelock ) 33 | { 34 | if ( _singleton == null ) 35 | { 36 | _singleton = new T (); 37 | } 38 | }; 39 | }; 40 | return _singleton; 41 | } 42 | 43 | /// 44 | /// 单件对象 45 | /// 46 | public static T Ins 47 | { 48 | get 49 | { 50 | return _singleton != null ? _singleton : CreateSingleton (); 51 | } 52 | } 53 | } 54 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Utils/SafeSingleton.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 51dffe94a7d11bb448aeeb39c6d32eb4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Utils/SingletonMonoBehaviour.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace Zero 4 | { 5 | /// 6 | /// MonoBehaviour的单例基类 7 | /// 8 | /// 9 | public abstract class SingletonMonoBehaviour : MonoBehaviour where T : Component 10 | { 11 | private static T _ins; 12 | 13 | /// 14 | /// 获得单例 15 | /// 16 | public static T Ins 17 | { 18 | get 19 | { 20 | CreateIns (); 21 | return _ins; 22 | } 23 | } 24 | 25 | public static void CreateIns () 26 | { 27 | if ( null == _ins ) 28 | { 29 | _ins = GameObject.FindObjectOfType (); 30 | 31 | if ( null == _ins ) 32 | { 33 | GameObject go = new GameObject (); 34 | go.name = typeof (T).Name; 35 | go.AddComponent (); 36 | _ins = go.GetComponent (); 37 | } 38 | } 39 | 40 | if ( _ins.transform.parent == null ) 41 | { 42 | DontDestroyOnLoad (_ins.gameObject); 43 | } 44 | } 45 | 46 | /// 47 | /// 销毁当前单例 48 | /// 49 | public static void DestroyIns() 50 | { 51 | if (null != _ins) 52 | { 53 | GameObject.Destroy(_ins.gameObject); 54 | _ins = null; 55 | } 56 | } 57 | } 58 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Utils/SingletonMonoBehaviour.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b8362246226f7e74ab8c48b5b3b9998e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Utils/UtilGameObject.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1a7d2dbbf3f131247a96e79a63ba6499 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Utils/UtilGeneral.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | 6 | namespace MVI4Unity 7 | { 8 | public class UtilGeneral : SafeSingleton 9 | { 10 | /// 11 | /// 方法是否能够匹配委托类型 12 | /// 13 | /// 14 | /// 15 | /// 16 | public bool IsMethodCompatibleWithDelegate (MethodInfo method) where T : class 17 | { 18 | MethodInfo delegateSignature = typeof (T).GetMethod ("Invoke"); 19 | IEnumerable delegateParameters = delegateSignature.GetParameters ().Select (x => x.ParameterType); 20 | IEnumerable methodParameters = method.GetParameters ().Select (x => x.ParameterType); 21 | 22 | //如果返回类型和函数签名都一致,说明委托类型与方法可以匹配上 23 | return delegateSignature.ReturnType == method.ReturnType && delegateParameters.SequenceEqual (methodParameters); 24 | } 25 | 26 | /// 27 | /// 将Method转换为Delegate 28 | /// 29 | /// 30 | /// 31 | /// 32 | /// 33 | /// 34 | public bool Method2Delegate (MethodInfo method , object inst , out T @delegate) where T : class 35 | { 36 | if ( IsMethodCompatibleWithDelegate (method) ) 37 | { 38 | @delegate = Delegate.CreateDelegate (typeof (T) , inst , method) as T; 39 | return @delegate != null; 40 | } 41 | @delegate = null; 42 | return false; 43 | } 44 | 45 | /// 46 | /// 获取类的基类 47 | /// /summary> 48 | /// 49 | /// 50 | /// 51 | public IEnumerable GetBaseClasses (Type type , bool includeSelf = false) 52 | { 53 | if ( type is object && type.BaseType is object ) 54 | { 55 | if ( includeSelf ) 56 | { 57 | yield return type; 58 | } 59 | Type current = type.BaseType; 60 | while ( current is object ) 61 | { 62 | yield return current; 63 | current = current.BaseType; 64 | } 65 | } 66 | } 67 | } 68 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Utils/UtilGeneral.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0181c68e674204649a9beff43ac94d22 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Windows.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 418c15481278b14469f5ec4d213523d9 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Windows/AWindow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 26035adbf3fdc964597053bb54b4f873 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Windows/AWindowComAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MVI4Unity 4 | { 5 | [AttributeUsage (AttributeTargets.Field)] 6 | public class AWindowComAttribute : Attribute 7 | { 8 | /// 9 | /// 对应的标签名称 10 | /// 11 | public readonly string tag; 12 | public AWindowComAttribute (string tag) 13 | { 14 | this.tag = tag; 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Windows/AWindowComAttribute.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7266aa8db53ed994a9731ffab6c4b1ae 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Windows/Node.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b7002391341aa2944b0d73eb44bfea43 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Windows/Node/WindowNode.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace MVI4Unity 6 | { 7 | public class WindowNode : IEquatable, IPoolItem 8 | { 9 | /// 10 | /// 子节点组 11 | /// 12 | public List> childNodeGroup; 13 | 14 | /// 15 | /// 该节点对应类型 16 | /// 17 | protected WindowNodeType windowNodeType; 18 | 19 | /// 20 | /// 该节点来源 21 | /// 22 | public WindowNode from; 23 | 24 | /// 25 | /// 该节点去向 26 | /// 27 | public WindowNode to; 28 | 29 | public int id; 30 | 31 | private AWindow _window; 32 | 33 | /// 34 | /// 对应的窗口 35 | /// 36 | public AWindow Window 37 | { 38 | get 39 | { 40 | return _window; 41 | } 42 | } 43 | 44 | public WindowNode () 45 | { 46 | childNodeGroup = PoolMgr.Ins.GetList> ().Pop (); 47 | } 48 | 49 | /// 50 | /// 清除记录 51 | /// 52 | public void ClearRecord () 53 | { 54 | from = null; 55 | to = null; 56 | } 57 | 58 | /// 59 | /// 设置节点类型 60 | /// 61 | /// 62 | public void SetWindowNodeType (WindowNodeType windowNodeType) 63 | { 64 | this.windowNodeType = windowNodeType; 65 | } 66 | 67 | /// 68 | /// 销毁 69 | /// 70 | public void Destory () 71 | { 72 | PoolMgr.Ins.GetWindowNodePool ().Push (this); 73 | } 74 | 75 | /// 76 | /// 拷贝节点空壳 77 | /// 78 | public WindowNode CloneNodeShallow () 79 | { 80 | WindowNode node = PoolMgr.Ins.GetWindowNodePool ().Pop (); 81 | for ( int i = 0 ; i < childNodeGroup.Count ; i++ ) 82 | { 83 | node.childNodeGroup.Add (PoolMgr.Ins.GetList ().Pop ()); 84 | } 85 | CloneNodeProp (node); 86 | return node; 87 | } 88 | 89 | /// 90 | /// 拷贝节点参数 91 | /// 92 | /// 93 | public void CloneNodeProp (WindowNode node) 94 | { 95 | node.windowNodeType = windowNodeType; 96 | node.id = id; 97 | node._window = _window; 98 | } 99 | 100 | public void OnPush () 101 | { 102 | //回收对应的实体窗口 103 | if ( _window != null ) 104 | { 105 | PoolMgr.Ins.PushAWindow (_window); 106 | } 107 | 108 | //回收每一个List 109 | for ( int i = 0 ; i < childNodeGroup.Count ; i++ ) 110 | { 111 | childNodeGroup [i].Push (); 112 | } 113 | 114 | //最后回收List> 115 | childNodeGroup.Push (); 116 | childNodeGroup = null; 117 | } 118 | 119 | public void OnPop () 120 | { 121 | childNodeGroup = childNodeGroup ?? PoolMgr.Ins.GetList> ().Pop (); 122 | } 123 | 124 | public bool Equals (WindowNode other) 125 | { 126 | //判断依据:节点类型对应的窗口池相同,即都是同一个预制体 127 | return windowNodeType.GetResTag ().Equals (other.windowNodeType.GetResTag ()); 128 | } 129 | 130 | public override string ToString () 131 | { 132 | return $"Type:{windowNodeType.GetType ()}\nresName:{windowNodeType.GetResTag ()}"; 133 | } 134 | 135 | #region 封装来自WindowNodeType的函数,而不是直接调用 136 | 137 | public AWindow CreateAWindow (Transform container) 138 | { 139 | _window = windowNodeType.CreateAWindow (container); 140 | return _window; 141 | } 142 | 143 | public virtual void FillProps (AWindow window , AStateBase state , IStore store) 144 | { 145 | windowNodeType.FillProps (window , state , store); 146 | } 147 | 148 | public List GetContainerList (AWindow window) 149 | { 150 | return windowNodeType.GetContainerList (window); 151 | } 152 | 153 | #endregion 154 | } 155 | 156 | /// 157 | /// 带有属性的节点 158 | /// 159 | /// 160 | /// 161 | /// 162 | public class WindowNode : WindowNode where A : AWindow where S : AStateBase 163 | { 164 | public P prop; 165 | 166 | public override void FillProps (AWindow window , AStateBase state , IStore store) 167 | { 168 | if ( windowNodeType is WindowNodeType realWindowNodeType ) 169 | { 170 | realWindowNodeType.FillProps (window , state , store , prop); 171 | return; 172 | } 173 | base.FillProps (window , state , store); 174 | } 175 | } 176 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Windows/Node/WindowNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9a4ca828ad786d64488a2b9abf638b12 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Windows/Node/WindowNodeDisputeResolve.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | 4 | namespace MVI4Unity 5 | { 6 | public class WindowNodeDisputeResolver : SafeSingleton 7 | { 8 | /// 9 | /// 解决视图节点冲突 10 | /// 11 | /// 12 | /// 13 | /// 14 | /// 15 | /// 16 | public void ResolveDispute4List (Transform container , AStateBase state , IStore store , List currNodes , List newNodes) 17 | { 18 | currNodes.RemoveAll (x => x == null); 19 | newNodes.RemoveAll (x => x == null); 20 | 21 | //将当前节点列表转换为字典,方便索引 22 | Dictionary id2WindowNode = PoolMgr.Ins.GetDict ().Pop (); 23 | for ( int i = 0 ; i < currNodes.Count ; i++ ) 24 | { 25 | WindowNode currNode = currNodes [i]; 26 | currNode.ClearRecord (); 27 | //如果没有设置ID,就忽略转换过程 28 | if ( currNode.id == default ) 29 | { 30 | continue; 31 | } 32 | id2WindowNode [currNode.id] = currNode; 33 | } 34 | 35 | //先进行ID索引匹配 36 | for ( int i = 0 ; i < newNodes.Count ; i++ ) 37 | { 38 | WindowNode newNode = newNodes [i]; 39 | 40 | if ( newNode.id != default 41 | && newNode.to == null 42 | && id2WindowNode.TryGetValue (newNode.id , out WindowNode currNode) 43 | && newNode.Equals (currNode) ) 44 | { 45 | newNode.to = currNode; 46 | currNode.from = newNode; 47 | } 48 | } 49 | id2WindowNode.Push (); 50 | id2WindowNode = null; 51 | 52 | //根据类型进行匹配 53 | for ( int i = 0 ; i < newNodes.Count ; i++ ) 54 | { 55 | WindowNode newNode = newNodes [i]; 56 | if ( newNode.to != null ) 57 | { 58 | continue; 59 | } 60 | 61 | for ( int j = 0 ; j < currNodes.Count ; j++ ) 62 | { 63 | if ( currNodes [j].from != null ) 64 | { 65 | continue; 66 | } 67 | 68 | if ( !newNode.Equals (currNodes [j]) ) 69 | { 70 | continue; 71 | } 72 | 73 | newNode.to = currNodes [j]; 74 | currNodes [j].from = newNode; 75 | break; 76 | } 77 | } 78 | 79 | //穷举当前的节点列表,如果存在未能匹配的节点,将这个节点删除(回收) 80 | for ( int i = 0 ; i < currNodes.Count ; ) 81 | { 82 | WindowNode currNode = currNodes [i]; 83 | if ( currNode.from == null ) 84 | { 85 | currNodes.RemoveAt (i); 86 | RecoveryWindow (currNode); 87 | } 88 | else 89 | { 90 | i++; 91 | } 92 | } 93 | 94 | for ( int i = 0 ; i < newNodes.Count ; i++ ) 95 | { 96 | WindowNode newnode = newNodes [i]; 97 | 98 | //匹配到当前的节点 99 | if ( newnode.to != null ) 100 | { 101 | Compare (newnode.to , newnode , state , store); 102 | } 103 | 104 | //没有匹配到,插入到当前列表 105 | else 106 | { 107 | AWindow window = newnode.CreateAWindow (container); 108 | currNodes.Add (newnode); 109 | newnode.FillProps (window , state , store); 110 | ResolveChildNodeDispute (newnode.CloneNodeShallow () , newnode , state , window , store); 111 | } 112 | } 113 | } 114 | 115 | void Compare (WindowNode curNode , WindowNode newNode , AStateBase state , IStore store) 116 | { 117 | newNode.FillProps (curNode.Window , state , store); 118 | ResolveChildNodeDispute (curNode , newNode , state , curNode.Window , store); 119 | } 120 | 121 | /// 122 | /// 解决子节点冲突 123 | /// 124 | /// 125 | /// 126 | /// 127 | /// 128 | /// 129 | void ResolveChildNodeDispute (WindowNode curNode , WindowNode newNode , AStateBase state , AWindow window , IStore store) 130 | { 131 | List newNodeContainerList = newNode.GetContainerList (window); 132 | for ( int i = 0 ; i < newNodeContainerList.Count ; i++ ) 133 | { 134 | Transform container = newNodeContainerList [i]; 135 | 136 | while ( newNode.childNodeGroup.Count <= i ) 137 | { 138 | newNode.childNodeGroup.Add (PoolMgr.Ins.GetList ().Pop ()); 139 | } 140 | 141 | while ( curNode.childNodeGroup.Count <= i ) 142 | { 143 | curNode.childNodeGroup.Add (PoolMgr.Ins.GetList ().Pop ()); 144 | } 145 | 146 | ResolveDispute4List (container , state , store , curNode.childNodeGroup [i] , newNode.childNodeGroup [i]); 147 | } 148 | newNodeContainerList.Push (); 149 | } 150 | 151 | /// 152 | /// 回收窗口 153 | /// 154 | /// 155 | void RecoveryWindow (WindowNode currentNode) 156 | { 157 | List containerList = currentNode.GetContainerList (currentNode.Window); 158 | for ( int containerIndex = 0 ; containerIndex < containerList.Count ; containerIndex++ ) 159 | { 160 | List childList = currentNode.childNodeGroup [containerIndex]; 161 | for ( int childIndex = 0 ; childIndex < childList.Count ; childIndex++ ) 162 | { 163 | RecoveryWindow (childList [childIndex]); 164 | } 165 | } 166 | currentNode.Destory (); 167 | containerList.Push (); 168 | } 169 | } 170 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Windows/Node/WindowNodeDisputeResolve.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c93426a21d1ad394a92db971cae85d95 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Windows/Node/WindowNodeType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace MVI4Unity 6 | { 7 | /// 8 | /// 节点类型 9 | /// 10 | public abstract class WindowNodeType 11 | { 12 | /// 13 | /// 创建一个节点 14 | /// 15 | /// 16 | /// 17 | public abstract WindowNode CreateWindowNode (AStateBase state); 18 | 19 | /// 20 | /// 创建一个节点 21 | /// 22 | /// 23 | /// 24 | /// 25 | public abstract WindowNode CreateWindowNode (AStateBase state , object @param); 26 | 27 | /// 28 | /// 获取容器列表 29 | /// 30 | /// 31 | /// 32 | public abstract List GetContainerList (AWindow window); 33 | 34 | /// 35 | /// 创建该节点类型的窗口 36 | /// 37 | /// 38 | /// 39 | public abstract AWindow CreateAWindow (Transform container); 40 | 41 | /// 42 | /// 获取资源标签 43 | /// 44 | /// 45 | public abstract string GetResTag (); 46 | 47 | /// 48 | /// 填充属性 49 | /// 50 | /// 51 | /// 52 | /// 53 | public abstract void FillProps (AWindow window , AStateBase state , IStore store); 54 | 55 | /// 56 | /// 获取根节点 57 | /// 58 | /// 59 | /// 60 | public WindowNode GetRoot (AStateBase state) 61 | { 62 | return CreateWindowNode (state); 63 | } 64 | 65 | /// 66 | /// 获取根节点 67 | /// 68 | /// 69 | /// 70 | /// 71 | public WindowNode GetRoot (AStateBase state , object @param) 72 | { 73 | return CreateWindowNode (state , @param); 74 | } 75 | } 76 | 77 | /// 78 | /// 节点类型 79 | /// 80 | /// 81 | /// 82 | /// 83 | public class WindowNodeType : WindowNodeType where A : AWindow where S : AStateBase 84 | { 85 | protected readonly string windowAssetPath; 86 | protected readonly PoolType windowPool; 87 | protected readonly Func> containerCreator; 88 | protected readonly Func>> childNodeCreator; 89 | protected readonly Action fillProps; 90 | 91 | /// 92 | /// 构造节点信息 93 | /// 94 | /// 95 | /// 96 | /// 97 | /// 98 | /// 99 | public WindowNodeType ( 100 | string windowAssetPath , 101 | Action fillProps , 102 | Func> containerCreator = default , 103 | Func>> childNodeCreator = default , 104 | PoolType windowPool = null) 105 | { 106 | this.windowAssetPath = windowAssetPath; 107 | this.windowPool = windowPool; 108 | this.containerCreator = containerCreator; 109 | this.childNodeCreator = childNodeCreator; 110 | this.fillProps = fillProps; 111 | } 112 | 113 | public override AWindow CreateAWindow (Transform container) 114 | { 115 | AWindow window = ( windowPool ?? PoolMgr.Ins.GetAWindowPool (windowAssetPath) ).Pop (); 116 | window.SetParent (container); 117 | window.GameObject.transform.localScale = Vector3.one; 118 | window.GameObject.transform.localPosition = new Vector3 (window.GameObject.transform.localScale.x , window.GameObject.transform.localScale.y , 0); 119 | return window; 120 | } 121 | 122 | public override WindowNode CreateWindowNode (AStateBase state) 123 | { 124 | return CreateWindowNode (state , default); 125 | } 126 | 127 | public override WindowNode CreateWindowNode (AStateBase state , object @param) 128 | { 129 | return CreateWindowNode (state , ( P ) param); 130 | } 131 | 132 | public WindowNode CreateWindowNode (AStateBase state , P @param) 133 | { 134 | WindowNode node = PoolMgr.Ins.GetWindowNodePool ().Pop (); 135 | node.prop = param; 136 | node.SetWindowNodeType (this); 137 | node.childNodeGroup.Clear (); 138 | node.childNodeGroup.AddRange (childNodeCreator == null ? PoolMgr.Ins.GetList> ().Pop () : childNodeCreator.Invoke (state as S)); 139 | return node; 140 | } 141 | 142 | public override List GetContainerList (AWindow window) 143 | { 144 | if ( containerCreator == null ) 145 | { 146 | return PoolMgr.Ins.GetList ().Pop (); 147 | } 148 | return containerCreator.Invoke (window as A); 149 | } 150 | 151 | public override void FillProps (AWindow window , AStateBase state , IStore store) 152 | { 153 | window.RemoveAllListeners (); 154 | fillProps?.Invoke (state as S , window as A , store , default); 155 | } 156 | 157 | public void FillProps (AWindow window , AStateBase state , IStore store , P @param) 158 | { 159 | window.RemoveAllListeners (); 160 | fillProps?.Invoke (state as S , window as A , store , param); 161 | } 162 | 163 | public override string GetResTag () 164 | { 165 | return windowAssetPath; 166 | } 167 | } 168 | 169 | /// 170 | /// 只带默认参数的节点类型 171 | /// 172 | /// 173 | /// 174 | public class WindowNodeType : WindowNodeType where A : AWindow where S : AStateBase 175 | { 176 | public WindowNodeType (string windowAssetPath , 177 | Action fillProps , 178 | Func> containerCreator = null , 179 | Func>> childNodeCreator = null , 180 | PoolType windowPool = null) : base (windowAssetPath , fillProps , containerCreator , childNodeCreator , windowPool) 181 | { 182 | 183 | } 184 | } 185 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Windows/Node/WindowNodeType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1db20004361636a40b40013e10f67c0f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Windows/ObjectBindingData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace MVI4Unity 5 | { 6 | /// 7 | /// 资源引用组件 8 | /// 9 | public class ObjectBindingData : MonoBehaviour 10 | { 11 | [Serializable] 12 | public struct BindingVO 13 | { 14 | public string key; 15 | public UnityEngine.Object [] list; 16 | } 17 | 18 | [Header ("数据引用")] 19 | public BindingVO [] resList; 20 | 21 | /// 22 | /// 找到Key对应的资源 23 | /// 24 | /// 25 | /// 26 | public UnityEngine.Object [] Find (string key) 27 | { 28 | foreach ( BindingVO vo in resList ) 29 | { 30 | if ( vo.key == key ) 31 | { 32 | return vo.list; 33 | } 34 | } 35 | 36 | return null; 37 | } 38 | 39 | public static UnityEngine.Object [] Find (GameObject go , string key) 40 | { 41 | ObjectBindingData data = go.GetComponent (); 42 | if ( null == data ) 43 | { 44 | return null; 45 | } 46 | return data.Find (key); 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Windows/ObjectBindingData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c8ecf131acd68204e9485b1e9eecf4fe 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Windows/RootNodeContainer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace MVI4Unity 6 | { 7 | public class RootNodeContainerData 8 | { 9 | public WindowNodeType component; 10 | public object data; 11 | } 12 | 13 | public interface IRootNodeContainer 14 | { 15 | /// 16 | /// 派发 17 | /// 18 | /// 19 | /// 20 | void DisPatch (Enum tag , object @param = null); 21 | 22 | /// 23 | /// 是否有效 24 | /// 25 | /// 26 | bool IsUseful (); 27 | } 28 | 29 | /// 30 | /// 根节点的容器 31 | /// 32 | public class RootNodeContainer : AWindow, IRootNodeContainer where S : AStateBase where R : IReducer 33 | { 34 | /// 35 | /// 当前节点列表 36 | /// 37 | private readonly List _currentNodes = new List (); 38 | private Store _store; 39 | private readonly Queue _stateQueue = new Queue (); 40 | private RootNodeContainerData _rootNodeContainerData; 41 | public event Action onDestroy; 42 | 43 | protected override void OnInit () 44 | { 45 | base.OnInit (); 46 | _store = SimpleStoreFactory.Ins.CreateStore (); 47 | _rootNodeContainerData = data as RootNodeContainerData; 48 | _store.Subscribe ((state) => 49 | { 50 | if ( IsDestroyed () ) 51 | { 52 | return; 53 | } 54 | _stateQueue.Enqueue (state); 55 | ResolveDisputeQuene (); 56 | }); 57 | _store.InitState (); 58 | } 59 | 60 | /// 61 | /// 是否等待 62 | /// 63 | bool wait = false; 64 | 65 | /// 66 | /// 解决冲突列表 67 | /// 68 | void ResolveDisputeQuene () 69 | { 70 | if ( _stateQueue.Count > 0 && !wait ) 71 | { 72 | wait = true; 73 | ResolveDispute (_stateQueue.Dequeue () , _rootNodeContainerData.component); 74 | wait = false; 75 | ResolveDisputeQuene (); 76 | } 77 | } 78 | 79 | /// 80 | /// 解决冲突 81 | /// 82 | /// 83 | /// 84 | void ResolveDispute (S state , WindowNodeType component) 85 | { 86 | List newNodeList = PoolMgr.Ins.GetList ().Pop (); //从池里获取一个列表 87 | WindowNode node = state.shouldDestroy ? default : _rootNodeContainerData.data != null ? component.GetRoot (state , _rootNodeContainerData.data) : component.GetRoot (state); 88 | newNodeList.Add (node); 89 | WindowNodeDisputeResolver.Ins.ResolveDispute4List (GameObject.transform , state , _store , _currentNodes , newNodeList); 90 | newNodeList.Push (); //列表用完回收 91 | 92 | if ( state.shouldDestroy ) 93 | { 94 | Destroy (); 95 | onDestroy?.Invoke (this); 96 | return; 97 | } 98 | 99 | if ( node != null && node.Window != null ) 100 | { 101 | node.Window.SetDefaultTransProp (); 102 | } 103 | } 104 | 105 | public void DisPatch (Enum tag , object @param = null) 106 | { 107 | _store?.DisPatch (tag , param); 108 | } 109 | 110 | public bool IsUseful () 111 | { 112 | return !IsDestroyed (); 113 | } 114 | } 115 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Windows/RootNodeContainer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 83dc475960cfb544b9fb99bc5c452918 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Windows/UIWinMgr.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace MVI4Unity 6 | { 7 | /// 8 | /// 界面管理器 9 | /// 10 | public class UIWinMgr : SafeSingleton 11 | { 12 | private readonly List _rootViewCacheList = new List (); 13 | 14 | /// 15 | /// 创建视图 16 | /// 17 | /// 18 | /// 19 | /// 20 | /// 21 | /// 22 | public AWindow Create (Type type , GameObject prefab , Transform parent , object data = null) 23 | { 24 | GameObject go = UnityEngine.Object.Instantiate (prefab , parent); 25 | go.name = prefab.name; 26 | AWindow view = Activator.CreateInstance (type) as AWindow; 27 | view.SetGameObject (go , data); 28 | return view; 29 | } 30 | 31 | /// 32 | /// 创建视图 33 | /// 34 | /// 35 | /// 36 | /// 37 | /// 38 | /// 39 | public T Create (GameObject prefab , Transform parent , object data = null) where T : AWindow 40 | { 41 | AWindow view = Create (typeof (T) , prefab , parent , data); 42 | return view as T; 43 | } 44 | 45 | /// 46 | /// 创建视图 47 | /// 48 | /// 49 | /// 50 | /// 51 | /// 52 | /// 53 | public T Create (string assetPath , Transform parent , object data = null) where T : AWindow 54 | { 55 | GameObject prefab = Resources.Load (assetPath); 56 | if ( prefab == default ) 57 | { 58 | Debug.LogError ($"assetPath[{assetPath}] 对应资源为空"); 59 | } 60 | T window = Create (prefab , parent , data); 61 | window.assetPath = assetPath; 62 | return window; 63 | } 64 | 65 | /// 66 | /// 打开某个界面 67 | /// 68 | /// 69 | /// 70 | /// 71 | /// 72 | /// 73 | public RootNodeContainer Open (Transform parent , WindowNodeType component) where S : AStateBase where R : IReducer 74 | { 75 | return PushCacheList (Create> ("RootNodeContainer" , parent , new RootNodeContainerData () { component = component })) as RootNodeContainer; 76 | } 77 | 78 | /// 79 | /// 打开某个界面 80 | /// 81 | /// 82 | /// 83 | /// 84 | /// 85 | /// 86 | /// 87 | public RootNodeContainer Open (Transform parent , WindowNodeType component , object @param) where S : AStateBase where R : IReducer 88 | { 89 | return PushCacheList (Create> ("RootNodeContainer" , parent , new RootNodeContainerData () { component = component , data = param })) as RootNodeContainer; 90 | } 91 | 92 | /// 93 | /// 关闭全部界面 94 | /// 95 | public void CloseAllView () 96 | { 97 | for ( int i = 0 ; i < _rootViewCacheList.Count ; i++ ) 98 | { 99 | _rootViewCacheList [i].DisPatch (ReducerCommonFunType.Close); 100 | } 101 | _rootViewCacheList.Clear (); 102 | } 103 | 104 | IRootNodeContainer PushCacheList (IRootNodeContainer rootNodeContainer) 105 | { 106 | for ( int i = 0 ; i < _rootViewCacheList.Count ; ) 107 | { 108 | if ( !_rootViewCacheList [i].IsUseful () ) 109 | { 110 | _rootViewCacheList.RemoveAt (i); 111 | } 112 | else 113 | { 114 | i++; 115 | } 116 | } 117 | _rootViewCacheList.Add (rootNodeContainer); 118 | return rootNodeContainer; 119 | } 120 | } 121 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Core/Windows/UIWinMgr.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 92842655035012d41be7b27ffda12bbf 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 493456ae05e60134f9b112330c16b9be 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Plugins/LitJson.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ae867ea64d58e9a449cc04a4f82c2e14 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Plugins/LitJson/IJsonWrapper.cs: -------------------------------------------------------------------------------- 1 | #region Header 2 | /** 3 | * IJsonWrapper.cs 4 | * Interface that represents a type capable of handling all kinds of JSON 5 | * data. This is mainly used when mapping objects through JsonMapper, and 6 | * it's implemented by JsonData. 7 | * 8 | * The authors disclaim copyright to this source code. For more details, see 9 | * the COPYING file included with this distribution. 10 | **/ 11 | #endregion 12 | 13 | 14 | using System.Collections; 15 | using System.Collections.Specialized; 16 | 17 | 18 | namespace LitJson 19 | { 20 | public enum JsonType 21 | { 22 | None, 23 | 24 | Object, 25 | Array, 26 | String, 27 | Int, 28 | Long, 29 | Double, 30 | Boolean 31 | } 32 | 33 | public interface IJsonWrapper : IList, IOrderedDictionary 34 | { 35 | bool IsArray { get; } 36 | bool IsBoolean { get; } 37 | bool IsDouble { get; } 38 | bool IsInt { get; } 39 | bool IsLong { get; } 40 | bool IsObject { get; } 41 | bool IsString { get; } 42 | 43 | bool GetBoolean (); 44 | double GetDouble (); 45 | int GetInt (); 46 | JsonType GetJsonType (); 47 | long GetLong (); 48 | string GetString (); 49 | 50 | void SetBoolean (bool val); 51 | void SetDouble (double val); 52 | void SetInt (int val); 53 | void SetJsonType (JsonType type); 54 | void SetLong (long val); 55 | void SetString (string val); 56 | 57 | string ToJson (); 58 | void ToJson (JsonWriter writer); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Plugins/LitJson/IJsonWrapper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eb89843880649894da9d8f86cc501853 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Plugins/LitJson/JsonData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 10151a7c62ace1e45add8bcba37197d3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Plugins/LitJson/JsonException.cs: -------------------------------------------------------------------------------- 1 | #region Header 2 | /** 3 | * JsonException.cs 4 | * Base class throwed by LitJSON when a parsing error occurs. 5 | * 6 | * The authors disclaim copyright to this source code. For more details, see 7 | * the COPYING file included with this distribution. 8 | **/ 9 | #endregion 10 | 11 | 12 | using System; 13 | 14 | 15 | namespace LitJson 16 | { 17 | public class JsonException : 18 | #if NETSTANDARD1_5 19 | Exception 20 | #else 21 | ApplicationException 22 | #endif 23 | { 24 | public JsonException () : base () 25 | { 26 | } 27 | 28 | internal JsonException (ParserToken token) : 29 | base (String.Format ( 30 | "Invalid token '{0}' in input string", token)) 31 | { 32 | } 33 | 34 | internal JsonException (ParserToken token, 35 | Exception inner_exception) : 36 | base (String.Format ( 37 | "Invalid token '{0}' in input string", token), 38 | inner_exception) 39 | { 40 | } 41 | 42 | internal JsonException (int c) : 43 | base (String.Format ( 44 | "Invalid character '{0}' in input string", (char) c)) 45 | { 46 | } 47 | 48 | internal JsonException (int c, Exception inner_exception) : 49 | base (String.Format ( 50 | "Invalid character '{0}' in input string", (char) c), 51 | inner_exception) 52 | { 53 | } 54 | 55 | 56 | public JsonException (string message) : base (message) 57 | { 58 | } 59 | 60 | public JsonException (string message, Exception inner_exception) : 61 | base (message, inner_exception) 62 | { 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Plugins/LitJson/JsonException.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 472ef29ce02cc2248ba13b4a6ed60f9b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Plugins/LitJson/JsonMapper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f924b228cbb019e46b74afd3654baad2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Plugins/LitJson/JsonMockWrapper.cs: -------------------------------------------------------------------------------- 1 | #region Header 2 | /** 3 | * JsonMockWrapper.cs 4 | * Mock object implementing IJsonWrapper, to facilitate actions like 5 | * skipping data more efficiently. 6 | * 7 | * The authors disclaim copyright to this source code. For more details, see 8 | * the COPYING file included with this distribution. 9 | **/ 10 | #endregion 11 | 12 | 13 | using System; 14 | using System.Collections; 15 | using System.Collections.Specialized; 16 | 17 | 18 | namespace LitJson 19 | { 20 | public class JsonMockWrapper : IJsonWrapper 21 | { 22 | public bool IsArray { get { return false; } } 23 | public bool IsBoolean { get { return false; } } 24 | public bool IsDouble { get { return false; } } 25 | public bool IsInt { get { return false; } } 26 | public bool IsLong { get { return false; } } 27 | public bool IsObject { get { return false; } } 28 | public bool IsString { get { return false; } } 29 | 30 | public bool GetBoolean () { return false; } 31 | public double GetDouble () { return 0.0; } 32 | public int GetInt () { return 0; } 33 | public JsonType GetJsonType () { return JsonType.None; } 34 | public long GetLong () { return 0L; } 35 | public string GetString () { return ""; } 36 | 37 | public void SetBoolean (bool val) {} 38 | public void SetDouble (double val) {} 39 | public void SetInt (int val) {} 40 | public void SetJsonType (JsonType type) {} 41 | public void SetLong (long val) {} 42 | public void SetString (string val) {} 43 | 44 | public string ToJson () { return ""; } 45 | public void ToJson (JsonWriter writer) {} 46 | 47 | 48 | bool IList.IsFixedSize { get { return true; } } 49 | bool IList.IsReadOnly { get { return true; } } 50 | 51 | object IList.this[int index] { 52 | get { return null; } 53 | set {} 54 | } 55 | 56 | int IList.Add (object value) { return 0; } 57 | void IList.Clear () {} 58 | bool IList.Contains (object value) { return false; } 59 | int IList.IndexOf (object value) { return -1; } 60 | void IList.Insert (int i, object v) {} 61 | void IList.Remove (object value) {} 62 | void IList.RemoveAt (int index) {} 63 | 64 | 65 | int ICollection.Count { get { return 0; } } 66 | bool ICollection.IsSynchronized { get { return false; } } 67 | object ICollection.SyncRoot { get { return null; } } 68 | 69 | void ICollection.CopyTo (Array array, int index) {} 70 | 71 | 72 | IEnumerator IEnumerable.GetEnumerator () { return null; } 73 | 74 | 75 | bool IDictionary.IsFixedSize { get { return true; } } 76 | bool IDictionary.IsReadOnly { get { return true; } } 77 | 78 | ICollection IDictionary.Keys { get { return null; } } 79 | ICollection IDictionary.Values { get { return null; } } 80 | 81 | object IDictionary.this[object key] { 82 | get { return null; } 83 | set {} 84 | } 85 | 86 | void IDictionary.Add (object k, object v) {} 87 | void IDictionary.Clear () {} 88 | bool IDictionary.Contains (object key) { return false; } 89 | void IDictionary.Remove (object key) {} 90 | 91 | IDictionaryEnumerator IDictionary.GetEnumerator () { return null; } 92 | 93 | 94 | object IOrderedDictionary.this[int idx] { 95 | get { return null; } 96 | set {} 97 | } 98 | 99 | IDictionaryEnumerator IOrderedDictionary.GetEnumerator () { 100 | return null; 101 | } 102 | void IOrderedDictionary.Insert (int i, object k, object v) {} 103 | void IOrderedDictionary.RemoveAt (int i) {} 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Plugins/LitJson/JsonMockWrapper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0c65c6e2912f3a346acdf24b9b065269 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Plugins/LitJson/JsonReader.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 32cea9187f629054f83d9bf8d43944f4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Plugins/LitJson/JsonWriter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d07b1d2d7b867e64298d9f06ac193dd3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Plugins/LitJson/Lexer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9d320f7b7c94d97478cfd0f1a9d4c54c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Plugins/LitJson/Netstandard15Polyfill.cs: -------------------------------------------------------------------------------- 1 | #if NETSTANDARD1_5 2 | using System; 3 | using System.Reflection; 4 | namespace LitJson 5 | { 6 | internal static class Netstandard15Polyfill 7 | { 8 | internal static Type GetInterface(this Type type, string name) 9 | { 10 | return type.GetTypeInfo().GetInterface(name); 11 | } 12 | 13 | internal static bool IsClass(this Type type) 14 | { 15 | return type.GetTypeInfo().IsClass; 16 | } 17 | 18 | internal static bool IsEnum(this Type type) 19 | { 20 | return type.GetTypeInfo().IsEnum; 21 | } 22 | } 23 | } 24 | #endif -------------------------------------------------------------------------------- /MVI4Unity/Assets/Plugins/LitJson/Netstandard15Polyfill.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6e3aff4b9ec90c94f902186eac612297 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Plugins/LitJson/ParserToken.cs: -------------------------------------------------------------------------------- 1 | #region Header 2 | /** 3 | * ParserToken.cs 4 | * Internal representation of the tokens used by the lexer and the parser. 5 | * 6 | * The authors disclaim copyright to this source code. For more details, see 7 | * the COPYING file included with this distribution. 8 | **/ 9 | #endregion 10 | 11 | 12 | namespace LitJson 13 | { 14 | internal enum ParserToken 15 | { 16 | // Lexer tokens (see section A.1.1. of the manual) 17 | None = System.Char.MaxValue + 1, 18 | Number, 19 | True, 20 | False, 21 | Null, 22 | CharSeq, 23 | // Single char 24 | Char, 25 | 26 | // Parser Rules (see section A.2.1 of the manual) 27 | Text, 28 | Object, 29 | ObjectPrime, 30 | Pair, 31 | PairRest, 32 | Array, 33 | ArrayPrime, 34 | Value, 35 | ValueRest, 36 | String, 37 | 38 | // End of input 39 | End, 40 | 41 | // The empty rule 42 | Epsilon 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Plugins/LitJson/ParserToken.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 289625690f7ae164eba87727cb05b886 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 99afaf0fa4d81844d8cb9389ab22fcdd 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Resources/CertainView.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0def8357a85b25545b7fc35c0ca9caa2 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Resources/RootNodeContainer.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &3565670351439428990 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 3565670351439428991} 12 | m_Layer: 5 13 | m_Name: RootNodeContainer 14 | m_TagString: Untagged 15 | m_Icon: {fileID: 0} 16 | m_NavMeshLayer: 0 17 | m_StaticEditorFlags: 0 18 | m_IsActive: 1 19 | --- !u!224 &3565670351439428991 20 | RectTransform: 21 | m_ObjectHideFlags: 0 22 | m_CorrespondingSourceObject: {fileID: 0} 23 | m_PrefabInstance: {fileID: 0} 24 | m_PrefabAsset: {fileID: 0} 25 | m_GameObject: {fileID: 3565670351439428990} 26 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 27 | m_LocalPosition: {x: 0, y: 0, z: 0} 28 | m_LocalScale: {x: 1, y: 1, z: 1} 29 | m_Children: [] 30 | m_Father: {fileID: 0} 31 | m_RootOrder: 0 32 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 33 | m_AnchorMin: {x: 0, y: 0} 34 | m_AnchorMax: {x: 1, y: 1} 35 | m_AnchoredPosition: {x: 0, y: 0} 36 | m_SizeDelta: {x: 0, y: 0} 37 | m_Pivot: {x: 0.5, y: 0.5} 38 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Resources/RootNodeContainer.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f2832238f72234341b4919f1e532e534 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Resources/TipView.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &3750610997194329718 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 3750610997194329719} 12 | - component: {fileID: 3750610997194329713} 13 | - component: {fileID: 3750610997194329712} 14 | m_Layer: 5 15 | m_Name: bg 16 | m_TagString: Untagged 17 | m_Icon: {fileID: 0} 18 | m_NavMeshLayer: 0 19 | m_StaticEditorFlags: 0 20 | m_IsActive: 1 21 | --- !u!224 &3750610997194329719 22 | RectTransform: 23 | m_ObjectHideFlags: 0 24 | m_CorrespondingSourceObject: {fileID: 0} 25 | m_PrefabInstance: {fileID: 0} 26 | m_PrefabAsset: {fileID: 0} 27 | m_GameObject: {fileID: 3750610997194329718} 28 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 29 | m_LocalPosition: {x: 0, y: 0, z: 0} 30 | m_LocalScale: {x: 1, y: 1, z: 1} 31 | m_ConstrainProportionsScale: 0 32 | m_Children: 33 | - {fileID: 3750610998812723492} 34 | m_Father: {fileID: 3750610997727638703} 35 | m_RootOrder: -1 36 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 37 | m_AnchorMin: {x: 0.5, y: 0.5} 38 | m_AnchorMax: {x: 0.5, y: 0.5} 39 | m_AnchoredPosition: {x: 0, y: 0} 40 | m_SizeDelta: {x: 430, y: 52} 41 | m_Pivot: {x: 0.5, y: 0.5} 42 | --- !u!222 &3750610997194329713 43 | CanvasRenderer: 44 | m_ObjectHideFlags: 0 45 | m_CorrespondingSourceObject: {fileID: 0} 46 | m_PrefabInstance: {fileID: 0} 47 | m_PrefabAsset: {fileID: 0} 48 | m_GameObject: {fileID: 3750610997194329718} 49 | m_CullTransparentMesh: 1 50 | --- !u!114 &3750610997194329712 51 | MonoBehaviour: 52 | m_ObjectHideFlags: 0 53 | m_CorrespondingSourceObject: {fileID: 0} 54 | m_PrefabInstance: {fileID: 0} 55 | m_PrefabAsset: {fileID: 0} 56 | m_GameObject: {fileID: 3750610997194329718} 57 | m_Enabled: 1 58 | m_EditorHideFlags: 0 59 | m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} 60 | m_Name: 61 | m_EditorClassIdentifier: 62 | m_Material: {fileID: 0} 63 | m_Color: {r: 1, g: 1, b: 1, a: 1} 64 | m_RaycastTarget: 1 65 | m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} 66 | m_Maskable: 1 67 | m_OnCullStateChanged: 68 | m_PersistentCalls: 69 | m_Calls: [] 70 | m_Sprite: {fileID: 21300000, guid: d75fceab3d315b04e952300506d43241, type: 3} 71 | m_Type: 0 72 | m_PreserveAspect: 0 73 | m_FillCenter: 1 74 | m_FillMethod: 4 75 | m_FillAmount: 1 76 | m_FillClockwise: 1 77 | m_FillOrigin: 0 78 | m_UseSpriteMesh: 0 79 | m_PixelsPerUnitMultiplier: 1 80 | --- !u!1 &3750610997727638702 81 | GameObject: 82 | m_ObjectHideFlags: 0 83 | m_CorrespondingSourceObject: {fileID: 0} 84 | m_PrefabInstance: {fileID: 0} 85 | m_PrefabAsset: {fileID: 0} 86 | serializedVersion: 6 87 | m_Component: 88 | - component: {fileID: 3750610997727638703} 89 | - component: {fileID: 6484009968150575602} 90 | m_Layer: 5 91 | m_Name: TipView 92 | m_TagString: Untagged 93 | m_Icon: {fileID: 0} 94 | m_NavMeshLayer: 0 95 | m_StaticEditorFlags: 0 96 | m_IsActive: 1 97 | --- !u!224 &3750610997727638703 98 | RectTransform: 99 | m_ObjectHideFlags: 0 100 | m_CorrespondingSourceObject: {fileID: 0} 101 | m_PrefabInstance: {fileID: 0} 102 | m_PrefabAsset: {fileID: 0} 103 | m_GameObject: {fileID: 3750610997727638702} 104 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 105 | m_LocalPosition: {x: 0, y: 0, z: 0} 106 | m_LocalScale: {x: 1, y: 1, z: 1} 107 | m_ConstrainProportionsScale: 0 108 | m_Children: 109 | - {fileID: 3750610997194329719} 110 | m_Father: {fileID: 0} 111 | m_RootOrder: -1 112 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 113 | m_AnchorMin: {x: 0, y: 0} 114 | m_AnchorMax: {x: 1, y: 1} 115 | m_AnchoredPosition: {x: 0, y: 0} 116 | m_SizeDelta: {x: 0, y: 0} 117 | m_Pivot: {x: 0.5, y: 0.5} 118 | --- !u!114 &6484009968150575602 119 | MonoBehaviour: 120 | m_ObjectHideFlags: 0 121 | m_CorrespondingSourceObject: {fileID: 0} 122 | m_PrefabInstance: {fileID: 0} 123 | m_PrefabAsset: {fileID: 0} 124 | m_GameObject: {fileID: 3750610997727638702} 125 | m_Enabled: 1 126 | m_EditorHideFlags: 0 127 | m_Script: {fileID: 11500000, guid: c8ecf131acd68204e9485b1e9eecf4fe, type: 3} 128 | m_Name: 129 | m_EditorClassIdentifier: 130 | resList: 131 | - key: text 132 | list: 133 | - {fileID: 3750610998812723547} 134 | --- !u!1 &3750610998812723547 135 | GameObject: 136 | m_ObjectHideFlags: 0 137 | m_CorrespondingSourceObject: {fileID: 0} 138 | m_PrefabInstance: {fileID: 0} 139 | m_PrefabAsset: {fileID: 0} 140 | serializedVersion: 6 141 | m_Component: 142 | - component: {fileID: 3750610998812723492} 143 | - component: {fileID: 3750610998812723494} 144 | - component: {fileID: 3750610998812723493} 145 | m_Layer: 5 146 | m_Name: text 147 | m_TagString: Untagged 148 | m_Icon: {fileID: 0} 149 | m_NavMeshLayer: 0 150 | m_StaticEditorFlags: 0 151 | m_IsActive: 1 152 | --- !u!224 &3750610998812723492 153 | RectTransform: 154 | m_ObjectHideFlags: 0 155 | m_CorrespondingSourceObject: {fileID: 0} 156 | m_PrefabInstance: {fileID: 0} 157 | m_PrefabAsset: {fileID: 0} 158 | m_GameObject: {fileID: 3750610998812723547} 159 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 160 | m_LocalPosition: {x: 0, y: 0, z: 0} 161 | m_LocalScale: {x: 1, y: 1, z: 1} 162 | m_ConstrainProportionsScale: 0 163 | m_Children: [] 164 | m_Father: {fileID: 3750610997194329719} 165 | m_RootOrder: -1 166 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 167 | m_AnchorMin: {x: 0, y: 0} 168 | m_AnchorMax: {x: 1, y: 1} 169 | m_AnchoredPosition: {x: 0, y: 0} 170 | m_SizeDelta: {x: 0, y: 0} 171 | m_Pivot: {x: 0.5, y: 0.5} 172 | --- !u!222 &3750610998812723494 173 | CanvasRenderer: 174 | m_ObjectHideFlags: 0 175 | m_CorrespondingSourceObject: {fileID: 0} 176 | m_PrefabInstance: {fileID: 0} 177 | m_PrefabAsset: {fileID: 0} 178 | m_GameObject: {fileID: 3750610998812723547} 179 | m_CullTransparentMesh: 1 180 | --- !u!114 &3750610998812723493 181 | MonoBehaviour: 182 | m_ObjectHideFlags: 0 183 | m_CorrespondingSourceObject: {fileID: 0} 184 | m_PrefabInstance: {fileID: 0} 185 | m_PrefabAsset: {fileID: 0} 186 | m_GameObject: {fileID: 3750610998812723547} 187 | m_Enabled: 1 188 | m_EditorHideFlags: 0 189 | m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} 190 | m_Name: 191 | m_EditorClassIdentifier: 192 | m_Material: {fileID: 0} 193 | m_Color: {r: 1, g: 1, b: 1, a: 1} 194 | m_RaycastTarget: 1 195 | m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} 196 | m_Maskable: 1 197 | m_OnCullStateChanged: 198 | m_PersistentCalls: 199 | m_Calls: [] 200 | m_FontData: 201 | m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} 202 | m_FontSize: 20 203 | m_FontStyle: 1 204 | m_BestFit: 0 205 | m_MinSize: 1 206 | m_MaxSize: 40 207 | m_Alignment: 4 208 | m_AlignByGeometry: 0 209 | m_RichText: 1 210 | m_HorizontalOverflow: 0 211 | m_VerticalOverflow: 0 212 | m_LineSpacing: 1 213 | m_Text: 12223123123123123 214 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Resources/TipView.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cd907e1f3d7913a47b6e6c9570226808 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Resources/UIContent.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2751ab0c1cbbfd04eb98761fc2cca023 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Resources/Windown01.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0d6948e3438c90f41bf0b932dda0e85d 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Resources/WindownItem.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &3070385743898663503 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 8045326923596730931} 12 | - component: {fileID: 5554391632109224077} 13 | - component: {fileID: 1533616811784132557} 14 | m_Layer: 5 15 | m_Name: WindownItem 16 | m_TagString: Untagged 17 | m_Icon: {fileID: 0} 18 | m_NavMeshLayer: 0 19 | m_StaticEditorFlags: 0 20 | m_IsActive: 1 21 | --- !u!224 &8045326923596730931 22 | RectTransform: 23 | m_ObjectHideFlags: 0 24 | m_CorrespondingSourceObject: {fileID: 0} 25 | m_PrefabInstance: {fileID: 0} 26 | m_PrefabAsset: {fileID: 0} 27 | m_GameObject: {fileID: 3070385743898663503} 28 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 29 | m_LocalPosition: {x: 0, y: 0, z: 0} 30 | m_LocalScale: {x: 1, y: 1, z: 1} 31 | m_Children: [] 32 | m_Father: {fileID: 0} 33 | m_RootOrder: 0 34 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 35 | m_AnchorMin: {x: 0.5, y: 0.5} 36 | m_AnchorMax: {x: 0.5, y: 0.5} 37 | m_AnchoredPosition: {x: 0, y: 0} 38 | m_SizeDelta: {x: 200, y: 50} 39 | m_Pivot: {x: 0.5, y: 0.5} 40 | --- !u!222 &5554391632109224077 41 | CanvasRenderer: 42 | m_ObjectHideFlags: 0 43 | m_CorrespondingSourceObject: {fileID: 0} 44 | m_PrefabInstance: {fileID: 0} 45 | m_PrefabAsset: {fileID: 0} 46 | m_GameObject: {fileID: 3070385743898663503} 47 | m_CullTransparentMesh: 0 48 | --- !u!114 &1533616811784132557 49 | MonoBehaviour: 50 | m_ObjectHideFlags: 0 51 | m_CorrespondingSourceObject: {fileID: 0} 52 | m_PrefabInstance: {fileID: 0} 53 | m_PrefabAsset: {fileID: 0} 54 | m_GameObject: {fileID: 3070385743898663503} 55 | m_Enabled: 1 56 | m_EditorHideFlags: 0 57 | m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} 58 | m_Name: 59 | m_EditorClassIdentifier: 60 | m_Material: {fileID: 0} 61 | m_Color: {r: 0.666201, g: 1, b: 0, a: 1} 62 | m_RaycastTarget: 1 63 | m_Maskable: 1 64 | m_OnCullStateChanged: 65 | m_PersistentCalls: 66 | m_Calls: [] 67 | m_Sprite: {fileID: 0} 68 | m_Type: 0 69 | m_PreserveAspect: 0 70 | m_FillCenter: 1 71 | m_FillMethod: 4 72 | m_FillAmount: 1 73 | m_FillClockwise: 1 74 | m_FillOrigin: 0 75 | m_UseSpriteMesh: 0 76 | m_PixelsPerUnitMultiplier: 1 77 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Resources/WindownItem.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 52da442f64ad8ee449f3f2a4af51cec5 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Resources/image.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d1dfaa4b38f9d304f99447780ed755d8 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Resources/image/bottom_05_v3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wilson403/MVI4Unity/0536c64469b831b880d6c1ed5413d4a9061a960c/MVI4Unity/Assets/Resources/image/bottom_05_v3.png -------------------------------------------------------------------------------- /MVI4Unity/Assets/Resources/image/bottom_05_v3.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d75fceab3d315b04e952300506d43241 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 12 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | flipGreenChannel: 0 24 | isReadable: 0 25 | streamingMipmaps: 0 26 | streamingMipmapsPriority: 0 27 | vTOnly: 0 28 | ignoreMasterTextureLimit: 0 29 | grayScaleToAlpha: 0 30 | generateCubemap: 6 31 | cubemapConvolution: 0 32 | seamlessCubemap: 0 33 | textureFormat: 1 34 | maxTextureSize: 2048 35 | textureSettings: 36 | serializedVersion: 2 37 | filterMode: 1 38 | aniso: 1 39 | mipBias: 0 40 | wrapU: 1 41 | wrapV: 1 42 | wrapW: 1 43 | nPOTScale: 0 44 | lightmap: 0 45 | compressionQuality: 50 46 | spriteMode: 1 47 | spriteExtrude: 1 48 | spriteMeshType: 1 49 | alignment: 0 50 | spritePivot: {x: 0.5, y: 0.5} 51 | spritePixelsToUnits: 100 52 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 53 | spriteGenerateFallbackPhysicsShape: 1 54 | alphaUsage: 1 55 | alphaIsTransparency: 1 56 | spriteTessellationDetail: -1 57 | textureType: 8 58 | textureShape: 1 59 | singleChannelComponent: 0 60 | flipbookRows: 1 61 | flipbookColumns: 1 62 | maxTextureSizeSet: 0 63 | compressionQualitySet: 0 64 | textureFormatSet: 0 65 | ignorePngGamma: 0 66 | applyGammaDecoding: 0 67 | swizzle: 50462976 68 | cookieLightType: 0 69 | platformSettings: 70 | - serializedVersion: 3 71 | buildTarget: DefaultTexturePlatform 72 | maxTextureSize: 2048 73 | resizeAlgorithm: 0 74 | textureFormat: -1 75 | textureCompression: 1 76 | compressionQuality: 50 77 | crunchedCompression: 0 78 | allowsAlphaSplitting: 0 79 | overridden: 0 80 | androidETC2FallbackOverride: 0 81 | forceMaximumCompressionQuality_BC6H_BC7: 0 82 | - serializedVersion: 3 83 | buildTarget: Standalone 84 | maxTextureSize: 2048 85 | resizeAlgorithm: 0 86 | textureFormat: -1 87 | textureCompression: 1 88 | compressionQuality: 50 89 | crunchedCompression: 0 90 | allowsAlphaSplitting: 0 91 | overridden: 0 92 | androidETC2FallbackOverride: 0 93 | forceMaximumCompressionQuality_BC6H_BC7: 0 94 | - serializedVersion: 3 95 | buildTarget: Server 96 | maxTextureSize: 2048 97 | resizeAlgorithm: 0 98 | textureFormat: -1 99 | textureCompression: 1 100 | compressionQuality: 50 101 | crunchedCompression: 0 102 | allowsAlphaSplitting: 0 103 | overridden: 0 104 | androidETC2FallbackOverride: 0 105 | forceMaximumCompressionQuality_BC6H_BC7: 0 106 | - serializedVersion: 3 107 | buildTarget: Android 108 | maxTextureSize: 2048 109 | resizeAlgorithm: 0 110 | textureFormat: -1 111 | textureCompression: 1 112 | compressionQuality: 50 113 | crunchedCompression: 0 114 | allowsAlphaSplitting: 0 115 | overridden: 0 116 | androidETC2FallbackOverride: 0 117 | forceMaximumCompressionQuality_BC6H_BC7: 0 118 | spriteSheet: 119 | serializedVersion: 2 120 | sprites: [] 121 | outline: [] 122 | physicsShape: [] 123 | bones: [] 124 | spriteID: 5e97eb03825dee720800000000000000 125 | internalID: 0 126 | vertices: [] 127 | indices: 128 | edges: [] 129 | weights: [] 130 | secondaryTextures: [] 131 | nameFileIdTable: {} 132 | spritePackingTag: 133 | pSDRemoveMatte: 0 134 | userData: 135 | assetBundleName: 136 | assetBundleVariant: 137 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Sample.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7be5ae3ddc9eab54fad939b3e7d0febd 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Sample/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 665645f8cbc7be044a40f04091430b0b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Sample/Scenes/Start.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | OcclusionCullingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_OcclusionBakeSettings: 8 | smallestOccluder: 5 9 | smallestHole: 0.25 10 | backfaceThreshold: 100 11 | m_SceneGUID: 00000000000000000000000000000000 12 | m_OcclusionCullingData: {fileID: 0} 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 9 17 | m_Fog: 0 18 | m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: 0.01 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} 24 | m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} 25 | m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 3 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 0} 30 | m_HaloStrength: 0.5 31 | m_FlareStrength: 1 32 | m_FlareFadeSpeed: 3 33 | m_HaloTexture: {fileID: 0} 34 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 35 | m_DefaultReflectionMode: 0 36 | m_DefaultReflectionResolution: 128 37 | m_ReflectionBounces: 1 38 | m_ReflectionIntensity: 1 39 | m_CustomReflection: {fileID: 0} 40 | m_Sun: {fileID: 0} 41 | m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &3 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 12 47 | m_GIWorkflowMode: 1 48 | m_GISettings: 49 | serializedVersion: 2 50 | m_BounceScale: 1 51 | m_IndirectOutputScale: 1 52 | m_AlbedoBoost: 1 53 | m_EnvironmentLightingMode: 0 54 | m_EnableBakedLightmaps: 0 55 | m_EnableRealtimeLightmaps: 0 56 | m_LightmapEditorSettings: 57 | serializedVersion: 12 58 | m_Resolution: 2 59 | m_BakeResolution: 40 60 | m_AtlasSize: 1024 61 | m_AO: 0 62 | m_AOMaxDistance: 1 63 | m_CompAOExponent: 1 64 | m_CompAOExponentDirect: 0 65 | m_ExtractAmbientOcclusion: 0 66 | m_Padding: 2 67 | m_LightmapParameters: {fileID: 0} 68 | m_LightmapsBakeMode: 1 69 | m_TextureCompression: 1 70 | m_FinalGather: 0 71 | m_FinalGatherFiltering: 1 72 | m_FinalGatherRayCount: 256 73 | m_ReflectionCompression: 2 74 | m_MixedBakeMode: 2 75 | m_BakeBackend: 1 76 | m_PVRSampling: 1 77 | m_PVRDirectSampleCount: 32 78 | m_PVRSampleCount: 512 79 | m_PVRBounces: 2 80 | m_PVREnvironmentSampleCount: 256 81 | m_PVREnvironmentReferencePointCount: 2048 82 | m_PVRFilteringMode: 1 83 | m_PVRDenoiserTypeDirect: 1 84 | m_PVRDenoiserTypeIndirect: 1 85 | m_PVRDenoiserTypeAO: 1 86 | m_PVRFilterTypeDirect: 0 87 | m_PVRFilterTypeIndirect: 0 88 | m_PVRFilterTypeAO: 0 89 | m_PVREnvironmentMIS: 1 90 | m_PVRCulling: 1 91 | m_PVRFilteringGaussRadiusDirect: 1 92 | m_PVRFilteringGaussRadiusIndirect: 5 93 | m_PVRFilteringGaussRadiusAO: 2 94 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 95 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 96 | m_PVRFilteringAtrousPositionSigmaAO: 1 97 | m_ExportTrainingData: 0 98 | m_TrainingDataDestination: TrainingData 99 | m_LightProbeSampleCountMultiplier: 4 100 | m_LightingDataAsset: {fileID: 0} 101 | m_LightingSettings: {fileID: 4890085278179872738, guid: ac09aa68d62cbf34c82425922b3aec9e, 102 | type: 2} 103 | --- !u!196 &4 104 | NavMeshSettings: 105 | serializedVersion: 2 106 | m_ObjectHideFlags: 0 107 | m_BuildSettings: 108 | serializedVersion: 2 109 | agentTypeID: 0 110 | agentRadius: 0.5 111 | agentHeight: 2 112 | agentSlope: 45 113 | agentClimb: 0.4 114 | ledgeDropHeight: 0 115 | maxJumpAcrossDistance: 0 116 | minRegionArea: 2 117 | manualCellSize: 0 118 | cellSize: 0.16666667 119 | manualTileSize: 0 120 | tileSize: 256 121 | accuratePlacement: 0 122 | maxJobWorkers: 0 123 | preserveTilesOutsideBounds: 0 124 | debug: 125 | m_Flags: 0 126 | m_NavMeshData: {fileID: 0} 127 | --- !u!1 &4839812 128 | GameObject: 129 | m_ObjectHideFlags: 0 130 | m_CorrespondingSourceObject: {fileID: 0} 131 | m_PrefabInstance: {fileID: 0} 132 | m_PrefabAsset: {fileID: 0} 133 | serializedVersion: 6 134 | m_Component: 135 | - component: {fileID: 4839813} 136 | - component: {fileID: 4839814} 137 | m_Layer: 0 138 | m_Name: StartDemo 139 | m_TagString: Untagged 140 | m_Icon: {fileID: 0} 141 | m_NavMeshLayer: 0 142 | m_StaticEditorFlags: 0 143 | m_IsActive: 1 144 | --- !u!4 &4839813 145 | Transform: 146 | m_ObjectHideFlags: 0 147 | m_CorrespondingSourceObject: {fileID: 0} 148 | m_PrefabInstance: {fileID: 0} 149 | m_PrefabAsset: {fileID: 0} 150 | m_GameObject: {fileID: 4839812} 151 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 152 | m_LocalPosition: {x: -7.8553452, y: 4.635517, z: -0.08519437} 153 | m_LocalScale: {x: 1, y: 1, z: 1} 154 | m_ConstrainProportionsScale: 0 155 | m_Children: [] 156 | m_Father: {fileID: 0} 157 | m_RootOrder: 1 158 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 159 | --- !u!114 &4839814 160 | MonoBehaviour: 161 | m_ObjectHideFlags: 0 162 | m_CorrespondingSourceObject: {fileID: 0} 163 | m_PrefabInstance: {fileID: 0} 164 | m_PrefabAsset: {fileID: 0} 165 | m_GameObject: {fileID: 4839812} 166 | m_Enabled: 1 167 | m_EditorHideFlags: 0 168 | m_Script: {fileID: 11500000, guid: abe278e53a135c84a9d6d997716ec8a7, type: 3} 169 | m_Name: 170 | m_EditorClassIdentifier: 171 | --- !u!1001 &1602697757 172 | PrefabInstance: 173 | m_ObjectHideFlags: 0 174 | serializedVersion: 2 175 | m_Modification: 176 | serializedVersion: 2 177 | m_TransformParent: {fileID: 0} 178 | m_Modifications: 179 | - target: {fileID: 8054616790964022089, guid: 2751ab0c1cbbfd04eb98761fc2cca023, 180 | type: 3} 181 | propertyPath: m_RootOrder 182 | value: 0 183 | objectReference: {fileID: 0} 184 | - target: {fileID: 8054616790964022089, guid: 2751ab0c1cbbfd04eb98761fc2cca023, 185 | type: 3} 186 | propertyPath: m_LocalPosition.x 187 | value: 0 188 | objectReference: {fileID: 0} 189 | - target: {fileID: 8054616790964022089, guid: 2751ab0c1cbbfd04eb98761fc2cca023, 190 | type: 3} 191 | propertyPath: m_LocalPosition.y 192 | value: 0 193 | objectReference: {fileID: 0} 194 | - target: {fileID: 8054616790964022089, guid: 2751ab0c1cbbfd04eb98761fc2cca023, 195 | type: 3} 196 | propertyPath: m_LocalPosition.z 197 | value: 0 198 | objectReference: {fileID: 0} 199 | - target: {fileID: 8054616790964022089, guid: 2751ab0c1cbbfd04eb98761fc2cca023, 200 | type: 3} 201 | propertyPath: m_LocalRotation.w 202 | value: 1 203 | objectReference: {fileID: 0} 204 | - target: {fileID: 8054616790964022089, guid: 2751ab0c1cbbfd04eb98761fc2cca023, 205 | type: 3} 206 | propertyPath: m_LocalRotation.x 207 | value: 0 208 | objectReference: {fileID: 0} 209 | - target: {fileID: 8054616790964022089, guid: 2751ab0c1cbbfd04eb98761fc2cca023, 210 | type: 3} 211 | propertyPath: m_LocalRotation.y 212 | value: 0 213 | objectReference: {fileID: 0} 214 | - target: {fileID: 8054616790964022089, guid: 2751ab0c1cbbfd04eb98761fc2cca023, 215 | type: 3} 216 | propertyPath: m_LocalRotation.z 217 | value: 0 218 | objectReference: {fileID: 0} 219 | - target: {fileID: 8054616790964022089, guid: 2751ab0c1cbbfd04eb98761fc2cca023, 220 | type: 3} 221 | propertyPath: m_LocalEulerAnglesHint.x 222 | value: 0 223 | objectReference: {fileID: 0} 224 | - target: {fileID: 8054616790964022089, guid: 2751ab0c1cbbfd04eb98761fc2cca023, 225 | type: 3} 226 | propertyPath: m_LocalEulerAnglesHint.y 227 | value: 0 228 | objectReference: {fileID: 0} 229 | - target: {fileID: 8054616790964022089, guid: 2751ab0c1cbbfd04eb98761fc2cca023, 230 | type: 3} 231 | propertyPath: m_LocalEulerAnglesHint.z 232 | value: 0 233 | objectReference: {fileID: 0} 234 | - target: {fileID: 8054616790964022090, guid: 2751ab0c1cbbfd04eb98761fc2cca023, 235 | type: 3} 236 | propertyPath: m_Name 237 | value: UIContent 238 | objectReference: {fileID: 0} 239 | - target: {fileID: 8054616791385950693, guid: 2751ab0c1cbbfd04eb98761fc2cca023, 240 | type: 3} 241 | propertyPath: m_MatchWidthOrHeight 242 | value: 0 243 | objectReference: {fileID: 0} 244 | - target: {fileID: 8054616791385950693, guid: 2751ab0c1cbbfd04eb98761fc2cca023, 245 | type: 3} 246 | propertyPath: m_ReferenceResolution.x 247 | value: 640 248 | objectReference: {fileID: 0} 249 | - target: {fileID: 8054616791385950693, guid: 2751ab0c1cbbfd04eb98761fc2cca023, 250 | type: 3} 251 | propertyPath: m_ReferenceResolution.y 252 | value: 1380 253 | objectReference: {fileID: 0} 254 | m_RemovedComponents: 255 | - {fileID: 1730306859, guid: 2751ab0c1cbbfd04eb98761fc2cca023, type: 3} 256 | m_AddedGameObjects: [] 257 | m_SourcePrefab: {fileID: 100100000, guid: 2751ab0c1cbbfd04eb98761fc2cca023, type: 3} 258 | --- !u!1 &1602697758 stripped 259 | GameObject: 260 | m_CorrespondingSourceObject: {fileID: 8054616790964022090, guid: 2751ab0c1cbbfd04eb98761fc2cca023, 261 | type: 3} 262 | m_PrefabInstance: {fileID: 1602697757} 263 | m_PrefabAsset: {fileID: 0} 264 | --- !u!224 &1602697759 stripped 265 | RectTransform: 266 | m_CorrespondingSourceObject: {fileID: 1402368711, guid: 2751ab0c1cbbfd04eb98761fc2cca023, 267 | type: 3} 268 | m_PrefabInstance: {fileID: 1602697757} 269 | m_PrefabAsset: {fileID: 0} 270 | --- !u!224 &1602697760 stripped 271 | RectTransform: 272 | m_CorrespondingSourceObject: {fileID: 1423875299, guid: 2751ab0c1cbbfd04eb98761fc2cca023, 273 | type: 3} 274 | m_PrefabInstance: {fileID: 1602697757} 275 | m_PrefabAsset: {fileID: 0} 276 | --- !u!114 &1602697761 277 | MonoBehaviour: 278 | m_ObjectHideFlags: 0 279 | m_CorrespondingSourceObject: {fileID: 0} 280 | m_PrefabInstance: {fileID: 0} 281 | m_PrefabAsset: {fileID: 0} 282 | m_GameObject: {fileID: 1602697758} 283 | m_Enabled: 1 284 | m_EditorHideFlags: 0 285 | m_Script: {fileID: 11500000, guid: 229a2f74bb47302438ae35e66889832e, type: 3} 286 | m_Name: 287 | m_EditorClassIdentifier: 288 | viewContainer: {fileID: 1602697760} 289 | tipContainer: {fileID: 1602697759} 290 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Sample/Scenes/Start.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6983326067f62dc42bd4a1f353ad68f2 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Sample/Script.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b611bd362b466ba4484e92cf4a362df3 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Sample/Script/CertainView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine.UI; 3 | 4 | namespace MVI4Unity.Sample 5 | { 6 | /* 7 | * 这里我把AWindow类,State类,以及Reducer类都写进一个类里是为了方便。实际项目里如果功能比较复杂,建议把这些类分开写,方便管理。 8 | * 比如AWindow类,State类,Reducer类,可以分别写在不同的文件里。 9 | */ 10 | 11 | public class CertainView : AWindow 12 | { 13 | [AWindowCom ("btnOK")] 14 | public Button btnOk; 15 | 16 | [AWindowCom ("btnCancel")] 17 | public Button btnCancel; 18 | 19 | [AWindowCom ("textTitle")] 20 | public Text textTitle; 21 | 22 | [AWindowCom ("textContent")] 23 | public Text textContent; 24 | } 25 | 26 | public class CertainViewState : AStateBase 27 | { 28 | public Action certain; 29 | public string content; 30 | public string title; 31 | } 32 | 33 | public enum CertainReducerFunType 34 | { 35 | ShowCertainView, 36 | InvokeCertainFun 37 | } 38 | 39 | public class CertainReducer : Reducer 40 | { 41 | [ReducerMethod (( int ) CertainReducerFunType.ShowCertainView)] 42 | CertainViewState ShowCertainView (CertainViewState oldState , object @param) 43 | { 44 | CertainViewState state = @param as CertainViewState; 45 | oldState.certain = state.certain; 46 | oldState.content = state.content; 47 | oldState.title = state.title; 48 | return oldState; 49 | } 50 | 51 | [ReducerMethod (( int ) CertainReducerFunType.InvokeCertainFun)] 52 | CertainViewState InvokeCertainFun (CertainViewState oldState , object @param) 53 | { 54 | if ( oldState != null ) 55 | { 56 | oldState?.certain?.Invoke (); 57 | } 58 | return oldState; 59 | } 60 | } 61 | 62 | public class CertainViewStatic 63 | { 64 | /// 65 | /// 确认界面组件 66 | /// 67 | public static WindowNodeType certainCom = new WindowNodeType ("CertainView" , 68 | fillProps: (state , window , store , prop) => 69 | { 70 | window.btnCancel.onClick.AddListener (() => 71 | { 72 | store.DisPatch (ReducerCommonFunType.Close); 73 | }); 74 | 75 | window.btnOk.onClick.AddListener (() => 76 | { 77 | store.DisPatch (CertainReducerFunType.InvokeCertainFun); 78 | store.DisPatch (ReducerCommonFunType.Close); 79 | }); 80 | 81 | window.textContent.text = state.content; 82 | window.textTitle.text = state.title; 83 | }); 84 | } 85 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Sample/Script/CertainView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0fec99be2f3148d44b445e19f6d885e2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Sample/Script/OpenViewMgr.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MVI4Unity.Sample 4 | { 5 | public class OpenViewMgr : SafeSingleton 6 | { 7 | /// 8 | /// 显示提示 9 | /// 10 | /// 11 | public void ShowTip (string content) 12 | { 13 | RootNodeContainer rootView = UIWinMgr.Ins.Open (UIContent.Ins.tipContainer , TipViewStatic.tipCom); 14 | rootView.DisPatch (TipViewReducerFunType.ShowTip , new TipViewState () { content = content }); 15 | } 16 | 17 | /// 18 | /// 显示确认框 19 | /// 20 | /// 21 | /// 22 | /// 23 | public void ShowCertainView (string title , string content , Action certain) 24 | { 25 | RootNodeContainer rootView = UIWinMgr.Ins.Open (UIContent.Ins.tipContainer , CertainViewStatic.certainCom); 26 | rootView.DisPatch (CertainReducerFunType.ShowCertainView , new CertainViewState () 27 | { 28 | content = content , 29 | title = title , 30 | certain = certain 31 | }); 32 | } 33 | 34 | /// 35 | /// 打开窗口01 36 | /// 37 | public void OpenWindow01 () 38 | { 39 | UIWinMgr.Ins.Open (UIContent.Ins.tipContainer , Window01Static.root); 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Sample/Script/OpenViewMgr.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bcd739e84d4fd184394fbdcc68dc7ff1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Sample/Script/StartDemo.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace MVI4Unity.Sample 4 | { 5 | public class StartDemo : MonoBehaviour 6 | { 7 | private void Awake () 8 | { 9 | OpenViewMgr.Ins.ShowTip ("欢迎进入演示场景"); 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Sample/Script/StartDemo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: abe278e53a135c84a9d6d997716ec8a7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Sample/Script/TipView.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using UnityEngine.UI; 3 | 4 | namespace MVI4Unity.Sample 5 | { 6 | /* 7 | * 这里我把AWindow类,State类,以及Reducer类都写进一个类里是为了方便。实际项目里如果功能比较复杂,建议把这些类分开写,方便管理。 8 | * 比如AWindow类,State类,Reducer类,可以分别写在不同的文件里。 9 | */ 10 | 11 | public enum TipViewReducerFunType 12 | { 13 | ShowTip, 14 | AutoDestroy 15 | } 16 | 17 | public class TipView : AWindow 18 | { 19 | [AWindowCom ("text")] 20 | public Text text; 21 | 22 | } 23 | 24 | public class TipViewState : AStateBase 25 | { 26 | public string content; 27 | } 28 | 29 | public class TipViewReducer : Reducer 30 | { 31 | [ReducerMethod (( int ) TipViewReducerFunType.ShowTip)] 32 | TipViewState ShowTip (TipViewState oldState , object @param) 33 | { 34 | return @param as TipViewState; 35 | } 36 | 37 | [ReducerMethod (( int ) TipViewReducerFunType.AutoDestroy , true)] 38 | async Task AutoDestroy (TipViewState oldState , object @param) 39 | { 40 | await Task.Delay (1500); 41 | TipViewState state = new TipViewState (); 42 | state.shouldDestroy = true; 43 | OpenViewMgr.Ins.OpenWindow01(); 44 | return state; 45 | } 46 | } 47 | 48 | public class TipViewStatic 49 | { 50 | /// 51 | /// 提示组件 52 | /// 53 | public static WindowNodeType tipCom = new WindowNodeType ("TipView" , 54 | fillProps: (state , window , store , prop) => 55 | { 56 | window.text.text = state.content; 57 | }); 58 | } 59 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Sample/Script/TipView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: afdfdc87fccac3d4b94407ec391f09b6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Sample/Script/UIContent.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using Zero; 3 | 4 | namespace MVI4Unity.Sample 5 | { 6 | public class UIContent : SingletonMonoBehaviour 7 | { 8 | public Transform viewContainer; 9 | public Transform tipContainer; 10 | } 11 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Sample/Script/UIContent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 229a2f74bb47302438ae35e66889832e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/Assets/Sample/Script/Window01.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | 6 | namespace MVI4Unity.Sample 7 | { 8 | /* 9 | * 这里我把AWindow类,State类,以及Reducer类都写进一个类里是为了方便。实际项目里如果功能比较复杂,建议把这些类分开写,方便管理。 10 | * 比如AWindow类,State类,Reducer类,可以分别写在不同的文件里。 11 | */ 12 | 13 | /// 14 | /// 这是一个主界面Window01,绑定了一些组件 15 | /// 通过预制体的ObjectBindingData组件信息来赋值组件 16 | /// 17 | public class Window01 : AWindow 18 | { 19 | [AWindowCom ("container1")] 20 | public Transform container1; 21 | 22 | [AWindowCom ("container2")] 23 | public Transform container2; 24 | 25 | [AWindowCom ("btn")] 26 | public Button btn; 27 | 28 | [AWindowCom ("btn2")] 29 | public Button btn2; 30 | 31 | [AWindowCom ("btnClose")] 32 | public Button btnClose; 33 | } 34 | 35 | /// 36 | /// 这是一个主界面Window01的子节点元素 37 | /// 38 | public class WindowItem : AWindow 39 | { 40 | 41 | } 42 | 43 | /// 44 | /// 这是Window01界面需要用到的数据 45 | /// 46 | public class State01 : AStateBase 47 | { 48 | public int count; 49 | } 50 | 51 | /// 52 | /// 这是刷新State01的函数集合 53 | /// 54 | public class Reducer01 : Reducer 55 | { 56 | public enum Reducer01MethodType 57 | { 58 | Init, 59 | Func01, 60 | Func02, 61 | Func03, 62 | } 63 | 64 | /// 65 | /// ReducerMethod特性包含2个参数,第一个对应的是函数枚举,第二个是可选参数,是否在初始化时自动调用1次,默认为false 66 | /// 67 | /// 68 | /// 69 | /// 70 | [ReducerMethod (( int ) Reducer01MethodType.Init , true)] 71 | State01 InitState (State01 oldState , object @param) 72 | { 73 | State01 state01 = new State01 (); 74 | state01.count = 10; 75 | return state01; 76 | } 77 | 78 | [ReducerMethod (( int ) Reducer01MethodType.Func01)] 79 | State01 Func01 (State01 oldState , object @param) 80 | { 81 | State01 state01 = new State01 (); 82 | state01.count = oldState.count - 1; 83 | return state01; 84 | } 85 | 86 | [ReducerMethod (( int ) Reducer01MethodType.Func02)] 87 | State01 Func02 (State01 oldState , object @param) 88 | { 89 | State01 state01 = new State01 (); 90 | state01.count = oldState.count + 1; 91 | return state01; 92 | } 93 | 94 | [ReducerMethod (( int ) Reducer01MethodType.Func03)] 95 | void Func03 (State01 oldState , object @param , Action setNewState) 96 | { 97 | setNewState.Invoke (new State01 ()); 98 | } 99 | } 100 | 101 | /// 102 | /// WindowNodeType的参数解释: 103 | /// fillProps:每次State更新时,会调用这个函数,用来刷新界面 104 | /// containerCreator:创建容器,这个容器指的是Unity的Transform,从对应的界面类型获取到,用来存放子节点 105 | /// childNodeCreator:创建子节点 106 | /// 107 | public class Window01Static 108 | { 109 | /// 110 | /// 这是WindowItem的节点 111 | /// 112 | public static WindowNodeType item = new WindowNodeType ("WindownItem" , 113 | fillProps: (state , window , store , prop) => 114 | { 115 | Debug.LogWarning ($"{state} = {window} = {store}"); 116 | }); 117 | 118 | /// 119 | /// 这是Windown01的界面,同时也是根节点 120 | /// 121 | public static WindowNodeType root = new WindowNodeType ("Windown01" , 122 | containerCreator: (window) => 123 | { 124 | //添加2个Window01里的容器container1,container2 125 | List containerList = PoolMgr.Ins.GetList ().Pop (); 126 | containerList.Add (window.container1); 127 | containerList.Add (window.container2); 128 | return containerList; 129 | } , 130 | childNodeCreator: (state) => 131 | { 132 | List> childNodeGroup = PoolMgr.Ins.GetList> ().Pop (); 133 | List childNodeList1 = PoolMgr.Ins.GetList ().Pop (); 134 | List childNodeList2 = PoolMgr.Ins.GetList ().Pop (); 135 | 136 | //给这2个容器添加子节点 137 | for ( int i = 0 ; i < state.count ; i++ ) 138 | { 139 | childNodeList1.Add (item.CreateWindowNode (state)); 140 | childNodeList2.Add (item.CreateWindowNode (state)); 141 | } 142 | 143 | childNodeGroup.Add (childNodeList1); 144 | childNodeGroup.Add (childNodeList2); 145 | 146 | return childNodeGroup; 147 | } , 148 | fillProps: (state , window , store , prop) => 149 | { 150 | if ( state.currentFunTag == ( int ) Reducer01.Reducer01MethodType.Func01 ) 151 | { 152 | //由Func01引起的变化 153 | } 154 | window.btn.onClick.AddListener (() => { store.DisPatch (Reducer01.Reducer01MethodType.Func01 , default); }); 155 | window.btn2.onClick.AddListener (() => { store.DisPatch (Reducer01.Reducer01MethodType.Func02 , default); }); 156 | window.btnClose.onClick.AddListener (() => { store.DisPatch (ReducerCommonFunType.Close , default); }); 157 | }); 158 | } 159 | } -------------------------------------------------------------------------------- /MVI4Unity/Assets/Sample/Script/Window01.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e2bcf91b167a3a4469bee17eb9b84827 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MVI4Unity/GlobalSuppressions.cs: -------------------------------------------------------------------------------- 1 | // This file is used by Code Analysis to maintain SuppressMessage 2 | // attributes that are applied to this project. 3 | // Project-level suppressions either have no target or are given 4 | // a specific target and scoped to a namespace, type, member, etc. 5 | 6 | using System.Diagnostics.CodeAnalysis; 7 | 8 | -------------------------------------------------------------------------------- /MVI4Unity/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_SpatializerPlugin: 16 | m_AmbisonicDecoderPlugin: 17 | m_DisableAudio: 0 18 | m_VirtualizeEffects: 1 19 | m_RequestedDSPBufferSize: 1024 20 | -------------------------------------------------------------------------------- /MVI4Unity/ProjectSettings/AutoStreamingSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1200 &1 4 | AutoStreamingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | mSearchMode: 15 8 | mCustomSearchFile: 9 | mTextureSearchString: 10 | mMeshSearchString: 11 | mTextures: [] 12 | mAudios: [] 13 | mMeshes: [] 14 | mScenes: [] 15 | mConfigCCD: 16 | useCCD: 0 17 | cosKey: 18 | projectGuid: 19 | bucketUuid: 20 | bucketName: 21 | badgeName: 22 | -------------------------------------------------------------------------------- /MVI4Unity/ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /MVI4Unity/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 11 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 0 23 | m_ReuseCollisionCallbacks: 1 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ContactPairsMode: 0 26 | m_BroadphaseType: 0 27 | m_WorldBounds: 28 | m_Center: {x: 0, y: 0, z: 0} 29 | m_Extent: {x: 250, y: 250, z: 250} 30 | m_WorldSubdivisions: 8 31 | m_FrictionType: 0 32 | m_EnableEnhancedDeterminism: 0 33 | m_EnableUnifiedHeightmaps: 1 34 | m_DefaultMaxAngluarSpeed: 7 35 | -------------------------------------------------------------------------------- /MVI4Unity/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: [] 8 | m_configObjects: {} 9 | -------------------------------------------------------------------------------- /MVI4Unity/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 9 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 0 10 | m_DefaultBehaviorMode: 1 11 | m_PrefabRegularEnvironment: {fileID: 0} 12 | m_PrefabUIEnvironment: {fileID: 0} 13 | m_SpritePackerMode: 4 14 | m_SpritePackerPaddingPower: 1 15 | m_EtcTextureCompressorBehavior: 1 16 | m_EtcTextureFastCompressor: 1 17 | m_EtcTextureNormalCompressor: 2 18 | m_EtcTextureBestCompressor: 4 19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref 20 | m_ProjectGenerationRootNamespace: 21 | m_CollabEditorSettings: 22 | inProgressEnabled: 1 23 | m_EnableTextureStreamingInEditMode: 1 24 | m_EnableTextureStreamingInPlayMode: 1 25 | m_AsyncShaderCompilation: 1 26 | m_EnterPlayModeOptionsEnabled: 0 27 | m_EnterPlayModeOptions: 3 28 | m_ShowLightmapResolutionOverlay: 1 29 | m_UseLegacyProbeSampleCount: 1 30 | m_AssetPipelineMode: 1 31 | m_CacheServerMode: 0 32 | m_CacheServerEndpoint: 33 | m_CacheServerNamespacePrefix: default 34 | m_CacheServerEnableDownload: 1 35 | m_CacheServerEnableUpload: 1 36 | -------------------------------------------------------------------------------- /MVI4Unity/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 12 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 34 | m_PreloadedShaders: [] 35 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 36 | type: 0} 37 | m_CustomRenderPipeline: {fileID: 0} 38 | m_TransparencySortMode: 0 39 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 40 | m_DefaultRenderingPath: 1 41 | m_DefaultMobileRenderingPath: 1 42 | m_TierSettings: [] 43 | m_LightmapStripping: 0 44 | m_FogStripping: 0 45 | m_InstancingStripping: 0 46 | m_LightmapKeepPlain: 1 47 | m_LightmapKeepDirCombined: 1 48 | m_LightmapKeepDynamicPlain: 1 49 | m_LightmapKeepDynamicDirCombined: 1 50 | m_LightmapKeepShadowMask: 1 51 | m_LightmapKeepSubtractive: 1 52 | m_FogKeepLinear: 1 53 | m_FogKeepExp: 1 54 | m_FogKeepExp2: 1 55 | m_AlbedoSwatchInfos: [] 56 | m_LightsUseLinearIntensity: 0 57 | m_LightsUseColorTemperature: 0 58 | -------------------------------------------------------------------------------- /MVI4Unity/ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!13 &1 4 | InputManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Axes: 8 | - serializedVersion: 3 9 | m_Name: Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: 0.001 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: 0.001 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: 0.001 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: 0.001 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left shift 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: 0.001 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: 0.1 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: 0.1 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: 0.1 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: 0.19 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: 0.19 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: 0.001 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: 0.001 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: 0.001 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: 0.001 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: 0.001 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: 0.001 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | -------------------------------------------------------------------------------- /MVI4Unity/ProjectSettings/MemorySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!387306366 &1 4 | MemorySettings: 5 | m_ObjectHideFlags: 0 6 | m_EditorMemorySettings: 7 | m_MainAllocatorBlockSize: -1 8 | m_ThreadAllocatorBlockSize: -1 9 | m_MainGfxBlockSize: -1 10 | m_ThreadGfxBlockSize: -1 11 | m_CacheBlockSize: -1 12 | m_TypetreeBlockSize: -1 13 | m_ProfilerBlockSize: -1 14 | m_ProfilerEditorBlockSize: -1 15 | m_BucketAllocatorGranularity: -1 16 | m_BucketAllocatorBucketsCount: -1 17 | m_BucketAllocatorBlockSize: -1 18 | m_BucketAllocatorBlockCount: -1 19 | m_ProfilerBucketAllocatorGranularity: -1 20 | m_ProfilerBucketAllocatorBucketsCount: -1 21 | m_ProfilerBucketAllocatorBlockSize: -1 22 | m_ProfilerBucketAllocatorBlockCount: -1 23 | m_TempAllocatorSizeMain: -1 24 | m_JobTempAllocatorBlockSize: -1 25 | m_BackgroundJobTempAllocatorBlockSize: -1 26 | m_JobTempAllocatorReducedBlockSize: -1 27 | m_TempAllocatorSizeGIBakingWorker: -1 28 | m_TempAllocatorSizeNavMeshWorker: -1 29 | m_TempAllocatorSizeAudioWorker: -1 30 | m_TempAllocatorSizeCloudWorker: -1 31 | m_TempAllocatorSizeGfx: -1 32 | m_TempAllocatorSizeJobWorker: -1 33 | m_TempAllocatorSizeBackgroundWorker: -1 34 | m_TempAllocatorSizePreloadManager: -1 35 | m_PlatformMemorySettings: {} 36 | -------------------------------------------------------------------------------- /MVI4Unity/ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /MVI4Unity/ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!149 &1 4 | NetworkManager: 5 | m_ObjectHideFlags: 0 6 | m_DebugLevel: 0 7 | m_Sendrate: 15 8 | m_AssetToPrefab: {} 9 | -------------------------------------------------------------------------------- /MVI4Unity/ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_ScopedRegistriesSettingsExpanded: 1 16 | oneTimeWarningShown: 0 17 | m_Registries: 18 | - m_Id: main 19 | m_Name: 20 | m_Url: https://packages.unity.cn 21 | m_Scopes: [] 22 | m_IsDefault: 1 23 | m_UserSelectedRegistryName: 24 | m_UserAddingNewScopedRegistry: 0 25 | m_RegistryInfoDraft: 26 | m_ErrorMessage: 27 | m_Original: 28 | m_Id: 29 | m_Name: 30 | m_Url: 31 | m_Scopes: [] 32 | m_IsDefault: 0 33 | m_Modified: 0 34 | m_Name: 35 | m_Url: 36 | m_Scopes: 37 | - 38 | m_SelectedScopeIndex: 0 39 | -------------------------------------------------------------------------------- /MVI4Unity/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_AutoSimulation: 1 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 1 46 | m_AutoSyncTransforms: 0 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /MVI4Unity/ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_DefaultPresets: {} 8 | -------------------------------------------------------------------------------- /MVI4Unity/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2022.1.21f1c1 2 | m_EditorVersionWithRevision: 2022.1.21f1c1 (62b3d36e659d) 3 | -------------------------------------------------------------------------------- /MVI4Unity/ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 3 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Very Low 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | shadowmaskMode: 0 21 | blendWeights: 1 22 | textureQuality: 1 23 | anisotropicTextures: 0 24 | antiAliasing: 0 25 | softParticles: 0 26 | softVegetation: 0 27 | realtimeReflectionProbes: 0 28 | billboardsFaceCameraPosition: 0 29 | vSyncCount: 0 30 | lodBias: 0.3 31 | maximumLODLevel: 0 32 | particleRaycastBudget: 4 33 | asyncUploadTimeSlice: 2 34 | asyncUploadBufferSize: 16 35 | resolutionScalingFixedDPIFactor: 1 36 | excludedTargetPlatforms: [] 37 | - serializedVersion: 2 38 | name: Low 39 | pixelLightCount: 0 40 | shadows: 0 41 | shadowResolution: 0 42 | shadowProjection: 1 43 | shadowCascades: 1 44 | shadowDistance: 20 45 | shadowNearPlaneOffset: 3 46 | shadowCascade2Split: 0.33333334 47 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 48 | shadowmaskMode: 0 49 | blendWeights: 2 50 | textureQuality: 0 51 | anisotropicTextures: 0 52 | antiAliasing: 0 53 | softParticles: 0 54 | softVegetation: 0 55 | realtimeReflectionProbes: 0 56 | billboardsFaceCameraPosition: 0 57 | vSyncCount: 0 58 | lodBias: 0.4 59 | maximumLODLevel: 0 60 | particleRaycastBudget: 16 61 | asyncUploadTimeSlice: 2 62 | asyncUploadBufferSize: 16 63 | resolutionScalingFixedDPIFactor: 1 64 | excludedTargetPlatforms: [] 65 | - serializedVersion: 2 66 | name: Medium 67 | pixelLightCount: 1 68 | shadows: 0 69 | shadowResolution: 0 70 | shadowProjection: 1 71 | shadowCascades: 1 72 | shadowDistance: 20 73 | shadowNearPlaneOffset: 3 74 | shadowCascade2Split: 0.33333334 75 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 76 | shadowmaskMode: 0 77 | blendWeights: 2 78 | textureQuality: 0 79 | anisotropicTextures: 0 80 | antiAliasing: 0 81 | softParticles: 0 82 | softVegetation: 0 83 | realtimeReflectionProbes: 0 84 | billboardsFaceCameraPosition: 0 85 | vSyncCount: 1 86 | lodBias: 0.7 87 | maximumLODLevel: 0 88 | particleRaycastBudget: 64 89 | asyncUploadTimeSlice: 2 90 | asyncUploadBufferSize: 16 91 | resolutionScalingFixedDPIFactor: 1 92 | excludedTargetPlatforms: [] 93 | - serializedVersion: 2 94 | name: High 95 | pixelLightCount: 2 96 | shadows: 0 97 | shadowResolution: 1 98 | shadowProjection: 1 99 | shadowCascades: 2 100 | shadowDistance: 40 101 | shadowNearPlaneOffset: 3 102 | shadowCascade2Split: 0.33333334 103 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 104 | shadowmaskMode: 1 105 | blendWeights: 2 106 | textureQuality: 0 107 | anisotropicTextures: 0 108 | antiAliasing: 0 109 | softParticles: 0 110 | softVegetation: 1 111 | realtimeReflectionProbes: 0 112 | billboardsFaceCameraPosition: 0 113 | vSyncCount: 1 114 | lodBias: 1 115 | maximumLODLevel: 0 116 | particleRaycastBudget: 256 117 | asyncUploadTimeSlice: 2 118 | asyncUploadBufferSize: 16 119 | resolutionScalingFixedDPIFactor: 1 120 | excludedTargetPlatforms: [] 121 | - serializedVersion: 2 122 | name: Very High 123 | pixelLightCount: 3 124 | shadows: 0 125 | shadowResolution: 2 126 | shadowProjection: 1 127 | shadowCascades: 2 128 | shadowDistance: 70 129 | shadowNearPlaneOffset: 3 130 | shadowCascade2Split: 0.33333334 131 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 132 | shadowmaskMode: 1 133 | blendWeights: 4 134 | textureQuality: 0 135 | anisotropicTextures: 0 136 | antiAliasing: 0 137 | softParticles: 0 138 | softVegetation: 1 139 | realtimeReflectionProbes: 0 140 | billboardsFaceCameraPosition: 0 141 | vSyncCount: 1 142 | lodBias: 1.5 143 | maximumLODLevel: 0 144 | particleRaycastBudget: 1024 145 | asyncUploadTimeSlice: 2 146 | asyncUploadBufferSize: 16 147 | resolutionScalingFixedDPIFactor: 1 148 | excludedTargetPlatforms: [] 149 | - serializedVersion: 2 150 | name: Ultra 151 | pixelLightCount: 4 152 | shadows: 0 153 | shadowResolution: 0 154 | shadowProjection: 1 155 | shadowCascades: 4 156 | shadowDistance: 150 157 | shadowNearPlaneOffset: 3 158 | shadowCascade2Split: 0.33333334 159 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 160 | shadowmaskMode: 1 161 | blendWeights: 4 162 | textureQuality: 0 163 | anisotropicTextures: 0 164 | antiAliasing: 0 165 | softParticles: 0 166 | softVegetation: 1 167 | realtimeReflectionProbes: 0 168 | billboardsFaceCameraPosition: 0 169 | vSyncCount: 1 170 | lodBias: 2 171 | maximumLODLevel: 0 172 | particleRaycastBudget: 4096 173 | asyncUploadTimeSlice: 2 174 | asyncUploadBufferSize: 16 175 | resolutionScalingFixedDPIFactor: 1 176 | excludedTargetPlatforms: [] 177 | m_PerPlatformDefaultQuality: 178 | Android: 2 179 | Nintendo 3DS: 5 180 | Nintendo Switch: 5 181 | PS4: 5 182 | PSM: 5 183 | PSP2: 2 184 | Stadia: 5 185 | Standalone: 5 186 | Tizen: 2 187 | WebGL: 3 188 | WiiU: 5 189 | Windows Store Apps: 5 190 | XboxOne: 5 191 | iPhone: 2 192 | tvOS: 2 193 | -------------------------------------------------------------------------------- /MVI4Unity/ProjectSettings/SceneTemplateSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "templatePinStates": [], 3 | "dependencyTypeInfos": [ 4 | { 5 | "userAdded": false, 6 | "type": "UnityEngine.AnimationClip", 7 | "ignore": false, 8 | "defaultInstantiationMode": 0, 9 | "supportsModification": true 10 | }, 11 | { 12 | "userAdded": false, 13 | "type": "UnityEditor.Animations.AnimatorController", 14 | "ignore": false, 15 | "defaultInstantiationMode": 0, 16 | "supportsModification": true 17 | }, 18 | { 19 | "userAdded": false, 20 | "type": "UnityEngine.AnimatorOverrideController", 21 | "ignore": false, 22 | "defaultInstantiationMode": 0, 23 | "supportsModification": true 24 | }, 25 | { 26 | "userAdded": false, 27 | "type": "UnityEditor.Audio.AudioMixerController", 28 | "ignore": false, 29 | "defaultInstantiationMode": 0, 30 | "supportsModification": true 31 | }, 32 | { 33 | "userAdded": false, 34 | "type": "UnityEngine.ComputeShader", 35 | "ignore": true, 36 | "defaultInstantiationMode": 1, 37 | "supportsModification": true 38 | }, 39 | { 40 | "userAdded": false, 41 | "type": "UnityEngine.Cubemap", 42 | "ignore": false, 43 | "defaultInstantiationMode": 0, 44 | "supportsModification": true 45 | }, 46 | { 47 | "userAdded": false, 48 | "type": "UnityEngine.GameObject", 49 | "ignore": false, 50 | "defaultInstantiationMode": 0, 51 | "supportsModification": true 52 | }, 53 | { 54 | "userAdded": false, 55 | "type": "UnityEditor.LightingDataAsset", 56 | "ignore": false, 57 | "defaultInstantiationMode": 0, 58 | "supportsModification": false 59 | }, 60 | { 61 | "userAdded": false, 62 | "type": "UnityEngine.LightingSettings", 63 | "ignore": false, 64 | "defaultInstantiationMode": 0, 65 | "supportsModification": true 66 | }, 67 | { 68 | "userAdded": false, 69 | "type": "UnityEngine.Material", 70 | "ignore": false, 71 | "defaultInstantiationMode": 0, 72 | "supportsModification": true 73 | }, 74 | { 75 | "userAdded": false, 76 | "type": "UnityEditor.MonoScript", 77 | "ignore": true, 78 | "defaultInstantiationMode": 1, 79 | "supportsModification": true 80 | }, 81 | { 82 | "userAdded": false, 83 | "type": "UnityEngine.PhysicMaterial", 84 | "ignore": false, 85 | "defaultInstantiationMode": 0, 86 | "supportsModification": true 87 | }, 88 | { 89 | "userAdded": false, 90 | "type": "UnityEngine.PhysicsMaterial2D", 91 | "ignore": false, 92 | "defaultInstantiationMode": 0, 93 | "supportsModification": true 94 | }, 95 | { 96 | "userAdded": false, 97 | "type": "UnityEngine.Rendering.PostProcessing.PostProcessProfile", 98 | "ignore": false, 99 | "defaultInstantiationMode": 0, 100 | "supportsModification": true 101 | }, 102 | { 103 | "userAdded": false, 104 | "type": "UnityEngine.Rendering.PostProcessing.PostProcessResources", 105 | "ignore": false, 106 | "defaultInstantiationMode": 0, 107 | "supportsModification": true 108 | }, 109 | { 110 | "userAdded": false, 111 | "type": "UnityEngine.Rendering.VolumeProfile", 112 | "ignore": false, 113 | "defaultInstantiationMode": 0, 114 | "supportsModification": true 115 | }, 116 | { 117 | "userAdded": false, 118 | "type": "UnityEditor.SceneAsset", 119 | "ignore": false, 120 | "defaultInstantiationMode": 0, 121 | "supportsModification": false 122 | }, 123 | { 124 | "userAdded": false, 125 | "type": "UnityEngine.Shader", 126 | "ignore": true, 127 | "defaultInstantiationMode": 1, 128 | "supportsModification": true 129 | }, 130 | { 131 | "userAdded": false, 132 | "type": "UnityEngine.ShaderVariantCollection", 133 | "ignore": true, 134 | "defaultInstantiationMode": 1, 135 | "supportsModification": true 136 | }, 137 | { 138 | "userAdded": false, 139 | "type": "UnityEngine.Texture", 140 | "ignore": false, 141 | "defaultInstantiationMode": 0, 142 | "supportsModification": true 143 | }, 144 | { 145 | "userAdded": false, 146 | "type": "UnityEngine.Texture2D", 147 | "ignore": false, 148 | "defaultInstantiationMode": 0, 149 | "supportsModification": true 150 | }, 151 | { 152 | "userAdded": false, 153 | "type": "UnityEngine.Timeline.TimelineAsset", 154 | "ignore": false, 155 | "defaultInstantiationMode": 0, 156 | "supportsModification": true 157 | } 158 | ], 159 | "defaultDependencyTypeInfo": { 160 | "userAdded": false, 161 | "type": "", 162 | "ignore": false, 163 | "defaultInstantiationMode": 1, 164 | "supportsModification": true 165 | }, 166 | "newSceneOverride": 0 167 | } -------------------------------------------------------------------------------- /MVI4Unity/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /MVI4Unity/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.1 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /MVI4Unity/ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_CNEventUrl: https://cdp.cloud.unity.cn/v1/events 13 | m_CNConfigUrl: https://cdp.cloud.unity.cn/config 14 | m_TestInitMode: 0 15 | CrashReportingSettings: 16 | m_EventUrl: https://perf-events.cloud.unity.cn 17 | m_Enabled: 0 18 | m_LogBufferSize: 10 19 | m_CaptureEditorExceptions: 1 20 | UnityPurchasingSettings: 21 | m_Enabled: 0 22 | m_TestMode: 0 23 | UnityAnalyticsSettings: 24 | m_Enabled: 1 25 | m_TestMode: 0 26 | m_InitializeOnStartup: 1 27 | UnityAdsSettings: 28 | m_Enabled: 0 29 | m_InitializeOnStartup: 1 30 | m_TestMode: 0 31 | m_IosGameId: 32 | m_AndroidGameId: 33 | m_GameIds: {} 34 | m_GameId: 35 | PerformanceReportingSettings: 36 | m_Enabled: 0 37 | -------------------------------------------------------------------------------- /MVI4Unity/ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_StripUpdateShader: {fileID: 0} 10 | m_RenderPipeSettingsPath: 11 | m_FixedTimeStep: 0.016666668 12 | m_MaxDeltaTime: 0.05 13 | -------------------------------------------------------------------------------- /MVI4Unity/ProjectSettings/VersionControlSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!890905787 &1 4 | VersionControlSettings: 5 | m_ObjectHideFlags: 0 6 | m_Mode: Visible Meta Files 7 | m_CollabEditorSettings: 8 | inProgressEnabled: 1 9 | -------------------------------------------------------------------------------- /MVI4Unity/ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } -------------------------------------------------------------------------------- /MVI4Unity/UserSettings/EditorUserSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!162 &1 4 | EditorUserSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_ConfigSettings: 8 | vcSharedLogLevel: 9 | value: 0d5e400f0650 10 | flags: 0 11 | m_VCAutomaticAdd: 1 12 | m_VCDebugCom: 0 13 | m_VCDebugCmd: 0 14 | m_VCDebugOut: 0 15 | m_SemanticMergeMode: 2 16 | m_DesiredImportWorkerCount: 2 17 | m_StandbyImportWorkerCount: 2 18 | m_IdleImportWorkerShutdownDelay: 60000 19 | m_VCShowFailedCheckout: 1 20 | m_VCOverwriteFailedCheckoutAssets: 1 21 | m_VCProjectOverlayIcons: 1 22 | m_VCHierarchyOverlayIcons: 1 23 | m_VCOtherOverlayIcons: 1 24 | m_VCAllowAsyncUpdate: 1 25 | m_ArtifactGarbageCollection: 1 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### 序言 2 | MVI是纯响应式、函数式编程的架构,更加强调数据的单向流动和唯一数据源。这种架构思想多用于传统Web前端领域,当然它同样可以用于Unity的UI设计,毕竟都是数据的同步以及表现层的刷新,该方案就是该思想的Unity实现版本。不管你是使用UGUI,NGUI或者其它,MVI4Unity都可以适用 3 | ![image](https://user-images.githubusercontent.com/38308449/228774903-6d283044-8e66-45ef-bd3d-e185dd0d8fae.png) 4 | 5 | --- 6 | 7 | ### 框架概述 8 | 9 | *框架大致可以划分为2部分,1是数据的同步管理,这部分就是MVI思想的体现。2是表现层的刷新,表现层是由一个个节点组成的UI树,每当数据更新,都会比较每一个节点来重组UI树以达到界面刷新的目的* 10 | 11 | --- 12 | 13 | ### 框架目录 14 | 15 | -- Core 框架核心逻辑 16 | * Pool : 框架使用的对象池工具,对于关闭的界面并不是直接销毁,而是回收待重新利用 17 | * StateManager : 状态管理,UI框架数据管理的部分 18 | * Windows : 表现层部分 19 | * Utils : 部分工具代码 20 | 21 | -- Sample 演示代码 22 | 23 | * StartDemo.cs : 演示代码入口 24 | * Window01.cs是一个基本界面的演示,注释比较全 25 | 26 | --- 27 | 28 | ### 如何管理数据 29 | 30 | ![image](https://user-images.githubusercontent.com/38308449/222396422-2055b233-e8a1-4e2a-8834-3e436f1ed7e7.png) 31 | * State: 业务逻辑的状态,表现层就是获取最新的State来刷新界面的 32 | * Reducer: 业务逻辑集合,就是一堆函数,采用函数式设计,不维护状态,只负责接收和返回新状态 33 | * Store: 相当于Reducer与表现层交互的中间件,存储维护Reducer派发下来的State并通知表现层 34 | 35 | --- 36 | 37 | ### 如何管理界面(表现层) 38 | 39 | ![image](https://user-images.githubusercontent.com/38308449/222775679-ec4bca4b-ab88-4b30-93fa-22e3df8d79f5.png) 40 | 这里使用节点树来维护UI结构,View就是界面,在这里它作为一个根节点,包含了其他的子元素。ViewNode是节点单元,任何UI元素都是有它构成的 41 | 使用这种层次分明的结构,能轻易地使用同样的方式来处理“整体/部分”的关系,提供代码复用率,同时也方便框架后续维护扩展 42 | 43 | --- 44 | 45 | ### 如何运行游戏演示 46 | 47 | * 游戏的演示场景是Start,双击运行游戏即可 48 | 49 | --- 50 | 51 | ### 如何使用该框架 52 | 53 | * 先从数据方面开始说起,UI需要数据来刷新样式,数据这块代码要如何写呢。以Window01.cs作为例子,需要一个Stata类作为状态数据,一个Reduce来更新数据。Reucer与View之间的交互由Store作为桥梁来完成,通过Store.Dispatch来通知状态更新从而刷新界面。 54 | 55 | ```c# 56 | //状态类 57 | public class State01 : AStateBase 58 | { 59 | public int count; 60 | } 61 | 62 | //用于刷新状态的函数集合 63 | public class Reducer01 : Reducer 64 | { 65 | 66 | } 67 | ``` 68 | 69 | 70 | 71 | * Reduce函数定义需要规范,必须符合如下委托签名的任意一种 72 | 73 | ```c# 74 | /// 75 | /// 同步委托 76 | /// 77 | /// 78 | /// 79 | /// 80 | public delegate S Reducer (S lastState , object @param); 81 | 82 | /// 83 | /// 异步委托 84 | /// 85 | /// 86 | /// 87 | /// 88 | public delegate Task AsyncReducer (S lastState , object @param); 89 | 90 | /// 91 | /// 回调委托 92 | /// 93 | /// 94 | /// 95 | /// 96 | public delegate void CallbackReducer (S lastState , object @param , Action setNewState); 97 | ``` 98 | 99 | 100 | 101 | * 接着来说表现层的代码组织,同样使用Window01.cs来作为例子。继承于Awindow的就是界面预制体组件管理类,提供按钮,文本之类的字段访问,以及一些基本的销毁,激活接口。***它的最大作用就是提供可访问的组件字段,其它的事情不用管,你可以这么理解*** 102 | 103 | ```c# 104 | public class Window01 : AWindow 105 | { 106 | [AWindowCom ("container1")] 107 | public Transform container1; 108 | 109 | [AWindowCom ("container2")] 110 | public Transform container2; 111 | 112 | [AWindowCom ("btn")] 113 | public Button btn; 114 | 115 | [AWindowCom ("btn2")] 116 | public Button btn2; 117 | 118 | [AWindowCom ("btnClose")] 119 | public Button btnClose; 120 | } 121 | ``` 122 | 123 | 124 | 125 | * 然后就是关键一步了,创建对应界面的WindowNodeType节点对象。主界面的就是根节点,主界面下的UI单元就是子节点。我们拿背包来举一个例子,背包主界面是一个根节点,背包里的物品是属于子节点,背包物品也可以有自己的子节点,可以这样套娃写下去。通过代码来构建这样的UI树,当状态刷新时,整棵树都会一起刷新,当然你也可以通过state.currentTag来获取引起刷新的事件来差异化处理刷新 126 | 127 | ```c# 128 | /// 129 | /// 这是Windown01的界面,同时也是根节点 130 | /// 131 | public static WindowNodeType root = new WindowNodeType ("Windown01" , 132 | containerCreator: (window) => 133 | { 134 | //添加2个Window01里的容器container1,container2 135 | List containerList = PoolMgr.Ins.GetList ().Pop (); 136 | containerList.Add (window.container1); 137 | containerList.Add (window.container2); 138 | return containerList; 139 | } , 140 | childNodeCreator: (state) => 141 | { 142 | List> childNodeGroup = PoolMgr.Ins.GetList> ().Pop (); 143 | List childNodeList1 = PoolMgr.Ins.GetList ().Pop (); 144 | List childNodeList2 = PoolMgr.Ins.GetList ().Pop (); 145 | 146 | //给这2个容器添加子节点 147 | for ( int i = 0 ; i < state.count ; i++ ) 148 | { 149 | childNodeList1.Add (item.CreateWindowNode (state)); 150 | childNodeList2.Add (item.CreateWindowNode (state)); 151 | } 152 | 153 | childNodeGroup.Add (childNodeList1); 154 | childNodeGroup.Add (childNodeList2); 155 | 156 | return childNodeGroup; 157 | } , 158 | //状态变更时执行 159 | fillProps: (state , window , store , prop) => 160 | { 161 | if ( state.currentFunTag == ( int ) Reducer01.Reducer01MethodType.Func01 ) 162 | { 163 | //由Func01引起的变化 164 | } 165 | }); 166 | 167 | /// 168 | /// 这是WindowItem的节点 169 | /// 170 | public static WindowNodeType item = new WindowNodeType ("WindownItem" , 171 | fillProps: (state , window , store , prop) => 172 | { 173 | 174 | }); 175 | ``` 176 | 177 | 178 | 179 | * 结合Sample案例,你会理解得更快 180 | 181 | --- 182 | 183 | ### 关于框架稳定性 184 | 185 | * 为了简化框架,除了核心逻辑部分其他功能都从简了,比如加载资源,框架是直接使用Resource加载的,如果正式使用可以替换接口 186 | * 会**长期维护**,发现问题可以提Issues,第一时间解决 187 | * 所在公司的卡牌养成游戏使用了该方案,**已上线测试** 188 | 189 | --- 190 | 191 | ### 未来更新计划 192 | * 加入滚动列表优化 193 | * 优化组件绑定 194 | 195 | --- 196 | 197 | ### 推荐项目 198 | - [JEngine](https://github.com/JasonXuDeveloper/JEngine) - The solution that allows unity games update in runtime. 使Unity开发的游戏支持热更新的解决方案。 199 | - [BDFramework](https://github.com/yimengfan/BDFramework.Core) - Simple and powerful Unity3d game workflow! 简单、高效、高度工业化的商业级unity3d 工作流。本项目借鉴了其状态管理部分 200 | - [Html2UnityRich](https://github.com/Wilson403/Html2UnityRich) - 能够将Html标签转化为Unity支持的富文本标签的库(UGUI or TextPro) 201 | --------------------------------------------------------------------------------