├── .gitattributes ├── .gitignore ├── .vsconfig ├── Assets ├── AutoBuilder.meta ├── AutoBuilder │ ├── AutoBuildConfiguration.asset │ ├── AutoBuildConfiguration.asset.meta │ ├── FuncTask-Post.asset │ ├── FuncTask-Post.asset.meta │ ├── FuncTask-Pre.asset │ ├── FuncTask-Pre.asset.meta │ ├── Nsis Installer Making Task.asset │ ├── Nsis Installer Making Task.asset.meta │ ├── PlayerSettings.preset │ ├── PlayerSettings.preset.meta │ ├── Presets.meta │ ├── Presets │ │ ├── AppAutoBuilderSettings.preset │ │ └── AppAutoBuilderSettings.preset.meta │ ├── ProcessTask.asset │ ├── ProcessTask.asset.meta │ ├── Virbox Encrypt Task.asset │ └── Virbox Encrypt Task.asset.meta ├── Resources.meta ├── Resources │ ├── BillingMode.json │ └── BillingMode.json.meta ├── Scenes.meta ├── Scenes │ ├── SampleScene 1.unity │ ├── SampleScene 1.unity.meta │ ├── SampleScene 2.unity │ ├── SampleScene 2.unity.meta │ ├── SampleScene.unity │ ├── SampleScene.unity.meta │ ├── SampleSceneSettings.lighting │ └── SampleSceneSettings.lighting.meta ├── Scripts.meta └── Scripts │ ├── Editor.meta │ ├── Editor │ ├── ScriptEncodingConverter.cs │ └── ScriptEncodingConverter.cs.meta │ ├── GameManager.cs │ ├── GameManager.cs.meta │ ├── ShowSceneName.cs │ └── ShowSceneName.cs.meta ├── LICENSE ├── Packages ├── App Auto Builder │ ├── .gitignore │ ├── CHANGELOG.md │ ├── CHANGELOG.md.meta │ ├── Editor.meta │ ├── Editor │ │ ├── AutoBuilder.cs │ │ ├── AutoBuilder.cs.meta │ │ ├── Data.meta │ │ ├── Data │ │ │ ├── AutoBuildConfiguration.cs │ │ │ ├── AutoBuildConfiguration.cs.meta │ │ │ ├── BuildOptionsLit.cs │ │ │ ├── BuildOptionsLit.cs.meta │ │ │ ├── BuildProfiles.cs │ │ │ ├── BuildProfiles.cs.meta │ │ │ ├── NsiResolver.cs │ │ │ ├── NsiResolver.cs.meta │ │ │ ├── Platform.cs │ │ │ ├── Platform.cs.meta │ │ │ ├── SceneInfo.cs │ │ │ ├── SceneInfo.cs.meta │ │ │ ├── TaskInfo.cs │ │ │ ├── TaskInfo.cs.meta │ │ │ ├── TaskType.cs │ │ │ └── TaskType.cs.meta │ │ ├── GUI.meta │ │ ├── GUI │ │ │ ├── BaseTaskEditor.cs │ │ │ ├── BaseTaskEditor.cs.meta │ │ │ ├── BuildProfilesDrawer.cs │ │ │ ├── BuildProfilesDrawer.cs.meta │ │ │ ├── EnumFlagsAttribute.cs │ │ │ ├── EnumFlagsAttribute.cs.meta │ │ │ ├── OpenFolderAttribute.cs │ │ │ ├── OpenFolderAttribute.cs.meta │ │ │ ├── SceneInfoDrawer.cs │ │ │ ├── SceneInfoDrawer.cs.meta │ │ │ ├── ShowInExplorerAttribute.cs │ │ │ ├── ShowInExplorerAttribute.cs.meta │ │ │ ├── TaskInfoDrawer.cs │ │ │ └── TaskInfoDrawer.cs.meta │ │ ├── Settings.meta │ │ ├── Settings │ │ │ ├── AppAutoBuilderSettingProvider.cs │ │ │ ├── AppAutoBuilderSettingProvider.cs.meta │ │ │ ├── AppAutoBuilderSettings.cs │ │ │ ├── AppAutoBuilderSettings.cs.meta │ │ │ ├── PresetReceiver.cs │ │ │ └── PresetReceiver.cs.meta │ │ ├── Task.meta │ │ ├── Task │ │ │ ├── BaseTask.cs │ │ │ ├── BaseTask.cs.meta │ │ │ ├── FileOperationTask.cs │ │ │ ├── FileOperationTask.cs.meta │ │ │ ├── FunctionExecuteTask.cs │ │ │ ├── FunctionExecuteTask.cs.meta │ │ │ ├── NsisInstallerMakingTask.cs │ │ │ ├── NsisInstallerMakingTask.cs.meta │ │ │ ├── RunProcessTask.cs │ │ │ ├── RunProcessTask.cs.meta │ │ │ ├── VirboxEncryptTask.cs │ │ │ └── VirboxEncryptTask.cs.meta │ │ ├── Utils.meta │ │ ├── Utils │ │ │ ├── AsyncStreamReader.cs │ │ │ ├── AsyncStreamReader.cs.meta │ │ │ ├── Program.cs │ │ │ ├── Program.cs.meta │ │ │ ├── ProgressBarWindow.cs │ │ │ └── ProgressBarWindow.cs.meta │ │ ├── com.bshsf.appautobuilder.asmdef │ │ └── com.bshsf.appautobuilder.asmdef.meta │ ├── package.json │ └── package.json.meta ├── manifest.json └── packages-lock.json ├── Readme.md ├── UserSettings ├── EditorUserSettings.asset ├── Layouts │ └── default-2021.dwlt └── Search.settings └── doc ├── FuncExecuteTask.png ├── NsisTask.png ├── RunProcessTask.png ├── VirboxTask.bmp ├── VirboxTask.png ├── autobuilder.gif ├── install.png └── interface.png /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /[Ll]ibrary/ 2 | /[Tt]emp/ 3 | /[Oo]bj/ 4 | /[Bb]uild/ 5 | /[Bb]uilds/ 6 | /[Ll]ogs/ 7 | /[Pp]rojectSettings/ 8 | /Assets/AssetStoreTools* 9 | /.vs/ 10 | 11 | # Autogenerated VS/MD solution and project files 12 | ExportedObj/ 13 | *.csproj 14 | *.unityproj 15 | *.sln 16 | *.suo 17 | *.tmp 18 | *.user 19 | *.userprefs 20 | *.pidb 21 | *.booproj 22 | *.svd 23 | 24 | 25 | # Unity3D generated meta files 26 | *.pidb.meta 27 | 28 | # Unity3D Generated File On Crash Reports 29 | sysinfo.txt 30 | 31 | # Builds 32 | *.apk 33 | *.unitypackage 34 | *.unitypackage.meta 35 | -------------------------------------------------------------------------------- /.vsconfig: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0", 3 | "components": [ 4 | "Microsoft.VisualStudio.Workload.ManagedGame" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /Assets/AutoBuilder.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f5a5b33141fd32a4eb6c31ef3468fa76 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AutoBuilder/AutoBuildConfiguration.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 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: 11500000, guid: a60e37a9482c0b94e80647dc2c0222c7, type: 3} 13 | m_Name: AutoBuildConfiguration 14 | m_EditorClassIdentifier: 15 | appLocationPath: E:/Unity/Temp/AppLocation 16 | profiles: 17 | - productName: AppTheSameNameIsOk 18 | isBuild: 0 19 | platform: 13 20 | saveLocation: AppOne 21 | productVersion: 1.0.0 22 | buildOptions: 1 23 | scenes: 24 | - scene: {fileID: 102900000, guid: b3bb2599e998b664c973acd74cf1ae3b, type: 3} 25 | enabled: 1 26 | - scene: {fileID: 102900000, guid: 2d11479ebd414b046b565beea84aaaa8, type: 3} 27 | enabled: 1 28 | customTask: 29 | - enabled: 0 30 | task: {fileID: 11400000, guid: 34f373d074091ea41ae45b3844a0df13, type: 2} 31 | - enabled: 0 32 | task: {fileID: 11400000, guid: 7194155011d21f44ebc236f361060d64, type: 2} 33 | - enabled: 0 34 | task: {fileID: 11400000, guid: eff9ce6e9d09eff45a184e59c5fdc2b2, type: 2} 35 | - productName: AppTheSameNameIsOk 36 | isBuild: 1 37 | platform: 19 38 | saveLocation: AppTwo 39 | productVersion: 1.0.0 40 | buildOptions: 1 41 | scenes: 42 | - scene: {fileID: 102900000, guid: b3bb2599e998b664c973acd74cf1ae3b, type: 3} 43 | enabled: 1 44 | - scene: {fileID: 102900000, guid: 2d11479ebd414b046b565beea84aaaa8, type: 3} 45 | enabled: 1 46 | customTask: 47 | - enabled: 1 48 | task: {fileID: 11400000, guid: 34f373d074091ea41ae45b3844a0df13, type: 2} 49 | - enabled: 0 50 | task: {fileID: 11400000, guid: eff9ce6e9d09eff45a184e59c5fdc2b2, type: 2} 51 | - enabled: 1 52 | task: {fileID: 11400000, guid: e5eae1986018db445a3c2b5cc19a3755, type: 2} 53 | - enabled: 1 54 | task: {fileID: 11400000, guid: 4271ba57f5c38f344a6c51aeeed12e96, type: 2} 55 | - productName: AppTheSameNameIsOk 56 | isBuild: 0 57 | platform: 13 58 | saveLocation: AppThree 59 | productVersion: 1.0.0 60 | buildOptions: 4 61 | scenes: 62 | - scene: {fileID: 102900000, guid: b3bb2599e998b664c973acd74cf1ae3b, type: 3} 63 | enabled: 1 64 | - scene: {fileID: 102900000, guid: 2d11479ebd414b046b565beea84aaaa8, type: 3} 65 | enabled: 1 66 | customTask: 67 | - enabled: 0 68 | task: {fileID: 11400000, guid: 34f373d074091ea41ae45b3844a0df13, type: 2} 69 | - enabled: 0 70 | task: {fileID: 11400000, guid: 7194155011d21f44ebc236f361060d64, type: 2} 71 | - enabled: 0 72 | task: {fileID: 11400000, guid: eff9ce6e9d09eff45a184e59c5fdc2b2, type: 2} 73 | -------------------------------------------------------------------------------- /Assets/AutoBuilder/AutoBuildConfiguration.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4db8f7b0909b9ab449dd0b64a2a86eee 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AutoBuilder/FuncTask-Post.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 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: 11500000, guid: 52e9e45d9227c494c932e29b162b0a3b, type: 3} 13 | m_Name: FuncTask-Post 14 | m_EditorClassIdentifier: 15 | taskType: 1 16 | priority: 0 17 | isEnable: 1 18 | scene: {fileID: 102900000, guid: b3bb2599e998b664c973acd74cf1ae3b, type: 3} 19 | script: {fileID: 11500000, guid: 740810d97dcafcb40af5e2b91bf8be5b, type: 3} 20 | function: SomeFunction 21 | args: FromCustomTask-Post 22 | -------------------------------------------------------------------------------- /Assets/AutoBuilder/FuncTask-Post.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7194155011d21f44ebc236f361060d64 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AutoBuilder/FuncTask-Pre.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 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: 11500000, guid: 52e9e45d9227c494c932e29b162b0a3b, type: 3} 13 | m_Name: FuncTask-Pre 14 | m_EditorClassIdentifier: 15 | taskType: 0 16 | priority: 0 17 | scene: {fileID: 102900000, guid: b3bb2599e998b664c973acd74cf1ae3b, type: 3} 18 | script: {fileID: 11500000, guid: 740810d97dcafcb40af5e2b91bf8be5b, type: 3} 19 | function: SomeFunction 20 | args: FromCustomTask 21 | -------------------------------------------------------------------------------- /Assets/AutoBuilder/FuncTask-Pre.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 34f373d074091ea41ae45b3844a0df13 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AutoBuilder/Nsis Installer Making Task.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 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: 11500000, guid: d682e8d91224630418184f5426f4b730, type: 3} 13 | m_Name: Nsis Installer Making Task 14 | m_EditorClassIdentifier: 15 | taskType: 1 16 | priority: 1 17 | exePath: C:\Program Files (x86)\NSIS\makensis.exe 18 | nsiResolvers: 19 | - enable: 1 20 | appName: "Auto Builder NSIS \u793A\u4F8B\u5E94\u7528" 21 | appVersion: 1.1.0 22 | startMenuFolder: Auto Builder Example 23 | appInstallDir: For Auto Builder\v${PRODUCT_VERSION}\NSIS Example 24 | outputFileName: autobulder-nsistaskdemo-v${PRODUCT_VERSION}-setup.exe 25 | publisher: Bian Shanghai 26 | website: https://www.jianshu.com/u/275cca6e5f17 27 | brandingText: Bian Shanghai 28 | components: 29 | - enable: 0 30 | sectionName: encrypt 31 | filePath: "D:\\\u8FC5\u96F7\u4E0B\u8F7D\\sense_shield_installer_pub_lcc_2.7.0.66418.exe" 32 | args: /S /not_create_desktop_shortcuts 33 | languages: 34 | - SimpChinese 35 | shotcuts: 36 | - name: "Auto Builder NSIS \u793A\u4F8B\u5E94\u7528" 37 | args: 38 | - name: "Auto Builder NSIS \u793A\u4F8B\u5E94\u7528(\u5E26\u81EA\u5B9A\u4E49\u53C2\u6570)" 39 | args: --Port=8888 40 | keepNsiFile: 0 41 | compileNsiFile: 1 42 | nsiOutputPath: E:\Unity\Temp\AppLocation 43 | installerOutputPath: E:\Unity\Temp\AppLocation 44 | - enable: 1 45 | appName: "Auto Builder NSIS \u793A\u4F8B\u5E94\u75282" 46 | appVersion: 1.1.2 47 | startMenuFolder: Auto Builder Example2 48 | appInstallDir: For Auto Builder\v${PRODUCT_VERSION}\NSIS Example 49 | outputFileName: autobulder-nsistaskdemo2-v${PRODUCT_VERSION}-setup.exe 50 | publisher: Bian Shanghai 51 | website: https://www.jianshu.com/u/275cca6e5f17 52 | brandingText: Bian Shanghai 53 | components: 54 | - enable: 0 55 | sectionName: encrypt 56 | filePath: "D:\\\u8FC5\u96F7\u4E0B\u8F7D\\sense_shield_installer_pub_lcc_2.7.0.66418.exe" 57 | args: /S /not_create_desktop_shortcuts 58 | languages: 59 | - SimpChinese 60 | shotcuts: 61 | - name: "Auto Builder NSIS \u793A\u4F8B\u5E94\u75282" 62 | args: 63 | - name: "Auto Builder NSIS \u793A\u4F8B\u5E94\u75282(\u5E26\u81EA\u5B9A\u4E49\u53C2\u6570)" 64 | args: --Port=8888 65 | keepNsiFile: 0 66 | compileNsiFile: 1 67 | nsiOutputPath: E:\Unity\Temp\AppLocation 68 | installerOutputPath: E:\Unity\Temp\AppLocation 69 | -------------------------------------------------------------------------------- /Assets/AutoBuilder/Nsis Installer Making Task.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4271ba57f5c38f344a6c51aeeed12e96 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AutoBuilder/PlayerSettings.preset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8bb82538569abbb429180e346abdaae6 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2655988077585873504 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AutoBuilder/Presets.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2b73337b1ad78174c880ae9ac7f0a3b1 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AutoBuilder/Presets/AppAutoBuilderSettings.preset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!181963792 &2655988077585873504 4 | Preset: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_Name: AppAutoBuilderSettings 10 | m_TargetType: 11 | m_NativeTypeID: 114 12 | m_ManagedTypePPtr: {fileID: 11500000, guid: 34d20e123549b834386c15d8baefa566, type: 3} 13 | m_ManagedTypeFallback: 14 | m_Properties: 15 | - target: {fileID: 0} 16 | propertyPath: m_Enabled 17 | value: 1 18 | objectReference: {fileID: 0} 19 | - target: {fileID: 0} 20 | propertyPath: m_EditorHideFlags 21 | value: 0 22 | objectReference: {fileID: 0} 23 | - target: {fileID: 0} 24 | propertyPath: m_EditorClassIdentifier 25 | value: 26 | objectReference: {fileID: 0} 27 | - target: {fileID: 0} 28 | propertyPath: virboxExePath 29 | value: C:/Program Files/senseshield/Virbox Protector 3 Trial/bin/virboxprotector_con.exe 30 | objectReference: {fileID: 0} 31 | - target: {fileID: 0} 32 | propertyPath: nsisExePath 33 | value: C:/Program Files (x86)/NSIS/makensis.exe 34 | objectReference: {fileID: 0} 35 | - target: {fileID: 0} 36 | propertyPath: shouldKeepNsisFile 37 | value: 0 38 | objectReference: {fileID: 0} 39 | m_ExcludedProperties: [] 40 | -------------------------------------------------------------------------------- /Assets/AutoBuilder/Presets/AppAutoBuilderSettings.preset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7e3b4d1e6b065144fbc0f5540cfe98e8 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2655988077585873504 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AutoBuilder/ProcessTask.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 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: 11500000, guid: d0ec0664d7c21aa4a93c627af6f4e3f0, type: 3} 13 | m_Name: ProcessTask 14 | m_EditorClassIdentifier: 15 | taskType: 0 16 | priority: 0 17 | exePath: cmd 18 | args: 19 | waitForExit: 1 20 | -------------------------------------------------------------------------------- /Assets/AutoBuilder/ProcessTask.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eff9ce6e9d09eff45a184e59c5fdc2b2 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AutoBuilder/Virbox Encrypt Task.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 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: 11500000, guid: 826558bef7b4070439af85fa338fcebf, type: 3} 13 | m_Name: Virbox Encrypt Task 14 | m_EditorClassIdentifier: 15 | taskType: 1 16 | priority: 0 17 | exePath: C:\Program Files\senseshield\Virbox Protector 3 Trial\bin\virboxprotector_con.exe 18 | dlls: 19 | - Assembly-CSharp.dll 20 | - Unity.TextMeshPro.dll 21 | -------------------------------------------------------------------------------- /Assets/AutoBuilder/Virbox Encrypt Task.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e5eae1986018db445a3c2b5cc19a3755 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 33ba492c3039b4c4cb3d097bcf394068 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Resources/BillingMode.json: -------------------------------------------------------------------------------- 1 | {"androidStore":"GooglePlay"} -------------------------------------------------------------------------------- /Assets/Resources/BillingMode.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b3a5270b6412a314fb4ea4250db193a9 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b986f77bfe971fa488c20452760d3a92 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scenes/SampleScene 1.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: 0 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 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: 170076734} 41 | m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &3 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 11 47 | m_GIWorkflowMode: 0 48 | m_GISettings: 49 | serializedVersion: 2 50 | m_BounceScale: 1 51 | m_IndirectOutputScale: 1 52 | m_AlbedoBoost: 1 53 | m_TemporalCoherenceThreshold: 1 54 | m_EnvironmentLightingMode: 0 55 | m_EnableBakedLightmaps: 1 56 | m_EnableRealtimeLightmaps: 0 57 | m_LightmapEditorSettings: 58 | serializedVersion: 10 59 | m_Resolution: 2 60 | m_BakeResolution: 10 61 | m_AtlasSize: 512 62 | m_AO: 0 63 | m_AOMaxDistance: 1 64 | m_CompAOExponent: 1 65 | m_CompAOExponentDirect: 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: 256 79 | m_PVRBounces: 2 80 | m_PVRFilterTypeDirect: 0 81 | m_PVRFilterTypeIndirect: 0 82 | m_PVRFilterTypeAO: 0 83 | m_PVRFilteringMode: 1 84 | m_PVRCulling: 1 85 | m_PVRFilteringGaussRadiusDirect: 1 86 | m_PVRFilteringGaussRadiusIndirect: 5 87 | m_PVRFilteringGaussRadiusAO: 2 88 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 89 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 90 | m_PVRFilteringAtrousPositionSigmaAO: 1 91 | m_ShowResolutionOverlay: 1 92 | m_LightingDataAsset: {fileID: 0} 93 | m_UseShadowmask: 1 94 | --- !u!196 &4 95 | NavMeshSettings: 96 | serializedVersion: 2 97 | m_ObjectHideFlags: 0 98 | m_BuildSettings: 99 | serializedVersion: 2 100 | agentTypeID: 0 101 | agentRadius: 0.5 102 | agentHeight: 2 103 | agentSlope: 45 104 | agentClimb: 0.4 105 | ledgeDropHeight: 0 106 | maxJumpAcrossDistance: 0 107 | minRegionArea: 2 108 | manualCellSize: 0 109 | cellSize: 0.16666667 110 | manualTileSize: 0 111 | tileSize: 256 112 | accuratePlacement: 0 113 | debug: 114 | m_Flags: 0 115 | m_NavMeshData: {fileID: 0} 116 | --- !u!1 &170076733 117 | GameObject: 118 | m_ObjectHideFlags: 0 119 | m_CorrespondingSourceObject: {fileID: 0} 120 | m_PrefabInternal: {fileID: 0} 121 | serializedVersion: 6 122 | m_Component: 123 | - component: {fileID: 170076735} 124 | - component: {fileID: 170076734} 125 | m_Layer: 0 126 | m_Name: Directional Light 127 | m_TagString: Untagged 128 | m_Icon: {fileID: 0} 129 | m_NavMeshLayer: 0 130 | m_StaticEditorFlags: 0 131 | m_IsActive: 1 132 | --- !u!108 &170076734 133 | Light: 134 | m_ObjectHideFlags: 0 135 | m_CorrespondingSourceObject: {fileID: 0} 136 | m_PrefabInternal: {fileID: 0} 137 | m_GameObject: {fileID: 170076733} 138 | m_Enabled: 1 139 | serializedVersion: 8 140 | m_Type: 1 141 | m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} 142 | m_Intensity: 1 143 | m_Range: 10 144 | m_SpotAngle: 30 145 | m_CookieSize: 10 146 | m_Shadows: 147 | m_Type: 2 148 | m_Resolution: -1 149 | m_CustomResolution: -1 150 | m_Strength: 1 151 | m_Bias: 0.05 152 | m_NormalBias: 0.4 153 | m_NearPlane: 0.2 154 | m_Cookie: {fileID: 0} 155 | m_DrawHalo: 0 156 | m_Flare: {fileID: 0} 157 | m_RenderMode: 0 158 | m_CullingMask: 159 | serializedVersion: 2 160 | m_Bits: 4294967295 161 | m_Lightmapping: 1 162 | m_LightShadowCasterMode: 0 163 | m_AreaSize: {x: 1, y: 1} 164 | m_BounceIntensity: 1 165 | m_ColorTemperature: 6570 166 | m_UseColorTemperature: 0 167 | m_ShadowRadius: 0 168 | m_ShadowAngle: 0 169 | --- !u!4 &170076735 170 | Transform: 171 | m_ObjectHideFlags: 0 172 | m_CorrespondingSourceObject: {fileID: 0} 173 | m_PrefabInternal: {fileID: 0} 174 | m_GameObject: {fileID: 170076733} 175 | m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} 176 | m_LocalPosition: {x: 0, y: 3, z: 0} 177 | m_LocalScale: {x: 1, y: 1, z: 1} 178 | m_Children: [] 179 | m_Father: {fileID: 0} 180 | m_RootOrder: 1 181 | m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} 182 | --- !u!1 &534669902 183 | GameObject: 184 | m_ObjectHideFlags: 0 185 | m_CorrespondingSourceObject: {fileID: 0} 186 | m_PrefabInternal: {fileID: 0} 187 | serializedVersion: 6 188 | m_Component: 189 | - component: {fileID: 534669905} 190 | - component: {fileID: 534669904} 191 | - component: {fileID: 534669903} 192 | m_Layer: 0 193 | m_Name: Main Camera 194 | m_TagString: MainCamera 195 | m_Icon: {fileID: 0} 196 | m_NavMeshLayer: 0 197 | m_StaticEditorFlags: 0 198 | m_IsActive: 1 199 | --- !u!81 &534669903 200 | AudioListener: 201 | m_ObjectHideFlags: 0 202 | m_CorrespondingSourceObject: {fileID: 0} 203 | m_PrefabInternal: {fileID: 0} 204 | m_GameObject: {fileID: 534669902} 205 | m_Enabled: 1 206 | --- !u!20 &534669904 207 | Camera: 208 | m_ObjectHideFlags: 0 209 | m_CorrespondingSourceObject: {fileID: 0} 210 | m_PrefabInternal: {fileID: 0} 211 | m_GameObject: {fileID: 534669902} 212 | m_Enabled: 1 213 | serializedVersion: 2 214 | m_ClearFlags: 1 215 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} 216 | m_projectionMatrixMode: 1 217 | m_SensorSize: {x: 36, y: 24} 218 | m_LensShift: {x: 0, y: 0} 219 | m_GateFitMode: 2 220 | m_FocalLength: 50 221 | m_NormalizedViewPortRect: 222 | serializedVersion: 2 223 | x: 0 224 | y: 0 225 | width: 1 226 | height: 1 227 | near clip plane: 0.3 228 | far clip plane: 1000 229 | field of view: 60 230 | orthographic: 0 231 | orthographic size: 5 232 | m_Depth: -1 233 | m_CullingMask: 234 | serializedVersion: 2 235 | m_Bits: 4294967295 236 | m_RenderingPath: -1 237 | m_TargetTexture: {fileID: 0} 238 | m_TargetDisplay: 0 239 | m_TargetEye: 3 240 | m_HDR: 1 241 | m_AllowMSAA: 1 242 | m_AllowDynamicResolution: 0 243 | m_ForceIntoRT: 0 244 | m_OcclusionCulling: 1 245 | m_StereoConvergence: 10 246 | m_StereoSeparation: 0.022 247 | --- !u!4 &534669905 248 | Transform: 249 | m_ObjectHideFlags: 0 250 | m_CorrespondingSourceObject: {fileID: 0} 251 | m_PrefabInternal: {fileID: 0} 252 | m_GameObject: {fileID: 534669902} 253 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 254 | m_LocalPosition: {x: 0, y: 1, z: -10} 255 | m_LocalScale: {x: 1, y: 1, z: 1} 256 | m_Children: [] 257 | m_Father: {fileID: 0} 258 | m_RootOrder: 0 259 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 260 | -------------------------------------------------------------------------------- /Assets/Scenes/SampleScene 1.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2d11479ebd414b046b565beea84aaaa8 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Scenes/SampleScene 2.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: 0 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 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: 170076734} 41 | m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &3 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 11 47 | m_GIWorkflowMode: 0 48 | m_GISettings: 49 | serializedVersion: 2 50 | m_BounceScale: 1 51 | m_IndirectOutputScale: 1 52 | m_AlbedoBoost: 1 53 | m_TemporalCoherenceThreshold: 1 54 | m_EnvironmentLightingMode: 0 55 | m_EnableBakedLightmaps: 1 56 | m_EnableRealtimeLightmaps: 0 57 | m_LightmapEditorSettings: 58 | serializedVersion: 10 59 | m_Resolution: 2 60 | m_BakeResolution: 10 61 | m_AtlasSize: 512 62 | m_AO: 0 63 | m_AOMaxDistance: 1 64 | m_CompAOExponent: 1 65 | m_CompAOExponentDirect: 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: 256 79 | m_PVRBounces: 2 80 | m_PVRFilterTypeDirect: 0 81 | m_PVRFilterTypeIndirect: 0 82 | m_PVRFilterTypeAO: 0 83 | m_PVRFilteringMode: 1 84 | m_PVRCulling: 1 85 | m_PVRFilteringGaussRadiusDirect: 1 86 | m_PVRFilteringGaussRadiusIndirect: 5 87 | m_PVRFilteringGaussRadiusAO: 2 88 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 89 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 90 | m_PVRFilteringAtrousPositionSigmaAO: 1 91 | m_ShowResolutionOverlay: 1 92 | m_LightingDataAsset: {fileID: 0} 93 | m_UseShadowmask: 1 94 | --- !u!196 &4 95 | NavMeshSettings: 96 | serializedVersion: 2 97 | m_ObjectHideFlags: 0 98 | m_BuildSettings: 99 | serializedVersion: 2 100 | agentTypeID: 0 101 | agentRadius: 0.5 102 | agentHeight: 2 103 | agentSlope: 45 104 | agentClimb: 0.4 105 | ledgeDropHeight: 0 106 | maxJumpAcrossDistance: 0 107 | minRegionArea: 2 108 | manualCellSize: 0 109 | cellSize: 0.16666667 110 | manualTileSize: 0 111 | tileSize: 256 112 | accuratePlacement: 0 113 | debug: 114 | m_Flags: 0 115 | m_NavMeshData: {fileID: 0} 116 | --- !u!1 &170076733 117 | GameObject: 118 | m_ObjectHideFlags: 0 119 | m_CorrespondingSourceObject: {fileID: 0} 120 | m_PrefabInternal: {fileID: 0} 121 | serializedVersion: 6 122 | m_Component: 123 | - component: {fileID: 170076735} 124 | - component: {fileID: 170076734} 125 | m_Layer: 0 126 | m_Name: Directional Light 127 | m_TagString: Untagged 128 | m_Icon: {fileID: 0} 129 | m_NavMeshLayer: 0 130 | m_StaticEditorFlags: 0 131 | m_IsActive: 1 132 | --- !u!108 &170076734 133 | Light: 134 | m_ObjectHideFlags: 0 135 | m_CorrespondingSourceObject: {fileID: 0} 136 | m_PrefabInternal: {fileID: 0} 137 | m_GameObject: {fileID: 170076733} 138 | m_Enabled: 1 139 | serializedVersion: 8 140 | m_Type: 1 141 | m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} 142 | m_Intensity: 1 143 | m_Range: 10 144 | m_SpotAngle: 30 145 | m_CookieSize: 10 146 | m_Shadows: 147 | m_Type: 2 148 | m_Resolution: -1 149 | m_CustomResolution: -1 150 | m_Strength: 1 151 | m_Bias: 0.05 152 | m_NormalBias: 0.4 153 | m_NearPlane: 0.2 154 | m_Cookie: {fileID: 0} 155 | m_DrawHalo: 0 156 | m_Flare: {fileID: 0} 157 | m_RenderMode: 0 158 | m_CullingMask: 159 | serializedVersion: 2 160 | m_Bits: 4294967295 161 | m_Lightmapping: 1 162 | m_LightShadowCasterMode: 0 163 | m_AreaSize: {x: 1, y: 1} 164 | m_BounceIntensity: 1 165 | m_ColorTemperature: 6570 166 | m_UseColorTemperature: 0 167 | m_ShadowRadius: 0 168 | m_ShadowAngle: 0 169 | --- !u!4 &170076735 170 | Transform: 171 | m_ObjectHideFlags: 0 172 | m_CorrespondingSourceObject: {fileID: 0} 173 | m_PrefabInternal: {fileID: 0} 174 | m_GameObject: {fileID: 170076733} 175 | m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} 176 | m_LocalPosition: {x: 0, y: 3, z: 0} 177 | m_LocalScale: {x: 1, y: 1, z: 1} 178 | m_Children: [] 179 | m_Father: {fileID: 0} 180 | m_RootOrder: 1 181 | m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} 182 | --- !u!1 &534669902 183 | GameObject: 184 | m_ObjectHideFlags: 0 185 | m_CorrespondingSourceObject: {fileID: 0} 186 | m_PrefabInternal: {fileID: 0} 187 | serializedVersion: 6 188 | m_Component: 189 | - component: {fileID: 534669905} 190 | - component: {fileID: 534669904} 191 | - component: {fileID: 534669903} 192 | m_Layer: 0 193 | m_Name: Main Camera 194 | m_TagString: MainCamera 195 | m_Icon: {fileID: 0} 196 | m_NavMeshLayer: 0 197 | m_StaticEditorFlags: 0 198 | m_IsActive: 1 199 | --- !u!81 &534669903 200 | AudioListener: 201 | m_ObjectHideFlags: 0 202 | m_CorrespondingSourceObject: {fileID: 0} 203 | m_PrefabInternal: {fileID: 0} 204 | m_GameObject: {fileID: 534669902} 205 | m_Enabled: 1 206 | --- !u!20 &534669904 207 | Camera: 208 | m_ObjectHideFlags: 0 209 | m_CorrespondingSourceObject: {fileID: 0} 210 | m_PrefabInternal: {fileID: 0} 211 | m_GameObject: {fileID: 534669902} 212 | m_Enabled: 1 213 | serializedVersion: 2 214 | m_ClearFlags: 1 215 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} 216 | m_projectionMatrixMode: 1 217 | m_SensorSize: {x: 36, y: 24} 218 | m_LensShift: {x: 0, y: 0} 219 | m_GateFitMode: 2 220 | m_FocalLength: 50 221 | m_NormalizedViewPortRect: 222 | serializedVersion: 2 223 | x: 0 224 | y: 0 225 | width: 1 226 | height: 1 227 | near clip plane: 0.3 228 | far clip plane: 1000 229 | field of view: 60 230 | orthographic: 0 231 | orthographic size: 5 232 | m_Depth: -1 233 | m_CullingMask: 234 | serializedVersion: 2 235 | m_Bits: 4294967295 236 | m_RenderingPath: -1 237 | m_TargetTexture: {fileID: 0} 238 | m_TargetDisplay: 0 239 | m_TargetEye: 3 240 | m_HDR: 1 241 | m_AllowMSAA: 1 242 | m_AllowDynamicResolution: 0 243 | m_ForceIntoRT: 0 244 | m_OcclusionCulling: 1 245 | m_StereoConvergence: 10 246 | m_StereoSeparation: 0.022 247 | --- !u!4 &534669905 248 | Transform: 249 | m_ObjectHideFlags: 0 250 | m_CorrespondingSourceObject: {fileID: 0} 251 | m_PrefabInternal: {fileID: 0} 252 | m_GameObject: {fileID: 534669902} 253 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 254 | m_LocalPosition: {x: 0, y: 1, z: -10} 255 | m_LocalScale: {x: 1, y: 1, z: 1} 256 | m_Children: [] 257 | m_Father: {fileID: 0} 258 | m_RootOrder: 0 259 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 260 | -------------------------------------------------------------------------------- /Assets/Scenes/SampleScene 2.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a78f2193836680449a6e93236778beba 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Scenes/SampleScene.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: 0 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 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: 170076734} 41 | m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &3 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 12 47 | m_GIWorkflowMode: 0 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: 1 55 | m_EnableRealtimeLightmaps: 0 56 | m_LightmapEditorSettings: 57 | serializedVersion: 12 58 | m_Resolution: 2 59 | m_BakeResolution: 10 60 | m_AtlasSize: 512 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: 256 79 | m_PVRBounces: 2 80 | m_PVREnvironmentSampleCount: 256 81 | m_PVREnvironmentReferencePointCount: 2048 82 | m_PVRFilteringMode: 2 83 | m_PVRDenoiserTypeDirect: 0 84 | m_PVRDenoiserTypeIndirect: 0 85 | m_PVRDenoiserTypeAO: 0 86 | m_PVRFilterTypeDirect: 0 87 | m_PVRFilterTypeIndirect: 0 88 | m_PVRFilterTypeAO: 0 89 | m_PVREnvironmentMIS: 0 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: eae586a0acb900441b6ea474591aa3b0, type: 2} 102 | --- !u!196 &4 103 | NavMeshSettings: 104 | serializedVersion: 2 105 | m_ObjectHideFlags: 0 106 | m_BuildSettings: 107 | serializedVersion: 2 108 | agentTypeID: 0 109 | agentRadius: 0.5 110 | agentHeight: 2 111 | agentSlope: 45 112 | agentClimb: 0.4 113 | ledgeDropHeight: 0 114 | maxJumpAcrossDistance: 0 115 | minRegionArea: 2 116 | manualCellSize: 0 117 | cellSize: 0.16666667 118 | manualTileSize: 0 119 | tileSize: 256 120 | accuratePlacement: 0 121 | maxJobWorkers: 0 122 | preserveTilesOutsideBounds: 0 123 | debug: 124 | m_Flags: 0 125 | m_NavMeshData: {fileID: 0} 126 | --- !u!1 &163381662 127 | GameObject: 128 | m_ObjectHideFlags: 0 129 | m_CorrespondingSourceObject: {fileID: 0} 130 | m_PrefabInstance: {fileID: 0} 131 | m_PrefabAsset: {fileID: 0} 132 | serializedVersion: 6 133 | m_Component: 134 | - component: {fileID: 163381666} 135 | - component: {fileID: 163381665} 136 | - component: {fileID: 163381664} 137 | - component: {fileID: 163381663} 138 | m_Layer: 5 139 | m_Name: Canvas 140 | m_TagString: Untagged 141 | m_Icon: {fileID: 0} 142 | m_NavMeshLayer: 0 143 | m_StaticEditorFlags: 0 144 | m_IsActive: 1 145 | --- !u!114 &163381663 146 | MonoBehaviour: 147 | m_ObjectHideFlags: 0 148 | m_CorrespondingSourceObject: {fileID: 0} 149 | m_PrefabInstance: {fileID: 0} 150 | m_PrefabAsset: {fileID: 0} 151 | m_GameObject: {fileID: 163381662} 152 | m_Enabled: 1 153 | m_EditorHideFlags: 0 154 | m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} 155 | m_Name: 156 | m_EditorClassIdentifier: 157 | m_IgnoreReversedGraphics: 1 158 | m_BlockingObjects: 0 159 | m_BlockingMask: 160 | serializedVersion: 2 161 | m_Bits: 4294967295 162 | --- !u!114 &163381664 163 | MonoBehaviour: 164 | m_ObjectHideFlags: 0 165 | m_CorrespondingSourceObject: {fileID: 0} 166 | m_PrefabInstance: {fileID: 0} 167 | m_PrefabAsset: {fileID: 0} 168 | m_GameObject: {fileID: 163381662} 169 | m_Enabled: 1 170 | m_EditorHideFlags: 0 171 | m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} 172 | m_Name: 173 | m_EditorClassIdentifier: 174 | m_UiScaleMode: 0 175 | m_ReferencePixelsPerUnit: 100 176 | m_ScaleFactor: 1 177 | m_ReferenceResolution: {x: 800, y: 600} 178 | m_ScreenMatchMode: 0 179 | m_MatchWidthOrHeight: 0 180 | m_PhysicalUnit: 3 181 | m_FallbackScreenDPI: 96 182 | m_DefaultSpriteDPI: 96 183 | m_DynamicPixelsPerUnit: 1 184 | m_PresetInfoIsWorld: 0 185 | --- !u!223 &163381665 186 | Canvas: 187 | m_ObjectHideFlags: 0 188 | m_CorrespondingSourceObject: {fileID: 0} 189 | m_PrefabInstance: {fileID: 0} 190 | m_PrefabAsset: {fileID: 0} 191 | m_GameObject: {fileID: 163381662} 192 | m_Enabled: 1 193 | serializedVersion: 3 194 | m_RenderMode: 0 195 | m_Camera: {fileID: 0} 196 | m_PlaneDistance: 100 197 | m_PixelPerfect: 0 198 | m_ReceivesEvents: 1 199 | m_OverrideSorting: 0 200 | m_OverridePixelPerfect: 0 201 | m_SortingBucketNormalizedSize: 0 202 | m_VertexColorAlwaysGammaSpace: 0 203 | m_AdditionalShaderChannelsFlag: 0 204 | m_SortingLayerID: 0 205 | m_SortingOrder: 0 206 | m_TargetDisplay: 0 207 | --- !u!224 &163381666 208 | RectTransform: 209 | m_ObjectHideFlags: 0 210 | m_CorrespondingSourceObject: {fileID: 0} 211 | m_PrefabInstance: {fileID: 0} 212 | m_PrefabAsset: {fileID: 0} 213 | m_GameObject: {fileID: 163381662} 214 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 215 | m_LocalPosition: {x: 0, y: 0, z: 0} 216 | m_LocalScale: {x: 0, y: 0, z: 0} 217 | m_ConstrainProportionsScale: 0 218 | m_Children: 219 | - {fileID: 1781046740} 220 | m_Father: {fileID: 0} 221 | m_RootOrder: 2 222 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 223 | m_AnchorMin: {x: 0, y: 0} 224 | m_AnchorMax: {x: 0, y: 0} 225 | m_AnchoredPosition: {x: 0, y: 0} 226 | m_SizeDelta: {x: 0, y: 0} 227 | m_Pivot: {x: 0, y: 0} 228 | --- !u!1 &170076733 229 | GameObject: 230 | m_ObjectHideFlags: 0 231 | m_CorrespondingSourceObject: {fileID: 0} 232 | m_PrefabInstance: {fileID: 0} 233 | m_PrefabAsset: {fileID: 0} 234 | serializedVersion: 6 235 | m_Component: 236 | - component: {fileID: 170076735} 237 | - component: {fileID: 170076734} 238 | m_Layer: 0 239 | m_Name: Directional Light 240 | m_TagString: Untagged 241 | m_Icon: {fileID: 0} 242 | m_NavMeshLayer: 0 243 | m_StaticEditorFlags: 0 244 | m_IsActive: 1 245 | --- !u!108 &170076734 246 | Light: 247 | m_ObjectHideFlags: 0 248 | m_CorrespondingSourceObject: {fileID: 0} 249 | m_PrefabInstance: {fileID: 0} 250 | m_PrefabAsset: {fileID: 0} 251 | m_GameObject: {fileID: 170076733} 252 | m_Enabled: 1 253 | serializedVersion: 10 254 | m_Type: 1 255 | m_Shape: 0 256 | m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} 257 | m_Intensity: 1 258 | m_Range: 10 259 | m_SpotAngle: 30 260 | m_InnerSpotAngle: 21.80208 261 | m_CookieSize: 10 262 | m_Shadows: 263 | m_Type: 2 264 | m_Resolution: -1 265 | m_CustomResolution: -1 266 | m_Strength: 1 267 | m_Bias: 0.05 268 | m_NormalBias: 0.4 269 | m_NearPlane: 0.2 270 | m_CullingMatrixOverride: 271 | e00: 1 272 | e01: 0 273 | e02: 0 274 | e03: 0 275 | e10: 0 276 | e11: 1 277 | e12: 0 278 | e13: 0 279 | e20: 0 280 | e21: 0 281 | e22: 1 282 | e23: 0 283 | e30: 0 284 | e31: 0 285 | e32: 0 286 | e33: 1 287 | m_UseCullingMatrixOverride: 0 288 | m_Cookie: {fileID: 0} 289 | m_DrawHalo: 0 290 | m_Flare: {fileID: 0} 291 | m_RenderMode: 0 292 | m_CullingMask: 293 | serializedVersion: 2 294 | m_Bits: 4294967295 295 | m_RenderingLayerMask: 1 296 | m_Lightmapping: 1 297 | m_LightShadowCasterMode: 0 298 | m_AreaSize: {x: 1, y: 1} 299 | m_BounceIntensity: 1 300 | m_ColorTemperature: 6570 301 | m_UseColorTemperature: 0 302 | m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} 303 | m_UseBoundingSphereOverride: 0 304 | m_UseViewFrustumForShadowCasterCull: 1 305 | m_ShadowRadius: 0 306 | m_ShadowAngle: 0 307 | --- !u!4 &170076735 308 | Transform: 309 | m_ObjectHideFlags: 0 310 | m_CorrespondingSourceObject: {fileID: 0} 311 | m_PrefabInstance: {fileID: 0} 312 | m_PrefabAsset: {fileID: 0} 313 | m_GameObject: {fileID: 170076733} 314 | m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} 315 | m_LocalPosition: {x: 0, y: 3, z: 0} 316 | m_LocalScale: {x: 1, y: 1, z: 1} 317 | m_ConstrainProportionsScale: 0 318 | m_Children: [] 319 | m_Father: {fileID: 0} 320 | m_RootOrder: 1 321 | m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} 322 | --- !u!1 &206452558 323 | GameObject: 324 | m_ObjectHideFlags: 0 325 | m_CorrespondingSourceObject: {fileID: 0} 326 | m_PrefabInstance: {fileID: 0} 327 | m_PrefabAsset: {fileID: 0} 328 | serializedVersion: 6 329 | m_Component: 330 | - component: {fileID: 206452561} 331 | - component: {fileID: 206452560} 332 | - component: {fileID: 206452559} 333 | m_Layer: 0 334 | m_Name: EventSystem 335 | m_TagString: Untagged 336 | m_Icon: {fileID: 0} 337 | m_NavMeshLayer: 0 338 | m_StaticEditorFlags: 0 339 | m_IsActive: 1 340 | --- !u!114 &206452559 341 | MonoBehaviour: 342 | m_ObjectHideFlags: 0 343 | m_CorrespondingSourceObject: {fileID: 0} 344 | m_PrefabInstance: {fileID: 0} 345 | m_PrefabAsset: {fileID: 0} 346 | m_GameObject: {fileID: 206452558} 347 | m_Enabled: 1 348 | m_EditorHideFlags: 0 349 | m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} 350 | m_Name: 351 | m_EditorClassIdentifier: 352 | m_SendPointerHoverToParent: 1 353 | m_HorizontalAxis: Horizontal 354 | m_VerticalAxis: Vertical 355 | m_SubmitButton: Submit 356 | m_CancelButton: Cancel 357 | m_InputActionsPerSecond: 10 358 | m_RepeatDelay: 0.5 359 | m_ForceModuleActive: 0 360 | --- !u!114 &206452560 361 | MonoBehaviour: 362 | m_ObjectHideFlags: 0 363 | m_CorrespondingSourceObject: {fileID: 0} 364 | m_PrefabInstance: {fileID: 0} 365 | m_PrefabAsset: {fileID: 0} 366 | m_GameObject: {fileID: 206452558} 367 | m_Enabled: 1 368 | m_EditorHideFlags: 0 369 | m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} 370 | m_Name: 371 | m_EditorClassIdentifier: 372 | m_FirstSelected: {fileID: 0} 373 | m_sendNavigationEvents: 1 374 | m_DragThreshold: 10 375 | --- !u!4 &206452561 376 | Transform: 377 | m_ObjectHideFlags: 0 378 | m_CorrespondingSourceObject: {fileID: 0} 379 | m_PrefabInstance: {fileID: 0} 380 | m_PrefabAsset: {fileID: 0} 381 | m_GameObject: {fileID: 206452558} 382 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 383 | m_LocalPosition: {x: 0, y: 0, z: 0} 384 | m_LocalScale: {x: 1, y: 1, z: 1} 385 | m_ConstrainProportionsScale: 0 386 | m_Children: [] 387 | m_Father: {fileID: 0} 388 | m_RootOrder: 3 389 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 390 | --- !u!1 &534669902 391 | GameObject: 392 | m_ObjectHideFlags: 0 393 | m_CorrespondingSourceObject: {fileID: 0} 394 | m_PrefabInstance: {fileID: 0} 395 | m_PrefabAsset: {fileID: 0} 396 | serializedVersion: 6 397 | m_Component: 398 | - component: {fileID: 534669905} 399 | - component: {fileID: 534669904} 400 | - component: {fileID: 534669903} 401 | m_Layer: 0 402 | m_Name: Main Camera 403 | m_TagString: MainCamera 404 | m_Icon: {fileID: 0} 405 | m_NavMeshLayer: 0 406 | m_StaticEditorFlags: 0 407 | m_IsActive: 1 408 | --- !u!81 &534669903 409 | AudioListener: 410 | m_ObjectHideFlags: 0 411 | m_CorrespondingSourceObject: {fileID: 0} 412 | m_PrefabInstance: {fileID: 0} 413 | m_PrefabAsset: {fileID: 0} 414 | m_GameObject: {fileID: 534669902} 415 | m_Enabled: 1 416 | --- !u!20 &534669904 417 | Camera: 418 | m_ObjectHideFlags: 0 419 | m_CorrespondingSourceObject: {fileID: 0} 420 | m_PrefabInstance: {fileID: 0} 421 | m_PrefabAsset: {fileID: 0} 422 | m_GameObject: {fileID: 534669902} 423 | m_Enabled: 1 424 | serializedVersion: 2 425 | m_ClearFlags: 1 426 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} 427 | m_projectionMatrixMode: 1 428 | m_GateFitMode: 2 429 | m_FOVAxisMode: 0 430 | m_SensorSize: {x: 36, y: 24} 431 | m_LensShift: {x: 0, y: 0} 432 | m_FocalLength: 50 433 | m_NormalizedViewPortRect: 434 | serializedVersion: 2 435 | x: 0 436 | y: 0 437 | width: 1 438 | height: 1 439 | near clip plane: 0.3 440 | far clip plane: 1000 441 | field of view: 60 442 | orthographic: 0 443 | orthographic size: 5 444 | m_Depth: -1 445 | m_CullingMask: 446 | serializedVersion: 2 447 | m_Bits: 4294967295 448 | m_RenderingPath: -1 449 | m_TargetTexture: {fileID: 0} 450 | m_TargetDisplay: 0 451 | m_TargetEye: 3 452 | m_HDR: 1 453 | m_AllowMSAA: 1 454 | m_AllowDynamicResolution: 0 455 | m_ForceIntoRT: 0 456 | m_OcclusionCulling: 1 457 | m_StereoConvergence: 10 458 | m_StereoSeparation: 0.022 459 | --- !u!4 &534669905 460 | Transform: 461 | m_ObjectHideFlags: 0 462 | m_CorrespondingSourceObject: {fileID: 0} 463 | m_PrefabInstance: {fileID: 0} 464 | m_PrefabAsset: {fileID: 0} 465 | m_GameObject: {fileID: 534669902} 466 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 467 | m_LocalPosition: {x: 0, y: 1, z: -10} 468 | m_LocalScale: {x: 1, y: 1, z: 1} 469 | m_ConstrainProportionsScale: 0 470 | m_Children: [] 471 | m_Father: {fileID: 0} 472 | m_RootOrder: 0 473 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 474 | --- !u!1 &1731367577 475 | GameObject: 476 | m_ObjectHideFlags: 0 477 | m_CorrespondingSourceObject: {fileID: 0} 478 | m_PrefabInstance: {fileID: 0} 479 | m_PrefabAsset: {fileID: 0} 480 | serializedVersion: 6 481 | m_Component: 482 | - component: {fileID: 1731367579} 483 | - component: {fileID: 1731367578} 484 | m_Layer: 0 485 | m_Name: '[GameManager]' 486 | m_TagString: Untagged 487 | m_Icon: {fileID: 0} 488 | m_NavMeshLayer: 0 489 | m_StaticEditorFlags: 0 490 | m_IsActive: 1 491 | --- !u!114 &1731367578 492 | MonoBehaviour: 493 | m_ObjectHideFlags: 0 494 | m_CorrespondingSourceObject: {fileID: 0} 495 | m_PrefabInstance: {fileID: 0} 496 | m_PrefabAsset: {fileID: 0} 497 | m_GameObject: {fileID: 1731367577} 498 | m_Enabled: 1 499 | m_EditorHideFlags: 0 500 | m_Script: {fileID: 11500000, guid: 740810d97dcafcb40af5e2b91bf8be5b, type: 3} 501 | m_Name: 502 | m_EditorClassIdentifier: 503 | platform: FromCustomTask 504 | --- !u!4 &1731367579 505 | Transform: 506 | m_ObjectHideFlags: 0 507 | m_CorrespondingSourceObject: {fileID: 0} 508 | m_PrefabInstance: {fileID: 0} 509 | m_PrefabAsset: {fileID: 0} 510 | m_GameObject: {fileID: 1731367577} 511 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 512 | m_LocalPosition: {x: 0, y: 0, z: 0} 513 | m_LocalScale: {x: 1, y: 1, z: 1} 514 | m_ConstrainProportionsScale: 0 515 | m_Children: [] 516 | m_Father: {fileID: 0} 517 | m_RootOrder: 4 518 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 519 | --- !u!1 &1781046739 520 | GameObject: 521 | m_ObjectHideFlags: 0 522 | m_CorrespondingSourceObject: {fileID: 0} 523 | m_PrefabInstance: {fileID: 0} 524 | m_PrefabAsset: {fileID: 0} 525 | serializedVersion: 6 526 | m_Component: 527 | - component: {fileID: 1781046740} 528 | - component: {fileID: 1781046743} 529 | - component: {fileID: 1781046742} 530 | - component: {fileID: 1781046741} 531 | m_Layer: 5 532 | m_Name: Text 533 | m_TagString: Untagged 534 | m_Icon: {fileID: 0} 535 | m_NavMeshLayer: 0 536 | m_StaticEditorFlags: 0 537 | m_IsActive: 1 538 | --- !u!224 &1781046740 539 | RectTransform: 540 | m_ObjectHideFlags: 0 541 | m_CorrespondingSourceObject: {fileID: 0} 542 | m_PrefabInstance: {fileID: 0} 543 | m_PrefabAsset: {fileID: 0} 544 | m_GameObject: {fileID: 1781046739} 545 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 546 | m_LocalPosition: {x: 0, y: 0, z: 0} 547 | m_LocalScale: {x: 1, y: 1, z: 1} 548 | m_ConstrainProportionsScale: 0 549 | m_Children: [] 550 | m_Father: {fileID: 163381666} 551 | m_RootOrder: 0 552 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 553 | m_AnchorMin: {x: 0, y: 0} 554 | m_AnchorMax: {x: 1, y: 1} 555 | m_AnchoredPosition: {x: 0, y: 0} 556 | m_SizeDelta: {x: 0, y: 0} 557 | m_Pivot: {x: 0.5, y: 0.5} 558 | --- !u!114 &1781046741 559 | MonoBehaviour: 560 | m_ObjectHideFlags: 0 561 | m_CorrespondingSourceObject: {fileID: 0} 562 | m_PrefabInstance: {fileID: 0} 563 | m_PrefabAsset: {fileID: 0} 564 | m_GameObject: {fileID: 1781046739} 565 | m_Enabled: 1 566 | m_EditorHideFlags: 0 567 | m_Script: {fileID: 11500000, guid: aa54649bdd266874e8eff42ffb09d1c5, type: 3} 568 | m_Name: 569 | m_EditorClassIdentifier: 570 | text: {fileID: 1781046742} 571 | --- !u!114 &1781046742 572 | MonoBehaviour: 573 | m_ObjectHideFlags: 0 574 | m_CorrespondingSourceObject: {fileID: 0} 575 | m_PrefabInstance: {fileID: 0} 576 | m_PrefabAsset: {fileID: 0} 577 | m_GameObject: {fileID: 1781046739} 578 | m_Enabled: 1 579 | m_EditorHideFlags: 0 580 | m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} 581 | m_Name: 582 | m_EditorClassIdentifier: 583 | m_Material: {fileID: 0} 584 | m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} 585 | m_RaycastTarget: 1 586 | m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} 587 | m_Maskable: 1 588 | m_OnCullStateChanged: 589 | m_PersistentCalls: 590 | m_Calls: [] 591 | m_FontData: 592 | m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} 593 | m_FontSize: 24 594 | m_FontStyle: 0 595 | m_BestFit: 0 596 | m_MinSize: 2 597 | m_MaxSize: 40 598 | m_Alignment: 0 599 | m_AlignByGeometry: 0 600 | m_RichText: 1 601 | m_HorizontalOverflow: 0 602 | m_VerticalOverflow: 0 603 | m_LineSpacing: 1 604 | m_Text: 605 | --- !u!222 &1781046743 606 | CanvasRenderer: 607 | m_ObjectHideFlags: 0 608 | m_CorrespondingSourceObject: {fileID: 0} 609 | m_PrefabInstance: {fileID: 0} 610 | m_PrefabAsset: {fileID: 0} 611 | m_GameObject: {fileID: 1781046739} 612 | m_CullTransparentMesh: 0 613 | -------------------------------------------------------------------------------- /Assets/Scenes/SampleScene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b3bb2599e998b664c973acd74cf1ae3b 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Scenes/SampleSceneSettings.lighting: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!850595691 &4890085278179872738 4 | LightingSettings: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_Name: SampleSceneSettings 10 | serializedVersion: 4 11 | m_GIWorkflowMode: 0 12 | m_EnableBakedLightmaps: 1 13 | m_EnableRealtimeLightmaps: 0 14 | m_RealtimeEnvironmentLighting: 1 15 | m_BounceScale: 1 16 | m_AlbedoBoost: 1 17 | m_IndirectOutputScale: 1 18 | m_UsingShadowmask: 1 19 | m_BakeBackend: 1 20 | m_LightmapMaxSize: 512 21 | m_BakeResolution: 10 22 | m_Padding: 2 23 | m_LightmapCompression: 3 24 | m_AO: 0 25 | m_AOMaxDistance: 1 26 | m_CompAOExponent: 1 27 | m_CompAOExponentDirect: 0 28 | m_ExtractAO: 0 29 | m_MixedBakeMode: 2 30 | m_LightmapsBakeMode: 1 31 | m_FilterMode: 1 32 | m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0} 33 | m_ExportTrainingData: 0 34 | m_TrainingDataDestination: TrainingData 35 | m_RealtimeResolution: 2 36 | m_ForceWhiteAlbedo: 0 37 | m_ForceUpdates: 0 38 | m_FinalGather: 0 39 | m_FinalGatherRayCount: 256 40 | m_FinalGatherFiltering: 1 41 | m_PVRCulling: 1 42 | m_PVRSampling: 1 43 | m_PVRDirectSampleCount: 32 44 | m_PVRSampleCount: 256 45 | m_PVREnvironmentSampleCount: 256 46 | m_PVREnvironmentReferencePointCount: 2048 47 | m_LightProbeSampleCountMultiplier: 4 48 | m_PVRBounces: 2 49 | m_PVRMinBounces: 2 50 | m_PVREnvironmentMIS: 0 51 | m_PVRFilteringMode: 2 52 | m_PVRDenoiserTypeDirect: 0 53 | m_PVRDenoiserTypeIndirect: 0 54 | m_PVRDenoiserTypeAO: 0 55 | m_PVRFilterTypeDirect: 0 56 | m_PVRFilterTypeIndirect: 0 57 | m_PVRFilterTypeAO: 0 58 | m_PVRFilteringGaussRadiusDirect: 1 59 | m_PVRFilteringGaussRadiusIndirect: 5 60 | m_PVRFilteringGaussRadiusAO: 2 61 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 62 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 63 | m_PVRFilteringAtrousPositionSigmaAO: 1 64 | m_PVRTiledBaking: 0 65 | -------------------------------------------------------------------------------- /Assets/Scenes/SampleSceneSettings.lighting.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eae586a0acb900441b6ea474591aa3b0 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 4890085278179872738 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 918ed62dfa8b28a449dd75e3ff3007b6 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 39239426c60008c4790bc9890bb6e5d5 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/ScriptEncodingConverter.cs: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) Bian Shanghai 3 | // https://github.com/Bian-Sh/Script-Encoding-Converter 4 | // Licensed under the MIT license. See the LICENSE.md file in the project root for more information. 5 | 6 | using System; 7 | using System.Collections.Generic; 8 | using System.IO; 9 | using System.Linq; 10 | using System.Reflection; 11 | using System.Runtime.CompilerServices; 12 | using System.Text; 13 | using UnityEditor; 14 | using UnityEngine; 15 | //BOM(Byte Order Mark) 16 | public class ScriptEncodingConverter 17 | { 18 | const string key = "SEC_AutoFix"; 19 | const string menu_to_utf8 = "Assets/Script Encoding Converter/To UTF8"; 20 | const string menu_to_gb2312 = "Assets/Script Encoding Converter/To GB2312"; 21 | const string menu_auto = "Assets/Script Encoding Converter/Auto Fix"; 22 | static bool isConvertManually = false; 23 | 24 | 25 | /// 是否开启Encoding自动修正 26 | [MenuItem(menu_auto, priority = 100)] 27 | static void SwitchAutoFixState() 28 | { 29 | var value = !EditorPrefs.GetBool(key, false); 30 | EditorPrefs.SetBool(key, value); 31 | Menu.SetChecked(menu_auto, value); 32 | } 33 | /// 初始化 菜单的 checked 状态 34 | [MenuItem(menu_auto, validate = true)] 35 | static bool SwitchAutoFixStateValidate() 36 | { 37 | var value = EditorPrefs.GetBool(key, false); 38 | Menu.SetChecked(menu_auto, value); 39 | return true; 40 | } 41 | 42 | /// 将脚本编码格式转换为 UTF8 43 | [MenuItem(menu_to_utf8)] 44 | static void Convert2UTF8() 45 | { 46 | var settings = new ConvertSettings 47 | { 48 | predicate = x => IsNeedConvertToUtf8(x), 49 | from = Encoding.GetEncoding(936), 50 | to = new UTF8Encoding(false), 51 | }; 52 | EncodingConverter(settings); 53 | } 54 | 55 | /// 将脚本编码格式转换为 GB2312 (测试用) 56 | [MenuItem(menu_to_gb2312)] 57 | static void Convert2GB2312() 58 | { 59 | var settings = new ConvertSettings 60 | { 61 | predicate = x => DetectFileEncoding(x, "utf-8"), 62 | from = Encoding.UTF8, 63 | to = Encoding.GetEncoding(936), 64 | }; 65 | EncodingConverter(settings); 66 | } 67 | 68 | // 因为 DetectFileEncoding 函数判断 gb2312 时,对 utf-8 no bom 返回了true,所以做双重判断 69 | static bool IsNeedConvertToUtf8(string file) => !DetectFileEncoding(file, "utf-8") && DetectFileEncoding(file, "gb2312"); 70 | 71 | public static bool DetectFileEncoding(string file, string name) 72 | { 73 | var encodingVerifier = Encoding.GetEncoding(name, new EncoderExceptionFallback(), new DecoderExceptionFallback()); 74 | using (var reader = new StreamReader(file, encodingVerifier, true, 1024)) 75 | { 76 | try 77 | { 78 | while (!reader.EndOfStream) 79 | { 80 | var line = reader.ReadLine(); 81 | } 82 | return reader.CurrentEncoding.BodyName == name; 83 | } 84 | catch (Exception) 85 | { 86 | return false; 87 | } 88 | } 89 | } 90 | 91 | static void EncodingConverter(ConvertSettings settings) 92 | { 93 | MonoScript[] msarr = Selection.GetFiltered(SelectionMode.DeepAssets); 94 | if (null != msarr && msarr.Length > 0) 95 | { 96 | isConvertManually = true; 97 | List files = new List(); 98 | foreach (var item in msarr) 99 | { 100 | string path = AssetDatabase.GetAssetPath(item); 101 | if (settings.predicate.Invoke(path)) 102 | { 103 | var text = File.ReadAllText(path, settings.from); 104 | File.WriteAllText(path, text, settings.to); 105 | files.Add(path); 106 | AssetDatabase.ImportAsset(path); 107 | } 108 | } 109 | Report("手动处理", files); 110 | isConvertManually = false; 111 | } 112 | } 113 | 114 | class ConvertSettings 115 | { 116 | public Func predicate; 117 | public Encoding from, to; 118 | } 119 | 120 | class ScriptEncodingAutoFixHandler : AssetPostprocessor 121 | { 122 | //所有的资源的导入,删除,移动,都会调用此方法,注意,这个方法是static的 123 | public static void OnPostprocessAllAssets(string[] importedAsset, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths) 124 | { 125 | //如果用户手动处理中,或者没选择自动修正则不处理,不响应此回调 126 | if (isConvertManually || !EditorPrefs.GetBool(key, false)) return; 127 | //仅对有修改的脚本进行处理, 内置 Package 包是只读的,避免死循环故而不处理。 128 | var scripts = importedAsset.Where(v => v.EndsWith(".cs")) 129 | .Where(v => !Path.GetFullPath(v).Contains("PackageCache")) 130 | .ToArray(); 131 | List files = new List(); 132 | foreach (var path in scripts) 133 | { 134 | //如果是 gb2312 编码就改成 utf-8 135 | if (IsNeedConvertToUtf8(path)) 136 | { 137 | var text = File.ReadAllText(path, Encoding.GetEncoding(936)); 138 | File.WriteAllText(path, text, new UTF8Encoding(false)); 139 | files.Add(path); 140 | } 141 | } 142 | if (files.Count > 0) 143 | { 144 | Report("Auto fix to UTF8", files); 145 | foreach (var file in files) 146 | { 147 | AssetDatabase.ImportAsset(file); 148 | } 149 | } 150 | } 151 | } 152 | 153 | #region 为 Log 的文件条目提供超链接,点击可以 Ping/高亮 脚本文件 154 | [InitializeOnLoadMethod] 155 | private static void Init() 156 | { 157 | #if UNITY_2021_1_OR_NEWER 158 | EditorGUI.hyperLinkClicked += OnLinkClicked; 159 | static void OnLinkClicked(EditorWindow ew, HyperLinkClickedEventArgs args) 160 | { 161 | if (args.hyperLinkData.TryGetValue("sourcefile", out var file)) 162 | { 163 | EditorGUIUtility.PingObject(AssetDatabase.LoadAssetAtPath(file)); 164 | } 165 | }; 166 | } 167 | #else 168 | var evt = typeof(EditorGUI).GetEvent("hyperLinkClicked", BindingFlags.Static | BindingFlags.NonPublic); 169 | if (evt != null) 170 | { 171 | var handler = Delegate.CreateDelegate(evt.EventHandlerType, typeof(ScriptEncodingConverter), nameof(OnLinkClicked)); 172 | evt.AddMethod.Invoke(null, new object[] { handler }); 173 | } 174 | } 175 | static void OnLinkClicked(object sender, EventArgs args) 176 | { 177 | var property = args.GetType().GetProperty("hyperlinkInfos", BindingFlags.Instance | BindingFlags.Public); 178 | if (property.GetValue(args) is Dictionary infos) 179 | { 180 | if (infos.TryGetValue("sourcefile", out var file)) 181 | { 182 | EditorGUIUtility.PingObject(AssetDatabase.LoadAssetAtPath(file)); 183 | } 184 | } 185 | } 186 | #endif 187 | static void Report(string title, IEnumerable files) 188 | { 189 | // 加入 hyperlink 190 | files = files.Select(v => $"{v}"); 191 | var info = files.Count() > 0 ? $"处理文件 {files.Count()} 个,更多 ↓ \n{string.Join("\n", files)}" : "没有发现编码问题!"; 192 | Debug.Log($"{title}: {info}"); 193 | } 194 | #endregion 195 | } 196 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/ScriptEncodingConverter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c78e89be41ad0ce40896d0666cd1338d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/GameManager.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | public class GameManager : MonoBehaviour 4 | { 5 | public string platform = "Default Platform"; 6 | 7 | private void Update() 8 | { 9 | Debug.LogError($"{nameof(GameManager)}: platform = {platform}"); 10 | } 11 | 12 | 13 | #if UNITY_EDITOR 14 | // this is the function that will be called by the RunFunctionTask 15 | // if the field "platform" is not equal to args that you set in the RunFunctionTask, it will be changed to args 16 | // if the field "platform" on the inspector is equal to args that you set in the RunFunctionTask, you can reset it to default value to see the effect gain 17 | 18 | // 这个函数会被 RunFunctionTask 调用 19 | // 如果 platform 字段不等于 RunFunctionTask 中的 args 字段,那么 platform 字段会被修改为 args 字段 20 | // 如果 Inspector 上 platform 数值等于 RunFunctionTask 中的 args 字段,那么你可以重置 platform 字段为默认值来查看效果 21 | 22 | private void SomeFunction(string args) 23 | { 24 | platform = args; 25 | Debug.Log($"{nameof(GameManager)}: Function called with args: {args}"); 26 | } 27 | #endif 28 | } 29 | -------------------------------------------------------------------------------- /Assets/Scripts/GameManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 740810d97dcafcb40af5e2b91bf8be5b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/ShowSceneName.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.SceneManagement; 3 | using UnityEngine.UI; 4 | 5 | public class ShowSceneName : MonoBehaviour 6 | { 7 | [SerializeField] 8 | #pragma warning disable IDE0044 // 添加只读修饰符 9 | Text text; 10 | #pragma warning restore IDE0044 // 添加只读修饰符 11 | void Start() 12 | { 13 | var str = $"当前场景名:{SceneManager.GetActiveScene().name}\n"; 14 | var count = SceneManager.sceneCountInBuildSettings; 15 | for (int i = 0; i < count; i++) 16 | { 17 | var path = SceneUtility.GetScenePathByBuildIndex(i); 18 | var name = System.IO.Path.GetFileNameWithoutExtension(path); 19 | str += $"{nameof(ShowSceneName)}: 打包的场景有:{name}\n"; 20 | } 21 | text.text = str; 22 | // 获取 Environment.GetCommandLineArgs() 的参数并换行展示 23 | var args = System.Environment.GetCommandLineArgs(); 24 | var argsStr = string.Join("\n", args); 25 | text.text += $"\n命令行参数:\n{argsStr}"; 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Assets/Scripts/ShowSceneName.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aa54649bdd266874e8eff42ffb09d1c5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 边上海 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 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/.gitignore: -------------------------------------------------------------------------------- 1 | /[Ll]ibrary/ 2 | /[Tt]emp/ 3 | /[Oo]bj/ 4 | /[Bb]uild/ 5 | /[Bb]uilds/ 6 | /[Pp]rojectSettings/ 7 | /Assets/AssetStoreTools* 8 | /.vs/ 9 | 10 | # Autogenerated VS/MD solution and project files 11 | ExportedObj/ 12 | *.csproj 13 | *.unityproj 14 | *.sln 15 | *.suo 16 | *.tmp 17 | *.user 18 | *.userprefs 19 | *.pidb 20 | *.booproj 21 | *.svd 22 | 23 | 24 | # Unity3D generated meta files 25 | *.pidb.meta 26 | 27 | # Unity3D Generated File On Crash Reports 28 | sysinfo.txt 29 | 30 | # Builds 31 | *.apk 32 | *.unitypackage 33 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this package will be documented in this file. 4 | 5 | The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) 6 | and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). 7 | 8 | ## [2.1.0] - 2024-09-25 9 | 10 | ### New Feature 11 | 12 | * 新增通过控制台超链接定位文件和文件夹的功能,方便查看任务输出成果 13 | 14 | ## [2.0.1] - 2024-09-24 15 | 16 | ### Fixed 17 | 18 | * 修复了 .nsi 文件抛出 No Directory 的异常 19 | * 修复了 SettingProviders 有些时候会报null 的问题 20 | 21 | ## [2.0.0] - 2024-09-22 22 | 23 | ### New Features 24 | 25 | * 新增 Virbox Task,支持使用 Virbox 对 exe 输出进行加密(Mono) 26 | * 新增 Nsis Tas,支持使用 Nsis 将 exe 输出包打包成 Windows 安装包 27 | * 新增 SettingProvider,支持在 Unity ProjectSettings 中配置 Virbox 和 Nsis 的路径 28 | * SettingProvider 实现通过 Presets 配置多个 Virbox 和 Nsis 的路径,随心切换 29 | 30 | ### Enhancements 31 | 32 | * 完善了 Task 的行为,现在支持 Task 预校验 33 | * 支持为 Task 传递参数 34 | * 支持 Task 返回值并传递给下一个 Task 35 | * Task 的测试支持传递参数 36 | 37 | ## [1.3.0] - 2023-10-16 38 | 39 | ### Changed 40 | 41 | * 将工程内部的打包路径存为相对路径,方便工程迁移,多人协作 42 | * 将打包平台的选择内置到 BuildProfiles 中,这样就可以一次打多个平台的 app 了 43 | 44 | ## [1.2.0] - 2023-09-17 45 | 46 | ### Enhancements 47 | 48 | * 将是否需要 build 的状态展示在 Foldout 右侧,更加直观,折叠也不打紧 49 | * 用户自定义任务新增 Properties 按钮,方便用户定位、展示 Task 资产方便配置参数 50 | 51 | ## [1.1.0] - 2023-09-16 52 | 53 | ### Fixed 54 | 55 | 修复了打安卓输出 .exe 文件的异常 56 | 57 | ### Enhancements 58 | 59 | 重绘了 inspector,更友好 60 | 61 | ### New 62 | 63 | 支持了 run process task 64 | 65 | ## [1.0.0] - 2023-05-14 66 | 67 | * 首次发布 68 | 69 | ### Changed 70 | 71 | ### Breaking Changes 72 | 73 | ### New Features 74 | 75 | ### Bug Fixes 76 | 77 | ### Added 78 | 79 | ### Fixed 80 | 81 | ### Removed 82 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/CHANGELOG.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7416a4a0a76d5c04ab97b88a143519be 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6dcf01505cadc004f9d69727763686f0 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/AutoBuilder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using UnityEditor; 6 | using UnityEditor.Callbacks; 7 | using UnityEditor.Presets; 8 | using UnityEngine; 9 | 10 | namespace zFramework.AppBuilder 11 | { 12 | public class AutoBuilder : EditorWindow 13 | { 14 | static EditorWindow window; 15 | [MenuItem("Tools/App Auto Builder")] 16 | public static void Init() 17 | { 18 | //获取插件版本 19 | var stack = new System.Diagnostics.StackTrace(true); 20 | var path = stack.GetFrame(0).GetFileName(); 21 | var root = Path.GetDirectoryName(path); 22 | root = root.Substring(0, root.LastIndexOf("\\Editor", StringComparison.Ordinal)); 23 | var content = File.ReadAllText($"{root}/package.json"); 24 | var version = JsonUtility.FromJson(content); 25 | 26 | window = GetWindow(typeof(AutoBuilder)); 27 | window.titleContent = new GUIContent($"App Auto Builder (v{version.version})"); 28 | window.minSize = new Vector2(400, 500); 29 | window.Show(); 30 | } 31 | 32 | void OnEnable() 33 | { 34 | assetsDirInfo = new DirectoryInfo(Application.dataPath); 35 | config = AutoBuildConfiguration.LoadOrCreate(); 36 | serializedObject = new SerializedObject(config); 37 | InitProperties(); 38 | } 39 | void InitProperties() 40 | { 41 | appLocationPath = serializedObject.FindProperty("appLocationPath"); 42 | profiles = serializedObject.FindProperty("profiles"); 43 | } 44 | 45 | void OnGUI() 46 | { 47 | serializedObject.Update(); 48 | InitProperties(); 49 | var rect_settings = new Rect(position.width-18, 2, 20, 20); 50 | 51 | // draw settings entry on the right of this window 52 | var icon = EditorGUIUtility.IconContent("d_Settings"); 53 | var style = GUI.skin.GetStyle("IconButton"); 54 | var content = new GUIContent(icon.image, "Open settiings"); 55 | if (GUI.Button(rect_settings, content, style)) 56 | { 57 | SettingsService.OpenProjectSettings("Project/App Auto Builder"); 58 | } 59 | 60 | using var disablescop = new EditorGUI.DisabledGroupScope(isBuilding); 61 | using var scope = new EditorGUI.ChangeCheckScope(); 62 | using (new GUILayout.VerticalScope()) 63 | { 64 | EditorGUILayout.PropertyField(appLocationPath); 65 | GUILayout.Space(8); 66 | using (var scroll = new GUILayout.ScrollViewScope(pos)) 67 | { 68 | EditorGUILayout.PropertyField(profiles); 69 | pos = scroll.scrollPosition; 70 | } 71 | EditorGUILayout.Space(); 72 | using (var hr = new EditorGUILayout.HorizontalScope(GUI.skin.box)) 73 | { 74 | GUILayout.FlexibleSpace(); 75 | var color = GUI.color; 76 | GUI.color = new Color32(127, 214, 253, 255); 77 | build_content.text = isBuilding ? "打包中..." : "打包"; 78 | if (GUILayout.Button(build_content, GUILayout.Height(36), GUILayout.Width(120))) 79 | { 80 | BuildPlayer(config); 81 | GUIUtility.ExitGUI(); 82 | } 83 | GUI.color = color; 84 | GUILayout.FlexibleSpace(); 85 | } 86 | } 87 | if (scope.changed) 88 | { 89 | serializedObject.ApplyModifiedProperties(); 90 | } 91 | } 92 | 93 | 94 | /// 95 | /// 配置校验,如果配置不对不打包 96 | /// 97 | /// 98 | static void ValidateProfiles(AutoBuildConfiguration config) 99 | { 100 | if (string.IsNullOrEmpty(config.appLocationPath)) 101 | { 102 | throw new Exception("应用打包存储路径未指定!"); 103 | } 104 | if (config.profiles.Any(v => string.IsNullOrEmpty(v.productName))) 105 | { 106 | throw new Exception("配置中存在软件名称为空的情况,请修复!"); 107 | } 108 | if (config.profiles.Any(v => v.platform == Platform.None)) 109 | { 110 | throw new Exception("配置中存在打包平台未指定的情况,请修复!"); 111 | } 112 | if (config.profiles.All(v => !v.isBuild)) 113 | { 114 | throw new Exception("请至少保证一个打包的配置 isBuild = true"); 115 | } 116 | 117 | foreach (var profile in config.profiles) 118 | { 119 | if (profile.isBuild) 120 | { 121 | if (profile.scenes.Count == 0) 122 | { 123 | throw new Exception($"请至少给 {profile.productName} 一个场景!"); 124 | } 125 | if (profile.scenes.Any(v => !v.scene)) 126 | { 127 | throw new Exception("场景列表请不要留空!"); 128 | } 129 | if (profile.scenes.All(v => !v.enabled)) 130 | { 131 | throw new Exception($"{profile.productName} 场景列表请至少勾选一个场景!"); 132 | } 133 | } 134 | } 135 | // 不可以存在相同的 Profile , 约定:ProductName 、 Platform 以及 sublocation 完全相同代表重复 136 | var groups = config.profiles.GroupBy(v => new { v.productName, v.platform, v.saveLocation }); 137 | foreach (var group in groups) 138 | { 139 | if (group.Count() > 1) 140 | { 141 | throw new Exception($"{group.Key.productName} 配置重复,至少 SubLocation 要不同!"); 142 | } 143 | } 144 | 145 | // 检查自定义任务校验函数是否通过 146 | foreach (var profile in config.profiles) 147 | { 148 | foreach (var task in profile.customTask) 149 | { 150 | if (task.enabled && !task.task.Validate()) 151 | { 152 | throw new Exception($"{profile.productName} 的 {task.task.name} 任务校验失败!"); 153 | } 154 | } 155 | } 156 | } 157 | 158 | static async void BuildPlayer(AutoBuildConfiguration config) 159 | { 160 | ValidateProfiles(config); 161 | var profiles = SortProfiles(config); 162 | isBuilding = true; 163 | 164 | foreach (var profile in profiles) 165 | { 166 | if (profile.isBuild) 167 | { 168 | var tasks = profile.customTask.Where(v => v.enabled) 169 | .Select(v => v.task) 170 | .Where(v => v.taskType == TaskType.PreBuild) 171 | .OrderBy(v => v.priority); 172 | var args = string.Empty; 173 | foreach (var item in tasks) 174 | { 175 | if (item) 176 | { 177 | Debug.Log($"执行 {item.name} PreBuild 任务"); 178 | // 支持将上一个任务的结果传递给下一个任务 179 | args = await item.RunAsync(args); 180 | } 181 | else 182 | { 183 | Debug.LogError($"{nameof(AutoBuilder)}: Custom Task is Missing!"); 184 | } 185 | } 186 | 187 | var scenes = new List(); 188 | foreach (var scene in profile.scenes) 189 | { 190 | if (scene.enabled) 191 | { 192 | var path = AssetDatabase.GetAssetPath(scene.scene); 193 | scenes.Add(new EditorBuildSettingsScene(path, true)); 194 | } 195 | } 196 | var options = Enum.GetNames(typeof(BuildOptionsLit)); 197 | var options_unity = BuildOptions.None; 198 | foreach (var item in options) 199 | { 200 | var op = (BuildOptionsLit)Enum.Parse(typeof(BuildOptionsLit), item); 201 | if (profile.buildOptions.HasFlag(op)) 202 | { 203 | var op_unity = (BuildOptions)Enum.Parse(typeof(BuildOptions), item); 204 | options_unity |= op_unity; 205 | } 206 | } 207 | var location = FormatPathToFullName(config.appLocationPath); 208 | var dir = Path.Combine(location, profile.saveLocation); 209 | if (!Directory.Exists(dir)) 210 | { 211 | Directory.CreateDirectory(dir); 212 | } 213 | var buildTarget = (BuildTarget)(int)profile.platform; 214 | 215 | var ext = buildTarget switch 216 | { 217 | BuildTarget.StandaloneWindows => ".exe", 218 | BuildTarget.StandaloneWindows64 => ".exe", 219 | BuildTarget.Android => ".apk", 220 | _ => string.Empty 221 | }; 222 | var file = $"{dir}/{profile.productName}{ext}"; 223 | PlayerSettings.productName = profile.productName; 224 | PlayerSettings.bundleVersion = profile.productVersion; 225 | EditorPrefs.SetBool("BuildByAutoBuilder", true); 226 | var report = BuildPipeline.BuildPlayer(scenes.ToArray(), file, buildTarget, options_unity); 227 | Debug.Log($"{profile.productName} 打包结果:{report.summary.result}"); 228 | } 229 | } 230 | } 231 | 232 | #region Assitant Fucntions 233 | /// 234 | /// 按 activeBuildTarget 最先打包,其他的按 platform 非乱序打包 235 | /// 236 | private static List SortProfiles(AutoBuildConfiguration config) 237 | { 238 | var list = new List(); 239 | // 抽离出需要打包的配置 240 | var profiles = config.profiles.Where(v => v.isBuild).ToList(); 241 | // 找到当前 activebuildtarget 对应的所有配置 242 | var actived_profiles = profiles.FindAll(v => v.platform == (Platform)(int)EditorUserBuildSettings.activeBuildTarget); 243 | if (actived_profiles != null) 244 | { 245 | list.AddRange(actived_profiles); 246 | } 247 | // 对其他配置进行排序,保证不乱序即可 248 | var other_profiles = profiles.FindAll(v => v.platform != (Platform)(int)EditorUserBuildSettings.activeBuildTarget); 249 | if (other_profiles != null) 250 | { 251 | other_profiles.Sort((a, b) => b.platform.CompareTo(a.platform)); 252 | list.AddRange(other_profiles); 253 | } 254 | return list; 255 | } 256 | private static string FormatPathToFullName(string stringValue) 257 | { 258 | if (string.IsNullOrEmpty(stringValue)) 259 | { 260 | return $"{assetsDirInfo.Parent.FullName}/{fallbackPath}"; 261 | } 262 | if (stringValue.StartsWith("./")) 263 | { 264 | stringValue = stringValue.Replace("./", $"{assetsDirInfo.Parent.FullName}/"); 265 | } 266 | return stringValue; 267 | } 268 | #endregion 269 | 270 | #region Callbacks 271 | [PostProcessBuild] 272 | static async void OnPostProcessBuild(BuildTarget target, string output) 273 | { 274 | var buildByAutoBuilder = EditorPrefs.GetBool("BuildByAutoBuilder"); 275 | if (!buildByAutoBuilder) 276 | { 277 | return; 278 | } 279 | // reset the flag 280 | EditorPrefs.DeleteKey("BuildByAutoBuilder"); 281 | config ??= AutoBuildConfiguration.LoadOrCreate(); 282 | var productname = Path.GetFileNameWithoutExtension(output); 283 | var profile = config.profiles.FirstOrDefault(v => v.productName == productname && v.platform == (Platform)target && v.isBuild); 284 | if (null != profile) 285 | { 286 | var tasks = profile.customTask.Where(v => v.enabled && v.task.taskType == TaskType.PostBuild) 287 | .Select(v => v.task) 288 | .OrderBy(v => v.priority); 289 | var param = output; 290 | foreach (var item in tasks) 291 | { 292 | if (item) 293 | { 294 | Debug.Log($"执行{item.name} PostBuild 任务"); 295 | param = await item.RunAsync(param); 296 | } 297 | else 298 | { 299 | Debug.LogError($"{nameof(AutoBuilder)}: Custom Task is Missing!"); 300 | } 301 | } 302 | } 303 | else 304 | { 305 | Debug.LogError($"{nameof(AutoBuilder)}: 找不到 {output} 的配置\nproductName = {productname}"); 306 | } 307 | // 打包结束 window 实例会被销毁,所以这里需要重新获取 308 | window = GetWindow(typeof(AutoBuilder)); 309 | window.ShowNotification(new GUIContent("打包结束,请确认是否打包成功!")); 310 | Debug.Log($" 打包结束,可通过控制台确认所有打包结果"); 311 | isBuilding = false; 312 | } 313 | #endregion 314 | 315 | #region Private Fields 316 | static AutoBuildConfiguration config; 317 | GUIContent build_content = new GUIContent("打包", "点击将按上述配置依次进行打包!"); 318 | SerializedObject serializedObject; 319 | SerializedProperty appLocationPath; 320 | SerializedProperty profiles; 321 | Vector2 pos = Vector2.zero; 322 | public const string fallbackPath = "Build"; 323 | public static DirectoryInfo assetsDirInfo; 324 | private static bool isBuilding; 325 | #endregion 326 | 327 | #region Assistance Type 328 | [Serializable] 329 | public class Version 330 | { 331 | public string version; 332 | } 333 | #endregion 334 | } 335 | } -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/AutoBuilder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 005494f81eca26d4a96d6bf5b10682be 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Data.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fce79a2825f66db44a21088ad34e4baa 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Data/AutoBuildConfiguration.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.IO; 3 | using UnityEditor; 4 | using UnityEngine; 5 | namespace zFramework.AppBuilder 6 | { 7 | public class AutoBuildConfiguration : ScriptableObject 8 | { 9 | [OpenFolder, Header("保存路径(Root)")] 10 | public string appLocationPath; 11 | [Header("软件出包配置")] 12 | public List profiles; 13 | 14 | public static AutoBuildConfiguration LoadOrCreate() 15 | { 16 | var file = "Assets/AutoBuilder/AutoBuildConfiguration.asset"; 17 | var config = AssetDatabase.LoadAssetAtPath(file); 18 | if (!config) 19 | { 20 | config = CreateInstance(); 21 | var dir = new DirectoryInfo(file); 22 | if (!dir.Parent.Exists) 23 | { 24 | dir.Parent.Create(); 25 | } 26 | AssetDatabase.CreateAsset(config, file); 27 | AssetDatabase.SaveAssets(); 28 | } 29 | return config; 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Data/AutoBuildConfiguration.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a60e37a9482c0b94e80647dc2c0222c7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Data/BuildOptionsLit.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace zFramework.AppBuilder 4 | { 5 | [Flags] 6 | public enum BuildOptionsLit 7 | { 8 | Development = 0x01, 9 | AutoRunPlayer = 0x02, 10 | ShowBuiltPlayer = 0x04, 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Data/BuildOptionsLit.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fa7e30d3417401843b5033e6ec3e66c2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Data/BuildProfiles.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | namespace zFramework.AppBuilder 5 | { 6 | [Serializable] 7 | public class BuildProfiles 8 | { 9 | [Header("应用名称:")] 10 | public string productName; 11 | [Header("是否出包:")] 12 | public bool isBuild; 13 | [Header("打包平台")] 14 | public Platform platform; 15 | [Header("保存路径(Sub)"),ShowInExplorer] 16 | public string saveLocation; 17 | [Header("软件版本:(形如:1.0.0)")] 18 | public string productVersion; 19 | [Header("构建可选项:"), EnumFlags] 20 | public BuildOptionsLit buildOptions; 21 | [Header("场景列表:不勾选不打包,注意排序")] 22 | public List scenes; 23 | [Header("用户自定义任务")] 24 | public List customTask; 25 | 26 | } 27 | } -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Data/BuildProfiles.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6ad6e47c243002744a18bcb5d99d076b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Data/NsiResolver.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Linq; 4 | using System.Text; 5 | using UnityEngine; 6 | namespace zFramework.Extension 7 | { 8 | [Serializable] 9 | public class NsiResolver 10 | { 11 | [Header("是否启用?")] 12 | public bool enable; 13 | [Header("App 信息:")] 14 | public string appName; 15 | public string appVersion; 16 | public string startMenuFolder; 17 | public string appInstallDir; 18 | public string outputFileName; 19 | public string installerOutputPath; 20 | [Header("版权信息:")] 21 | public string publisher; 22 | public string website; 23 | public string brandingText; 24 | [Header("内嵌组件:")] 25 | public Component[] components; 26 | [Header("多语言")] 27 | public string[] languages = new[] { "SimpChinese" }; 28 | [Header("快捷方式:")] 29 | public Shotcut[] shotcuts; 30 | public string OutputFileLocation { get; private set; } 31 | 32 | 33 | public string Process(string output) 34 | { 35 | string exeEntry = Directory.GetFiles(output, "*.exe").Where(x => !x.StartsWith("UnityCrashHandler")).FirstOrDefault(); 36 | if (string.IsNullOrEmpty(exeEntry)) 37 | { 38 | throw new FileNotFoundException("Can not find exe file in output folder"); 39 | } 40 | 41 | if (Directory.Exists(installerOutputPath) == false) 42 | { 43 | Directory.CreateDirectory(installerOutputPath); 44 | } 45 | 46 | appInstallDir = appInstallDir.Replace("/", "\\"); 47 | var outputFileName = this.outputFileName.Replace("${PRODUCT_VERSION}", appVersion); 48 | 49 | OutputFileLocation = Path.Combine(installerOutputPath, outputFileName); 50 | // .nsi 文件存放在与输出目录同级目录下 51 | string nsiFilePath = Path.Combine(installerOutputPath, $"{outputFileName[..^4]}.nsi"); 52 | 53 | string exeName = Path.GetFileName(exeEntry); 54 | var nsiBuilder = new StringBuilder(DefaultNsisScript); 55 | nsiBuilder.Replace("#Name#", appName) 56 | .Replace("#Version#", appVersion) 57 | .Replace("#ExeName#", exeName) 58 | .Replace("#InstallDir#", appInstallDir) 59 | .Replace("#OutputFileName#", OutputFileLocation) 60 | .Replace("#Publisher#", publisher) 61 | .Replace("#WebSite#", website) 62 | .Replace("#BrandingText#", brandingText) 63 | .Replace("#OriginDir#", output) 64 | .Replace("#StartMenuDir#", startMenuFolder) 65 | .Replace("#OutputDir#", installerOutputPath); // 生成的安装程序输出目录 66 | 67 | // 多语言 68 | string lang = string.Join("\n", languages.Select(x => $"!insertmacro MUI_LANGUAGE \"{x}\"")); 69 | nsiBuilder.Replace("#Languate#", lang); 70 | 71 | // 构建快捷方式 72 | StringBuilder sb_add = new(), sb_remove = new(); 73 | foreach (var shotcut in shotcuts) 74 | { 75 | string args = string.IsNullOrEmpty(shotcut.args) ? string.Empty : $" \"{shotcut.args}\""; 76 | sb_add.AppendLine($"CreateShortCut \"$SMPROGRAMS\\{startMenuFolder}\\{shotcut.name}.lnk\" \"$INSTDIR\\{exeName}\"{args}"); 77 | sb_add.AppendLine($"CreateShortCut \"$DESKTOP\\{shotcut.name}.lnk\" \"$INSTDIR\\{exeName}\"{args}"); 78 | sb_remove.AppendLine($"Delete \"$SMPROGRAMS\\{startMenuFolder}\\{shotcut.name}.lnk\""); 79 | sb_remove.AppendLine($"Delete \"$DESKTOP\\{shotcut.name}.lnk\""); 80 | } 81 | nsiBuilder.Replace("#AddedShotcut#", sb_add.ToString()) 82 | .Replace("#RemovedShotcut#", sb_remove.ToString()); 83 | 84 | // 处理组件 85 | var idx = 2; //从 SEC02 开始 86 | StringBuilder sb = new(); 87 | foreach (var component in components) 88 | { 89 | if (!component.enable) 90 | { 91 | continue; 92 | } 93 | var SEC = $"SEC{(idx > 9 ? $"{idx}" : $"0{idx}")}"; 94 | idx++; 95 | sb.AppendLine($"Section \"{component.sectionName}\" {SEC}"); 96 | sb.AppendLine($" SetOutPath \"$TEMP\""); 97 | sb.AppendLine($" SetOverwrite ifnewer"); 98 | sb.AppendLine($" File \"{component.filePath}\""); 99 | sb.AppendLine($" ExecWait '\"$TEMP\\{Path.GetFileName(component.filePath)}\" {component.args}' $0"); 100 | sb.AppendLine($" DetailPrint \"{Path.GetFileName(component.filePath)} $R0 return $0\""); 101 | sb.AppendLine($" IntCmp $0 3 InstallSuccess InstallSuccess InstallError"); 102 | sb.AppendLine($" InstallError:"); 103 | sb.AppendLine($" ; TODO"); 104 | sb.AppendLine($" Quit"); 105 | sb.AppendLine($" InstallSuccess:"); 106 | sb.AppendLine($" ; TODO"); 107 | sb.AppendLine($"SectionEnd"); 108 | sb.AppendLine(); 109 | } 110 | nsiBuilder.Replace("#Components#", sb.ToString()); 111 | File.WriteAllText(nsiFilePath, nsiBuilder.ToString(), Encoding.GetEncoding("GB2312")); 112 | return nsiFilePath; 113 | } 114 | 115 | readonly string DefaultNsisScript = @"; 该脚本使用 App Auto Builder 生成 116 | ; 安装程序初始定义常量 117 | !define PRODUCT_NAME ""#Name#"" 118 | !define PRODUCT_VERSION ""#Version#"" 119 | !define PRODUCT_PUBLISHER ""#Publisher#"" 120 | !define PRODUCT_WEB_SITE ""#WebSite#"" 121 | !define PRODUCT_DIR_REGKEY ""Software\Microsoft\Windows\CurrentVersion\App Paths\#ExeName#"" 122 | !define PRODUCT_UNINST_KEY ""Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"" 123 | !define PRODUCT_UNINST_ROOT_KEY ""HKLM"" 124 | 125 | SetCompressor lzma 126 | 127 | ; ------ MUI 现代界面定义 (1.67 版本以上兼容) ------ 128 | !include ""MUI.nsh"" 129 | 130 | ; MUI 预定义常量 131 | !define MUI_ABORTWARNING 132 | !define MUI_ICON ""${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"" 133 | !define MUI_UNICON ""${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"" 134 | 135 | ; 欢迎页面 136 | !insertmacro MUI_PAGE_WELCOME 137 | ; 安装目录选择页面 138 | !insertmacro MUI_PAGE_DIRECTORY 139 | ; 安装过程页面 140 | !insertmacro MUI_PAGE_INSTFILES 141 | ; 安装完成页面 142 | !define MUI_FINISHPAGE_RUN ""$INSTDIR\#ExeName#"" 143 | !insertmacro MUI_PAGE_FINISH 144 | 145 | ; 安装卸载过程页面 146 | !insertmacro MUI_UNPAGE_INSTFILES 147 | 148 | ; 安装界面包含的语言设置 149 | #Languate# 150 | 151 | ; 安装预释放文件 152 | !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS 153 | ; ------ MUI 现代界面定义结束 ------ 154 | 155 | Name ""${PRODUCT_NAME} v${PRODUCT_VERSION}"" 156 | !system 'mkdir ""#OutputDir#""' 157 | OutFile ""#OutputFileName#"" 158 | InstallDir ""$PROGRAMFILES\#InstallDir#"" 159 | InstallDirRegKey HKLM ""${PRODUCT_UNINST_KEY}"" ""UninstallString"" 160 | ShowInstDetails show 161 | ShowUnInstDetails show 162 | BrandingText ""#BrandingText#"" 163 | 164 | ; 程序以管理员权限运行 165 | RequestExecutionLevel admin 166 | 167 | Section ""runas"" 168 | ;针对当前用户有效 169 | WriteRegStr HKCU ""SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"" ""$INSTDIR\#ExeName#"" ""RUNASADMIN"" 170 | ;针对所有用户有效 171 | WriteRegStr HKEY_LOCAL_MACHINE ""SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"" ""$INSTDIR\#ExeName#"" ""RUNASADMIN"" 172 | SectionEnd 173 | 174 | Section ""MainSection"" SEC01 175 | SetOutPath ""$INSTDIR"" 176 | SetOverwrite ifnewer 177 | File /r ""#OriginDir#\*.*"" 178 | 179 | ; shotcut 创建 180 | CreateDirectory ""$SMPROGRAMS\#StartMenuDir#"" 181 | #AddedShotcut# 182 | SectionEnd 183 | 184 | ; 组件 185 | #Components# 186 | 187 | Section -AdditionalIcons 188 | WriteIniStr ""$INSTDIR\${PRODUCT_NAME}.url"" ""InternetShortcut"" ""URL"" ""${PRODUCT_WEB_SITE}"" 189 | CreateShortCut ""$SMPROGRAMS\#StartMenuDir#\Website.lnk"" ""$INSTDIR\${PRODUCT_NAME}.url"" 190 | CreateShortCut ""$SMPROGRAMS\#StartMenuDir#\Uninstall.lnk"" ""$INSTDIR\uninst.exe"" 191 | SectionEnd 192 | 193 | Section -Post 194 | WriteUninstaller ""$INSTDIR\uninst.exe"" 195 | WriteRegStr HKLM ""${PRODUCT_DIR_REGKEY}"" """" ""$INSTDIR\#ExeName#"" 196 | WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} ""${PRODUCT_UNINST_KEY}"" ""DisplayName"" ""$(^Name)"" 197 | WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} ""${PRODUCT_UNINST_KEY}"" ""UninstallString"" ""$INSTDIR\uninst.exe"" 198 | WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} ""${PRODUCT_UNINST_KEY}"" ""DisplayIcon"" ""$INSTDIR\#ExeName#"" 199 | WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} ""${PRODUCT_UNINST_KEY}"" ""DisplayVersion"" ""${PRODUCT_VERSION}"" 200 | WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} ""${PRODUCT_UNINST_KEY}"" ""URLInfoAbout"" ""${PRODUCT_WEB_SITE}"" 201 | WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} ""${PRODUCT_UNINST_KEY}"" ""Publisher"" ""${PRODUCT_PUBLISHER}"" 202 | SectionEnd 203 | 204 | /****************************** 205 | * 以下是安装程序的卸载部分 * 206 | ******************************/ 207 | 208 | Section Uninstall 209 | Delete ""$INSTDIR\${PRODUCT_NAME}.url"" 210 | Delete ""$INSTDIR\uninst.exe"" 211 | Delete ""$SMPROGRAMS\#StartMenuDir#\Uninstall.lnk"" 212 | Delete ""$SMPROGRAMS\#StartMenuDir#\Website.lnk"" 213 | 214 | #RemovedShotcut# 215 | 216 | RMDir ""$SMPROGRAMS\#StartMenuDir#"" 217 | RMDir /r ""$INSTDIR"" 218 | 219 | DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} ""${PRODUCT_UNINST_KEY}"" 220 | DeleteRegKey HKLM ""${PRODUCT_DIR_REGKEY}"" 221 | SetAutoClose true 222 | SectionEnd 223 | 224 | #-- 根据 NSIS 脚本编辑规则,所有 Function 区段必须放置在 Section 区段之后编写,以避免安装程序出现未可预知的问题。--# 225 | 226 | Function un.onInit 227 | MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 ""您确实要完全移除 $(^Name) ,及其所有的组件?"" IDYES +2 228 | Abort 229 | FunctionEnd 230 | 231 | Function un.onUninstSuccess 232 | HideWindow 233 | MessageBox MB_ICONINFORMATION|MB_OK ""$(^Name) 已成功地从您的计算机移除。"" 234 | FunctionEnd 235 | "; 236 | 237 | #region Assistance Type 238 | /// 239 | /// 第三方组件默认释放到 Temp 目录下,并使用 args 参数进行安装 240 | /// 241 | [Serializable] 242 | public class Component 243 | { 244 | /// 245 | /// 启用与否 246 | /// 247 | public bool enable; 248 | /// 249 | /// 章节/分段名称 250 | /// 251 | public string sectionName; 252 | /// 253 | /// 文件路径 254 | /// 255 | public string filePath; 256 | /// 257 | /// 安装参数,如果不想看见安装界面,请指定对应静默安装参数 258 | /// 259 | public string args; 260 | } 261 | 262 | [Serializable] 263 | public class Shotcut 264 | { 265 | public string name; 266 | public string args; // 根据上下文自动获取、 自动拼接到目标程序后面 267 | } 268 | #endregion 269 | } 270 | } 271 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Data/NsiResolver.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8bc43ba72efbbcf4f8ff047e5e8a405f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Data/Platform.cs: -------------------------------------------------------------------------------- 1 | namespace zFramework.AppBuilder 2 | { 3 | public enum Platform 4 | { 5 | None = 0, 6 | Windows = 5, 7 | Windows64 = 19, 8 | Android = 13, 9 | IOS = 9, 10 | MacOS = 2, 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Data/Platform.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3f79035ce0fa253408bb9180967fe576 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Data/SceneInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEditor; 3 | namespace zFramework.AppBuilder 4 | { 5 | [Serializable] 6 | public class SceneInfo 7 | { 8 | public SceneAsset scene; 9 | public bool enabled; 10 | } 11 | } -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Data/SceneInfo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 95fd11d85e3e5f648b32b1b662ec1f38 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Data/TaskInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | namespace zFramework.AppBuilder 3 | { 4 | [Serializable] 5 | public class TaskInfo 6 | { 7 | public bool enabled; 8 | public BaseTask task; 9 | } 10 | } -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Data/TaskInfo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1db010ffbb12b314e851eecd7462f680 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Data/TaskType.cs: -------------------------------------------------------------------------------- 1 | namespace zFramework.AppBuilder 2 | { 3 | /// 4 | /// 任务类型 5 | /// 6 | public enum TaskType 7 | { 8 | /// 9 | /// APP 构建前 10 | /// 11 | PreBuild, 12 | /// 13 | /// APP 构建完成后 14 | /// 15 | PostBuild 16 | } 17 | } -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Data/TaskType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d7cf98021ad14c645a90d5cb4e70d0b3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/GUI.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 467e8e3ad2a3beb438ef5004430adca8 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/GUI/BaseTaskEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | using UnityEngine; 3 | namespace zFramework.AppBuilder 4 | { 5 | [CustomEditor(typeof(BaseTask), true)] 6 | public class BaseTaskEditor : Editor 7 | { 8 | public BaseTask task; 9 | public GUIContent GUIContent = new GUIContent("Test Run Task", "测试用户任务,请务必对自己的操作有认知能力!"); 10 | public virtual void OnEnable() 11 | { 12 | task = (BaseTask)target; 13 | } 14 | 15 | string arg = string.Empty; 16 | public override void OnInspectorGUI() 17 | { 18 | DrawDefaultInspector(); 19 | using (var verticalScope = new EditorGUILayout.VerticalScope(EditorStyles.selectionRect)) 20 | { 21 | arg = EditorGUILayout.TextField("Args", arg); 22 | GUILayout.Space(4); 23 | var buttonRect = GUILayoutUtility.GetRect(GUIContent, GUI.skin.button, GUILayout.Height(24), GUILayout.Width(120)); 24 | buttonRect.x = (EditorGUIUtility.currentViewWidth - buttonRect.width) / 2; 25 | 26 | if (GUI.Button(buttonRect, GUIContent)) 27 | { 28 | async void InternalTask() 29 | { 30 | var output = await task.RunAsync(arg); 31 | if (!string.IsNullOrEmpty(output)) 32 | { 33 | Debug.Log(output); 34 | } 35 | } 36 | InternalTask(); 37 | } 38 | } 39 | DrawHelpbox(task); 40 | } 41 | 42 | public void DrawHelpbox(BaseTask task) 43 | { 44 | if (!string.IsNullOrEmpty(task.Description)) 45 | { 46 | EditorGUILayout.HelpBox(task.Description, MessageType.Info); 47 | } 48 | } 49 | 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/GUI/BaseTaskEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 51475f4d672f13340a1f475f5de53b89 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/GUI/BuildProfilesDrawer.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | using UnityEngine; 3 | namespace zFramework.AppBuilder 4 | { 5 | [CustomPropertyDrawer(typeof(BuildProfiles))] 6 | public class BuildProfilesDrawer : PropertyDrawer 7 | { 8 | public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) 9 | { 10 | // begin drawer property 11 | var label_p = EditorGUI.BeginProperty(position, label, property); 12 | 13 | // draw a foldout 14 | var rect_foldout = position; 15 | rect_foldout.height = EditorGUIUtility.singleLineHeight; 16 | Rect rect_buildstate = rect_foldout; 17 | // 当此 so 在 editorwindow 中被加载,需要向左缩进 10 18 | if (!EditorGUIUtility.hierarchyMode) 19 | { 20 | rect_foldout.xMin -= 12; 21 | } 22 | // 将 platform 绘制成 label 后缀 ,例如:OneApp(Windows64) 23 | var platform = property.FindPropertyRelative("platform"); 24 | var appname = property.FindPropertyRelative("productName").stringValue; 25 | var label_platform = $"{appname}({platform.enumDisplayNames[platform.enumValueIndex]})"; 26 | label_p.text = label_platform; 27 | 28 | // 将 isbuild 绘制在 foldout 右侧,靠右对齐 29 | rect_buildstate.x = position.width - 60; 30 | rect_buildstate.width = 100; 31 | var isbuild = property.FindPropertyRelative("isBuild"); 32 | var label_isbuild = $"Need be build {(isbuild.boolValue && platform.enumValueIndex != 0 ? "" : "×")}"; 33 | var cached = GUI.skin.label.richText; 34 | GUI.skin.label.richText = true; 35 | GUI.Label(rect_buildstate, label_isbuild); 36 | GUI.skin.label.richText = cached; 37 | 38 | property.isExpanded = EditorGUI.Foldout(rect_foldout, property.isExpanded, label_p, EditorStyles.boldFont); 39 | if (!property.isExpanded) 40 | { 41 | EditorGUI.EndProperty(); 42 | return; 43 | } 44 | 45 | 46 | //local function for draw a serialized property 47 | bool DrawProperty(ref Rect rect, string propertyName) 48 | { 49 | var prop = property.FindPropertyRelative(propertyName); 50 | rect.y += rect.height; 51 | rect.height = EditorGUI.GetPropertyHeight(prop); 52 | return EditorGUI.PropertyField(rect, prop, true); 53 | } 54 | Rect rect = position; 55 | rect.height = EditorGUIUtility.singleLineHeight; // skip foldout 56 | DrawProperty(ref rect, "productName"); // draw productName 57 | DrawProperty(ref rect, "isBuild"); // draw isBuild 58 | DrawProperty(ref rect, "platform"); // draw platform 59 | DrawProperty(ref rect, "saveLocation"); // draw saveLocation 60 | DrawProperty(ref rect, "productVersion"); // draw productVersion 61 | DrawProperty(ref rect, "buildOptions"); // draw buildOptions 62 | DrawProperty(ref rect, "scenes"); // draw scenes 63 | DrawProperty(ref rect, "customTask"); // draw customTask 64 | 65 | EditorGUI.EndProperty(); // end drawer property 66 | } 67 | 68 | public override float GetPropertyHeight(SerializedProperty property, GUIContent label) 69 | { 70 | if (!property.isExpanded) 71 | { 72 | return EditorGUIUtility.singleLineHeight; 73 | } 74 | var height = EditorGUI.GetPropertyHeight(property); 75 | return height; 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/GUI/BuildProfilesDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6c7b18754779c0649a88a7d0a01e291d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/GUI/EnumFlagsAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEditor; 3 | using UnityEngine; 4 | 5 | namespace zFramework.AppBuilder 6 | { 7 | [AttributeUsage(AttributeTargets.Field, AllowMultiple = false)] 8 | public class EnumFlagsAttribute : PropertyAttribute { } 9 | 10 | [CustomPropertyDrawer(typeof(EnumFlagsAttribute))] 11 | public class EnumFlagsAttributeDrawer : PropertyDrawer 12 | { 13 | public override void OnGUI(Rect position, SerializedProperty prop, GUIContent label) 14 | { 15 | var typeAttr = attribute as EnumFlagsAttribute; 16 | label.text = label.text + "(" + prop.intValue + ")"; 17 | prop.intValue = DrawBitMaskField(position, prop.intValue, fieldInfo.FieldType, label); 18 | } 19 | //https://answers.unity.com/questions/393992/custom-inspector-multi-select-enum-dropdown.html 20 | public static int DrawBitMaskField(Rect aPosition, int aMask, System.Type aType, GUIContent aLabel) 21 | { 22 | var itemNames = Enum.GetNames(aType); 23 | var itemValues = Enum.GetValues(aType) as int[]; 24 | 25 | int val = aMask; 26 | int maskVal = 0; 27 | for (int i = 0; i < itemValues.Length; i++) 28 | { 29 | if (itemValues[i] != 0) 30 | { 31 | if ((val & itemValues[i]) == itemValues[i]) 32 | maskVal |= 1 << i; 33 | } 34 | else if (val == 0) 35 | maskVal |= 1 << i; 36 | } 37 | int newMaskVal = EditorGUI.MaskField(aPosition, aLabel, maskVal, itemNames); 38 | int changes = maskVal ^ newMaskVal; 39 | 40 | for (int i = 0; i < itemValues.Length; i++) 41 | { 42 | if ((changes & (1 << i)) != 0) // has this list item changed? 43 | { 44 | if ((newMaskVal & (1 << i)) != 0) // has it been set? 45 | { 46 | if (itemValues[i] == 0) // special case: if "0" is set, just set the val to 0 47 | { 48 | val = 0; 49 | break; 50 | } 51 | else 52 | val |= itemValues[i]; 53 | } 54 | else // it has been reset 55 | { 56 | val &= ~itemValues[i]; 57 | } 58 | } 59 | } 60 | return val; 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/GUI/EnumFlagsAttribute.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1a53e91796786c343997dcb04ed1e2d9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/GUI/OpenFolderAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using UnityEditor; 4 | using UnityEngine; 5 | namespace zFramework.AppBuilder 6 | { 7 | public class OpenFolderAttribute : PropertyAttribute { } 8 | [CustomPropertyDrawer(typeof(OpenFolderAttribute))] 9 | public class OpenFolderAttributeDrawer : PropertyDrawer 10 | { 11 | public override void OnGUI(Rect _position, SerializedProperty _property, GUIContent _lable) 12 | { 13 | var rect = new Rect(_position); 14 | rect.width -= 60; 15 | _property.stringValue = EditorGUI.TextField(rect, _property.displayName, _property.stringValue); 16 | var rect_bt = new Rect(_position); 17 | rect_bt.x = rect_bt.width - (EditorGUIUtility.hierarchyMode ? 44 : 54); 18 | rect_bt.width = 58; 19 | if (GUI.Button(rect_bt, content)) 20 | { 21 | var defaultpath = string.IsNullOrEmpty(_property.stringValue) ? $"{AutoBuilder.assetsDirInfo.Parent.FullName}/{AutoBuilder.fallbackPath}" : _property.stringValue; 22 | var path = EditorUtility.OpenFolderPanel("请选择路径", defaultpath, string.Empty); 23 | if (!string.IsNullOrEmpty(path)) 24 | { 25 | GUIUtility.keyboardControl = 0; 26 | _property.stringValue = FormatPathToRelative(path); 27 | } 28 | } 29 | } 30 | 31 | // 默认路径是当前工程目录内的 Build 文件夹 32 | // 如果用户选择的是当前工程的 Assets 文件夹,就报错并设置为上一次的值,如果上一次的值无意义,就设置为约定的默认值 33 | // 如果用户选择的路径是当前工程内的文件夹,就将其转换成相对路径,否则就是绝对路径 34 | // 序列化的是相对路径,这样方便多人合作. 35 | // 假设当前工程目录是 E:/UnityProjects/OneApp 36 | // ./Build => E:/UnityProjects/OneApp/Build 37 | // E:/UnityProjects/Output/OneApp => 不是当前项目子目录原样输出 38 | private string FormatPathToRelative(string stringValue) 39 | { 40 | if (string.IsNullOrEmpty(stringValue)) 41 | { 42 | Debug.LogWarning($"AutoBuilder: 路径为空,返回默认路径"); 43 | return $"./{AutoBuilder.fallbackPath}"; 44 | } 45 | var projectpath = AutoBuilder.assetsDirInfo.Parent.FullName; 46 | projectpath = projectpath.Replace("\\", "/").TrimEnd('/'); 47 | stringValue = stringValue.Replace("\\", "/").TrimEnd('/'); 48 | if (projectpath == stringValue) 49 | { 50 | Debug.LogWarning($"AutoBuilder: 路径工程根目录,返回默认路径"); 51 | return $"./{AutoBuilder.fallbackPath}"; 52 | } 53 | if (stringValue.StartsWith(projectpath)) 54 | { 55 | stringValue = stringValue.Replace(projectpath, "."); 56 | } 57 | if (stringValue.StartsWith("./Assets")) 58 | { 59 | Debug.LogWarning($"AutoBuilder: 路径不能在 Assets 目录内,返回默认路径"); 60 | return $"./{AutoBuilder.fallbackPath}"; 61 | } 62 | return stringValue; 63 | } 64 | 65 | GUIContent content = new GUIContent("选择", "选择打包的应用存储的文件夹"); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/GUI/OpenFolderAttribute.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0f7a1aab50390074382b36282fe79497 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/GUI/SceneInfoDrawer.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | namespace zFramework.AppBuilder 4 | { 5 | [CustomPropertyDrawer(typeof(SceneInfo))] 6 | public class SceneInfoDrawer : PropertyDrawer 7 | { 8 | GUIContent forenable = new GUIContent("", "是否将这个场景打包"); 9 | 10 | public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) 11 | { 12 | Rect r1 = position; 13 | r1.width = 20; 14 | Rect r2 = position; 15 | r2.xMin = r1.xMax + 10; 16 | EditorGUI.BeginProperty(position, label, property); 17 | EditorGUI.PropertyField(r1, property.FindPropertyRelative("enabled"), forenable); 18 | EditorGUI.PropertyField(r2, property.FindPropertyRelative("scene"), GUIContent.none); 19 | EditorGUI.EndProperty(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/GUI/SceneInfoDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ebcda77fb51e1204191cd3efc859865f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/GUI/ShowInExplorerAttribute.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using UnityEditor; 3 | using UnityEngine; 4 | namespace zFramework.AppBuilder 5 | { 6 | /// 7 | /// Show in explorer for a folder path 8 | /// 9 | public class ShowInExplorerAttribute : PropertyAttribute { } 10 | 11 | [CustomPropertyDrawer(typeof(ShowInExplorerAttribute))] 12 | public class ShowInExplorerAttributeDrawer : PropertyDrawer 13 | { 14 | GUIContent content = new GUIContent("Show", "Show in explorer"); 15 | public override void OnGUI(Rect _position, SerializedProperty _property, GUIContent _lable) 16 | { 17 | var rect = new Rect(_position); 18 | rect.width -= 62; 19 | _property.stringValue = EditorGUI.TextField(rect, _property.displayName, _property.stringValue); 20 | var rect_bt = new Rect(_position); 21 | rect_bt.x = rect_bt.xMax - (EditorGUIUtility.hierarchyMode ? 50 : 60); 22 | rect_bt.width = 58; 23 | if (GUI.Button(rect_bt, content)) 24 | { 25 | var defaultpath = _property.serializedObject.FindProperty("appLocationPath").stringValue; 26 | if (string.IsNullOrEmpty(defaultpath)) 27 | { 28 | //log warning 29 | Debug.LogWarning("Root Path is empty, please set root path first!"); 30 | return; 31 | } 32 | var subpath = _property.stringValue; 33 | var fullpath = Path.Combine(defaultpath, subpath); 34 | if (!Directory.Exists(fullpath)) 35 | { 36 | //log warning 37 | Debug.LogWarning("Path not exist, please build your app first !"); 38 | return; 39 | } 40 | // show in explorer 41 | EditorUtility.RevealInFinder(fullpath); 42 | } 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/GUI/ShowInExplorerAttribute.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 14364287715e30f46a19b88f518ec832 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/GUI/TaskInfoDrawer.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | namespace zFramework.AppBuilder 4 | { 5 | [CustomPropertyDrawer(typeof(TaskInfo))] 6 | public class TaskInfoDrawer : PropertyDrawer 7 | { 8 | GUIContent forenable = new GUIContent("", "是否启用这个任务"); 9 | GUIContent forbutton = new GUIContent("Properties", "打开任务的属性面板"); 10 | 11 | public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) 12 | { 13 | EditorGUI.BeginProperty(position, label, property); 14 | 15 | Rect r1 = position; 16 | r1.width = 20; 17 | EditorGUI.PropertyField(r1, property.FindPropertyRelative("enabled"), forenable); 18 | 19 | Rect r2 = position; 20 | r2.xMin = r1.xMax + 10; 21 | r2.width -= r1.width + 60; 22 | EditorGUI.PropertyField(r2, property.FindPropertyRelative("task"), GUIContent.none); 23 | 24 | //Draw a button on the right to open the properties panel of the task's scriptable object. 25 | Rect r3 = position; 26 | r3.xMin = r2.xMax + 10; 27 | if (GUI.Button(r3, forbutton, EditorStyles.miniButton)) 28 | { 29 | var task = property.FindPropertyRelative("task"); 30 | var taskobj = task.objectReferenceValue; 31 | if (taskobj != null) 32 | { 33 | EditorGUIUtility.PingObject(taskobj); 34 | Selection.activeObject = taskobj; 35 | #if UNITY_2020_2_OR_NEWER 36 | //open the properties panel of the task's scriptable object. 37 | EditorApplication.ExecuteMenuItem("Assets/Properties..."); 38 | #endif 39 | } 40 | } 41 | 42 | EditorGUI.EndProperty(); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/GUI/TaskInfoDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e44c6e0246870b6448cdbb5ad4702326 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Settings.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 504ab0bbce5468e4fb5e069a99cd8628 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Settings/AppAutoBuilderSettingProvider.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using System.IO; 4 | using UnityEditorInternal; 5 | using UnityEngine.UIElements; 6 | using UnityEditor.Presets; 7 | using static UnityEngine.GraphicsBuffer; 8 | using System; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace zFramework.AppBuilder 12 | { 13 | /// 14 | /// Settings provider for the AppAutoBuilder settings 15 | /// (accessible from Tools > App Auto Builder) 16 | /// Saves the settings in a json file in the ProjectSettings folder. 17 | /// 18 | public partial class AppAutoBuilderSettingProvider : SettingsProvider 19 | { 20 | const string aboutMessage = @"Unity 一键打包工具,适用于 频繁切换打包场景的情景,一劳永逸,一键打多个app ; 21 | Unity one-click packaging tool, suitable for scenarios where the packaging scene is frequently switched. One-time effort to package multiple apps with just one click."; 22 | const string repositoryLink = "https://github.com/Bian-Sh/Unity-Application-Auto-Builder"; 23 | 24 | static private AppAutoBuilderSettings settings; 25 | static SerializedObject serializedObject; 26 | 27 | private const string PATH = "Project/App Auto Builder"; 28 | private const string TITLE = "App Auto Builder"; 29 | const string SettingsPath = "ProjectSettings/AppAutoBuilderSettings.asset"; 30 | string version = "1.0.0"; 31 | 32 | public AppAutoBuilderSettingProvider() : base(PATH, SettingsScope.Project) 33 | { 34 | label = TITLE; 35 | } 36 | 37 | override public void OnActivate(string searchContext, VisualElement rootElement) 38 | { 39 | base.OnActivate(searchContext, rootElement); 40 | serializedObject = new SerializedObject(Settings); 41 | var path = AssetDatabase.GetAssetPath(MonoScript.FromScriptableObject(settings)); 42 | var jsonfile = Path.Combine(Path.GetDirectoryName(path), "..\\..", "package.json"); 43 | if (File.Exists(jsonfile)) 44 | { 45 | var json = File.ReadAllLines(jsonfile); 46 | // "version": "1.3.0", 47 | foreach (var line in json) 48 | { 49 | var str = line.Trim(); 50 | if (str.StartsWith("\"version\":")) 51 | { 52 | var arr = str.Split("\"", System.StringSplitOptions.RemoveEmptyEntries); 53 | version = arr[2]; 54 | break; 55 | } 56 | } 57 | } 58 | } 59 | 60 | public override void OnTitleBarGUI() 61 | { 62 | //draw a preset button here on the right title bar 63 | var icon = EditorGUIUtility.IconContent("d_Preset.Context"); 64 | var style = GUI.skin.GetStyle("IconButton"); 65 | var content = new GUIContent(icon.image, "Load or saving preset"); 66 | if (GUILayout.Button(content, style)) 67 | { 68 | var receiver = ScriptableObject.CreateInstance(); 69 | receiver.Init(settings, this); 70 | PresetSelector.ShowSelector(settings, null, true, receiver); 71 | } 72 | } 73 | 74 | /// 75 | /// GUI callback for drawing the settings provider GUI. 76 | /// 77 | /// The search context for the GUI. 78 | public override void OnGUI(string searchContext) 79 | { 80 | GUILayout.Space(10); 81 | if (serializedObject?.targetObject == null) 82 | { 83 | serializedObject = new SerializedObject(Settings); 84 | } 85 | // draw the settings GUI 86 | using var changescope = new EditorGUI.ChangeCheckScope(); 87 | serializedObject.Update(); 88 | var virboxExePath = serializedObject.FindProperty("virboxExePath"); 89 | var nsisExePath = serializedObject.FindProperty("nsisExePath"); 90 | var shouldKeepNsisFile = serializedObject.FindProperty("shouldKeepNsisFile"); 91 | 92 | GUILayout.Label("Virbox Exe Path:"); 93 | using (var horizontal = new EditorGUILayout.HorizontalScope()) 94 | { 95 | virboxExePath.stringValue = GUILayout.TextField(virboxExePath.stringValue); 96 | // button for open file dialog 97 | if (GUILayout.Button(openfiledilog, GUILayout.Width(30))) 98 | { 99 | var path = EditorUtility.OpenFilePanel("请选择 Virbox 命令行程序", "", "exe"); 100 | if (!string.IsNullOrEmpty(path)) 101 | { 102 | virboxExePath.stringValue = path; 103 | } 104 | } 105 | } 106 | GUILayout.Label("NSIS Exe Path:"); 107 | using (var horizontal = new EditorGUILayout.HorizontalScope()) 108 | { 109 | nsisExePath.stringValue = GUILayout.TextField(nsisExePath.stringValue); 110 | // button for open file dialog 111 | if (GUILayout.Button(openfiledilog, GUILayout.Width(30))) 112 | { 113 | var path = EditorUtility.OpenFilePanel("请选择 NSIS 命令行程序", "", "exe"); 114 | if (!string.IsNullOrEmpty(path)) 115 | { 116 | nsisExePath.stringValue = path; 117 | } 118 | } 119 | } 120 | // toggle right here for shouldKeepNsisFile 121 | shouldKeepNsisFile.boolValue = GUILayout.Toggle(shouldKeepNsisFile.boolValue, "Should Keep NSIS File"); 122 | 123 | 124 | if (changescope.changed) 125 | { 126 | serializedObject.ApplyModifiedProperties(); 127 | SaveSettings(); 128 | } 129 | // ABOUT 130 | GUILayout.BeginVertical(GUI.skin.box); 131 | GUILayout.Label(aboutMessage, EditorStyles.wordWrappedLabel); 132 | if (GUILayout.Button("More info: " + repositoryLink, EditorStyles.linkLabel)) Application.OpenURL(repositoryLink); 133 | GUILayout.EndVertical(); 134 | } 135 | 136 | public override void OnFooterBarGUI() 137 | { 138 | var style = new GUIStyle(EditorStyles.centeredGreyMiniLabel) 139 | { 140 | alignment = TextAnchor.MiddleRight, 141 | fontSize = 12, 142 | wordWrap = true 143 | }; 144 | GUILayout.Label($"Version {version}", style); 145 | } 146 | 147 | /// 148 | /// Loads the settings from the settings file or creates new default settings if the file doesn't exist. 149 | /// 150 | private static void LoadSettings() 151 | { 152 | string dir = Path.GetDirectoryName(SettingsPath); 153 | 154 | if (!Directory.Exists(dir)) 155 | { 156 | Directory.CreateDirectory(dir); 157 | } 158 | 159 | if (File.Exists(SettingsPath)) 160 | { 161 | var arr = InternalEditorUtility.LoadSerializedFileAndForget(SettingsPath); 162 | if (arr.Length > 0) 163 | { 164 | settings = (AppAutoBuilderSettings)arr[0]; 165 | } 166 | if (settings == null) 167 | { 168 | throw new InvalidDataException($"There was an error in the settings file,check this file : {SettingsPath}!"); 169 | } 170 | } 171 | else 172 | { 173 | settings = ScriptableObject.CreateInstance(); 174 | InternalEditorUtility.SaveToSerializedFileAndForget(new[] { settings }, SettingsPath, true); 175 | } 176 | } 177 | 178 | /// 179 | /// Saves the settings to the settings file. 180 | /// 181 | public void SaveSettings() => InternalEditorUtility.SaveToSerializedFileAndForget(new[] { settings }, SettingsPath, true); 182 | 183 | /// 184 | /// Gets the ExportProjectToZip settings (loads them if they are not loaded yet). 185 | /// 186 | public static AppAutoBuilderSettings Settings 187 | { 188 | get 189 | { 190 | if (settings == null) LoadSettings(); 191 | return settings; 192 | } 193 | } 194 | 195 | /// 196 | /// Creates the settings provider instance. 197 | /// 198 | /// The newly created SettingsProvider instance. 199 | [SettingsProvider] 200 | static public SettingsProvider CreateSettingsProvider() 201 | { 202 | return new AppAutoBuilderSettingProvider(); 203 | } 204 | 205 | internal static void ShowSettings() 206 | { 207 | SettingsService.OpenProjectSettings(PATH); 208 | } 209 | 210 | readonly GUIContent openfiledilog = new("···", "Open File Dialog"); 211 | 212 | } 213 | } 214 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Settings/AppAutoBuilderSettingProvider.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4fa8f7143b4df8642af25bb8221d0259 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Settings/AppAutoBuilderSettings.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | 4 | namespace zFramework.AppBuilder 5 | { 6 | [Serializable] 7 | public class AppAutoBuilderSettings : ScriptableObject 8 | { 9 | public string virboxExePath; 10 | public string nsisExePath; 11 | public bool shouldKeepNsisFile; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Settings/AppAutoBuilderSettings.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 34d20e123549b834386c15d8baefa566 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Settings/PresetReceiver.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | using UnityEditor.Presets; 3 | using UnityEngine; 4 | 5 | namespace zFramework.AppBuilder 6 | { 7 | public class PresetReceiver : PresetSelectorReceiver 8 | { 9 | private Object m_Target; 10 | private Preset m_InitialValue; 11 | private AppAutoBuilderSettingProvider provider; 12 | 13 | internal void Init(Object target, AppAutoBuilderSettingProvider provider) 14 | { 15 | m_Target = target; 16 | this.provider = provider; 17 | m_InitialValue = new Preset(target); 18 | } 19 | public override void OnSelectionChanged(Preset selection) 20 | { 21 | if (selection != null) 22 | { 23 | Undo.RecordObject(m_Target, "Apply Preset " + selection.name); 24 | selection.ApplyTo(m_Target); 25 | } 26 | else 27 | { 28 | Undo.RecordObject(m_Target, "Cancel Preset"); 29 | m_InitialValue.ApplyTo(m_Target); 30 | } 31 | provider.SaveSettings(); 32 | provider.Repaint(); 33 | } 34 | public override void OnSelectionClosed(Preset selection) 35 | { 36 | OnSelectionChanged(selection); 37 | Object.DestroyImmediate(this); 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Settings/PresetReceiver.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8c21546c30a7a1048838b37214300d9f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Task.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7b9f16012745a3d44943eba3953aa9df 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Task/BaseTask.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | using UnityEditor; 5 | using UnityEngine; 6 | namespace zFramework.AppBuilder 7 | { 8 | public class BaseTask : ScriptableObject 9 | { 10 | public TaskType taskType; 11 | public int priority; 12 | internal string Description; 13 | public virtual Task RunAsync(string output) 14 | { 15 | throw new System.NotImplementedException(); 16 | } 17 | 18 | /// 19 | /// 为避免运行后才发现错误,可以在这里进行一些预检查 20 | /// 21 | /// 22 | public virtual bool Validate() 23 | { 24 | return true; 25 | } 26 | 27 | #region Report task result 28 | // 报告任务结果,将 文件路径在控制台中使用 HyperLink 的方式显示,方便用户一键直达文件 Or 文件夹 29 | [InitializeOnLoadMethod] 30 | private static void Init() 31 | { 32 | #if UNITY_2021_1_OR_NEWER 33 | EditorGUI.hyperLinkClicked += OnLinkClicked; 34 | static void OnLinkClicked(EditorWindow ew, HyperLinkClickedEventArgs args) 35 | { 36 | if (args.hyperLinkData.TryGetValue("autobuilderresult", out var path)) 37 | { 38 | EditorUtility.RevealInFinder(path); 39 | } 40 | }; 41 | } 42 | #else 43 | var evt = typeof(EditorGUI).GetEvent("hyperLinkClicked", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic); 44 | if (evt != null) 45 | { 46 | var handler = Delegate.CreateDelegate(evt.EventHandlerType, typeof(BaseTask), nameof(OnLinkClicked)); 47 | evt.AddMethod.Invoke(null, new object[] { handler }); 48 | } 49 | } 50 | static void OnLinkClicked(object sender, EventArgs args) 51 | { 52 | var property = args.GetType().GetProperty("hyperlinkInfos", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public); 53 | if (property.GetValue(args) is Dictionary infos) 54 | { 55 | if (infos.TryGetValue("autobuilderresult", out var path)) 56 | { 57 | EditorUtility.RevealInFinder(path); 58 | } 59 | } 60 | } 61 | #endif 62 | 63 | public void ReportResult(string path, Func Prefixed = null) 64 | { 65 | var prefix = Prefixed?.Invoke(); 66 | Debug.Log($"{prefix}{path}"); 67 | } 68 | 69 | #endregion 70 | 71 | 72 | } 73 | } -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Task/BaseTask.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1fd1882d37479c94e950a4f0b7134224 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Task/FileOperationTask.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using UnityEngine; 3 | namespace zFramework.AppBuilder 4 | { 5 | // todo: add a task to operate files for copy, delete, move, rename, create, etc. 6 | // todo: 添加一个任务来操作文件,比如复制,删除,移动,重命名,创建等等 7 | [CreateAssetMenu(fileName = "FileOperationTask", menuName = "Auto Builder/Task/File Operation Task")] 8 | public class FileOperationTask : BaseTask 9 | { 10 | public override Task RunAsync(string output) 11 | { 12 | //hi guys,if you want to add a task to operate files, you can add it here. 13 | // 嗨,bro,如果你想添加一个操作文件的任务,你可以在这里添加。 14 | return Task.FromResult(string.Empty); 15 | } 16 | 17 | // enum of file operation type 18 | // 文件操作类型的枚举 19 | public enum OperationType 20 | { 21 | Copy, 22 | Delete, 23 | Move, 24 | Rename, 25 | Create, 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Task/FileOperationTask.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cb421993da967b548b1e180beb8723bb 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Task/FunctionExecuteTask.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reflection; 3 | using System.Threading.Tasks; 4 | using UnityEditor; 5 | using UnityEditor.SceneManagement; 6 | using UnityEngine; 7 | using Object = UnityEngine.Object; 8 | namespace zFramework.AppBuilder 9 | { 10 | // this is a simple example allow you to change some data inside of a scene before build 11 | // 这是一个简单的例子,允许你在构建前修改场景中的一些数据 12 | // for example, you have a method named Process in GameManager, you can fill it in. 13 | // 例如你有一个方法叫 Process 在 GameManager 中,你可以填入。 14 | 15 | [CreateAssetMenu(fileName = "FunctionTask", menuName = "Auto Builder/Task/Function Task")] 16 | 17 | public class FunctionExecuteTask : BaseTask 18 | { 19 | public SceneAsset scene; 20 | public MonoScript script; 21 | // 常规方法,比如 GameManager 中有 Process 方法 ,填入即可 22 | public string function; 23 | // 字段 args 是传入方法的参数,仅支持传入一个 string 或其他基础类型(请执行确认他们是否可以被 Convert.ChangeType 转换) 24 | public string args; 25 | SceneSetup[] previourScenes; 26 | 27 | private void OnEnable() 28 | { 29 | Description = @"方法执行任务非常的有用,可以在打包前或者打包后动态的修改指定场景中的变量并保存,PreBuild、PostBuild 配合使用可以使得修改只对指定的构建生效! 30 | The FunctionExecute Task is a highly useful tool that allows you to modify data within a scene both before and after building, and then save those changes. By using prebuild and postbuild wisely, you can make targeted modifications for specific builds."; 31 | } 32 | 33 | 34 | public override Task RunAsync(string output) 35 | { 36 | try 37 | { 38 | Debug.Log($"{nameof(FunctionExecuteTask)}: Run Function"); 39 | //如果用户指定场景,我们加载场景中的函数 40 | // 否则,我们加载的函数必须认定用户执行的是静态函数,如果函数不存在则会报错,但不会影响构建 41 | if (scene) 42 | { 43 | // Save current open Scene into previours scene list , for re-open 44 | previourScenes = EditorSceneManager.GetSceneManagerSetup(); 45 | // Open the scene 46 | var loadedScene = EditorSceneManager.OpenScene(AssetDatabase.GetAssetPath(scene)); 47 | // Get the type of the class 48 | var type = script.GetClass(); 49 | // Get the method 50 | var flag = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; 51 | var method = type.GetMethod(function, flag); 52 | // Get the instance of the class 53 | var instance = Object.FindObjectOfType(type); 54 | // 强转 参数类型 为 method 的参数类型 55 | if (method == null) 56 | { 57 | Debug.LogError($"{nameof(FunctionExecuteTask)}: {function} 方法不存在!"); 58 | return Task.FromResult(string.Empty); 59 | } 60 | var argtype = method.GetParameters()[0].ParameterType; 61 | var arg = Convert.ChangeType(this.args, argtype); 62 | 63 | // Invoke the method 64 | method.Invoke(instance, new object[] { arg }); 65 | EditorSceneManager.SaveScene(loadedScene); 66 | // Re-open previours scenes 67 | EditorSceneManager.RestoreSceneManagerSetup(previourScenes); 68 | } 69 | else 70 | { 71 | var type = script.GetClass(); 72 | var flag = BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic; 73 | var method = type.GetMethod(function, flag); 74 | if (method != null) 75 | { 76 | method.Invoke(null, new object[] { this.args }); 77 | } 78 | else 79 | { 80 | Debug.LogError($"{nameof(FunctionExecuteTask)}: 如果不指定场景,{function} 必须为静态方法!"); 81 | } 82 | } 83 | return Task.FromResult(string.Empty); 84 | } 85 | catch (Exception e) 86 | { 87 | Debug.LogError($"{nameof(FunctionExecuteTask)}: 执行方法失败! \n{e}"); 88 | return Task.FromResult(string.Empty); 89 | } 90 | } 91 | } 92 | } -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Task/FunctionExecuteTask.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 52e9e45d9227c494c932e29b162b0a3b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Task/NsisInstallerMakingTask.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using UnityEditor; 7 | using UnityEngine; 8 | using zFramework.AppBuilder; 9 | using zFramework.AppBuilder.Utils; 10 | namespace zFramework.Extension 11 | { 12 | /* 13 | // 以下时 Nsis 必要配置 14 | // 应用基础信息:名称;版本 ;注册表 App Paths;多语言 15 | // 公司、版权信息:公司名,主页,Branding Text (安装引导程序的左下角字样) 16 | // 应用安装时内含数据采集 与 快捷方式构建(需要自定义快捷方式参数) 17 | // 应用卸载时数据的删除(含快捷方式的移除) 18 | // 新增第三方应用以及调用参数 19 | // 约定:安装时会覆盖已有文件,卸载时会移除所有文件,所以,如有用户数据,请存储在非安装目录下!!!! 20 | // 约定:由于 Nsis 使用的路径是相对于 .nsi 文件的,为方便起见,.nsi 文件与要打包的文件夹放在同一目录下 21 | */ 22 | /// 23 | /// 这个任务通过 makensis.exe + .nsi 文件生成 Window 系统下的 exe 安装程序! 24 | /// 25 | [CreateAssetMenu(fileName = "Nsis Installer Making Task", menuName = "Auto Builder/Task/Nsis Installer Making Task")] 26 | public class NsisInstallerMakingTask : BaseTask 27 | { 28 | [Header("Nsi 列表:"), Tooltip("使用这种方式可以实现一个应用输出多个不同名称的安装包")] 29 | public List nsiResolvers; 30 | 31 | private void OnEnable() 32 | { 33 | taskType = TaskType.PostBuild; 34 | Description = "使用 makensis.exe 和 .nsi 文件生成 Windows 系统下的 exe 安装程序。Generate a Windows executable installer using makensis.exe and .nsi files."; 35 | } 36 | public override async Task RunAsync(string output) 37 | { 38 | var exePath = AppAutoBuilderSettingProvider.Settings.nsisExePath; 39 | if (string.IsNullOrEmpty(exePath) || !File.Exists(exePath)) 40 | { 41 | throw new ArgumentNullException("makensis.exe 路径不可用,请检查!"); 42 | } 43 | // 如果是文件,就使用其 Parent 文件夹 44 | if (File.Exists(output)) 45 | { 46 | output = Path.GetDirectoryName(output); 47 | } 48 | if (string.IsNullOrEmpty(output) || !Directory.Exists(output)) 49 | { 50 | throw new ArgumentNullException("output path is null or empty"); 51 | } 52 | totalResolver = nsiResolvers.Count(v => v.enable); 53 | currentResolver = 1; 54 | try 55 | { 56 | foreach (var nsiResolver in nsiResolvers) 57 | { 58 | if (!nsiResolver.enable) 59 | { 60 | continue; 61 | } 62 | var nsifile = nsiResolver.Process(output); 63 | 64 | currentInstallerName = Path.GetFileName(nsiResolver.outputFileName.Replace("${PRODUCT_VERSION}", nsiResolver.appVersion)); 65 | progressid = Progress.Start($"({currentResolver}/{totalResolver})编译安装包 {currentInstallerName} "); 66 | 67 | // 读取 output 目录下的所有文件相对路径并存放到 files 中,以便于编译时计算进度 68 | files.Clear(); 69 | count = 0; 70 | var root = new DirectoryInfo(output); 71 | foreach (var file in root.GetFiles("*", SearchOption.AllDirectories)) 72 | { 73 | files.Add(file.FullName.Replace(root.FullName, string.Empty).TrimStart('\\')); 74 | } 75 | // 调用 makensis.exe 进行编译 76 | var startInfo = new System.Diagnostics.ProcessStartInfo 77 | { 78 | FileName = exePath, 79 | Arguments = $"-V4 \"{nsifile}\"", // 使用 V4 log 等级 80 | CreateNoWindow = true 81 | }; 82 | var program = new Program(startInfo); 83 | 84 | program.OnStandardOutputReceived += OnStandardOutputReceived; 85 | program.OnStandardErrorReceived += (line) => 86 | { 87 | Debug.LogError(line); 88 | }; 89 | await program.StartAsync(); 90 | 91 | // 编译完成后,输出编译结果,用户可以在控制台通过点击路径定位文件 92 | ReportResult(nsiResolver.OutputFileLocation, () => $"安装包 {currentInstallerName} 编译完成,路径:"); 93 | 94 | Progress.Remove(progressid); 95 | 96 | currentResolver++; 97 | if (program.ExitCode != 0) 98 | { 99 | throw new Exception($"Nsis 编译错误!"); 100 | } 101 | else 102 | { 103 | Debug.Log($"{currentInstallerName} 编译完成!"); 104 | } 105 | if (!AppAutoBuilderSettingProvider.Settings.shouldKeepNsisFile) 106 | { 107 | File.Delete(nsifile); 108 | } 109 | } 110 | return string.Empty; // 无需反馈 111 | } 112 | catch (Exception) 113 | { 114 | throw; 115 | } 116 | finally 117 | { 118 | EditorUtility.ClearProgressBar(); 119 | // ProgressBarWindow.ClearProgressBar(); 120 | } 121 | } 122 | 123 | // 相对路径文件,当任务执行前记录 124 | private readonly List files = new(); 125 | private int count = 0; 126 | private int totalResolver, currentResolver, progressid; 127 | private string currentInstallerName; 128 | 129 | /// 130 | /// Compile Nsi File log, 反馈编译进度 131 | /// 132 | /// 133 | private void OnStandardOutputReceived(string obj) 134 | { 135 | // 如果是文件处理,规则是以 “File: "”开头 136 | if (obj.StartsWith("File: \"")) 137 | { 138 | var fileName = obj.Split('"')[1]; 139 | count++; 140 | var step = (float)currentResolver / totalResolver; 141 | var progress = (float)count / files.Count * step; 142 | var globalProgress = Mathf.Clamp01((float)(currentResolver - 1) / totalResolver + progress); 143 | EditorUtility.DisplayProgressBar($"({currentResolver}/{totalResolver})编译安装包 {currentInstallerName} ", $"({count }/{files.Count} )完成压缩:{fileName} ", globalProgress); 144 | //ProgressBarWindow.ShowProgressBar($"({currentResolver}/{totalResolver})编译安装包 {currentInstallerName} ", $"({count }/{files.Count} )完成压缩:{fileName} ", globalProgress); 145 | Progress.Report(progressid, (float)count / files.Count, $"({count}/{files.Count} )完成压缩:{fileName} "); 146 | } 147 | } 148 | 149 | public override bool Validate() 150 | { 151 | var exePath = AppAutoBuilderSettingProvider.Settings.nsisExePath; 152 | if (string.IsNullOrEmpty(exePath) || !File.Exists(exePath)) 153 | { 154 | Debug.LogError("makensis.exe 路径不可用,请检查!"); 155 | return false; 156 | } 157 | if (nsiResolvers == null || nsiResolvers.Count == 0 || nsiResolvers.Count(v => v.enable) == 0) 158 | { 159 | Debug.LogError("nsiResolvers 为空或均未激活,请检查!"); 160 | return false; 161 | } 162 | // todo,遍历该对象及所有能够绘制到 Inspector 的字段所标注的 RequredAttribute 163 | // 任意 RequredAttribute 检查不通过返回 false 164 | 165 | return true; 166 | } 167 | } 168 | } -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Task/NsisInstallerMakingTask.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d682e8d91224630418184f5426f4b730 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Task/RunProcessTask.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using UnityEngine; 3 | 4 | namespace zFramework.AppBuilder 5 | { 6 | //add a task to run a process, it is a simple task to run a process,without io redirect 7 | //添加一个任务来运行一个进程, 这是一个简单的任务来运行一个进程,不带io重定向 8 | [CreateAssetMenu(fileName = "ProcessTask", menuName = "Auto Builder/Task/Process Task")] 9 | public class RunProcessTask : BaseTask 10 | { 11 | public string exePath; 12 | public string args; 13 | public bool waitForExit; 14 | 15 | private void OnEnable() 16 | { 17 | Description = "在打包前后执行程序方便处理一些事务,应该会有用吧"; 18 | } 19 | public async override Task RunAsync(string output) 20 | { 21 | if (!string.IsNullOrEmpty(exePath)) 22 | { 23 | Debug.Log($"{nameof(RunProcessTask)}: Run Process"); 24 | var process = System.Diagnostics.Process.Start(exePath, this.args); 25 | if (waitForExit) 26 | { 27 | await Task.Run(process.WaitForExit); 28 | } 29 | } 30 | return string.Empty; 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Task/RunProcessTask.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d0ec0664d7c21aa4a93c627af6f4e3f0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Task/VirboxEncryptTask.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.IO; 4 | using System.Threading.Tasks; 5 | using UnityEditor; 6 | using UnityEngine; 7 | using zFramework.AppBuilder.Utils; 8 | using Debug = UnityEngine.Debug; 9 | namespace zFramework.AppBuilder 10 | { 11 | //add a task to run a process, it is a simple task to run a process,without io redirect 12 | //添加一个任务来运行一个进程, 这是一个简单的任务来运行一个进程,不带io重定向 13 | [CreateAssetMenu(fileName = "Virbox Encrypt Task", menuName = "Auto Builder/Task/Virbox Encrypt Task")] 14 | public class VirboxEncryptTask : BaseTask 15 | { 16 | [Header("需要被加密的 DLL 文件:")] 17 | public string[] dlls = new[] { "Assembly-CSharp.dll" }; 18 | private void OnEnable() 19 | { 20 | taskType = TaskType.PostBuild; 21 | Description = "通过这个任务使用 Virbox 加密服务商提供的服务加密应用程序!Use this task to encrypt your application with the service provided by Virbox!"; 22 | } 23 | 24 | //output = E:\Unity\Temp\AppLocation\AppTwo\AppTheSameNameIsOk.exe 25 | public override async Task RunAsync(string output) 26 | { 27 | var exePath = AppAutoBuilderSettingProvider.Settings.virboxExePath; 28 | if (string.IsNullOrEmpty(exePath) || !File.Exists(exePath)) 29 | { 30 | // Show Settings 31 | AppAutoBuilderSettingProvider.ShowSettings(); 32 | throw new ArgumentNullException("Virbox 控制台程序路径不可用,请检查!"); 33 | } 34 | if (string.IsNullOrEmpty(output) || !File.Exists(output)) 35 | { 36 | throw new ArgumentNullException("exe file is null or empty or file is not exists!"); 37 | } 38 | var applicationName = Path.GetFileNameWithoutExtension(output); 39 | 40 | var fileInfo = new FileInfo(output); 41 | var foldNameOrigin = fileInfo.Directory.Name; 42 | var root = fileInfo.Directory.Parent.FullName; 43 | 44 | try 45 | { 46 | //多出来的2个分别是:UnityPlayer.dll、mono-2.0-bdwgc.dll,它们默认会被处理 47 | // 其他 asset 资产暂不做处理 48 | EditorUtility.DisplayProgressBar("Virbox 加密中,请等待...", "", 0.8F); 49 | 50 | // 装载要加密的 dll 51 | var asmArgs = "-asm \""; 52 | for (int i = 0; i < dlls.Length; i++) 53 | { 54 | asmArgs += $"{applicationName}_Data/Managed/{dlls[i]};"; 55 | } 56 | asmArgs = asmArgs.TrimEnd(';') + "\""; 57 | // 命令行参数:inputDir -u3d --res-enc=1 -asm "Assembly-CSharp.dll;Assembly-CSharp-firstpass.dll" 58 | // 如果不指定 outputDir,则默认为 inputDir 同级目录, 且文件名后面会加上 _protected 59 | var combinedArgs = $"\"{fileInfo.DirectoryName}\" -u3d --res-enc=1 {asmArgs}"; 60 | 61 | // run virbox encrypt 62 | var startInfo = new ProcessStartInfo 63 | { 64 | FileName = exePath, 65 | Arguments = combinedArgs, 66 | CreateNoWindow = true 67 | }; 68 | var program = new Program(startInfo); 69 | program.OnStandardErrorReceived += (errorStr) => 70 | { 71 | if (!string.IsNullOrEmpty(errorStr)) 72 | { 73 | var message = errorStr.Contains("A0000011") ? "请先登录 Virbox 账号!" : errorStr; 74 | EditorUtility.DisplayDialog("Virbox 加密错误", message, "确定"); 75 | throw new Exception(errorStr); 76 | } 77 | }; 78 | program.OnStandardOutputReceived += OnStandardOutputReceived; 79 | await program.StartAsync(); 80 | Debug.Log("Virbox 加密任务执行完毕,请检查是否有报错!"); 81 | var result = $"{root}/{foldNameOrigin}_protected"; 82 | ReportResult(result, () => "Virbox 加密任务输出目录:"); 83 | return result; 84 | } 85 | catch (Exception) 86 | { 87 | throw; 88 | } 89 | finally 90 | { 91 | EditorUtility.ClearProgressBar(); 92 | } 93 | } 94 | 95 | private void OnStandardOutputReceived(string obj) 96 | { 97 | //Debug.Log(obj); 98 | } 99 | 100 | public override bool Validate() 101 | { 102 | var exePath = AppAutoBuilderSettingProvider.Settings.virboxExePath; 103 | if (string.IsNullOrEmpty(exePath) || !File.Exists(exePath)) 104 | { 105 | Debug.LogError("Virbox 控制台程序路径不可用,请检查!"); 106 | return false; 107 | } 108 | return true; 109 | } 110 | } 111 | } -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Task/VirboxEncryptTask.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 826558bef7b4070439af85fa338fcebf 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Utils.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 150cf7093a7e21f409a692016379f73c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Utils/AsyncStreamReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Threading; 4 | using System.Threading.Tasks; 5 | 6 | namespace zFramework.AppBuilder.Utils 7 | { 8 | internal class AsyncStreamReader : IDisposable 9 | { 10 | private readonly StreamReader reader; 11 | private readonly CancellationTokenSource cts = new(); 12 | public event Action OnOutputDataReceived; 13 | 14 | public AsyncStreamReader(StreamReader reader) 15 | { 16 | this.reader = reader; 17 | } 18 | 19 | public void Start() 20 | { 21 | Task.Run(ReceivingDataFunc); 22 | } 23 | 24 | private async Task ReceivingDataFunc() 25 | { 26 | while (!cts.Token.IsCancellationRequested) 27 | { 28 | var line = await reader.ReadLineAsync(); 29 | if (!string.IsNullOrEmpty(line)) 30 | { 31 | OnOutputDataReceived?.Invoke(line); 32 | } 33 | } 34 | } 35 | 36 | public void Dispose() 37 | { 38 | cts.Cancel(); 39 | reader.Dispose(); 40 | } 41 | } 42 | 43 | } -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Utils/AsyncStreamReader.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4bc0630e0c6a88a418c64ac454a717b7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Utils/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Threading; 4 | using System.Threading.Tasks; 5 | using UnityEngine; 6 | 7 | namespace zFramework.AppBuilder.Utils 8 | { 9 | internal class Program : IDisposable 10 | { 11 | internal event Action OnStandardOutputReceived; 12 | internal event Action OnStandardErrorReceived; 13 | private readonly SynchronizationContext context; 14 | public Process _process; 15 | 16 | protected Program() 17 | { 18 | if (Thread.CurrentThread.ManagedThreadId != 1) 19 | { 20 | throw new InvalidOperationException("Program must be created on the main thread"); 21 | } 22 | context = SynchronizationContext.Current; 23 | _process = new Process(); 24 | } 25 | 26 | public Program(ProcessStartInfo si) : this() 27 | { 28 | _process.StartInfo = si; 29 | _process.StartInfo.RedirectStandardError = true; 30 | _process.StartInfo.RedirectStandardOutput = true; 31 | _process.StartInfo.UseShellExecute = false; 32 | //Encoding is GB2312 33 | _process.StartInfo.StandardOutputEncoding = System.Text.Encoding.GetEncoding("GB2312"); 34 | _process.StartInfo.StandardErrorEncoding = System.Text.Encoding.GetEncoding("GB2312"); 35 | } 36 | 37 | public async Task StartAsync() 38 | { 39 | void RunProcess() 40 | { 41 | _process.Start(); 42 | using var outputReader = new AsyncStreamReader(_process.StandardOutput); 43 | using var errorReader = new AsyncStreamReader(_process.StandardError); 44 | outputReader.OnOutputDataReceived += result => context.Post(_ => OnStandardOutputReceived?.Invoke(result), null); 45 | errorReader.OnOutputDataReceived += result => context.Post(_ => OnStandardErrorReceived?.Invoke(result), null); 46 | outputReader.Start(); 47 | errorReader.Start(); 48 | WaitForExit(); 49 | } 50 | await Task.Run(RunProcess); 51 | } 52 | 53 | public void Dispose() 54 | { 55 | if (!_process.HasExited) 56 | { 57 | _process.Kill(); 58 | WaitForExit(); 59 | } 60 | _process.Dispose(); 61 | } 62 | 63 | private int SleepTimeoutMiliseconds => 10; 64 | 65 | public int ExitCode => _process.ExitCode; 66 | 67 | public void WaitForExit() 68 | { 69 | // Case 1111601: Process.WaitForExit hangs on OSX platform 70 | if (Application.platform == RuntimePlatform.OSXEditor) 71 | { 72 | while (!_process.HasExited) 73 | { 74 | // Don't consume 100% of CPU while waiting for process to exit 75 | Thread.Sleep(SleepTimeoutMiliseconds); 76 | } 77 | } 78 | else 79 | { 80 | _process.WaitForExit(); 81 | } 82 | } 83 | } 84 | 85 | } -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Utils/Program.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4c2fc07ee47957342885e38a04e0c79f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Utils/ProgressBarWindow.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | using UnityEngine; 3 | 4 | public class ProgressBarWindow : EditorWindow 5 | { 6 | private static ProgressBarWindow window; 7 | private static float progress; 8 | private static string info; 9 | private static new string title; 10 | public static void ShowProgressBar(string title, string info, float progress) 11 | { 12 | if (window == null) 13 | { 14 | window = CreateInstance(); 15 | window.titleContent = new GUIContent(title); 16 | window.position = new Rect(Screen.width / 2, Screen.height / 2, 400, 100); 17 | window.minSize = window.maxSize = new Vector2(600, 80); 18 | window.ShowModalUtility(); // Show as a modal utility window, which is always on top 19 | } 20 | 21 | ProgressBarWindow.info = info; 22 | ProgressBarWindow.title = title; 23 | ProgressBarWindow.progress = progress; 24 | window?.Repaint(); 25 | } 26 | 27 | public static void ClearProgressBar() 28 | { 29 | window = GetWindow(); 30 | if (window != null) 31 | { 32 | window.Close(); 33 | window = null; 34 | } 35 | } 36 | 37 | private void OnGUI() 38 | { 39 | window.titleContent.text = title; 40 | EditorGUI.ProgressBar(new Rect(3, 20, position.width - 6, 20), progress, $"{progress * 100:F1}%"); 41 | EditorGUI.LabelField(new Rect(3, 50, position.width - 6, 20), info); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/Utils/ProgressBarWindow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 17ec3dbb9ba8e0d408c84b21e34af7d2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/com.bshsf.appautobuilder.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.bshsf.appautobuilder", 3 | "references": [ 4 | "Malee.ReorderableList" 5 | ], 6 | "optionalUnityReferences": [], 7 | "includePlatforms": [ 8 | "Editor" 9 | ], 10 | "excludePlatforms": [], 11 | "allowUnsafeCode": false, 12 | "overrideReferences": false, 13 | "precompiledReferences": [], 14 | "autoReferenced": true, 15 | "defineConstraints": [] 16 | } -------------------------------------------------------------------------------- /Packages/App Auto Builder/Editor/com.bshsf.appautobuilder.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1ec740ea534079d41b48e9ecbb9ab525 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Packages/App Auto Builder/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.bshsf.appautobuilder", 3 | "author": "bian shanghai", 4 | "displayName": "App Auto Builder", 5 | "version": "2.1.0", 6 | "unity": "2019.4", 7 | "keywords": [ 8 | "unity", 9 | "editor", 10 | "auto", 11 | "build app" 12 | ], 13 | "description": "Editor extension for build application automatically, config once and build to many apps at a time with one key, and you can combine any scene as you wish.\n\nv 1.1.0\n1. \u652f\u6301\u4e86 run process task\n2. \u91cd\u7ed8\u4e86 inspector\uff0c\u66f4\u591a\u63d0\u793a\n3. \u4fee\u590d\u4e86\u6253\u5b89\u5353\u8f93\u51fa .exe \u6587\u4ef6\u7684\u5f02\u5e38" 14 | } -------------------------------------------------------------------------------- /Packages/App Auto Builder/package.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 84d3960ee5f84d94aabb37cab2517619 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.collab-proxy": "1.17.2", 4 | "com.unity.ide.rider": "3.0.15", 5 | "com.unity.ide.visualstudio": "2.0.16", 6 | "com.unity.ide.vscode": "1.2.5", 7 | "com.unity.test-framework": "1.1.33", 8 | "com.unity.textmeshpro": "3.0.6", 9 | "com.unity.timeline": "1.7.1", 10 | "com.unity.ugui": "1.0.0", 11 | "com.unity.visualscripting": "1.7.8", 12 | "com.unity.modules.ai": "1.0.0", 13 | "com.unity.modules.androidjni": "1.0.0", 14 | "com.unity.modules.animation": "1.0.0", 15 | "com.unity.modules.assetbundle": "1.0.0", 16 | "com.unity.modules.audio": "1.0.0", 17 | "com.unity.modules.cloth": "1.0.0", 18 | "com.unity.modules.director": "1.0.0", 19 | "com.unity.modules.imageconversion": "1.0.0", 20 | "com.unity.modules.imgui": "1.0.0", 21 | "com.unity.modules.jsonserialize": "1.0.0", 22 | "com.unity.modules.particlesystem": "1.0.0", 23 | "com.unity.modules.physics": "1.0.0", 24 | "com.unity.modules.physics2d": "1.0.0", 25 | "com.unity.modules.screencapture": "1.0.0", 26 | "com.unity.modules.terrain": "1.0.0", 27 | "com.unity.modules.terrainphysics": "1.0.0", 28 | "com.unity.modules.tilemap": "1.0.0", 29 | "com.unity.modules.ui": "1.0.0", 30 | "com.unity.modules.uielements": "1.0.0", 31 | "com.unity.modules.umbra": "1.0.0", 32 | "com.unity.modules.unityanalytics": "1.0.0", 33 | "com.unity.modules.unitywebrequest": "1.0.0", 34 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 35 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 36 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 37 | "com.unity.modules.unitywebrequestwww": "1.0.0", 38 | "com.unity.modules.vehicles": "1.0.0", 39 | "com.unity.modules.video": "1.0.0", 40 | "com.unity.modules.vr": "1.0.0", 41 | "com.unity.modules.wind": "1.0.0", 42 | "com.unity.modules.xr": "1.0.0" 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Packages/packages-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.bshsf.appautobuilder": { 4 | "version": "file:App Auto Builder", 5 | "depth": 0, 6 | "source": "embedded", 7 | "dependencies": {} 8 | }, 9 | "com.unity.collab-proxy": { 10 | "version": "1.17.2", 11 | "depth": 0, 12 | "source": "registry", 13 | "dependencies": { 14 | "com.unity.services.core": "1.0.1" 15 | }, 16 | "url": "https://packages.unity.cn" 17 | }, 18 | "com.unity.ext.nunit": { 19 | "version": "1.0.6", 20 | "depth": 1, 21 | "source": "registry", 22 | "dependencies": {}, 23 | "url": "https://packages.unity.cn" 24 | }, 25 | "com.unity.ide.rider": { 26 | "version": "3.0.15", 27 | "depth": 0, 28 | "source": "registry", 29 | "dependencies": { 30 | "com.unity.ext.nunit": "1.0.6" 31 | }, 32 | "url": "https://packages.unity.cn" 33 | }, 34 | "com.unity.ide.visualstudio": { 35 | "version": "2.0.16", 36 | "depth": 0, 37 | "source": "registry", 38 | "dependencies": { 39 | "com.unity.test-framework": "1.1.9" 40 | }, 41 | "url": "https://packages.unity.cn" 42 | }, 43 | "com.unity.ide.vscode": { 44 | "version": "1.2.5", 45 | "depth": 0, 46 | "source": "registry", 47 | "dependencies": {}, 48 | "url": "https://packages.unity.cn" 49 | }, 50 | "com.unity.nuget.newtonsoft-json": { 51 | "version": "3.2.1", 52 | "depth": 2, 53 | "source": "registry", 54 | "dependencies": {}, 55 | "url": "https://packages.unity.cn" 56 | }, 57 | "com.unity.services.core": { 58 | "version": "1.12.2", 59 | "depth": 1, 60 | "source": "registry", 61 | "dependencies": { 62 | "com.unity.modules.unitywebrequest": "1.0.0", 63 | "com.unity.nuget.newtonsoft-json": "3.2.1", 64 | "com.unity.modules.androidjni": "1.0.0" 65 | }, 66 | "url": "https://packages.unity.cn" 67 | }, 68 | "com.unity.test-framework": { 69 | "version": "1.1.33", 70 | "depth": 0, 71 | "source": "registry", 72 | "dependencies": { 73 | "com.unity.ext.nunit": "1.0.6", 74 | "com.unity.modules.imgui": "1.0.0", 75 | "com.unity.modules.jsonserialize": "1.0.0" 76 | }, 77 | "url": "https://packages.unity.cn" 78 | }, 79 | "com.unity.textmeshpro": { 80 | "version": "3.0.6", 81 | "depth": 0, 82 | "source": "registry", 83 | "dependencies": { 84 | "com.unity.ugui": "1.0.0" 85 | }, 86 | "url": "https://packages.unity.cn" 87 | }, 88 | "com.unity.timeline": { 89 | "version": "1.7.1", 90 | "depth": 0, 91 | "source": "registry", 92 | "dependencies": { 93 | "com.unity.modules.director": "1.0.0", 94 | "com.unity.modules.animation": "1.0.0", 95 | "com.unity.modules.audio": "1.0.0", 96 | "com.unity.modules.particlesystem": "1.0.0" 97 | }, 98 | "url": "https://packages.unity.cn" 99 | }, 100 | "com.unity.ugui": { 101 | "version": "1.0.0", 102 | "depth": 0, 103 | "source": "builtin", 104 | "dependencies": { 105 | "com.unity.modules.ui": "1.0.0", 106 | "com.unity.modules.imgui": "1.0.0" 107 | } 108 | }, 109 | "com.unity.visualscripting": { 110 | "version": "1.7.8", 111 | "depth": 0, 112 | "source": "registry", 113 | "dependencies": { 114 | "com.unity.ugui": "1.0.0", 115 | "com.unity.modules.jsonserialize": "1.0.0" 116 | }, 117 | "url": "https://packages.unity.cn" 118 | }, 119 | "com.unity.modules.ai": { 120 | "version": "1.0.0", 121 | "depth": 0, 122 | "source": "builtin", 123 | "dependencies": {} 124 | }, 125 | "com.unity.modules.androidjni": { 126 | "version": "1.0.0", 127 | "depth": 0, 128 | "source": "builtin", 129 | "dependencies": {} 130 | }, 131 | "com.unity.modules.animation": { 132 | "version": "1.0.0", 133 | "depth": 0, 134 | "source": "builtin", 135 | "dependencies": {} 136 | }, 137 | "com.unity.modules.assetbundle": { 138 | "version": "1.0.0", 139 | "depth": 0, 140 | "source": "builtin", 141 | "dependencies": {} 142 | }, 143 | "com.unity.modules.audio": { 144 | "version": "1.0.0", 145 | "depth": 0, 146 | "source": "builtin", 147 | "dependencies": {} 148 | }, 149 | "com.unity.modules.cloth": { 150 | "version": "1.0.0", 151 | "depth": 0, 152 | "source": "builtin", 153 | "dependencies": { 154 | "com.unity.modules.physics": "1.0.0" 155 | } 156 | }, 157 | "com.unity.modules.director": { 158 | "version": "1.0.0", 159 | "depth": 0, 160 | "source": "builtin", 161 | "dependencies": { 162 | "com.unity.modules.audio": "1.0.0", 163 | "com.unity.modules.animation": "1.0.0" 164 | } 165 | }, 166 | "com.unity.modules.imageconversion": { 167 | "version": "1.0.0", 168 | "depth": 0, 169 | "source": "builtin", 170 | "dependencies": {} 171 | }, 172 | "com.unity.modules.imgui": { 173 | "version": "1.0.0", 174 | "depth": 0, 175 | "source": "builtin", 176 | "dependencies": {} 177 | }, 178 | "com.unity.modules.jsonserialize": { 179 | "version": "1.0.0", 180 | "depth": 0, 181 | "source": "builtin", 182 | "dependencies": {} 183 | }, 184 | "com.unity.modules.particlesystem": { 185 | "version": "1.0.0", 186 | "depth": 0, 187 | "source": "builtin", 188 | "dependencies": {} 189 | }, 190 | "com.unity.modules.physics": { 191 | "version": "1.0.0", 192 | "depth": 0, 193 | "source": "builtin", 194 | "dependencies": {} 195 | }, 196 | "com.unity.modules.physics2d": { 197 | "version": "1.0.0", 198 | "depth": 0, 199 | "source": "builtin", 200 | "dependencies": {} 201 | }, 202 | "com.unity.modules.screencapture": { 203 | "version": "1.0.0", 204 | "depth": 0, 205 | "source": "builtin", 206 | "dependencies": { 207 | "com.unity.modules.imageconversion": "1.0.0" 208 | } 209 | }, 210 | "com.unity.modules.subsystems": { 211 | "version": "1.0.0", 212 | "depth": 1, 213 | "source": "builtin", 214 | "dependencies": { 215 | "com.unity.modules.jsonserialize": "1.0.0" 216 | } 217 | }, 218 | "com.unity.modules.terrain": { 219 | "version": "1.0.0", 220 | "depth": 0, 221 | "source": "builtin", 222 | "dependencies": {} 223 | }, 224 | "com.unity.modules.terrainphysics": { 225 | "version": "1.0.0", 226 | "depth": 0, 227 | "source": "builtin", 228 | "dependencies": { 229 | "com.unity.modules.physics": "1.0.0", 230 | "com.unity.modules.terrain": "1.0.0" 231 | } 232 | }, 233 | "com.unity.modules.tilemap": { 234 | "version": "1.0.0", 235 | "depth": 0, 236 | "source": "builtin", 237 | "dependencies": { 238 | "com.unity.modules.physics2d": "1.0.0" 239 | } 240 | }, 241 | "com.unity.modules.ui": { 242 | "version": "1.0.0", 243 | "depth": 0, 244 | "source": "builtin", 245 | "dependencies": {} 246 | }, 247 | "com.unity.modules.uielements": { 248 | "version": "1.0.0", 249 | "depth": 0, 250 | "source": "builtin", 251 | "dependencies": { 252 | "com.unity.modules.ui": "1.0.0", 253 | "com.unity.modules.imgui": "1.0.0", 254 | "com.unity.modules.jsonserialize": "1.0.0", 255 | "com.unity.modules.uielementsnative": "1.0.0" 256 | } 257 | }, 258 | "com.unity.modules.uielementsnative": { 259 | "version": "1.0.0", 260 | "depth": 1, 261 | "source": "builtin", 262 | "dependencies": { 263 | "com.unity.modules.ui": "1.0.0", 264 | "com.unity.modules.imgui": "1.0.0", 265 | "com.unity.modules.jsonserialize": "1.0.0" 266 | } 267 | }, 268 | "com.unity.modules.umbra": { 269 | "version": "1.0.0", 270 | "depth": 0, 271 | "source": "builtin", 272 | "dependencies": {} 273 | }, 274 | "com.unity.modules.unityanalytics": { 275 | "version": "1.0.0", 276 | "depth": 0, 277 | "source": "builtin", 278 | "dependencies": { 279 | "com.unity.modules.unitywebrequest": "1.0.0", 280 | "com.unity.modules.jsonserialize": "1.0.0" 281 | } 282 | }, 283 | "com.unity.modules.unitywebrequest": { 284 | "version": "1.0.0", 285 | "depth": 0, 286 | "source": "builtin", 287 | "dependencies": {} 288 | }, 289 | "com.unity.modules.unitywebrequestassetbundle": { 290 | "version": "1.0.0", 291 | "depth": 0, 292 | "source": "builtin", 293 | "dependencies": { 294 | "com.unity.modules.assetbundle": "1.0.0", 295 | "com.unity.modules.unitywebrequest": "1.0.0" 296 | } 297 | }, 298 | "com.unity.modules.unitywebrequestaudio": { 299 | "version": "1.0.0", 300 | "depth": 0, 301 | "source": "builtin", 302 | "dependencies": { 303 | "com.unity.modules.unitywebrequest": "1.0.0", 304 | "com.unity.modules.audio": "1.0.0" 305 | } 306 | }, 307 | "com.unity.modules.unitywebrequesttexture": { 308 | "version": "1.0.0", 309 | "depth": 0, 310 | "source": "builtin", 311 | "dependencies": { 312 | "com.unity.modules.unitywebrequest": "1.0.0", 313 | "com.unity.modules.imageconversion": "1.0.0" 314 | } 315 | }, 316 | "com.unity.modules.unitywebrequestwww": { 317 | "version": "1.0.0", 318 | "depth": 0, 319 | "source": "builtin", 320 | "dependencies": { 321 | "com.unity.modules.unitywebrequest": "1.0.0", 322 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 323 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 324 | "com.unity.modules.audio": "1.0.0", 325 | "com.unity.modules.assetbundle": "1.0.0", 326 | "com.unity.modules.imageconversion": "1.0.0" 327 | } 328 | }, 329 | "com.unity.modules.vehicles": { 330 | "version": "1.0.0", 331 | "depth": 0, 332 | "source": "builtin", 333 | "dependencies": { 334 | "com.unity.modules.physics": "1.0.0" 335 | } 336 | }, 337 | "com.unity.modules.video": { 338 | "version": "1.0.0", 339 | "depth": 0, 340 | "source": "builtin", 341 | "dependencies": { 342 | "com.unity.modules.audio": "1.0.0", 343 | "com.unity.modules.ui": "1.0.0", 344 | "com.unity.modules.unitywebrequest": "1.0.0" 345 | } 346 | }, 347 | "com.unity.modules.vr": { 348 | "version": "1.0.0", 349 | "depth": 0, 350 | "source": "builtin", 351 | "dependencies": { 352 | "com.unity.modules.jsonserialize": "1.0.0", 353 | "com.unity.modules.physics": "1.0.0", 354 | "com.unity.modules.xr": "1.0.0" 355 | } 356 | }, 357 | "com.unity.modules.wind": { 358 | "version": "1.0.0", 359 | "depth": 0, 360 | "source": "builtin", 361 | "dependencies": {} 362 | }, 363 | "com.unity.modules.xr": { 364 | "version": "1.0.0", 365 | "depth": 0, 366 | "source": "builtin", 367 | "dependencies": { 368 | "com.unity.modules.physics": "1.0.0", 369 | "com.unity.modules.jsonserialize": "1.0.0", 370 | "com.unity.modules.subsystems": "1.0.0" 371 | } 372 | } 373 | } 374 | } 375 | -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | # Application Auto Builder 2 | 3 | # 作用 (Features): 4 | 5 | 1. 一次配置,一键打包,输出多个应用: 6 | 7 | one config, one click, output multiple applications, see the picture below: 8 | 9 | 2. 支持在打包前后通过 Task 参与到打包流程中,支持场景内数据修改,支持执行应用程序,支持文件操作(计划中) 10 | 11 | Support participating in the packaging process through Task before and after packaging, support scene data modification, support application execution, support file operation (in plan) 12 | 13 | 3. 支持 .exe 和 .apk 的打包,其他文件类型拿到源码自己加 14 | 15 | Support .exe and .apk packaging, other file types get the source code and add them by yourself 16 | 17 | ```csharp 18 | var dir = $"{config.appLocationPath}/{profile.productName}"; 19 | { 20 | var ext = config.targetPlatform switch 21 | BuildTarget.StandaloneWindows => ".exe", 22 | BuildTarget.StandaloneWindows64 => ".exe", 23 | BuildTarget.Android => ".apk", 24 | _ => throw new Exception("不支持的打包平台!") // TODO: 其他平台的后缀请各领域专家补充,欢迎提 PR 25 | }; 26 | var file = $"{dir}/{profile.productName}{ext}"; 27 | ``` 28 | 29 | 文件在这里(Files are here):([Packages/App Auto Builder/Editor/AutoBuilder.cs](https://github.com/Bian-Sh/Unity-Application-Auto-Builder/blob/af093ebb1424186ac0f6794e151aa7057f61ac65/Packages/App%20Auto%20Builder/Editor/AutoBuilder.cs#L161)) 30 | 31 | 4. 支持通过 Virbox Task 对打包后的应用进行加密; 32 | Support encrypting the packaged application through Virbox Task 33 | 34 | 5. 支持通过 Nsis Task 对打包后的应用进行安装包制作; 35 | Support making installation package for the packaged application through Nsis Task 36 | 37 | 38 | 39 | # 界面(Interface): 40 | 41 | ![](doc/interface.png) 42 | 43 | | Function Execute Task | Run Process Task | 44 | | ------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | 45 | | ![](doc/FuncExecuteTask.png) | ![](doc/RunProcessTask.png) | 46 | | 通过这个 task ,你可以写逻辑在打包前后对 scene 内的任意数据进行修改 | 通过这个 Task,你可以在构建前、后运行一个应用程序,可以设置是否卡主线程,方便控制打包流程 | 47 | | With this task, you can write logic to modify any data in the scene before and after build | With this Task, you can run an application before and after the build, and you can set whether to block the main thread to facilitate the control of the build process | 48 | | Virbox Task| Nsis Task | 49 | | ![](doc/VirboxTask.png) | ![](doc/NsisTask.png) | 50 | |通过这个 Task 实现对打包的应用加密| 通过这个 Task,对打包后的应用进行安装包的制作 | 51 | |With this Task, the packaged application is encrypted|With this Task, the packaged application is made into an installation package| 52 | 53 | 54 | # 使用(Usage): 55 | 56 | 1. Clone 本仓库或者使用 UPM 安装(Install with UPM) 57 | 58 | Clone this repository or install with UPM 59 | 60 | ![](doc/install.png) 61 | 62 | ``` 63 | https://github.com/Bian-Sh/Unity-Application-Auto-Builder.git/?path=Packages/App%20Auto%20Builder/ 64 | ``` 65 | 66 | 2. 通过菜单 Tools -> App Auto Builder 打开界面 67 | 68 | Open the interface through the menu Tools -> App Auto Builder 69 | 70 | 3. 在弹出的面板中依次配置好打包平台、打包路径、应用名称、版本信息、包含的场景以及打包前后需要处理的自定义任务 71 | 72 | Configure the packaging platform, packaging path, application name, version information, included scenes and custom tasks to be processed before and after packaging in the pop-up panel in turn 73 | 74 | 4. 完成上述配置,点击 Build 按钮即可开始打包,看到控制台输出 `打包成功` 字样即表示打包完成 75 | 76 | After completing the above configuration, click the Build button to start packaging. When you see the console output "Build successfully", it means that the packaging is completed 77 | 78 | # 演示 (Animation): 79 | 80 | ![](doc/autobuilder.gif) 81 | 82 | # 计划 (Todo) 83 | 84 | 1. FunctionExecuteTask 支持当用户指定场景后自动获取该场景使用的所有 Type 供用户选择 85 | 86 | FunctionExecuteTask support automatic acquisition of Type after specifying the scene for users to choose 87 | 88 | 2. FunctionExecuteTask 支持当用户选定 Type 后自动获取 参数为 string 或者 prefab(计划支持 string 和 prefab)的函数供用户选择 89 | 90 | FunctionExecuteTask supports automatic acquisition of functions with parameters as string or prefab (plan to support string and prefab) for users to choose after the user selects Type 91 | 92 | 3. FunctionExecuteTask 新增一个变体,支持对 prefab 做打包前、后的修改(目前支持的是对 Scene 文件修改) 93 | 94 | FunctionExecuteTask adds a variant that supports modification of prefab before and after packaging (currently supports modification of Scene file) 95 | 96 | 4. 得益于 EditorSettings 的 Preset 功能,我想如果能够支持用户在打包前、后恢复不同的 Preset 数据会不会很有帮助。 97 | 98 | Thanks to the Preset function of EditorSettings, I think it would be helpful if users could restore different Preset data before and after build application. 99 | 100 | 5. 我希望自定义 Task 可以通过 ReorderableList 右下角 + 添加,可以选择 Task类型,自动构建实例并赋值,同时将其存为主配置文件的 subassets 101 | 102 | I hope that custom Task can be added by ReorderableList in the lower right corner +, Task type can be selected, instance can be automatically built and assigned, and saved as a subassets of the main configuration file . 103 | 104 | 6. 我希望自定义 Task 全部绘制在 EditorWindow 上,不需要用户额外选中他们才能修改配置 105 | 106 | I hope that all custom Task can be drawn on EditorWindow, and users do not need to select them separately to modify the configuration 107 | 108 | 7. FileOperationTask 感觉不是很紧急,如果需要用户可以自己继承 BaskTask 随便写写就行 109 | 110 | FileOperationTask doesn't feel very urgent. If you need it, you can inherit BaskTask and write it casually 111 | 112 | **最后,如果有什么好的建议,欢迎提 issue 或者 pr** 113 | 114 | **Finally, if you have any good suggestions, please feel free to issue or pr** 115 | 116 | # 扩展阅读 (Reference): 117 | 118 | [[Unity 3D] 多场景任意组合的一键出多包的打包工具](https://www.jianshu.com/p/4ad5be33b60b?v=1667139567703) 119 | -------------------------------------------------------------------------------- /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 | RecentlyUsedSceneGuid-0: 9 | value: 01025604570050020857557a12750944154e4f792d2b2267792a1b62e3e5673a 10 | flags: 0 11 | vcSharedLogLevel: 12 | value: 0d5e400f0650 13 | flags: 0 14 | m_VCAutomaticAdd: 1 15 | m_VCDebugCom: 0 16 | m_VCDebugCmd: 0 17 | m_VCDebugOut: 0 18 | m_SemanticMergeMode: 2 19 | m_DesiredImportWorkerCount: 3 20 | m_StandbyImportWorkerCount: 2 21 | m_IdleImportWorkerShutdownDelay: 60000 22 | m_VCShowFailedCheckout: 1 23 | m_VCOverwriteFailedCheckoutAssets: 1 24 | m_VCProjectOverlayIcons: 1 25 | m_VCHierarchyOverlayIcons: 1 26 | m_VCOtherOverlayIcons: 1 27 | m_VCAllowAsyncUpdate: 1 28 | m_ArtifactGarbageCollection: 1 29 | -------------------------------------------------------------------------------- /UserSettings/Layouts/default-2021.dwlt: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 52 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: 1 12 | m_Script: {fileID: 12004, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_PixelRect: 16 | serializedVersion: 2 17 | x: 2097 18 | y: 481 19 | width: 1206 20 | height: 832 21 | m_ShowMode: 4 22 | m_Title: Console 23 | m_RootView: {fileID: 6} 24 | m_MinSize: {x: 875, y: 300} 25 | m_MaxSize: {x: 10000, y: 10000} 26 | m_Maximized: 0 27 | --- !u!114 &2 28 | MonoBehaviour: 29 | m_ObjectHideFlags: 52 30 | m_CorrespondingSourceObject: {fileID: 0} 31 | m_PrefabInstance: {fileID: 0} 32 | m_PrefabAsset: {fileID: 0} 33 | m_GameObject: {fileID: 0} 34 | m_Enabled: 1 35 | m_EditorHideFlags: 1 36 | m_Script: {fileID: 12010, guid: 0000000000000000e000000000000000, type: 0} 37 | m_Name: 38 | m_EditorClassIdentifier: 39 | m_Children: 40 | - {fileID: 9} 41 | - {fileID: 3} 42 | m_Position: 43 | serializedVersion: 2 44 | x: 0 45 | y: 30 46 | width: 1206 47 | height: 782 48 | m_MinSize: {x: 300, y: 200} 49 | m_MaxSize: {x: 24288, y: 16192} 50 | vertical: 0 51 | controlID: 19 52 | --- !u!114 &3 53 | MonoBehaviour: 54 | m_ObjectHideFlags: 52 55 | m_CorrespondingSourceObject: {fileID: 0} 56 | m_PrefabInstance: {fileID: 0} 57 | m_PrefabAsset: {fileID: 0} 58 | m_GameObject: {fileID: 0} 59 | m_Enabled: 1 60 | m_EditorHideFlags: 1 61 | m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0} 62 | m_Name: 63 | m_EditorClassIdentifier: 64 | m_Children: [] 65 | m_Position: 66 | serializedVersion: 2 67 | x: 921 68 | y: 0 69 | width: 285 70 | height: 782 71 | m_MinSize: {x: 276, y: 71} 72 | m_MaxSize: {x: 4001, y: 4021} 73 | m_ActualView: {fileID: 13} 74 | m_Panes: 75 | - {fileID: 13} 76 | m_Selected: 0 77 | m_LastSelected: 0 78 | --- !u!114 &4 79 | MonoBehaviour: 80 | m_ObjectHideFlags: 52 81 | m_CorrespondingSourceObject: {fileID: 0} 82 | m_PrefabInstance: {fileID: 0} 83 | m_PrefabAsset: {fileID: 0} 84 | m_GameObject: {fileID: 0} 85 | m_Enabled: 1 86 | m_EditorHideFlags: 1 87 | m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0} 88 | m_Name: 89 | m_EditorClassIdentifier: 90 | m_Children: [] 91 | m_Position: 92 | serializedVersion: 2 93 | x: 0 94 | y: 0 95 | width: 228 96 | height: 342 97 | m_MinSize: {x: 201, y: 221} 98 | m_MaxSize: {x: 4001, y: 4021} 99 | m_ActualView: {fileID: 14} 100 | m_Panes: 101 | - {fileID: 14} 102 | m_Selected: 0 103 | m_LastSelected: 0 104 | --- !u!114 &5 105 | MonoBehaviour: 106 | m_ObjectHideFlags: 52 107 | m_CorrespondingSourceObject: {fileID: 0} 108 | m_PrefabInstance: {fileID: 0} 109 | m_PrefabAsset: {fileID: 0} 110 | m_GameObject: {fileID: 0} 111 | m_Enabled: 1 112 | m_EditorHideFlags: 1 113 | m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0} 114 | m_Name: ConsoleWindow 115 | m_EditorClassIdentifier: 116 | m_Children: [] 117 | m_Position: 118 | serializedVersion: 2 119 | x: 0 120 | y: 342 121 | width: 921 122 | height: 440 123 | m_MinSize: {x: 101, y: 121} 124 | m_MaxSize: {x: 4001, y: 4021} 125 | m_ActualView: {fileID: 17} 126 | m_Panes: 127 | - {fileID: 12} 128 | - {fileID: 17} 129 | m_Selected: 1 130 | m_LastSelected: 0 131 | --- !u!114 &6 132 | MonoBehaviour: 133 | m_ObjectHideFlags: 52 134 | m_CorrespondingSourceObject: {fileID: 0} 135 | m_PrefabInstance: {fileID: 0} 136 | m_PrefabAsset: {fileID: 0} 137 | m_GameObject: {fileID: 0} 138 | m_Enabled: 1 139 | m_EditorHideFlags: 1 140 | m_Script: {fileID: 12008, guid: 0000000000000000e000000000000000, type: 0} 141 | m_Name: 142 | m_EditorClassIdentifier: 143 | m_Children: 144 | - {fileID: 7} 145 | - {fileID: 2} 146 | - {fileID: 8} 147 | m_Position: 148 | serializedVersion: 2 149 | x: 0 150 | y: 0 151 | width: 1206 152 | height: 832 153 | m_MinSize: {x: 875, y: 300} 154 | m_MaxSize: {x: 10000, y: 10000} 155 | m_UseTopView: 1 156 | m_TopViewHeight: 30 157 | m_UseBottomView: 1 158 | m_BottomViewHeight: 20 159 | --- !u!114 &7 160 | MonoBehaviour: 161 | m_ObjectHideFlags: 52 162 | m_CorrespondingSourceObject: {fileID: 0} 163 | m_PrefabInstance: {fileID: 0} 164 | m_PrefabAsset: {fileID: 0} 165 | m_GameObject: {fileID: 0} 166 | m_Enabled: 1 167 | m_EditorHideFlags: 1 168 | m_Script: {fileID: 12011, guid: 0000000000000000e000000000000000, type: 0} 169 | m_Name: 170 | m_EditorClassIdentifier: 171 | m_Children: [] 172 | m_Position: 173 | serializedVersion: 2 174 | x: 0 175 | y: 0 176 | width: 1206 177 | height: 30 178 | m_MinSize: {x: 0, y: 0} 179 | m_MaxSize: {x: 0, y: 0} 180 | m_LastLoadedLayoutName: 181 | --- !u!114 &8 182 | MonoBehaviour: 183 | m_ObjectHideFlags: 52 184 | m_CorrespondingSourceObject: {fileID: 0} 185 | m_PrefabInstance: {fileID: 0} 186 | m_PrefabAsset: {fileID: 0} 187 | m_GameObject: {fileID: 0} 188 | m_Enabled: 1 189 | m_EditorHideFlags: 1 190 | m_Script: {fileID: 12042, guid: 0000000000000000e000000000000000, type: 0} 191 | m_Name: 192 | m_EditorClassIdentifier: 193 | m_Children: [] 194 | m_Position: 195 | serializedVersion: 2 196 | x: 0 197 | y: 812 198 | width: 1206 199 | height: 20 200 | m_MinSize: {x: 0, y: 0} 201 | m_MaxSize: {x: 0, y: 0} 202 | --- !u!114 &9 203 | MonoBehaviour: 204 | m_ObjectHideFlags: 52 205 | m_CorrespondingSourceObject: {fileID: 0} 206 | m_PrefabInstance: {fileID: 0} 207 | m_PrefabAsset: {fileID: 0} 208 | m_GameObject: {fileID: 0} 209 | m_Enabled: 1 210 | m_EditorHideFlags: 1 211 | m_Script: {fileID: 12010, guid: 0000000000000000e000000000000000, type: 0} 212 | m_Name: 213 | m_EditorClassIdentifier: 214 | m_Children: 215 | - {fileID: 10} 216 | - {fileID: 5} 217 | m_Position: 218 | serializedVersion: 2 219 | x: 0 220 | y: 0 221 | width: 921 222 | height: 782 223 | m_MinSize: {x: 200, y: 200} 224 | m_MaxSize: {x: 16192, y: 16192} 225 | vertical: 1 226 | controlID: 29 227 | --- !u!114 &10 228 | MonoBehaviour: 229 | m_ObjectHideFlags: 52 230 | m_CorrespondingSourceObject: {fileID: 0} 231 | m_PrefabInstance: {fileID: 0} 232 | m_PrefabAsset: {fileID: 0} 233 | m_GameObject: {fileID: 0} 234 | m_Enabled: 1 235 | m_EditorHideFlags: 1 236 | m_Script: {fileID: 12010, guid: 0000000000000000e000000000000000, type: 0} 237 | m_Name: 238 | m_EditorClassIdentifier: 239 | m_Children: 240 | - {fileID: 4} 241 | - {fileID: 11} 242 | m_Position: 243 | serializedVersion: 2 244 | x: 0 245 | y: 0 246 | width: 921 247 | height: 342 248 | m_MinSize: {x: 200, y: 100} 249 | m_MaxSize: {x: 16192, y: 8096} 250 | vertical: 0 251 | controlID: 30 252 | --- !u!114 &11 253 | MonoBehaviour: 254 | m_ObjectHideFlags: 52 255 | m_CorrespondingSourceObject: {fileID: 0} 256 | m_PrefabInstance: {fileID: 0} 257 | m_PrefabAsset: {fileID: 0} 258 | m_GameObject: {fileID: 0} 259 | m_Enabled: 1 260 | m_EditorHideFlags: 1 261 | m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0} 262 | m_Name: 263 | m_EditorClassIdentifier: 264 | m_Children: [] 265 | m_Position: 266 | serializedVersion: 2 267 | x: 228 268 | y: 0 269 | width: 693 270 | height: 342 271 | m_MinSize: {x: 202, y: 221} 272 | m_MaxSize: {x: 4002, y: 4021} 273 | m_ActualView: {fileID: 15} 274 | m_Panes: 275 | - {fileID: 15} 276 | - {fileID: 16} 277 | m_Selected: 0 278 | m_LastSelected: 1 279 | --- !u!114 &12 280 | MonoBehaviour: 281 | m_ObjectHideFlags: 52 282 | m_CorrespondingSourceObject: {fileID: 0} 283 | m_PrefabInstance: {fileID: 0} 284 | m_PrefabAsset: {fileID: 0} 285 | m_GameObject: {fileID: 0} 286 | m_Enabled: 1 287 | m_EditorHideFlags: 1 288 | m_Script: {fileID: 12014, guid: 0000000000000000e000000000000000, type: 0} 289 | m_Name: 290 | m_EditorClassIdentifier: 291 | m_MinSize: {x: 230, y: 250} 292 | m_MaxSize: {x: 10000, y: 10000} 293 | m_TitleContent: 294 | m_Text: Project 295 | m_Image: {fileID: -7501376956915960154, guid: 0000000000000000d000000000000000, 296 | type: 0} 297 | m_Tooltip: 298 | m_Pos: 299 | serializedVersion: 2 300 | x: 2097 301 | y: 853 302 | width: 920 303 | height: 419 304 | m_ViewDataDictionary: {fileID: 0} 305 | m_OverlayCanvas: 306 | m_LastAppliedPresetName: Default 307 | m_SaveData: [] 308 | m_SearchFilter: 309 | m_NameFilter: 310 | m_ClassNames: [] 311 | m_AssetLabels: [] 312 | m_AssetBundleNames: [] 313 | m_VersionControlStates: [] 314 | m_SoftLockControlStates: [] 315 | m_ReferencingInstanceIDs: 316 | m_SceneHandles: 317 | m_ShowAllHits: 0 318 | m_SkipHidden: 0 319 | m_SearchArea: 1 320 | m_Folders: 321 | - Packages/com.malee.reorderablelist 322 | m_Globs: [] 323 | m_OriginalText: 324 | m_ViewMode: 1 325 | m_StartGridSize: 64 326 | m_LastFolders: 327 | - Packages/com.malee.reorderablelist 328 | m_LastFoldersGridSize: -1 329 | m_LastProjectPath: E:\Unity\Project\SceneAutoBuilder 330 | m_LockTracker: 331 | m_IsLocked: 0 332 | m_FolderTreeState: 333 | scrollPos: {x: 0, y: 0} 334 | m_SelectedIDs: 1e580000 335 | m_LastClickedID: 22558 336 | m_ExpandedIDs: 00000000045800000658000000ca9a3bffffff7f 337 | m_RenameOverlay: 338 | m_UserAcceptedRename: 0 339 | m_Name: 340 | m_OriginalName: 341 | m_EditFieldRect: 342 | serializedVersion: 2 343 | x: 0 344 | y: 0 345 | width: 0 346 | height: 0 347 | m_UserData: 0 348 | m_IsWaitingForDelay: 0 349 | m_IsRenaming: 0 350 | m_OriginalEventType: 11 351 | m_IsRenamingFilename: 1 352 | m_ClientGUIView: {fileID: 0} 353 | m_SearchString: 354 | m_CreateAssetUtility: 355 | m_EndAction: {fileID: 0} 356 | m_InstanceID: 0 357 | m_Path: 358 | m_Icon: {fileID: 0} 359 | m_ResourceFile: 360 | m_AssetTreeState: 361 | scrollPos: {x: 0, y: 0} 362 | m_SelectedIDs: 363 | m_LastClickedID: 0 364 | m_ExpandedIDs: 000000000458000006580000 365 | m_RenameOverlay: 366 | m_UserAcceptedRename: 0 367 | m_Name: 368 | m_OriginalName: 369 | m_EditFieldRect: 370 | serializedVersion: 2 371 | x: 0 372 | y: 0 373 | width: 0 374 | height: 0 375 | m_UserData: 0 376 | m_IsWaitingForDelay: 0 377 | m_IsRenaming: 0 378 | m_OriginalEventType: 11 379 | m_IsRenamingFilename: 1 380 | m_ClientGUIView: {fileID: 0} 381 | m_SearchString: 382 | m_CreateAssetUtility: 383 | m_EndAction: {fileID: 0} 384 | m_InstanceID: 0 385 | m_Path: 386 | m_Icon: {fileID: 0} 387 | m_ResourceFile: 388 | m_ListAreaState: 389 | m_SelectedInstanceIDs: 390 | m_LastClickedInstanceID: 0 391 | m_HadKeyboardFocusLastEvent: 0 392 | m_ExpandedInstanceIDs: c6230000 393 | m_RenameOverlay: 394 | m_UserAcceptedRename: 0 395 | m_Name: 396 | m_OriginalName: 397 | m_EditFieldRect: 398 | serializedVersion: 2 399 | x: 0 400 | y: 0 401 | width: 0 402 | height: 0 403 | m_UserData: 0 404 | m_IsWaitingForDelay: 0 405 | m_IsRenaming: 0 406 | m_OriginalEventType: 11 407 | m_IsRenamingFilename: 1 408 | m_ClientGUIView: {fileID: 0} 409 | m_CreateAssetUtility: 410 | m_EndAction: {fileID: 0} 411 | m_InstanceID: 0 412 | m_Path: 413 | m_Icon: {fileID: 0} 414 | m_ResourceFile: 415 | m_NewAssetIndexInList: -1 416 | m_ScrollPosition: {x: 0, y: 0} 417 | m_GridSize: 64 418 | m_SkipHiddenPackages: 0 419 | m_DirectoriesAreaWidth: 207 420 | --- !u!114 &13 421 | MonoBehaviour: 422 | m_ObjectHideFlags: 52 423 | m_CorrespondingSourceObject: {fileID: 0} 424 | m_PrefabInstance: {fileID: 0} 425 | m_PrefabAsset: {fileID: 0} 426 | m_GameObject: {fileID: 0} 427 | m_Enabled: 1 428 | m_EditorHideFlags: 1 429 | m_Script: {fileID: 12019, guid: 0000000000000000e000000000000000, type: 0} 430 | m_Name: 431 | m_EditorClassIdentifier: 432 | m_MinSize: {x: 275, y: 50} 433 | m_MaxSize: {x: 4000, y: 4000} 434 | m_TitleContent: 435 | m_Text: Inspector 436 | m_Image: {fileID: -6905738622615590433, guid: 0000000000000000d000000000000000, 437 | type: 0} 438 | m_Tooltip: 439 | m_Pos: 440 | serializedVersion: 2 441 | x: 3018 442 | y: 511 443 | width: 284 444 | height: 761 445 | m_ViewDataDictionary: {fileID: 0} 446 | m_OverlayCanvas: 447 | m_LastAppliedPresetName: Default 448 | m_SaveData: [] 449 | m_ObjectsLockedBeforeSerialization: [] 450 | m_InstanceIDsLockedBeforeSerialization: 451 | m_PreviewResizer: 452 | m_CachedPref: 160 453 | m_ControlHash: -371814159 454 | m_PrefName: Preview_InspectorPreview 455 | m_LastInspectedObjectInstanceID: -1 456 | m_LastVerticalScrollValue: 0 457 | m_GlobalObjectId: 458 | m_InspectorMode: 0 459 | m_LockTracker: 460 | m_IsLocked: 0 461 | m_PreviewWindow: {fileID: 0} 462 | --- !u!114 &14 463 | MonoBehaviour: 464 | m_ObjectHideFlags: 52 465 | m_CorrespondingSourceObject: {fileID: 0} 466 | m_PrefabInstance: {fileID: 0} 467 | m_PrefabAsset: {fileID: 0} 468 | m_GameObject: {fileID: 0} 469 | m_Enabled: 1 470 | m_EditorHideFlags: 1 471 | m_Script: {fileID: 12061, guid: 0000000000000000e000000000000000, type: 0} 472 | m_Name: 473 | m_EditorClassIdentifier: 474 | m_MinSize: {x: 200, y: 200} 475 | m_MaxSize: {x: 4000, y: 4000} 476 | m_TitleContent: 477 | m_Text: Hierarchy 478 | m_Image: {fileID: -590624980919486359, guid: 0000000000000000d000000000000000, 479 | type: 0} 480 | m_Tooltip: 481 | m_Pos: 482 | serializedVersion: 2 483 | x: 2097 484 | y: 511 485 | width: 227 486 | height: 321 487 | m_ViewDataDictionary: {fileID: 0} 488 | m_OverlayCanvas: 489 | m_LastAppliedPresetName: Default 490 | m_SaveData: [] 491 | m_SceneHierarchy: 492 | m_TreeViewState: 493 | scrollPos: {x: 0, y: 0} 494 | m_SelectedIDs: 495 | m_LastClickedID: 0 496 | m_ExpandedIDs: 38fbffff 497 | m_RenameOverlay: 498 | m_UserAcceptedRename: 0 499 | m_Name: 500 | m_OriginalName: 501 | m_EditFieldRect: 502 | serializedVersion: 2 503 | x: 0 504 | y: 0 505 | width: 0 506 | height: 0 507 | m_UserData: 0 508 | m_IsWaitingForDelay: 0 509 | m_IsRenaming: 0 510 | m_OriginalEventType: 11 511 | m_IsRenamingFilename: 0 512 | m_ClientGUIView: {fileID: 0} 513 | m_SearchString: 514 | m_ExpandedScenes: [] 515 | m_CurrenRootInstanceID: 0 516 | m_LockTracker: 517 | m_IsLocked: 0 518 | m_CurrentSortingName: TransformSorting 519 | m_WindowGUID: 4c969a2b90040154d917609493e03593 520 | --- !u!114 &15 521 | MonoBehaviour: 522 | m_ObjectHideFlags: 52 523 | m_CorrespondingSourceObject: {fileID: 0} 524 | m_PrefabInstance: {fileID: 0} 525 | m_PrefabAsset: {fileID: 0} 526 | m_GameObject: {fileID: 0} 527 | m_Enabled: 1 528 | m_EditorHideFlags: 1 529 | m_Script: {fileID: 12013, guid: 0000000000000000e000000000000000, type: 0} 530 | m_Name: 531 | m_EditorClassIdentifier: 532 | m_MinSize: {x: 200, y: 200} 533 | m_MaxSize: {x: 4000, y: 4000} 534 | m_TitleContent: 535 | m_Text: Scene 536 | m_Image: {fileID: 2318424515335265636, guid: 0000000000000000d000000000000000, 537 | type: 0} 538 | m_Tooltip: 539 | m_Pos: 540 | serializedVersion: 2 541 | x: 2325 542 | y: 511 543 | width: 691 544 | height: 321 545 | m_ViewDataDictionary: {fileID: 0} 546 | m_OverlayCanvas: 547 | m_LastAppliedPresetName: Default 548 | m_SaveData: 549 | - dockPosition: 0 550 | containerId: overlay-toolbar__top 551 | floating: 0 552 | collapsed: 0 553 | displayed: 1 554 | snapOffset: {x: 0, y: 0} 555 | snapOffsetDelta: {x: -101, y: -26} 556 | snapCorner: 3 557 | id: Tool Settings 558 | index: 0 559 | layout: 1 560 | - dockPosition: 0 561 | containerId: overlay-toolbar__top 562 | floating: 0 563 | collapsed: 0 564 | displayed: 1 565 | snapOffset: {x: -141, y: 149} 566 | snapOffsetDelta: {x: 0, y: 0} 567 | snapCorner: 1 568 | id: unity-grid-and-snap-toolbar 569 | index: 1 570 | layout: 1 571 | - dockPosition: 1 572 | containerId: overlay-toolbar__top 573 | floating: 0 574 | collapsed: 0 575 | displayed: 1 576 | snapOffset: {x: 0, y: 0} 577 | snapOffsetDelta: {x: 0, y: 0} 578 | snapCorner: 0 579 | id: unity-scene-view-toolbar 580 | index: 0 581 | layout: 1 582 | - dockPosition: 1 583 | containerId: overlay-toolbar__top 584 | floating: 0 585 | collapsed: 0 586 | displayed: 0 587 | snapOffset: {x: 0, y: 0} 588 | snapOffsetDelta: {x: 0, y: 0} 589 | snapCorner: 1 590 | id: unity-search-toolbar 591 | index: 1 592 | layout: 1 593 | - dockPosition: 0 594 | containerId: overlay-container--left 595 | floating: 0 596 | collapsed: 0 597 | displayed: 1 598 | snapOffset: {x: 0, y: 0} 599 | snapOffsetDelta: {x: 0, y: 0} 600 | snapCorner: 0 601 | id: unity-transform-toolbar 602 | index: 0 603 | layout: 2 604 | - dockPosition: 0 605 | containerId: overlay-container--right 606 | floating: 0 607 | collapsed: 0 608 | displayed: 1 609 | snapOffset: {x: 67.5, y: 86} 610 | snapOffsetDelta: {x: 0, y: 0} 611 | snapCorner: 0 612 | id: Orientation 613 | index: 0 614 | layout: 4 615 | - dockPosition: 1 616 | containerId: overlay-container--right 617 | floating: 0 618 | collapsed: 0 619 | displayed: 0 620 | snapOffset: {x: 0, y: 0} 621 | snapOffsetDelta: {x: 0, y: 0} 622 | snapCorner: 0 623 | id: Scene View/Light Settings 624 | index: 0 625 | layout: 4 626 | - dockPosition: 1 627 | containerId: overlay-container--right 628 | floating: 0 629 | collapsed: 0 630 | displayed: 0 631 | snapOffset: {x: 0, y: 0} 632 | snapOffsetDelta: {x: 0, y: 0} 633 | snapCorner: 0 634 | id: Scene View/Camera 635 | index: 1 636 | layout: 4 637 | - dockPosition: 1 638 | containerId: overlay-container--right 639 | floating: 0 640 | collapsed: 0 641 | displayed: 0 642 | snapOffset: {x: 0, y: 0} 643 | snapOffsetDelta: {x: 0, y: 0} 644 | snapCorner: 0 645 | id: Scene View/Cloth Constraints 646 | index: 2 647 | layout: 4 648 | - dockPosition: 1 649 | containerId: overlay-container--right 650 | floating: 0 651 | collapsed: 0 652 | displayed: 0 653 | snapOffset: {x: 0, y: 0} 654 | snapOffsetDelta: {x: 0, y: 0} 655 | snapCorner: 0 656 | id: Scene View/Cloth Collisions 657 | index: 3 658 | layout: 4 659 | - dockPosition: 1 660 | containerId: overlay-container--right 661 | floating: 0 662 | collapsed: 0 663 | displayed: 0 664 | snapOffset: {x: 0, y: 0} 665 | snapOffsetDelta: {x: 0, y: 0} 666 | snapCorner: 0 667 | id: Scene View/Navmesh Display 668 | index: 4 669 | layout: 4 670 | - dockPosition: 1 671 | containerId: overlay-container--right 672 | floating: 0 673 | collapsed: 0 674 | displayed: 0 675 | snapOffset: {x: 0, y: 0} 676 | snapOffsetDelta: {x: 0, y: 0} 677 | snapCorner: 0 678 | id: Scene View/Agent Display 679 | index: 5 680 | layout: 4 681 | - dockPosition: 1 682 | containerId: overlay-container--right 683 | floating: 0 684 | collapsed: 0 685 | displayed: 0 686 | snapOffset: {x: 0, y: 0} 687 | snapOffsetDelta: {x: 0, y: 0} 688 | snapCorner: 0 689 | id: Scene View/Obstacle Display 690 | index: 6 691 | layout: 4 692 | - dockPosition: 1 693 | containerId: overlay-container--right 694 | floating: 0 695 | collapsed: 0 696 | displayed: 0 697 | snapOffset: {x: 0, y: 0} 698 | snapOffsetDelta: {x: 0, y: 0} 699 | snapCorner: 0 700 | id: Scene View/Occlusion Culling 701 | index: 7 702 | layout: 4 703 | - dockPosition: 1 704 | containerId: overlay-container--right 705 | floating: 0 706 | collapsed: 0 707 | displayed: 0 708 | snapOffset: {x: 0, y: 0} 709 | snapOffsetDelta: {x: 0, y: 0} 710 | snapCorner: 0 711 | id: Scene View/Physics Debugger 712 | index: 8 713 | layout: 4 714 | - dockPosition: 1 715 | containerId: overlay-container--right 716 | floating: 0 717 | collapsed: 0 718 | displayed: 0 719 | snapOffset: {x: 0, y: 0} 720 | snapOffsetDelta: {x: 0, y: 0} 721 | snapCorner: 0 722 | id: Scene View/Scene Visibility 723 | index: 9 724 | layout: 4 725 | - dockPosition: 1 726 | containerId: overlay-container--right 727 | floating: 0 728 | collapsed: 0 729 | displayed: 0 730 | snapOffset: {x: 0, y: 0} 731 | snapOffsetDelta: {x: 0, y: 0} 732 | snapCorner: 0 733 | id: Scene View/Particles 734 | index: 10 735 | layout: 4 736 | m_WindowGUID: cc27987af1a868c49b0894db9c0f5429 737 | m_Gizmos: 1 738 | m_OverrideSceneCullingMask: 6917529027641081856 739 | m_SceneIsLit: 1 740 | m_SceneLighting: 1 741 | m_2DMode: 0 742 | m_isRotationLocked: 0 743 | m_PlayAudio: 0 744 | m_AudioPlay: 0 745 | m_Position: 746 | m_Target: {x: 0, y: 0, z: 0} 747 | speed: 2 748 | m_Value: {x: 0, y: 0, z: 0} 749 | m_RenderMode: 0 750 | m_CameraMode: 751 | drawMode: 0 752 | name: Shaded 753 | section: Shading Mode 754 | m_ValidateTrueMetals: 0 755 | m_DoValidateTrueMetals: 0 756 | m_ExposureSliderValue: 0 757 | m_SceneViewState: 758 | m_AlwaysRefresh: 0 759 | showFog: 1 760 | showSkybox: 1 761 | showFlares: 1 762 | showImageEffects: 1 763 | showParticleSystems: 1 764 | showVisualEffectGraphs: 1 765 | m_FxEnabled: 1 766 | m_Grid: 767 | xGrid: 768 | m_Fade: 769 | m_Target: 0 770 | speed: 2 771 | m_Value: 0 772 | m_Color: {r: 0.5, g: 0.5, b: 0.5, a: 0.4} 773 | m_Pivot: {x: 0, y: 0, z: 0} 774 | m_Size: {x: 0, y: 0} 775 | yGrid: 776 | m_Fade: 777 | m_Target: 1 778 | speed: 2 779 | m_Value: 1 780 | m_Color: {r: 0.5, g: 0.5, b: 0.5, a: 0.4} 781 | m_Pivot: {x: 0, y: 0, z: 0} 782 | m_Size: {x: 1, y: 1} 783 | zGrid: 784 | m_Fade: 785 | m_Target: 0 786 | speed: 2 787 | m_Value: 0 788 | m_Color: {r: 0.5, g: 0.5, b: 0.5, a: 0.4} 789 | m_Pivot: {x: 0, y: 0, z: 0} 790 | m_Size: {x: 0, y: 0} 791 | m_ShowGrid: 1 792 | m_GridAxis: 1 793 | m_gridOpacity: 0.5 794 | m_Rotation: 795 | m_Target: {x: -0.08717229, y: 0.89959055, z: -0.21045254, w: -0.3726226} 796 | speed: 2 797 | m_Value: {x: -0.08717229, y: 0.89959055, z: -0.21045254, w: -0.3726226} 798 | m_Size: 799 | m_Target: 10 800 | speed: 2 801 | m_Value: 10 802 | m_Ortho: 803 | m_Target: 0 804 | speed: 2 805 | m_Value: 0 806 | m_CameraSettings: 807 | m_Speed: 1 808 | m_SpeedNormalized: 0.5 809 | m_SpeedMin: 0.001 810 | m_SpeedMax: 2 811 | m_EasingEnabled: 1 812 | m_EasingDuration: 0.4 813 | m_AccelerationEnabled: 1 814 | m_FieldOfViewHorizontalOrVertical: 60 815 | m_NearClip: 0.03 816 | m_FarClip: 10000 817 | m_DynamicClip: 1 818 | m_OcclusionCulling: 0 819 | m_LastSceneViewRotation: {x: 0, y: 0, z: 0, w: 0} 820 | m_LastSceneViewOrtho: 0 821 | m_ReplacementShader: {fileID: 0} 822 | m_ReplacementString: 823 | m_SceneVisActive: 1 824 | m_LastLockedObject: {fileID: 0} 825 | m_ViewIsLockedToObject: 0 826 | --- !u!114 &16 827 | MonoBehaviour: 828 | m_ObjectHideFlags: 52 829 | m_CorrespondingSourceObject: {fileID: 0} 830 | m_PrefabInstance: {fileID: 0} 831 | m_PrefabAsset: {fileID: 0} 832 | m_GameObject: {fileID: 0} 833 | m_Enabled: 1 834 | m_EditorHideFlags: 1 835 | m_Script: {fileID: 12015, guid: 0000000000000000e000000000000000, type: 0} 836 | m_Name: 837 | m_EditorClassIdentifier: 838 | m_MinSize: {x: 200, y: 200} 839 | m_MaxSize: {x: 4000, y: 4000} 840 | m_TitleContent: 841 | m_Text: Game 842 | m_Image: {fileID: -2087823869225018852, guid: 0000000000000000d000000000000000, 843 | type: 0} 844 | m_Tooltip: 845 | m_Pos: 846 | serializedVersion: 2 847 | x: 507 848 | y: 94 849 | width: 1532 850 | height: 790 851 | m_ViewDataDictionary: {fileID: 0} 852 | m_OverlayCanvas: 853 | m_LastAppliedPresetName: Default 854 | m_SaveData: [] 855 | m_SerializedViewNames: [] 856 | m_SerializedViewValues: [] 857 | m_PlayModeViewName: GameView 858 | m_ShowGizmos: 0 859 | m_TargetDisplay: 0 860 | m_ClearColor: {r: 0, g: 0, b: 0, a: 0} 861 | m_TargetSize: {x: 1532, y: 769} 862 | m_TextureFilterMode: 0 863 | m_TextureHideFlags: 61 864 | m_RenderIMGUI: 0 865 | m_EnterPlayModeBehavior: 0 866 | m_UseMipMap: 0 867 | m_VSyncEnabled: 0 868 | m_Gizmos: 0 869 | m_Stats: 0 870 | m_SelectedSizes: 00000000000000000000000000000000000000000000000000000000000000000000000000000000 871 | m_ZoomArea: 872 | m_HRangeLocked: 0 873 | m_VRangeLocked: 0 874 | hZoomLockedByDefault: 0 875 | vZoomLockedByDefault: 0 876 | m_HBaseRangeMin: -766 877 | m_HBaseRangeMax: 766 878 | m_VBaseRangeMin: -395 879 | m_VBaseRangeMax: 395 880 | m_HAllowExceedBaseRangeMin: 1 881 | m_HAllowExceedBaseRangeMax: 1 882 | m_VAllowExceedBaseRangeMin: 1 883 | m_VAllowExceedBaseRangeMax: 1 884 | m_ScaleWithWindow: 0 885 | m_HSlider: 0 886 | m_VSlider: 0 887 | m_IgnoreScrollWheelUntilClicked: 0 888 | m_EnableMouseInput: 1 889 | m_EnableSliderZoomHorizontal: 0 890 | m_EnableSliderZoomVertical: 0 891 | m_UniformScale: 1 892 | m_UpDirection: 1 893 | m_DrawArea: 894 | serializedVersion: 2 895 | x: 0 896 | y: 0 897 | width: 1532 898 | height: 790 899 | m_Scale: {x: 1, y: 1} 900 | m_Translation: {x: 766, y: 395} 901 | m_MarginLeft: 0 902 | m_MarginRight: 0 903 | m_MarginTop: 0 904 | m_MarginBottom: 0 905 | m_LastShownAreaInsideMargins: 906 | serializedVersion: 2 907 | x: -766 908 | y: -395 909 | width: 1532 910 | height: 790 911 | m_MinimalGUI: 1 912 | m_defaultScale: 1 913 | m_LastWindowPixelSize: {x: 1532, y: 790} 914 | m_ClearInEditMode: 1 915 | m_NoCameraWarning: 1 916 | m_LowResolutionForAspectRatios: 01000000000000000000 917 | m_XRRenderMode: 0 918 | m_RenderTexture: {fileID: 0} 919 | --- !u!114 &17 920 | MonoBehaviour: 921 | m_ObjectHideFlags: 52 922 | m_CorrespondingSourceObject: {fileID: 0} 923 | m_PrefabInstance: {fileID: 0} 924 | m_PrefabAsset: {fileID: 0} 925 | m_GameObject: {fileID: 0} 926 | m_Enabled: 1 927 | m_EditorHideFlags: 1 928 | m_Script: {fileID: 12003, guid: 0000000000000000e000000000000000, type: 0} 929 | m_Name: 930 | m_EditorClassIdentifier: 931 | m_MinSize: {x: 100, y: 100} 932 | m_MaxSize: {x: 4000, y: 4000} 933 | m_TitleContent: 934 | m_Text: Console 935 | m_Image: {fileID: 111653112392082826, guid: 0000000000000000d000000000000000, 936 | type: 0} 937 | m_Tooltip: 938 | m_Pos: 939 | serializedVersion: 2 940 | x: 2097 941 | y: 853 942 | width: 920 943 | height: 419 944 | m_ViewDataDictionary: {fileID: 0} 945 | m_OverlayCanvas: 946 | m_LastAppliedPresetName: Default 947 | m_SaveData: [] 948 | -------------------------------------------------------------------------------- /UserSettings/Search.settings: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /doc/FuncExecuteTask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bian-Sh/Unity-Application-Auto-Builder/08e270c055b2462c43757ad99661254613473895/doc/FuncExecuteTask.png -------------------------------------------------------------------------------- /doc/NsisTask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bian-Sh/Unity-Application-Auto-Builder/08e270c055b2462c43757ad99661254613473895/doc/NsisTask.png -------------------------------------------------------------------------------- /doc/RunProcessTask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bian-Sh/Unity-Application-Auto-Builder/08e270c055b2462c43757ad99661254613473895/doc/RunProcessTask.png -------------------------------------------------------------------------------- /doc/VirboxTask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bian-Sh/Unity-Application-Auto-Builder/08e270c055b2462c43757ad99661254613473895/doc/VirboxTask.bmp -------------------------------------------------------------------------------- /doc/VirboxTask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bian-Sh/Unity-Application-Auto-Builder/08e270c055b2462c43757ad99661254613473895/doc/VirboxTask.png -------------------------------------------------------------------------------- /doc/autobuilder.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bian-Sh/Unity-Application-Auto-Builder/08e270c055b2462c43757ad99661254613473895/doc/autobuilder.gif -------------------------------------------------------------------------------- /doc/install.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bian-Sh/Unity-Application-Auto-Builder/08e270c055b2462c43757ad99661254613473895/doc/install.png -------------------------------------------------------------------------------- /doc/interface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bian-Sh/Unity-Application-Auto-Builder/08e270c055b2462c43757ad99661254613473895/doc/interface.png --------------------------------------------------------------------------------