├── .github └── workflows │ ├── actions │ └── checkout-orphan │ │ └── action.yml │ ├── development.yml │ └── release.yml ├── LICENSE ├── README.md ├── UnityCSharpPatch ├── .gitignore ├── .idea │ └── .idea.UnityCSharpPatch │ │ └── .idea │ │ ├── .gitignore │ │ ├── encodings.xml │ │ ├── indexLayout.xml │ │ └── vcs.xml ├── AnotherPackages │ └── com.test.local-outer-package │ │ ├── LocalOuterPackage.asmdef │ │ ├── LocalOuterPackage.asmdef.meta │ │ ├── OuterTest.cs │ │ ├── OuterTest.cs.meta │ │ ├── csc.rsp │ │ ├── csc.rsp.meta │ │ ├── package.json │ │ └── package.json.meta ├── Assets │ ├── Scene.unity │ ├── Scene.unity.meta │ ├── Scripts.meta │ └── Scripts │ │ ├── Custom.meta │ │ ├── Custom │ │ ├── Custom.asmdef │ │ ├── Custom.asmdef.meta │ │ ├── Features.meta │ │ ├── Features │ │ │ ├── Constructor.cs │ │ │ ├── Constructor.cs.meta │ │ │ ├── EmptyTypeDeclaration.cs │ │ │ ├── EmptyTypeDeclaration.cs.meta │ │ │ ├── ExtensionBlock.cs │ │ │ ├── ExtensionBlock.cs.meta │ │ │ ├── FieldKeyword.cs │ │ │ ├── FieldKeyword.cs.meta │ │ │ ├── ImplicitSpanConversions.cs │ │ │ ├── ImplicitSpanConversions.cs.meta │ │ │ ├── NullConditionalAssignment.cs │ │ │ ├── NullConditionalAssignment.cs.meta │ │ │ ├── PartialConstructor.cs │ │ │ ├── PartialConstructor.cs.meta │ │ │ ├── PartialEvent.cs │ │ │ ├── PartialEvent.cs.meta │ │ │ ├── PartialProperty.cs │ │ │ ├── PartialProperty.cs.meta │ │ │ ├── SimpleLambdaParameters.cs │ │ │ ├── SimpleLambdaParameters.cs.meta │ │ │ ├── UnboundGenericTypeNameOf.cs │ │ │ └── UnboundGenericTypeNameOf.cs.meta │ │ ├── GlobalUsings.cs │ │ ├── GlobalUsings.cs.meta │ │ ├── ITest.cs │ │ ├── ITest.cs.meta │ │ ├── TestRunner.cs │ │ ├── TestRunner.cs.meta │ │ ├── csc.rsp │ │ └── csc.rsp.meta │ │ ├── Default.meta │ │ └── Default │ │ ├── Default.asmdef │ │ ├── Default.asmdef.meta │ │ ├── KeywordAsTypeName.cs │ │ └── KeywordAsTypeName.cs.meta ├── Packages │ ├── com.kandreyc.unity-csharp-patch │ │ ├── Editor.meta │ │ ├── Editor │ │ │ ├── AssetPostProcessor.cs │ │ │ ├── AssetPostProcessor.cs.meta │ │ │ ├── CSProjectModifier.cs │ │ │ ├── CSProjectModifier.cs.meta │ │ │ ├── Csc.meta │ │ │ ├── Csc │ │ │ │ ├── CscCache.cs │ │ │ │ ├── CscCache.cs.meta │ │ │ │ ├── CscInfo.cs │ │ │ │ ├── CscInfo.cs.meta │ │ │ │ ├── CscParser.cs │ │ │ │ ├── CscParser.cs.meta │ │ │ │ ├── LocalPackagesCscCollector.cs │ │ │ │ ├── LocalPackagesCscCollector.cs.meta │ │ │ │ ├── Location.cs │ │ │ │ ├── Location.cs.meta │ │ │ │ ├── ProjectCscCollector.cs │ │ │ │ └── ProjectCscCollector.cs.meta │ │ │ ├── PatchInfo.cs │ │ │ ├── PatchInfo.cs.meta │ │ │ ├── SolutionUtility.cs │ │ │ ├── SolutionUtility.cs.meta │ │ │ ├── UnityCSharpPatch.Editor.asmdef │ │ │ ├── UnityCSharpPatch.Editor.asmdef.meta │ │ │ ├── Utils.meta │ │ │ └── Utils │ │ │ │ ├── TinyJson.cs │ │ │ │ └── TinyJson.cs.meta │ │ ├── package.json │ │ └── package.json.meta │ ├── com.test.local-inner-package │ │ ├── InnerTest.cs │ │ ├── InnerTest.cs.meta │ │ ├── LocalInnerPackage.asmdef │ │ ├── LocalInnerPackage.asmdef.meta │ │ ├── csc.rsp │ │ ├── csc.rsp.meta │ │ ├── package.json │ │ └── package.json.meta │ ├── manifest.json │ └── packages-lock.json └── ProjectSettings │ ├── AudioManager.asset │ ├── ClusterInputManager.asset │ ├── DynamicsManager.asset │ ├── EditorBuildSettings.asset │ ├── EditorSettings.asset │ ├── GraphicsSettings.asset │ ├── InputManager.asset │ ├── MemorySettings.asset │ ├── NavMeshAreas.asset │ ├── PackageManagerSettings.asset │ ├── Packages │ └── com.unity.testtools.codecoverage │ │ └── Settings.json │ ├── Physics2DSettings.asset │ ├── PresetManager.asset │ ├── ProjectSettings.asset │ ├── ProjectVersion.txt │ ├── QualitySettings.asset │ ├── SceneTemplateSettings.json │ ├── TagManager.asset │ ├── TimeManager.asset │ ├── UnityConnectSettings.asset │ ├── VFXManager.asset │ └── VersionControlSettings.asset └── UnityEditorPatch ├── .gitignore ├── Extensions ├── ModuleDefinitionExtensions.cs └── TypeDefinitionExtensions.cs ├── FodyWeavers.xml ├── FodyWeavers.xsd ├── InfoProviders ├── Editor │ ├── EditorInfo.cs │ └── EditorInfoProvider.cs └── Sdk │ ├── SDKInfo.cs │ ├── SDKInfoProvider.cs │ └── WeakAssemblyLoadContext.cs ├── Input ├── ApplyPatchOptions.cs └── RevertPatchOptions.cs ├── Interactors ├── Backup.cs ├── DotNetPatch.cs ├── PatchApplier.cs ├── PatchReverter.cs └── SourceGeneratorPatch.cs ├── Program.cs ├── Result.cs ├── UnityEditorPatch.csproj ├── UnityEditorPatch.sln └── Utilities ├── FileSystemUtility.cs └── ProcessUtility.cs /.github/workflows/actions/checkout-orphan/action.yml: -------------------------------------------------------------------------------- 1 | name: 'checkout-orphan' 2 | 3 | inputs: 4 | clean: 5 | required: true 6 | branch: 7 | required: true 8 | 9 | runs: 10 | using: "composite" 11 | steps: 12 | - name: Checkout '${{ inputs.branch }}' 13 | run: | 14 | function BranchExists() { 15 | git ls-remote --heads origin $1 | grep $1 16 | } 17 | 18 | if BranchExists "${{ inputs.branch }}" 19 | then 20 | git checkout ${{ inputs.branch }} 21 | else 22 | git checkout --orphan ${{ inputs.branch }} 23 | 24 | if ${{ inputs.clean }} == 'true' 25 | then 26 | git clean -fdx 27 | git reset --hard 28 | fi 29 | fi 30 | shell: bash 31 | 32 | - name: Clean 33 | if: ${{ inputs.clean == 'true' }} 34 | run: | 35 | rm -rf * 36 | shell: bash 37 | -------------------------------------------------------------------------------- /.github/workflows/development.yml: -------------------------------------------------------------------------------- 1 | name: development 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | build: 8 | runs-on: ubuntu-latest 9 | permissions: 10 | contents: write 11 | steps: 12 | - name: Checkout 13 | uses: actions/checkout@v4 14 | with: 15 | fetch-depth: 0 16 | 17 | - uses: actions/setup-node@v4 18 | - uses: git-actions/set-user@v1 19 | 20 | - name: Setup .NET 21 | uses: actions/setup-dotnet@v4 22 | with: 23 | dotnet-version: 8.0.x 24 | 25 | - name: Build 26 | working-directory: ./UnityEditorPatch 27 | run: | 28 | buildFolder="build/" 29 | targetFolder="./build/EditorPatch~" 30 | 31 | dotnet publish UnityEditorPatch.csproj -c Release --no-self-contained -o $buildFolder 32 | 33 | mkdir $targetFolder 34 | mv ./build/UnityEditorPatch.dll $targetFolder 35 | mv ./build/UnityEditorPatch.runtimeconfig.json $targetFolder 36 | 37 | - name: Assemble Package 38 | run: | 39 | mkdir package 40 | mv ./UnityEditorPatch/build/EditorPatch~ ./package 41 | mv ./UnityCSharpPatch/Packages/com.kandreyc.unity-csharp-patch/** ./package 42 | 43 | - name: Publish Artifacts 44 | uses: actions/upload-artifact@v4 45 | with: 46 | name: package 47 | path: ./package/** 48 | retention-days: 1 -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: release 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | build: 8 | runs-on: ubuntu-latest 9 | permissions: 10 | contents: write 11 | steps: 12 | - name: Checkout 13 | uses: actions/checkout@v4 14 | with: 15 | fetch-depth: 0 16 | 17 | - uses: actions/setup-node@v4 18 | - uses: git-actions/set-user@v1 19 | 20 | - name: Setup .NET 21 | uses: actions/setup-dotnet@v4 22 | with: 23 | dotnet-version: 8.0.x 24 | 25 | - name: Build 26 | working-directory: ./UnityEditorPatch 27 | run: | 28 | buildFolder="build/" 29 | targetFolder="./build/EditorPatch~" 30 | 31 | dotnet publish UnityEditorPatch.csproj -c Release --no-self-contained -o $buildFolder 32 | 33 | mkdir $targetFolder 34 | mv ./build/UnityEditorPatch.dll $targetFolder 35 | mv ./build/UnityEditorPatch.runtimeconfig.json $targetFolder 36 | 37 | - name: Assemble Package 38 | run: | 39 | mkdir package 40 | mv ./UnityEditorPatch/build/EditorPatch~ ./package 41 | mv ./UnityCSharpPatch/Packages/com.kandreyc.unity-csharp-patch/** ./package 42 | 43 | - name: Publish Artifacts 44 | uses: actions/upload-artifact@v4 45 | with: 46 | name: release 47 | path: ./package/** 48 | retention-days: 1 49 | 50 | - uses: ./.github/workflows/actions/checkout-orphan 51 | name: Checkout 'release' 52 | with: 53 | branch: release 54 | clean: true 55 | 56 | - uses: actions/download-artifact@v4 57 | with: 58 | name: release 59 | 60 | - uses: actions-ecosystem/action-get-latest-tag@v1 61 | id: get-latest-tag 62 | with: 63 | initial_version: "v1.0.0" 64 | with_initial_version: true 65 | 66 | - name: Publish Release 67 | run: | 68 | function TagExists() { 69 | git rev-parse $1 >/dev/null 2>&1 70 | } 71 | 72 | name=$(npm pkg get name --workspaces=false | tr -d \") 73 | tag_version="${{ steps.get-latest-tag.outputs.tag }}" 74 | version="${tag_version#v}" 75 | 76 | npm pkg set version=$version 77 | 78 | if TagExists $tag_version 79 | then 80 | npm version minor --no-git-tag-version 81 | version=$(npm pkg get version --workspaces=false | tr -d \") 82 | tag_version="v$version" 83 | fi 84 | 85 | git add * 86 | git commit -m "$name@$version" 87 | git tag $tag_version 88 | 89 | git push origin release 90 | git push origin $tag_version 91 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Andreychuk Karim 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Unity C# Patch 2 | ================ 3 | [![release](https://github.com/kandreyc/unity-csharp-patch/actions/workflows/release.yml/badge.svg)](https://github.com/kandreyc/unity-csharp-patch/actions/workflows/release.yml) 4 | ![Static Badge](https://img.shields.io/badge/Unity-2022%2B-black.svg?style=flat&logo=unity&color=%231f1f1f) 5 | 6 | Unleash the full potential by being in sync with the latest C# versions that are configured individually for each ``.asmdef``. 7 | 8 | How it works: 9 | ------------- 10 | 1. **Editor Patching**: The `UnityEditorPatch` is responsible for updating the built-in dotnet SDK within the Unity editor. Unity, by default, ships with dotnet version `6.0.21`. 11 | 12 | 2. **Language Version Tracking**: `UnityPackage` keeps track of the C# language version specified in your `csc.rsp` file that is located alongside each `.asmdef`. This is required to help Unity to understand which C# version it should use while compiling the code of your `.asmdef`. 13 | 14 | 3. **Project File Adjustment**: Finally, `UnityPackage` modifies the `.csproj` file to reflect the C# version specified in the `csc.rsp`. This alerts your IDE to the correct language version to use, ensuring it can provide you with all the relevant language features. 15 | 16 | Supported AssemblyDefinition locations: 17 | -------- 18 | 1. Project - everything that is located in `Assets/` folder of your project. 19 | 2. Embedded Packages - everything that is located in `Packages/` folder of your project. 20 | 3. Local Packages - everything that is located anywhere on your pc with specified path with `file:` prefix in manifest. 21 | 22 | > [!WARNING] 23 | > **DON'T** put `.asmdef` with its `csc.rsp` at the root of the project (`Assets/`). 24 | > Unity in that case will apply the specified C# version to everything, that may cause compile errors (e.g. `field` keyword is used as a name in some third party library). 25 | > Place it in any subfolder (usually Scripts, but doesn't matter, just not at the root) 26 | 27 | 28 | > [!NOTE] 29 | > OS support: Mac / Linux / Windows. 30 | > You can backup your editor just in case, but should be fine. 31 | > 32 | > Patch will modify the Editor installation, so all the projects that are using it will be affected (default for unity C# version will be used for compilation, but from newer (patched) dotnet sdk) 33 | > 34 | > Tested on target platforms: Mac / Windows / Linux / iOS / Android / WebGL 35 | > 36 | > Tested in IDEs: 37 | > 38 | > `Rider 2025.1` with integration package `com.unity.ide.rider@3.0.36` 39 | > 40 | > `VSCode 1.99.3` with integration package `com.unity.ide.visualstudio@2.0.23` 41 | > 42 | > `Visual Studio Community 2022 17.13.6` with integration package `com.unity.ide.visualstudio@2.0.23` 43 | 44 | How to Install: 45 | --------------- 46 | 47 | 1. Add the package via git url ``https://github.com/kandreyc/unity-csharp-patch.git#v1.4.0`` 48 | 2. Ensure Unity Editor is closed. 49 | 3. Ensure latest dotnet sdk is installed. [Download Page](https://dotnet.microsoft.com/en-us/download) 50 | 4. Open terminal at folder ``EditorPatch~`` inside the added package. 51 | 5. Patch the editor (administrative privileges are required): 52 | ``` 53 | $ dotnet UnityEditorPatch.dll apply --editor '/Applications/Unity/Hub/Editor/2022.3.21f1' --allow-prerelease 54 | ``` 55 | where ``--editor`` - path to the unity editor 56 | 57 | where ``--allow-prerelease`` - (optional) allows to use prerelease dotnet sdk 58 | 59 | In case if you want to revert the patch: 60 | ``` 61 | $ dotnet UnityEditorPatch.dll revert --editor '/Applications/Unity/Hub/Editor/2022.3.21f1' 62 | ``` 63 | where ``--editor`` - path to the unity editor 64 | 65 | 6. Open the Unity Editor with your project and create a `csc.rsp` file alongside desired `.asmdef` with the following content: 66 | ``` 67 | -langVersion:13 68 | -nullable:enable 69 | ``` 70 | where: 71 | 72 | - ``langVersion`` (optional) - C# version you want to be used for this ``.asmdef``. Values are ``10``, ``11``, ``12``, ``13``, ``preview`` 73 | - ``nullable`` (optional) - allows to use nullables like ``string?`` without defining ``#nullable enable/disable`` in each file where it used. Values are ``enable``, ``disable`` 74 | 75 | 7. Refresh the Editor. All required magic should be done here. 76 | 8. Enjoy! 77 | 78 | Language Support 79 | ---------------- 80 | 81 | > [!NOTE] 82 | > `preview` features support of .net 10 in `Rider` / `Visual Studio` is still in development. 83 | > Code will compile and work, but you may suffer from errors in IDE. 84 | > Currently only `VSCode` supports all new features 85 | 86 | C# | Feature | Support 87 | -|-|:-----: 88 | preview | [`field` keyword](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-14#the-field-keyword) | Yes 89 | preview | [`partial` events and instance constructors](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-14#more-partial-members) | Yes 90 | preview | [`nameof` unbound generic types support for](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-14#unbound-generic-types-and-nameof) | Yes 91 | preview | [Extension members](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-14#extension-members) | Yes 92 | preview | [Null conditional assignment](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-14#null-conditional-assignment) | Yes 93 | preview | [Simple lambda parameters](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-14#simple-lambda-parameters-with-modifiers) | Yes 94 | preview | [Implicit span conversions](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-14#implicit-span-conversions) | Yes 95 | 13 | [`params` collections](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-13#params-collections) | Yes 96 | 13 | [New lock type and semantics](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-13#new-lock-object) | No 97 | 13 | [New escape sequence - \\e](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-13#new-escape-sequence) | Yes 98 | 13 | [Method group natural type improvements](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-13#method-group-natural-type) | Yes 99 | 13 | [Implicit indexer access in object initializers](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-13#implicit-index-access) | Yes 100 | 13 | [Enable ref locals and unsafe contexts in iterators and async methods](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-13#ref-and-unsafe-in-iterators-and-async-methods) | Yes 101 | 13 | [Enable ref struct types to implement interfaces](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-13#ref-struct-interfaces) | No 102 | 13 | [Allow ref struct types as arguments for type parameters in generics](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-13#allows-ref-struct) | No 103 | 13 | [Partial properties and indexers](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-13#more-partial-members) | Yes 104 | 13 | [Overload resolution priority](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-13#overload-resolution-priority) | PolySharp 105 | 12 | [Primary constructors](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-12#primary-constructors) | Yes 106 | 12 | [Optional parameters in lambda expressions](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-12#default-lambda-parameters) | Yes 107 | 12 | [Alias for any type](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-12#alias-any-type) | Yes 108 | 12 | [Inline arrays](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-12#inline-arrays) | No 109 | 12 | [Collection expressions](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-12#collection-expressions) | Yes 110 | 12 | [Interceptors](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-12#interceptors) | No 111 | 11 | [Raw string literals](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-11#raw-string-literals) | Yes 112 | 11 | [`static abstract/static virtual` members in interfaces](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-11#generic-math-support) | No 113 | 11 | [Checked user defined operators](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-11#generic-math-support) | Yes 114 | 11 | [Relaxed shift operators](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-11#generic-math-support) | Yes 115 | 11 | [Unsigned right-shift operator](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-11#generic-math-support) | Yes 116 | 11 | [Generic attributes](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-11#generic-attributes) | Crash 117 | 11 | [UTF-8 string literals](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-11#utf-8-string-literals) | Yes 118 | 11 | [Newlines in string interpolations](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-11#newlines-in-string-interpolations) | Yes 119 | 11 | [List patterns](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-11#list-patterns) | Yes 120 | 11 | [File-local types](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-11#file-local-types) | Yes 121 | 11 | [Required members](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-11#required-members) | PolySharp 122 | 11 | [Auto-default structs](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-11#auto-default-struct) | Yes 123 | 11 | [Pattern match `Span` or `ReadOnlySpan` on a constant `string`](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-11#pattern-match-spanchar-or-readonlyspanchar-on-a-constant-string) | Yes 124 | 11 | [Extended nameof scope](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-11#extended-nameof-scope) | Yes 125 | 11 | [Numeric `IntPtr` and `UIntPtr`](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-11#numeric-intptr-and-uintptr) | Yes 126 | 11 | [`ref` fields](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-11#ref-fields-and-ref-scoped-variables) | No 127 | 11 | [`ref scoped` variables](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-11#ref-fields-and-ref-scoped-variables) | PolySharp 128 | 11 | [Improved method group conversion to delegate](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-11#improved-method-group-conversion-to-delegate) | Yes 129 | 10 | [Record structs](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-10#record-structs) | Yes 130 | 10 | [Improvements of structure types](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-10#improvements-of-structure-types) | Yes 131 | 10 | [Interpolated string handler](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-10#interpolated-string-handler) | PolySharp 132 | 10 | [Global using directives](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-10#global-using-directives) | Yes 133 | 10 | [File-scoped namespace declaration](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-10#file-scoped-namespace-declaration) | Yes 134 | 10 | [Extended property patterns](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-10#extended-property-patterns) | Yes 135 | 10 | [Lambda expression improvements](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-10#lambda-expression-improvements) | Yes 136 | 10 | [Constant interpolated strings](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-10#constant-interpolated-strings) | Yes 137 | 10 | [Record types can seal ToString](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-10#record-types-can-seal-tostring) | Yes 138 | 10 | [Assignment and declaration in same deconstruction](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-10#assignment-and-declaration-in-same-deconstruction) | Yes 139 | 10 | [Improved definite assignment](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-10#improved-definite-assignment) | Yes 140 | 10 | [CallerArgumentExpression attribute](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-10#callerargumentexpression-attribute-diagnostics) | PolySharp 141 | 10 | [Enhanced #line pragma](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-10#enhanced-line-pragma) | Yes 142 | 143 | **Support:** 144 | * **Yes** - feature works exactly as expected. 145 | * **No** - requires runtime features or BCL changes that Unity does not have. Attempting to use the feature may result in compiler errors. 146 | * **Crash** - requires runtime features that Unity does not have. Attempting to use the feature may compile, but will result in crashes. 147 | * **PolySharp** - feature works when using [PolySharp](https://github.com/Sergio0694/PolySharp) and/or manually implementing missing APIs. 148 | 149 | Motivation 150 | ========== 151 | This project was inspired and motivated by two key repositories: 152 | 1. [CsprojModifier](https://github.com/Cysharp/CsprojModifier) 153 | 2. [UnityRoslynUpdater](https://github.com/DaZombieKiller/UnityRoslynUpdater) 154 | 155 | While the **UnityRoslynUpdater** serves its purpose by upgrading the C# version across all projects, my goal was to allow using custom C# version only where it is required. 156 | So that my package gives the control of what assemblies should be allowed to use newer C# version, which helps to prevent naming conflicts with embedded/thirdparty libs/sdks, or affect the projects that you don't want to 157 | 158 | Inspired by **CsprojModifier**, I've automated modifying ``.csproj`` files based on ``.asmdef`` properties, making it possible for your IDE to use the newest C# features. 159 | -------------------------------------------------------------------------------- /UnityCSharpPatch/.gitignore: -------------------------------------------------------------------------------- 1 | # This .gitignore file should be placed at the root of your Unity project directory 2 | # 3 | # Get latest from https://github.com/github/gitignore/blob/main/Unity.gitignore 4 | # 5 | /[Ll]ibrary/ 6 | /[Tt]emp/ 7 | /[Oo]bj/ 8 | /[Bb]uild/ 9 | /[Bb]uilds/ 10 | /[Ll]ogs/ 11 | /[Uu]ser[Ss]ettings/ 12 | 13 | # MemoryCaptures can get excessive in size. 14 | # They also could contain extremely sensitive data 15 | /[Mm]emoryCaptures/ 16 | 17 | # Recordings can get excessive in size 18 | /[Rr]ecordings/ 19 | 20 | # Uncomment this line if you wish to ignore the asset store tools plugin 21 | # /[Aa]ssets/AssetStoreTools* 22 | 23 | # Autogenerated Jetbrains Rider plugin 24 | /[Aa]ssets/Plugins/Editor/JetBrains* 25 | 26 | # Visual Studio cache directory 27 | .vs/ 28 | 29 | # Gradle cache directory 30 | .gradle/ 31 | 32 | # Autogenerated VS/MD/Consulo solution and project files 33 | ExportedObj/ 34 | .consulo/ 35 | *.csproj 36 | *.unityproj 37 | *.sln 38 | *.suo 39 | *.tmp 40 | *.user 41 | *.userprefs 42 | *.pidb 43 | *.booproj 44 | *.svd 45 | *.pdb 46 | *.mdb 47 | *.opendb 48 | *.VC.db 49 | 50 | # Unity3D generated meta files 51 | *.pidb.meta 52 | *.pdb.meta 53 | *.mdb.meta 54 | 55 | # Unity3D generated file on crash reports 56 | sysinfo.txt 57 | 58 | # Builds 59 | *.apk 60 | *.aab 61 | *.unitypackage 62 | *.app 63 | 64 | # Crashlytics generated file 65 | crashlytics-build.properties 66 | 67 | # Packed Addressables 68 | /[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin* 69 | 70 | # Temporary auto-generated Android Assets 71 | /[Aa]ssets/[Ss]treamingAssets/aa.meta 72 | /[Aa]ssets/[Ss]treamingAssets/aa/* -------------------------------------------------------------------------------- /UnityCSharpPatch/.idea/.idea.UnityCSharpPatch/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Rider ignored files 5 | /.idea.UnityCSharpPatch.iml 6 | /contentModel.xml 7 | /modules.xml 8 | /projectSettingsUpdater.xml 9 | # Editor-based HTTP Client requests 10 | /httpRequests/ 11 | # Datasource local storage ignored files 12 | /dataSources/ 13 | /dataSources.local.xml 14 | -------------------------------------------------------------------------------- /UnityCSharpPatch/.idea/.idea.UnityCSharpPatch/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /UnityCSharpPatch/.idea/.idea.UnityCSharpPatch/.idea/indexLayout.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /UnityCSharpPatch/.idea/.idea.UnityCSharpPatch/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /UnityCSharpPatch/AnotherPackages/com.test.local-outer-package/LocalOuterPackage.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "LocalOuterPackage" 3 | } 4 | -------------------------------------------------------------------------------- /UnityCSharpPatch/AnotherPackages/com.test.local-outer-package/LocalOuterPackage.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f08394f3d44514713a749d6e805b9fa8 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /UnityCSharpPatch/AnotherPackages/com.test.local-outer-package/OuterTest.cs: -------------------------------------------------------------------------------- 1 | public class OuterTest; -------------------------------------------------------------------------------- /UnityCSharpPatch/AnotherPackages/com.test.local-outer-package/OuterTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 84ab57069bf64a5e89b6b9136d0bb8cf 3 | timeCreated: 1721143254 -------------------------------------------------------------------------------- /UnityCSharpPatch/AnotherPackages/com.test.local-outer-package/csc.rsp: -------------------------------------------------------------------------------- 1 | -langVersion:12 2 | -nullable:enable -------------------------------------------------------------------------------- /UnityCSharpPatch/AnotherPackages/com.test.local-outer-package/csc.rsp.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ff5044b61b90345cfba978c62ab1c0ae 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /UnityCSharpPatch/AnotherPackages/com.test.local-outer-package/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "displayName": "Local Outer Package", 3 | "name": "com.test.local-outer-package", 4 | "version": "1.0.0", 5 | "unity": "2022.3", 6 | "description": "" 7 | } 8 | -------------------------------------------------------------------------------- /UnityCSharpPatch/AnotherPackages/com.test.local-outer-package/package.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 42f2db03088bc45a5a54b499728fffee 3 | PackageManifestImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scene.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: 0} 41 | m_UseRadianceAmbientProbe: 0 42 | --- !u!157 &3 43 | LightmapSettings: 44 | m_ObjectHideFlags: 0 45 | serializedVersion: 12 46 | m_GIWorkflowMode: 1 47 | m_GISettings: 48 | serializedVersion: 2 49 | m_BounceScale: 1 50 | m_IndirectOutputScale: 1 51 | m_AlbedoBoost: 1 52 | m_EnvironmentLightingMode: 0 53 | m_EnableBakedLightmaps: 1 54 | m_EnableRealtimeLightmaps: 0 55 | m_LightmapEditorSettings: 56 | serializedVersion: 12 57 | m_Resolution: 2 58 | m_BakeResolution: 40 59 | m_AtlasSize: 1024 60 | m_AO: 0 61 | m_AOMaxDistance: 1 62 | m_CompAOExponent: 1 63 | m_CompAOExponentDirect: 0 64 | m_ExtractAmbientOcclusion: 0 65 | m_Padding: 2 66 | m_LightmapParameters: {fileID: 0} 67 | m_LightmapsBakeMode: 1 68 | m_TextureCompression: 1 69 | m_FinalGather: 0 70 | m_FinalGatherFiltering: 1 71 | m_FinalGatherRayCount: 256 72 | m_ReflectionCompression: 2 73 | m_MixedBakeMode: 2 74 | m_BakeBackend: 1 75 | m_PVRSampling: 1 76 | m_PVRDirectSampleCount: 32 77 | m_PVRSampleCount: 512 78 | m_PVRBounces: 2 79 | m_PVREnvironmentSampleCount: 256 80 | m_PVREnvironmentReferencePointCount: 2048 81 | m_PVRFilteringMode: 1 82 | m_PVRDenoiserTypeDirect: 1 83 | m_PVRDenoiserTypeIndirect: 1 84 | m_PVRDenoiserTypeAO: 1 85 | m_PVRFilterTypeDirect: 0 86 | m_PVRFilterTypeIndirect: 0 87 | m_PVRFilterTypeAO: 0 88 | m_PVREnvironmentMIS: 1 89 | m_PVRCulling: 1 90 | m_PVRFilteringGaussRadiusDirect: 1 91 | m_PVRFilteringGaussRadiusIndirect: 5 92 | m_PVRFilteringGaussRadiusAO: 2 93 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 94 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 95 | m_PVRFilteringAtrousPositionSigmaAO: 1 96 | m_ExportTrainingData: 0 97 | m_TrainingDataDestination: TrainingData 98 | m_LightProbeSampleCountMultiplier: 4 99 | m_LightingDataAsset: {fileID: 0} 100 | m_LightingSettings: {fileID: 0} 101 | --- !u!196 &4 102 | NavMeshSettings: 103 | serializedVersion: 2 104 | m_ObjectHideFlags: 0 105 | m_BuildSettings: 106 | serializedVersion: 3 107 | agentTypeID: 0 108 | agentRadius: 0.5 109 | agentHeight: 2 110 | agentSlope: 45 111 | agentClimb: 0.4 112 | ledgeDropHeight: 0 113 | maxJumpAcrossDistance: 0 114 | minRegionArea: 2 115 | manualCellSize: 0 116 | cellSize: 0.16666667 117 | manualTileSize: 0 118 | tileSize: 256 119 | buildHeightMesh: 0 120 | maxJobWorkers: 0 121 | preserveTilesOutsideBounds: 0 122 | debug: 123 | m_Flags: 0 124 | m_NavMeshData: {fileID: 0} 125 | --- !u!1 &83502837 126 | GameObject: 127 | m_ObjectHideFlags: 0 128 | m_CorrespondingSourceObject: {fileID: 0} 129 | m_PrefabInstance: {fileID: 0} 130 | m_PrefabAsset: {fileID: 0} 131 | serializedVersion: 6 132 | m_Component: 133 | - component: {fileID: 83502841} 134 | - component: {fileID: 83502840} 135 | - component: {fileID: 83502839} 136 | - component: {fileID: 83502838} 137 | m_Layer: 5 138 | m_Name: Canvas 139 | m_TagString: Untagged 140 | m_Icon: {fileID: 0} 141 | m_NavMeshLayer: 0 142 | m_StaticEditorFlags: 0 143 | m_IsActive: 1 144 | --- !u!114 &83502838 145 | MonoBehaviour: 146 | m_ObjectHideFlags: 0 147 | m_CorrespondingSourceObject: {fileID: 0} 148 | m_PrefabInstance: {fileID: 0} 149 | m_PrefabAsset: {fileID: 0} 150 | m_GameObject: {fileID: 83502837} 151 | m_Enabled: 1 152 | m_EditorHideFlags: 0 153 | m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} 154 | m_Name: 155 | m_EditorClassIdentifier: 156 | m_IgnoreReversedGraphics: 1 157 | m_BlockingObjects: 0 158 | m_BlockingMask: 159 | serializedVersion: 2 160 | m_Bits: 4294967295 161 | --- !u!114 &83502839 162 | MonoBehaviour: 163 | m_ObjectHideFlags: 0 164 | m_CorrespondingSourceObject: {fileID: 0} 165 | m_PrefabInstance: {fileID: 0} 166 | m_PrefabAsset: {fileID: 0} 167 | m_GameObject: {fileID: 83502837} 168 | m_Enabled: 1 169 | m_EditorHideFlags: 0 170 | m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} 171 | m_Name: 172 | m_EditorClassIdentifier: 173 | m_UiScaleMode: 1 174 | m_ReferencePixelsPerUnit: 100 175 | m_ScaleFactor: 1 176 | m_ReferenceResolution: {x: 1080, y: 1920} 177 | m_ScreenMatchMode: 0 178 | m_MatchWidthOrHeight: 0 179 | m_PhysicalUnit: 3 180 | m_FallbackScreenDPI: 96 181 | m_DefaultSpriteDPI: 96 182 | m_DynamicPixelsPerUnit: 1 183 | m_PresetInfoIsWorld: 0 184 | --- !u!223 &83502840 185 | Canvas: 186 | m_ObjectHideFlags: 0 187 | m_CorrespondingSourceObject: {fileID: 0} 188 | m_PrefabInstance: {fileID: 0} 189 | m_PrefabAsset: {fileID: 0} 190 | m_GameObject: {fileID: 83502837} 191 | m_Enabled: 1 192 | serializedVersion: 3 193 | m_RenderMode: 0 194 | m_Camera: {fileID: 0} 195 | m_PlaneDistance: 100 196 | m_PixelPerfect: 0 197 | m_ReceivesEvents: 1 198 | m_OverrideSorting: 0 199 | m_OverridePixelPerfect: 0 200 | m_SortingBucketNormalizedSize: 0 201 | m_VertexColorAlwaysGammaSpace: 0 202 | m_AdditionalShaderChannelsFlag: 0 203 | m_UpdateRectTransformForStandalone: 0 204 | m_SortingLayerID: 0 205 | m_SortingOrder: 0 206 | m_TargetDisplay: 0 207 | --- !u!224 &83502841 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: 83502837} 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: 605357146} 220 | m_Father: {fileID: 0} 221 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 222 | m_AnchorMin: {x: 0, y: 0} 223 | m_AnchorMax: {x: 0, y: 0} 224 | m_AnchoredPosition: {x: 0, y: 0} 225 | m_SizeDelta: {x: 0, y: 0} 226 | m_Pivot: {x: 0, y: 0} 227 | --- !u!1 &438930283 228 | GameObject: 229 | m_ObjectHideFlags: 0 230 | m_CorrespondingSourceObject: {fileID: 0} 231 | m_PrefabInstance: {fileID: 0} 232 | m_PrefabAsset: {fileID: 0} 233 | serializedVersion: 6 234 | m_Component: 235 | - component: {fileID: 438930286} 236 | - component: {fileID: 438930285} 237 | - component: {fileID: 438930287} 238 | m_Layer: 0 239 | m_Name: Main Camera 240 | m_TagString: MainCamera 241 | m_Icon: {fileID: 0} 242 | m_NavMeshLayer: 0 243 | m_StaticEditorFlags: 0 244 | m_IsActive: 1 245 | --- !u!20 &438930285 246 | Camera: 247 | m_ObjectHideFlags: 0 248 | m_CorrespondingSourceObject: {fileID: 0} 249 | m_PrefabInstance: {fileID: 0} 250 | m_PrefabAsset: {fileID: 0} 251 | m_GameObject: {fileID: 438930283} 252 | m_Enabled: 1 253 | serializedVersion: 2 254 | m_ClearFlags: 2 255 | m_BackGroundColor: {r: 0.3018868, g: 0.3018868, b: 0.3018868, a: 1} 256 | m_projectionMatrixMode: 1 257 | m_GateFitMode: 2 258 | m_FOVAxisMode: 0 259 | m_Iso: 200 260 | m_ShutterSpeed: 0.005 261 | m_Aperture: 16 262 | m_FocusDistance: 10 263 | m_FocalLength: 50 264 | m_BladeCount: 5 265 | m_Curvature: {x: 2, y: 11} 266 | m_BarrelClipping: 0.25 267 | m_Anamorphism: 0 268 | m_SensorSize: {x: 36, y: 24} 269 | m_LensShift: {x: 0, y: 0} 270 | m_NormalizedViewPortRect: 271 | serializedVersion: 2 272 | x: 0 273 | y: 0 274 | width: 1 275 | height: 1 276 | near clip plane: 0 277 | far clip plane: 1 278 | field of view: 60 279 | orthographic: 1 280 | orthographic size: 1 281 | m_Depth: -1 282 | m_CullingMask: 283 | serializedVersion: 2 284 | m_Bits: 4294967295 285 | m_RenderingPath: -1 286 | m_TargetTexture: {fileID: 0} 287 | m_TargetDisplay: 0 288 | m_TargetEye: 3 289 | m_HDR: 1 290 | m_AllowMSAA: 1 291 | m_AllowDynamicResolution: 0 292 | m_ForceIntoRT: 0 293 | m_OcclusionCulling: 1 294 | m_StereoConvergence: 10 295 | m_StereoSeparation: 0.022 296 | --- !u!4 &438930286 297 | Transform: 298 | m_ObjectHideFlags: 0 299 | m_CorrespondingSourceObject: {fileID: 0} 300 | m_PrefabInstance: {fileID: 0} 301 | m_PrefabAsset: {fileID: 0} 302 | m_GameObject: {fileID: 438930283} 303 | serializedVersion: 2 304 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 305 | m_LocalPosition: {x: 0, y: 1, z: -10} 306 | m_LocalScale: {x: 1, y: 1, z: 1} 307 | m_ConstrainProportionsScale: 0 308 | m_Children: [] 309 | m_Father: {fileID: 0} 310 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 311 | --- !u!114 &438930287 312 | MonoBehaviour: 313 | m_ObjectHideFlags: 0 314 | m_CorrespondingSourceObject: {fileID: 0} 315 | m_PrefabInstance: {fileID: 0} 316 | m_PrefabAsset: {fileID: 0} 317 | m_GameObject: {fileID: 438930283} 318 | m_Enabled: 1 319 | m_EditorHideFlags: 0 320 | m_Script: {fileID: 11500000, guid: 77036910f02c4bc59877e1a9b6b26603, type: 3} 321 | m_Name: 322 | m_EditorClassIdentifier: 323 | _text: {fileID: 1277855983} 324 | --- !u!1 &560130992 325 | GameObject: 326 | m_ObjectHideFlags: 0 327 | m_CorrespondingSourceObject: {fileID: 0} 328 | m_PrefabInstance: {fileID: 0} 329 | m_PrefabAsset: {fileID: 0} 330 | serializedVersion: 6 331 | m_Component: 332 | - component: {fileID: 560130995} 333 | - component: {fileID: 560130994} 334 | - component: {fileID: 560130993} 335 | m_Layer: 0 336 | m_Name: EventSystem 337 | m_TagString: Untagged 338 | m_Icon: {fileID: 0} 339 | m_NavMeshLayer: 0 340 | m_StaticEditorFlags: 0 341 | m_IsActive: 1 342 | --- !u!114 &560130993 343 | MonoBehaviour: 344 | m_ObjectHideFlags: 0 345 | m_CorrespondingSourceObject: {fileID: 0} 346 | m_PrefabInstance: {fileID: 0} 347 | m_PrefabAsset: {fileID: 0} 348 | m_GameObject: {fileID: 560130992} 349 | m_Enabled: 1 350 | m_EditorHideFlags: 0 351 | m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} 352 | m_Name: 353 | m_EditorClassIdentifier: 354 | m_SendPointerHoverToParent: 1 355 | m_HorizontalAxis: Horizontal 356 | m_VerticalAxis: Vertical 357 | m_SubmitButton: Submit 358 | m_CancelButton: Cancel 359 | m_InputActionsPerSecond: 10 360 | m_RepeatDelay: 0.5 361 | m_ForceModuleActive: 0 362 | --- !u!114 &560130994 363 | MonoBehaviour: 364 | m_ObjectHideFlags: 0 365 | m_CorrespondingSourceObject: {fileID: 0} 366 | m_PrefabInstance: {fileID: 0} 367 | m_PrefabAsset: {fileID: 0} 368 | m_GameObject: {fileID: 560130992} 369 | m_Enabled: 1 370 | m_EditorHideFlags: 0 371 | m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} 372 | m_Name: 373 | m_EditorClassIdentifier: 374 | m_FirstSelected: {fileID: 0} 375 | m_sendNavigationEvents: 1 376 | m_DragThreshold: 10 377 | --- !u!4 &560130995 378 | Transform: 379 | m_ObjectHideFlags: 0 380 | m_CorrespondingSourceObject: {fileID: 0} 381 | m_PrefabInstance: {fileID: 0} 382 | m_PrefabAsset: {fileID: 0} 383 | m_GameObject: {fileID: 560130992} 384 | serializedVersion: 2 385 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 386 | m_LocalPosition: {x: 0, y: 0, z: 0} 387 | m_LocalScale: {x: 1, y: 1, z: 1} 388 | m_ConstrainProportionsScale: 0 389 | m_Children: [] 390 | m_Father: {fileID: 0} 391 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 392 | --- !u!1 &605357145 393 | GameObject: 394 | m_ObjectHideFlags: 0 395 | m_CorrespondingSourceObject: {fileID: 0} 396 | m_PrefabInstance: {fileID: 0} 397 | m_PrefabAsset: {fileID: 0} 398 | serializedVersion: 6 399 | m_Component: 400 | - component: {fileID: 605357146} 401 | - component: {fileID: 605357149} 402 | - component: {fileID: 605357148} 403 | - component: {fileID: 605357147} 404 | m_Layer: 5 405 | m_Name: Scroll View 406 | m_TagString: Untagged 407 | m_Icon: {fileID: 0} 408 | m_NavMeshLayer: 0 409 | m_StaticEditorFlags: 0 410 | m_IsActive: 1 411 | --- !u!224 &605357146 412 | RectTransform: 413 | m_ObjectHideFlags: 0 414 | m_CorrespondingSourceObject: {fileID: 0} 415 | m_PrefabInstance: {fileID: 0} 416 | m_PrefabAsset: {fileID: 0} 417 | m_GameObject: {fileID: 605357145} 418 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 419 | m_LocalPosition: {x: 0, y: 0, z: 0} 420 | m_LocalScale: {x: 1, y: 1, z: 1} 421 | m_ConstrainProportionsScale: 0 422 | m_Children: 423 | - {fileID: 736999110} 424 | m_Father: {fileID: 83502841} 425 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 426 | m_AnchorMin: {x: 0, y: 0} 427 | m_AnchorMax: {x: 1, y: 1} 428 | m_AnchoredPosition: {x: 0, y: 0} 429 | m_SizeDelta: {x: 0, y: 0} 430 | m_Pivot: {x: 0.5, y: 0.5} 431 | --- !u!114 &605357147 432 | MonoBehaviour: 433 | m_ObjectHideFlags: 0 434 | m_CorrespondingSourceObject: {fileID: 0} 435 | m_PrefabInstance: {fileID: 0} 436 | m_PrefabAsset: {fileID: 0} 437 | m_GameObject: {fileID: 605357145} 438 | m_Enabled: 1 439 | m_EditorHideFlags: 0 440 | m_Script: {fileID: 11500000, guid: 1aa08ab6e0800fa44ae55d278d1423e3, type: 3} 441 | m_Name: 442 | m_EditorClassIdentifier: 443 | m_Content: {fileID: 1491675941} 444 | m_Horizontal: 0 445 | m_Vertical: 1 446 | m_MovementType: 1 447 | m_Elasticity: 0.1 448 | m_Inertia: 1 449 | m_DecelerationRate: 0.135 450 | m_ScrollSensitivity: 1 451 | m_Viewport: {fileID: 736999110} 452 | m_HorizontalScrollbar: {fileID: 0} 453 | m_VerticalScrollbar: {fileID: 0} 454 | m_HorizontalScrollbarVisibility: 2 455 | m_VerticalScrollbarVisibility: 2 456 | m_HorizontalScrollbarSpacing: -3 457 | m_VerticalScrollbarSpacing: -3 458 | m_OnValueChanged: 459 | m_PersistentCalls: 460 | m_Calls: [] 461 | --- !u!114 &605357148 462 | MonoBehaviour: 463 | m_ObjectHideFlags: 0 464 | m_CorrespondingSourceObject: {fileID: 0} 465 | m_PrefabInstance: {fileID: 0} 466 | m_PrefabAsset: {fileID: 0} 467 | m_GameObject: {fileID: 605357145} 468 | m_Enabled: 1 469 | m_EditorHideFlags: 0 470 | m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} 471 | m_Name: 472 | m_EditorClassIdentifier: 473 | m_Material: {fileID: 0} 474 | m_Color: {r: 1, g: 1, b: 1, a: 0} 475 | m_RaycastTarget: 1 476 | m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} 477 | m_Maskable: 1 478 | m_OnCullStateChanged: 479 | m_PersistentCalls: 480 | m_Calls: [] 481 | m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} 482 | m_Type: 1 483 | m_PreserveAspect: 0 484 | m_FillCenter: 1 485 | m_FillMethod: 4 486 | m_FillAmount: 1 487 | m_FillClockwise: 1 488 | m_FillOrigin: 0 489 | m_UseSpriteMesh: 0 490 | m_PixelsPerUnitMultiplier: 1 491 | --- !u!222 &605357149 492 | CanvasRenderer: 493 | m_ObjectHideFlags: 0 494 | m_CorrespondingSourceObject: {fileID: 0} 495 | m_PrefabInstance: {fileID: 0} 496 | m_PrefabAsset: {fileID: 0} 497 | m_GameObject: {fileID: 605357145} 498 | m_CullTransparentMesh: 1 499 | --- !u!1 &736999109 500 | GameObject: 501 | m_ObjectHideFlags: 0 502 | m_CorrespondingSourceObject: {fileID: 0} 503 | m_PrefabInstance: {fileID: 0} 504 | m_PrefabAsset: {fileID: 0} 505 | serializedVersion: 6 506 | m_Component: 507 | - component: {fileID: 736999110} 508 | - component: {fileID: 736999113} 509 | - component: {fileID: 736999112} 510 | - component: {fileID: 736999111} 511 | m_Layer: 5 512 | m_Name: Viewport 513 | m_TagString: Untagged 514 | m_Icon: {fileID: 0} 515 | m_NavMeshLayer: 0 516 | m_StaticEditorFlags: 0 517 | m_IsActive: 1 518 | --- !u!224 &736999110 519 | RectTransform: 520 | m_ObjectHideFlags: 0 521 | m_CorrespondingSourceObject: {fileID: 0} 522 | m_PrefabInstance: {fileID: 0} 523 | m_PrefabAsset: {fileID: 0} 524 | m_GameObject: {fileID: 736999109} 525 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 526 | m_LocalPosition: {x: 0, y: 0, z: 0} 527 | m_LocalScale: {x: 1, y: 1, z: 1} 528 | m_ConstrainProportionsScale: 0 529 | m_Children: 530 | - {fileID: 1491675941} 531 | m_Father: {fileID: 605357146} 532 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 533 | m_AnchorMin: {x: 0, y: 0} 534 | m_AnchorMax: {x: 1, y: 1} 535 | m_AnchoredPosition: {x: 0, y: 0} 536 | m_SizeDelta: {x: -17, y: 0} 537 | m_Pivot: {x: 0, y: 1} 538 | --- !u!114 &736999111 539 | MonoBehaviour: 540 | m_ObjectHideFlags: 0 541 | m_CorrespondingSourceObject: {fileID: 0} 542 | m_PrefabInstance: {fileID: 0} 543 | m_PrefabAsset: {fileID: 0} 544 | m_GameObject: {fileID: 736999109} 545 | m_Enabled: 1 546 | m_EditorHideFlags: 0 547 | m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3} 548 | m_Name: 549 | m_EditorClassIdentifier: 550 | m_ShowMaskGraphic: 0 551 | --- !u!114 &736999112 552 | MonoBehaviour: 553 | m_ObjectHideFlags: 0 554 | m_CorrespondingSourceObject: {fileID: 0} 555 | m_PrefabInstance: {fileID: 0} 556 | m_PrefabAsset: {fileID: 0} 557 | m_GameObject: {fileID: 736999109} 558 | m_Enabled: 1 559 | m_EditorHideFlags: 0 560 | m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} 561 | m_Name: 562 | m_EditorClassIdentifier: 563 | m_Material: {fileID: 0} 564 | m_Color: {r: 1, g: 1, b: 1, a: 1} 565 | m_RaycastTarget: 1 566 | m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} 567 | m_Maskable: 1 568 | m_OnCullStateChanged: 569 | m_PersistentCalls: 570 | m_Calls: [] 571 | m_Sprite: {fileID: 10917, guid: 0000000000000000f000000000000000, type: 0} 572 | m_Type: 1 573 | m_PreserveAspect: 0 574 | m_FillCenter: 1 575 | m_FillMethod: 4 576 | m_FillAmount: 1 577 | m_FillClockwise: 1 578 | m_FillOrigin: 0 579 | m_UseSpriteMesh: 0 580 | m_PixelsPerUnitMultiplier: 1 581 | --- !u!222 &736999113 582 | CanvasRenderer: 583 | m_ObjectHideFlags: 0 584 | m_CorrespondingSourceObject: {fileID: 0} 585 | m_PrefabInstance: {fileID: 0} 586 | m_PrefabAsset: {fileID: 0} 587 | m_GameObject: {fileID: 736999109} 588 | m_CullTransparentMesh: 1 589 | --- !u!1 &1277855980 590 | GameObject: 591 | m_ObjectHideFlags: 0 592 | m_CorrespondingSourceObject: {fileID: 0} 593 | m_PrefabInstance: {fileID: 0} 594 | m_PrefabAsset: {fileID: 0} 595 | serializedVersion: 6 596 | m_Component: 597 | - component: {fileID: 1277855981} 598 | - component: {fileID: 1277855984} 599 | - component: {fileID: 1277855983} 600 | - component: {fileID: 1277855982} 601 | m_Layer: 5 602 | m_Name: Text (Legacy) 603 | m_TagString: Untagged 604 | m_Icon: {fileID: 0} 605 | m_NavMeshLayer: 0 606 | m_StaticEditorFlags: 0 607 | m_IsActive: 1 608 | --- !u!224 &1277855981 609 | RectTransform: 610 | m_ObjectHideFlags: 0 611 | m_CorrespondingSourceObject: {fileID: 0} 612 | m_PrefabInstance: {fileID: 0} 613 | m_PrefabAsset: {fileID: 0} 614 | m_GameObject: {fileID: 1277855980} 615 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 616 | m_LocalPosition: {x: 0, y: 0, z: 0} 617 | m_LocalScale: {x: 1, y: 1, z: 1} 618 | m_ConstrainProportionsScale: 0 619 | m_Children: [] 620 | m_Father: {fileID: 1491675941} 621 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 622 | m_AnchorMin: {x: 0, y: 1} 623 | m_AnchorMax: {x: 0, y: 1} 624 | m_AnchoredPosition: {x: 570, y: -52.148438} 625 | m_SizeDelta: {x: 1080, y: 44.296875} 626 | m_Pivot: {x: 0.5, y: 0.5} 627 | --- !u!114 &1277855982 628 | MonoBehaviour: 629 | m_ObjectHideFlags: 0 630 | m_CorrespondingSourceObject: {fileID: 0} 631 | m_PrefabInstance: {fileID: 0} 632 | m_PrefabAsset: {fileID: 0} 633 | m_GameObject: {fileID: 1277855980} 634 | m_Enabled: 1 635 | m_EditorHideFlags: 0 636 | m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3} 637 | m_Name: 638 | m_EditorClassIdentifier: 639 | m_HorizontalFit: 0 640 | m_VerticalFit: 2 641 | --- !u!114 &1277855983 642 | MonoBehaviour: 643 | m_ObjectHideFlags: 0 644 | m_CorrespondingSourceObject: {fileID: 0} 645 | m_PrefabInstance: {fileID: 0} 646 | m_PrefabAsset: {fileID: 0} 647 | m_GameObject: {fileID: 1277855980} 648 | m_Enabled: 1 649 | m_EditorHideFlags: 0 650 | m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} 651 | m_Name: 652 | m_EditorClassIdentifier: 653 | m_Material: {fileID: 0} 654 | m_Color: {r: 0.7924528, g: 0.7924528, b: 0.7924528, a: 1} 655 | m_RaycastTarget: 1 656 | m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} 657 | m_Maskable: 1 658 | m_OnCullStateChanged: 659 | m_PersistentCalls: 660 | m_Calls: [] 661 | m_FontData: 662 | m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} 663 | m_FontSize: 40 664 | m_FontStyle: 0 665 | m_BestFit: 0 666 | m_MinSize: 4 667 | m_MaxSize: 70 668 | m_Alignment: 0 669 | m_AlignByGeometry: 0 670 | m_RichText: 1 671 | m_HorizontalOverflow: 0 672 | m_VerticalOverflow: 0 673 | m_LineSpacing: 1 674 | m_Text: 675 | --- !u!222 &1277855984 676 | CanvasRenderer: 677 | m_ObjectHideFlags: 0 678 | m_CorrespondingSourceObject: {fileID: 0} 679 | m_PrefabInstance: {fileID: 0} 680 | m_PrefabAsset: {fileID: 0} 681 | m_GameObject: {fileID: 1277855980} 682 | m_CullTransparentMesh: 1 683 | --- !u!1 &1491675940 684 | GameObject: 685 | m_ObjectHideFlags: 0 686 | m_CorrespondingSourceObject: {fileID: 0} 687 | m_PrefabInstance: {fileID: 0} 688 | m_PrefabAsset: {fileID: 0} 689 | serializedVersion: 6 690 | m_Component: 691 | - component: {fileID: 1491675941} 692 | - component: {fileID: 1491675943} 693 | - component: {fileID: 1491675942} 694 | m_Layer: 5 695 | m_Name: Content 696 | m_TagString: Untagged 697 | m_Icon: {fileID: 0} 698 | m_NavMeshLayer: 0 699 | m_StaticEditorFlags: 0 700 | m_IsActive: 1 701 | --- !u!224 &1491675941 702 | RectTransform: 703 | m_ObjectHideFlags: 0 704 | m_CorrespondingSourceObject: {fileID: 0} 705 | m_PrefabInstance: {fileID: 0} 706 | m_PrefabAsset: {fileID: 0} 707 | m_GameObject: {fileID: 1491675940} 708 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 709 | m_LocalPosition: {x: 0, y: 0, z: 0} 710 | m_LocalScale: {x: 1, y: 1, z: 1} 711 | m_ConstrainProportionsScale: 0 712 | m_Children: 713 | - {fileID: 1277855981} 714 | m_Father: {fileID: 736999110} 715 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 716 | m_AnchorMin: {x: 0, y: 1} 717 | m_AnchorMax: {x: 1, y: 1} 718 | m_AnchoredPosition: {x: 0.000031294992, y: 0} 719 | m_SizeDelta: {x: -23.958084, y: 0} 720 | m_Pivot: {x: 0, y: 1} 721 | --- !u!114 &1491675942 722 | MonoBehaviour: 723 | m_ObjectHideFlags: 0 724 | m_CorrespondingSourceObject: {fileID: 0} 725 | m_PrefabInstance: {fileID: 0} 726 | m_PrefabAsset: {fileID: 0} 727 | m_GameObject: {fileID: 1491675940} 728 | m_Enabled: 1 729 | m_EditorHideFlags: 0 730 | m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3} 731 | m_Name: 732 | m_EditorClassIdentifier: 733 | m_HorizontalFit: 0 734 | m_VerticalFit: 2 735 | --- !u!114 &1491675943 736 | MonoBehaviour: 737 | m_ObjectHideFlags: 0 738 | m_CorrespondingSourceObject: {fileID: 0} 739 | m_PrefabInstance: {fileID: 0} 740 | m_PrefabAsset: {fileID: 0} 741 | m_GameObject: {fileID: 1491675940} 742 | m_Enabled: 1 743 | m_EditorHideFlags: 0 744 | m_Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3} 745 | m_Name: 746 | m_EditorClassIdentifier: 747 | m_Padding: 748 | m_Left: 30 749 | m_Right: 0 750 | m_Top: 30 751 | m_Bottom: 0 752 | m_ChildAlignment: 0 753 | m_Spacing: 0 754 | m_ChildForceExpandWidth: 1 755 | m_ChildForceExpandHeight: 1 756 | m_ChildControlWidth: 0 757 | m_ChildControlHeight: 0 758 | m_ChildScaleWidth: 0 759 | m_ChildScaleHeight: 0 760 | m_ReverseArrangement: 0 761 | --- !u!1660057539 &9223372036854775807 762 | SceneRoots: 763 | m_ObjectHideFlags: 0 764 | m_Roots: 765 | - {fileID: 438930286} 766 | - {fileID: 83502841} 767 | - {fileID: 560130995} 768 | -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 56ef2c2d96cd042288056bc28f725b14 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b3f46fcfd26fa438a9f7224faf7e1220 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts/Custom.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 81518c115303c45839505fde5b2a8aa1 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts/Custom/Custom.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Custom", 3 | "rootNamespace": "", 4 | "references": [], 5 | "includePlatforms": [], 6 | "excludePlatforms": [], 7 | "allowUnsafeCode": false, 8 | "overrideReferences": false, 9 | "precompiledReferences": [], 10 | "autoReferenced": true, 11 | "defineConstraints": [], 12 | "versionDefines": [], 13 | "noEngineReferences": false 14 | } -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts/Custom/Custom.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e6e53c700a1bd4ace8698d8b56fdd734 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts/Custom/Features.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 318dc524dbe78437690130319fdbfcd4 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts/Custom/Features/Constructor.cs: -------------------------------------------------------------------------------- 1 | namespace Custom.Features; 2 | 3 | public class Constructor : ITest 4 | { 5 | public void Run() 6 | { 7 | var test = new Test(42, "42"); 8 | 9 | Assert.AreEqual(42, test.A); 10 | Assert.AreEqual("42", test.B); 11 | } 12 | 13 | private class Test(int a, string b) 14 | { 15 | public int A => a; 16 | public string B => b; 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts/Custom/Features/Constructor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cd6384f66ced43efac87cae87df15154 3 | timeCreated: 1719780994 -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts/Custom/Features/EmptyTypeDeclaration.cs: -------------------------------------------------------------------------------- 1 | namespace Custom.Features; 2 | 3 | public class EmptyTypeDeclaration : ITest 4 | { 5 | public void Run() 6 | { 7 | Assert.AreNotEqual(null, new Test()); 8 | } 9 | 10 | private class Test; 11 | } -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts/Custom/Features/EmptyTypeDeclaration.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 03265b773bdf4272940dc8cbdec6f7ac 3 | timeCreated: 1719780898 -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts/Custom/Features/ExtensionBlock.cs: -------------------------------------------------------------------------------- 1 | namespace Custom.Features; 2 | 3 | public class ExtensionBlock : ITest 4 | { 5 | public void Run() 6 | { 7 | Assert.AreEqual(42, this.Count); 8 | } 9 | } 10 | 11 | public static class TestExtensionBlockExtensions 12 | { 13 | extension(ExtensionBlock block) 14 | { 15 | public int Count => 42; 16 | } 17 | } -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts/Custom/Features/ExtensionBlock.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 540ebfd3419041a5b325c913f891b081 3 | timeCreated: 1745270453 -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts/Custom/Features/FieldKeyword.cs: -------------------------------------------------------------------------------- 1 | namespace Custom.Features; 2 | 3 | public class FieldKeyword : ITest 4 | { 5 | public int Property 6 | { 7 | get => field; 8 | set => field = Mathf.Clamp(value, 0, 100); 9 | } 10 | 11 | public void Run() 12 | { 13 | Property = 142; 14 | 15 | Assert.AreEqual(Property, 100); 16 | } 17 | } -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts/Custom/Features/FieldKeyword.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ce2a5a86a66b417080de912db925860a 3 | timeCreated: 1735759603 -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts/Custom/Features/ImplicitSpanConversions.cs: -------------------------------------------------------------------------------- 1 | namespace Custom.Features; 2 | 3 | public class ImplicitSpanConversions : ITest 4 | { 5 | public void Run() 6 | { 7 | int[] arr = [42]; 8 | 9 | Assert.AreEqual(42, arr.First()); 10 | } 11 | } 12 | 13 | public static class ImplicitSpanConversionsExtensions 14 | { 15 | public static T First(this ReadOnlySpan span) 16 | { 17 | return span[0]; 18 | } 19 | } -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts/Custom/Features/ImplicitSpanConversions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5c214f957d8c4551a781adf335b05409 3 | timeCreated: 1745274129 -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts/Custom/Features/NullConditionalAssignment.cs: -------------------------------------------------------------------------------- 1 | namespace Custom.Features; 2 | 3 | public class NullConditionalAssignment : ITest 4 | { 5 | private Test? _test; 6 | 7 | public void Run() 8 | { 9 | _test?.Property = 100; 10 | _test = new Test { Property = 0 }; 11 | _test.Property += 25; 12 | 13 | Assert.AreEqual(25, _test.Property); 14 | } 15 | 16 | private class Test 17 | { 18 | public int Property { get; set; } 19 | } 20 | } -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts/Custom/Features/NullConditionalAssignment.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c95531f33e8e42c8b207a264dbd95beb 3 | timeCreated: 1745272042 -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts/Custom/Features/PartialConstructor.cs: -------------------------------------------------------------------------------- 1 | namespace Custom.Features; 2 | 3 | public class PartialConstructor : ITest 4 | { 5 | public void Run() 6 | { 7 | Assert.AreEqual(42, new Test(42).Value); 8 | } 9 | 10 | private partial class Test 11 | { 12 | public partial Test(int value); 13 | } 14 | 15 | private partial class Test 16 | { 17 | public int Value { get; } 18 | 19 | public partial Test(int value) 20 | { 21 | Value = value; 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts/Custom/Features/PartialConstructor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 129cb1ad4d08401b864c163bb1ff2fca 3 | timeCreated: 1745274808 -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts/Custom/Features/PartialEvent.cs: -------------------------------------------------------------------------------- 1 | namespace Custom.Features; 2 | 3 | public partial class PartialEvent : ITest 4 | { 5 | public partial event Action TestEvent; 6 | 7 | public void Run() 8 | { 9 | var calledTimes = 0; 10 | TestEvent += () => calledTimes++; 11 | 12 | InvokeTestEvent(); 13 | 14 | Assert.AreEqual(1, calledTimes); 15 | } 16 | } 17 | 18 | public partial class PartialEvent 19 | { 20 | private Action? _actions = delegate { }; 21 | 22 | public partial event Action TestEvent 23 | { 24 | add => _actions += value; 25 | remove => _actions -= value; 26 | } 27 | 28 | public void InvokeTestEvent() 29 | { 30 | _actions?.Invoke(); 31 | } 32 | } -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts/Custom/Features/PartialEvent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 722f1c1a9a8e46d59600a791b6f799e8 3 | timeCreated: 1745270771 -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts/Custom/Features/PartialProperty.cs: -------------------------------------------------------------------------------- 1 | namespace Custom.Features; 2 | 3 | public partial class PartialProperty : ITest 4 | { 5 | partial int Property { get; set; } 6 | 7 | public void Run() 8 | { 9 | Property = 142; 10 | 11 | Assert.AreEqual(100, Property); 12 | } 13 | } 14 | 15 | public partial class PartialProperty 16 | { 17 | partial int Property 18 | { 19 | get; 20 | set => field = Mathf.Clamp(value, 0, 100); 21 | } 22 | } -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts/Custom/Features/PartialProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 297f69265a3e457ba8e47ff73dee0bf3 3 | timeCreated: 1735759587 -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts/Custom/Features/SimpleLambdaParameters.cs: -------------------------------------------------------------------------------- 1 | namespace Custom.Features; 2 | 3 | public class SimpleLambdaParameters : ITest 4 | { 5 | private delegate bool TryParse(string text, out T result); 6 | 7 | public void Run() 8 | { 9 | TryParse parser = (text, out result) => int.TryParse(text, out result); 10 | 11 | Assert.AreEqual(true, parser("42", out var value)); 12 | Assert.AreEqual(42, value); 13 | } 14 | } -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts/Custom/Features/SimpleLambdaParameters.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1ac0fdcf43da4ba8b1b7c346b30a2bf7 3 | timeCreated: 1745274490 -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts/Custom/Features/UnboundGenericTypeNameOf.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Custom.Features; 4 | 5 | public class UnboundGenericTypeNameOf : ITest 6 | { 7 | public void Run() 8 | { 9 | Assert.AreEqual("List", nameof(List<>)); 10 | } 11 | } -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts/Custom/Features/UnboundGenericTypeNameOf.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eb714e1110474adfa3cd559a5a8aae7a 3 | timeCreated: 1745273037 -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts/Custom/GlobalUsings.cs: -------------------------------------------------------------------------------- 1 | global using System; 2 | global using System.Collections; 3 | 4 | global using UnityEngine; 5 | global using UnityEngine.Assertions; -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts/Custom/GlobalUsings.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 125d529def854e24b81bfa9ac9d47ca4 3 | timeCreated: 1719781064 -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts/Custom/ITest.cs: -------------------------------------------------------------------------------- 1 | namespace Custom; 2 | 3 | public interface ITest 4 | { 5 | void Run(); 6 | } -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts/Custom/ITest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b8fe820bf4504beeb6578d4772434751 3 | timeCreated: 1745275478 -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts/Custom/TestRunner.cs: -------------------------------------------------------------------------------- 1 | using Custom.Features; 2 | using UnityEngine.UI; 3 | 4 | namespace Custom; 5 | 6 | public class TestRunner : MonoBehaviour 7 | { 8 | [SerializeField] private Text? _text; 9 | 10 | private readonly Type[] _tests = 11 | [ 12 | typeof(Constructor), 13 | typeof(EmptyTypeDeclaration), 14 | typeof(ExtensionBlock), 15 | typeof(FieldKeyword), 16 | typeof(ImplicitSpanConversions), 17 | typeof(NullConditionalAssignment), 18 | typeof(PartialConstructor), 19 | typeof(PartialEvent), 20 | typeof(PartialProperty), 21 | typeof(SimpleLambdaParameters), 22 | typeof(UnboundGenericTypeNameOf) 23 | ]; 24 | 25 | private IEnumerator Start() 26 | { 27 | _text!.text = string.Empty; 28 | 29 | for (var index = 0; index < _tests.Length; index++) 30 | { 31 | var testType = _tests[index]; 32 | _text.text += $"[{index + 1}/{_tests.Length}] Start test {testType.Name}\n"; 33 | 34 | var test = (ITest)Activator.CreateInstance(testType); 35 | test.Run(); 36 | 37 | var str = $"[{index + 1}/{_tests.Length}] Test {testType.Name} passed"; 38 | 39 | _text.text += $"{str}\n\n"; 40 | Debug.Log(str); 41 | 42 | yield return null; 43 | } 44 | 45 | _text.text += "All tests passed"; 46 | } 47 | } -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts/Custom/TestRunner.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 77036910f02c4bc59877e1a9b6b26603 3 | timeCreated: 1745275209 -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts/Custom/csc.rsp: -------------------------------------------------------------------------------- 1 | -langVersion:preview 2 | -nullable:enable -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts/Custom/csc.rsp.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f0db6ef5a2a0c488da01e84b37d7059d 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts/Default.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a59e0bba2dc1f43eca04c54a96c6b451 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts/Default/Default.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Default", 3 | "rootNamespace": "", 4 | "references": [], 5 | "includePlatforms": [], 6 | "excludePlatforms": [], 7 | "allowUnsafeCode": false, 8 | "overrideReferences": false, 9 | "precompiledReferences": [], 10 | "autoReferenced": true, 11 | "defineConstraints": [], 12 | "versionDefines": [], 13 | "noEngineReferences": false 14 | } -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts/Default/Default.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b9deff6e6b9f84e2fad75c698dfd9903 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts/Default/KeywordAsTypeName.cs: -------------------------------------------------------------------------------- 1 | namespace Default 2 | { 3 | // ReSharper disable once InconsistentNaming 4 | public class scoped // in newer c# this class name will lead to compile error 5 | { 6 | 7 | } 8 | } -------------------------------------------------------------------------------- /UnityCSharpPatch/Assets/Scripts/Default/KeywordAsTypeName.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6547e91b3ec94ab1a287bc2cffa90c32 3 | timeCreated: 1719781409 -------------------------------------------------------------------------------- /UnityCSharpPatch/Packages/com.kandreyc.unity-csharp-patch/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 49c84ff7816bb44e9ba0845c6c090263 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UnityCSharpPatch/Packages/com.kandreyc.unity-csharp-patch/Editor/AssetPostProcessor.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Linq; 3 | using UnityEditor; 4 | using UnityCSharpPatch.Editor.Csc; 5 | 6 | namespace UnityCSharpPatch.Editor 7 | { 8 | public class AssetPostProcessor : AssetPostprocessor 9 | { 10 | private static void OnPostprocessAllAssets(string[] imported, string[] deleted, string[] movedTo, string[] movedFrom) 11 | { 12 | if (!imported.Any(IsCsc) && !deleted.Any(IsCsc)) 13 | { 14 | return; 15 | } 16 | 17 | CscCache.Reset(); 18 | SolutionUtility.RegenerateProjects(); 19 | AssetDatabase.Refresh(); 20 | } 21 | 22 | private static bool IsCsc(string asset) 23 | { 24 | return Path.GetFileName(asset) is "csc.rsp"; 25 | } 26 | 27 | public static string OnGeneratedCSProject(string path, string content) 28 | { 29 | return PatchInfo.IsEditorPatched() 30 | ? CsProjectModifier.Process(path, content) 31 | : content; 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /UnityCSharpPatch/Packages/com.kandreyc.unity-csharp-patch/Editor/AssetPostProcessor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 189998ca185a840db9a0fb736cfb1445 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UnityCSharpPatch/Packages/com.kandreyc.unity-csharp-patch/Editor/CSProjectModifier.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Linq; 3 | using System.Xml.Linq; 4 | using UnityCSharpPatch.Editor.Csc; 5 | 6 | namespace UnityCSharpPatch.Editor 7 | { 8 | public static class CsProjectModifier 9 | { 10 | public static string Process(string path, string content) 11 | { 12 | var asmdefName = Path.GetFileNameWithoutExtension(path); 13 | 14 | if (!CscCache.Value.TryGetValue(asmdefName, out var info)) 15 | { 16 | return content; 17 | } 18 | 19 | var xDocument = XDocument.Parse(content); 20 | var langVersionElement = xDocument.Find("LangVersion"); 21 | 22 | if (info.Patch.TryGetValue("langVersion", out var version)) 23 | { 24 | langVersionElement!.Value = version; 25 | } 26 | 27 | if (info.Patch.TryGetValue("nullable", out var nullable)) 28 | { 29 | langVersionElement!.AddAfterSelf(xDocument.CreateElement("Nullable", nullable)); 30 | } 31 | 32 | return xDocument.ToString(); 33 | } 34 | 35 | private static XElement Find(this XDocument document, string name) 36 | { 37 | var fullName = document.Root!.GetDefaultNamespace().GetName(name); 38 | return document.Descendants().First(e => e.Name == fullName); 39 | } 40 | 41 | private static XElement CreateElement(this XDocument document, string name, string value) 42 | { 43 | return new XElement( 44 | document.Root!.GetDefaultNamespace().GetName(name), 45 | value 46 | ); 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /UnityCSharpPatch/Packages/com.kandreyc.unity-csharp-patch/Editor/CSProjectModifier.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b2f0df3af7894a0f941d0b6f08e9a1ba 3 | timeCreated: 1719622464 -------------------------------------------------------------------------------- /UnityCSharpPatch/Packages/com.kandreyc.unity-csharp-patch/Editor/Csc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 90425dc1cbbc4b429fce01bed5af8019 3 | timeCreated: 1721071734 -------------------------------------------------------------------------------- /UnityCSharpPatch/Packages/com.kandreyc.unity-csharp-patch/Editor/Csc/CscCache.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using UnityEditor; 3 | using UnityEngine; 4 | using System.Collections.Generic; 5 | 6 | namespace UnityCSharpPatch.Editor.Csc 7 | { 8 | public static class CscCache 9 | { 10 | private static Dictionary _map; 11 | 12 | public static IReadOnlyDictionary Value => _map ??= Fetch(); 13 | 14 | [InitializeOnLoadMethod] 15 | public static void Reset() 16 | { 17 | _map = null; 18 | } 19 | 20 | private static Dictionary Fetch() 21 | { 22 | var cscInfos = ProjectCscCollector.Collect().Concat(LocalPackagesCscCollector.Collect()); 23 | var map = new Dictionary(); 24 | 25 | foreach (var info in cscInfos) 26 | { 27 | if (!map.TryAdd(info.AsmdefName, info)) 28 | { 29 | Debug.LogWarningFormat( 30 | "Detected multiple {0}.asmdef files with the same name. This is not supported.", 31 | info.AsmdefName 32 | ); 33 | } 34 | } 35 | 36 | return map; 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /UnityCSharpPatch/Packages/com.kandreyc.unity-csharp-patch/Editor/Csc/CscCache.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c574836a47f5467c85e775f1f54e0bc5 3 | timeCreated: 1721071738 -------------------------------------------------------------------------------- /UnityCSharpPatch/Packages/com.kandreyc.unity-csharp-patch/Editor/Csc/CscInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace UnityCSharpPatch.Editor.Csc 4 | { 5 | public class CscInfo 6 | { 7 | public string AsmdefName { get; set; } 8 | public Location Location { get; set; } 9 | public Dictionary Patch { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /UnityCSharpPatch/Packages/com.kandreyc.unity-csharp-patch/Editor/Csc/CscInfo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 80436801a35c401b896b7b01f6912edf 3 | timeCreated: 1721256688 -------------------------------------------------------------------------------- /UnityCSharpPatch/Packages/com.kandreyc.unity-csharp-patch/Editor/Csc/CscParser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Collections.Generic; 4 | 5 | namespace UnityCSharpPatch.Editor.Csc 6 | { 7 | public static class CscParser 8 | { 9 | private static readonly Dictionary LangVersions = new() 10 | { 11 | { "10", "10"}, 12 | { "11", "11"}, 13 | { "12", "12"}, 14 | { "13", "13"}, 15 | { "preview", "preview"} 16 | }; 17 | 18 | public static bool TryParse(string csc, out Dictionary info) 19 | { 20 | if (!File.Exists(csc)) 21 | { 22 | info = default; 23 | return false; 24 | } 25 | 26 | info = new Dictionary(); 27 | foreach (var line in File.ReadAllLines(csc)) 28 | { 29 | var option = line.Split(":", StringSplitOptions.RemoveEmptyEntries); 30 | 31 | if (option.Length != 2) 32 | { 33 | continue; 34 | } 35 | 36 | var (name, value) = (option[0].Trim(), option[1].Trim()); 37 | 38 | switch (name) 39 | { 40 | case "-langVersion" when LangVersions.TryGetValue(key: value, out var version): 41 | { 42 | info.TryAdd("langVersion", version); 43 | break; 44 | } 45 | case "-nullable" when value is "enable" or "disable": 46 | { 47 | info.TryAdd("nullable", value); 48 | break; 49 | } 50 | } 51 | } 52 | 53 | return info.Count > 0; 54 | } 55 | } 56 | } -------------------------------------------------------------------------------- /UnityCSharpPatch/Packages/com.kandreyc.unity-csharp-patch/Editor/Csc/CscParser.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a987d44788a94a78935a762ace2fe5a5 3 | timeCreated: 1719622237 -------------------------------------------------------------------------------- /UnityCSharpPatch/Packages/com.kandreyc.unity-csharp-patch/Editor/Csc/LocalPackagesCscCollector.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using TinyJson; 3 | using System.IO; 4 | using System.Linq; 5 | using UnityEditor; 6 | using UnityEngine; 7 | using UnityEditorInternal; 8 | using System.Collections.Generic; 9 | 10 | namespace UnityCSharpPatch.Editor.Csc 11 | { 12 | public static class LocalPackagesCscCollector 13 | { 14 | private const string LocalVersionPrefix = "file:"; 15 | private static readonly string ProjectRoot = Directory.GetParent(Application.dataPath)!.FullName; 16 | private static readonly string PackagesRoot = Path.Combine(ProjectRoot, "Packages"); 17 | 18 | public static CscInfo[] Collect() 19 | { 20 | Location[] localPackages; 21 | if (TryGetFromPackageLock(out var packages)) 22 | { 23 | localPackages = packages; 24 | } 25 | else if (TryGetFromManifest(out packages)) 26 | { 27 | localPackages = packages; 28 | } 29 | else 30 | { 31 | return Array.Empty(); 32 | } 33 | 34 | return localPackages 35 | .Select(location => (location, assets: AssetDatabase.FindAssets($"t:{nameof(AssemblyDefinitionAsset)}", new[] { location.Relative }))) 36 | .SelectMany(t => t.assets.Select(guid => 37 | { 38 | var (asmdefName, cscPath) = Unpack(guid); 39 | 40 | var pathFromPackage = cscPath.Replace(t.location.Relative + Path.DirectorySeparatorChar, string.Empty); 41 | var absolutePath = Path.Combine(t.location.Absolute, pathFromPackage); 42 | 43 | var location = new Location 44 | { 45 | Relative = cscPath, 46 | Absolute = absolutePath 47 | }; 48 | 49 | return CscParser.TryParse(location.Absolute, out var info) 50 | ? new CscInfo { AsmdefName = asmdefName, Location = location, Patch = info } 51 | : default; 52 | 53 | })) 54 | .Where(info => info is not null) 55 | .ToArray(); 56 | } 57 | 58 | private static bool TryGetFromManifest(out Location[] packages) 59 | { 60 | try 61 | { 62 | var location = Path.Combine(PackagesRoot, "manifest.json"); 63 | 64 | if (!File.Exists(location)) 65 | { 66 | packages = Array.Empty(); 67 | return false; 68 | } 69 | 70 | packages = File.ReadAllText(location).FromJson() 71 | .Dependencies 72 | .Where(t => t.Value.StartsWith(LocalVersionPrefix)) 73 | .Select(t => CreateLocation(t.Key, t.Value)) 74 | .ToArray(); 75 | 76 | return true; 77 | } 78 | catch (Exception e) 79 | { 80 | Debug.LogError(e); 81 | packages = Array.Empty(); 82 | return false; 83 | } 84 | } 85 | 86 | private static bool TryGetFromPackageLock(out Location[] packages) 87 | { 88 | try 89 | { 90 | var location = Path.Combine(PackagesRoot, "packages-lock.json"); 91 | 92 | if (!File.Exists(location)) 93 | { 94 | packages = Array.Empty(); 95 | return false; 96 | } 97 | 98 | packages = File.ReadAllText(location).FromJson() 99 | .Dependencies 100 | .Where(t => t.Value.Source is "local" or "embedded") 101 | .Where(t => t.Value.Version?.StartsWith(LocalVersionPrefix) ?? false) 102 | .Select(t => CreateLocation(t.Key, t.Value.Version)) 103 | .ToArray(); 104 | 105 | return true; 106 | } 107 | catch (Exception e) 108 | { 109 | Debug.LogError(e); 110 | packages = Array.Empty(); 111 | 112 | return false; 113 | } 114 | } 115 | 116 | private static Location CreateLocation(string packageName, string packageVersion) 117 | { 118 | var projectRelative = Path.Combine("Packages", packageName); 119 | var packagesRelative = packageVersion.Replace(LocalVersionPrefix, string.Empty); 120 | var absolute = Path.GetFullPath(Path.Combine(PackagesRoot, packagesRelative)); 121 | 122 | return new Location 123 | { 124 | Absolute = absolute, 125 | Relative = projectRelative, 126 | }; 127 | } 128 | 129 | private static (string asmdefName, string cscPath) Unpack(string asmdef) 130 | { 131 | var asmdefPath = AssetDatabase.GUIDToAssetPath(asmdef); 132 | 133 | return ( 134 | Path.GetFileNameWithoutExtension(asmdefPath), 135 | Path.Combine(Path.GetDirectoryName(asmdefPath)!, "csc.rsp") 136 | ); 137 | } 138 | 139 | public class PackageLock 140 | { 141 | // ReSharper disable once CollectionNeverUpdated.Global 142 | public Dictionary Dependencies { get; set; } 143 | } 144 | 145 | public class Package 146 | { 147 | public string Source { get; set; } 148 | public string Version { get; set; } 149 | } 150 | 151 | public class Manifest 152 | { 153 | // ReSharper disable once CollectionNeverUpdated.Global 154 | public Dictionary Dependencies { get; set; } 155 | } 156 | } 157 | } -------------------------------------------------------------------------------- /UnityCSharpPatch/Packages/com.kandreyc.unity-csharp-patch/Editor/Csc/LocalPackagesCscCollector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 63170071c220484797d197a132e2ceef 3 | timeCreated: 1721071797 -------------------------------------------------------------------------------- /UnityCSharpPatch/Packages/com.kandreyc.unity-csharp-patch/Editor/Csc/Location.cs: -------------------------------------------------------------------------------- 1 | namespace UnityCSharpPatch.Editor.Csc 2 | { 3 | public class Location 4 | { 5 | public string Relative { get; set; } 6 | public string Absolute { get; set; } 7 | } 8 | } -------------------------------------------------------------------------------- /UnityCSharpPatch/Packages/com.kandreyc.unity-csharp-patch/Editor/Csc/Location.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a0f9599621db4085ad74ae8ad7f1ca68 3 | timeCreated: 1721256768 -------------------------------------------------------------------------------- /UnityCSharpPatch/Packages/com.kandreyc.unity-csharp-patch/Editor/Csc/ProjectCscCollector.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Linq; 3 | using UnityEditor; 4 | using UnityEngine; 5 | using UnityEditorInternal; 6 | 7 | namespace UnityCSharpPatch.Editor.Csc 8 | { 9 | public static class ProjectCscCollector 10 | { 11 | public static CscInfo[] Collect() 12 | { 13 | var projectRoot = Directory.GetParent(Application.dataPath)!.FullName; 14 | 15 | return AssetDatabase.FindAssets($"t:{nameof(AssemblyDefinitionAsset)}", new[] { "Assets" }) 16 | .Select(Unpack) 17 | .Select(t => 18 | { 19 | var location = new Location 20 | { 21 | Relative = t.cscPath, 22 | Absolute = Path.Combine(projectRoot, t.cscPath) 23 | }; 24 | 25 | return CscParser.TryParse(location.Absolute, out var info) 26 | ? new CscInfo { AsmdefName = t.asmdefName, Location = location, Patch = info } 27 | : default; 28 | }) 29 | .Where(info => info is not null) 30 | .ToArray(); 31 | } 32 | 33 | private static (string asmdefName, string cscPath) Unpack(string asmdef) 34 | { 35 | var asmdefPath = AssetDatabase.GUIDToAssetPath(asmdef); 36 | 37 | return ( 38 | Path.GetFileNameWithoutExtension(asmdefPath), 39 | Path.Combine(Path.GetDirectoryName(asmdefPath)!, "csc.rsp") 40 | ); 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /UnityCSharpPatch/Packages/com.kandreyc.unity-csharp-patch/Editor/Csc/ProjectCscCollector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 729734bacee84b4cb4201593e52afb12 3 | timeCreated: 1721071769 -------------------------------------------------------------------------------- /UnityCSharpPatch/Packages/com.kandreyc.unity-csharp-patch/Editor/PatchInfo.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using UnityEditor; 3 | 4 | namespace UnityCSharpPatch.Editor 5 | { 6 | public static class PatchInfo 7 | { 8 | public static bool IsEditorPatched() 9 | { 10 | return Directory.Exists(Path.Combine(EditorApplication.applicationContentsPath, "__patch_backup")); 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /UnityCSharpPatch/Packages/com.kandreyc.unity-csharp-patch/Editor/PatchInfo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3886e0fc1fc24cf8a2c0a8b4bb0c7247 3 | timeCreated: 1719754294 -------------------------------------------------------------------------------- /UnityCSharpPatch/Packages/com.kandreyc.unity-csharp-patch/Editor/SolutionUtility.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Unity.CodeEditor; 3 | 4 | namespace UnityCSharpPatch.Editor 5 | { 6 | public static class SolutionUtility 7 | { 8 | public static void RegenerateProjects() 9 | { 10 | // HACK: Make it look like a dummy file has been added. 11 | var _ = Array.Empty(); 12 | var dummyFile = new[] { "RegenerateProject.cs" }; 13 | CodeEditor.CurrentEditor.SyncIfNeeded(dummyFile, _, _, _, _); 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /UnityCSharpPatch/Packages/com.kandreyc.unity-csharp-patch/Editor/SolutionUtility.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9ac138a10f284a2982af09482904a0d8 3 | timeCreated: 1719622359 -------------------------------------------------------------------------------- /UnityCSharpPatch/Packages/com.kandreyc.unity-csharp-patch/Editor/UnityCSharpPatch.Editor.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "UnityCSharpPatch.Editor", 3 | "rootNamespace": "UnityCSharpPatch", 4 | "references": [], 5 | "includePlatforms": [ 6 | "Editor" 7 | ], 8 | "excludePlatforms": [], 9 | "allowUnsafeCode": false, 10 | "overrideReferences": false, 11 | "precompiledReferences": [], 12 | "autoReferenced": true, 13 | "defineConstraints": [], 14 | "versionDefines": [], 15 | "noEngineReferences": false 16 | } -------------------------------------------------------------------------------- /UnityCSharpPatch/Packages/com.kandreyc.unity-csharp-patch/Editor/UnityCSharpPatch.Editor.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f36170c7ab93484993b896a94dba9efb 3 | timeCreated: 1719778746 -------------------------------------------------------------------------------- /UnityCSharpPatch/Packages/com.kandreyc.unity-csharp-patch/Editor/Utils.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ffa6504f372f4c78ad4eccfa8082daa6 3 | timeCreated: 1721136663 -------------------------------------------------------------------------------- /UnityCSharpPatch/Packages/com.kandreyc.unity-csharp-patch/Editor/Utils/TinyJson.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Reflection; 5 | using System.Runtime.Serialization; 6 | using System.Text; 7 | 8 | #pragma warning disable 9 | // ReSharper disable All 10 | 11 | namespace TinyJson 12 | { 13 | // Really simple JSON parser in ~300 lines 14 | // - Attempts to parse JSON files with minimal GC allocation 15 | // - Nice and simple "[1,2,3]".FromJson>() API 16 | // - Classes and structs can be parsed too! 17 | // class Foo { public int Value; } 18 | // "{\"Value\":10}".FromJson() 19 | // - Can parse JSON without type information into Dictionary and List e.g. 20 | // "[1,2,3]".FromJson().GetType() == typeof(List) 21 | // "{\"Value\":10}".FromJson().GetType() == typeof(Dictionary) 22 | // - No JIT Emit support to support AOT compilation on iOS 23 | // - Attempts are made to NOT throw an exception if the JSON is corrupted or invalid: returns null instead. 24 | // - Only public fields and property setters on classes/structs will be written to 25 | // 26 | // Limitations: 27 | // - No JIT Emit support to parse structures quickly 28 | // - Limited to parsing <2GB JSON files (due to int.MaxValue) 29 | // - Parsing of abstract classes or interfaces is NOT supported and will throw an exception. 30 | public static class JSONParser 31 | { 32 | [ThreadStatic] static Stack> splitArrayPool; 33 | [ThreadStatic] static StringBuilder stringBuilder; 34 | [ThreadStatic] static Dictionary> fieldInfoCache; 35 | [ThreadStatic] static Dictionary> propertyInfoCache; 36 | 37 | public static T FromJson(this string json) 38 | { 39 | // Initialize, if needed, the ThreadStatic variables 40 | if (propertyInfoCache == null) propertyInfoCache = new Dictionary>(); 41 | if (fieldInfoCache == null) fieldInfoCache = new Dictionary>(); 42 | if (stringBuilder == null) stringBuilder = new StringBuilder(); 43 | if (splitArrayPool == null) splitArrayPool = new Stack>(); 44 | 45 | //Remove all whitespace not within strings to make parsing simpler 46 | stringBuilder.Length = 0; 47 | for (int i = 0; i < json.Length; i++) 48 | { 49 | char c = json[i]; 50 | if (c == '"') 51 | { 52 | i = AppendUntilStringEnd(true, i, json); 53 | continue; 54 | } 55 | if (char.IsWhiteSpace(c)) 56 | continue; 57 | 58 | stringBuilder.Append(c); 59 | } 60 | 61 | //Parse the thing! 62 | return (T)ParseValue(typeof(T), stringBuilder.ToString()); 63 | } 64 | 65 | static int AppendUntilStringEnd(bool appendEscapeCharacter, int startIdx, string json) 66 | { 67 | stringBuilder.Append(json[startIdx]); 68 | for (int i = startIdx + 1; i < json.Length; i++) 69 | { 70 | if (json[i] == '\\') 71 | { 72 | if (appendEscapeCharacter) 73 | stringBuilder.Append(json[i]); 74 | stringBuilder.Append(json[i + 1]); 75 | i++;//Skip next character as it is escaped 76 | } 77 | else if (json[i] == '"') 78 | { 79 | stringBuilder.Append(json[i]); 80 | return i; 81 | } 82 | else 83 | stringBuilder.Append(json[i]); 84 | } 85 | return json.Length - 1; 86 | } 87 | 88 | //Splits { :, : } and [ , ] into a list of strings 89 | static List Split(string json) 90 | { 91 | List splitArray = splitArrayPool.Count > 0 ? splitArrayPool.Pop() : new List(); 92 | splitArray.Clear(); 93 | if (json.Length == 2) 94 | return splitArray; 95 | int parseDepth = 0; 96 | stringBuilder.Length = 0; 97 | for (int i = 1; i < json.Length - 1; i++) 98 | { 99 | switch (json[i]) 100 | { 101 | case '[': 102 | case '{': 103 | parseDepth++; 104 | break; 105 | case ']': 106 | case '}': 107 | parseDepth--; 108 | break; 109 | case '"': 110 | i = AppendUntilStringEnd(true, i, json); 111 | continue; 112 | case ',': 113 | case ':': 114 | if (parseDepth == 0) 115 | { 116 | splitArray.Add(stringBuilder.ToString()); 117 | stringBuilder.Length = 0; 118 | continue; 119 | } 120 | break; 121 | } 122 | 123 | stringBuilder.Append(json[i]); 124 | } 125 | 126 | splitArray.Add(stringBuilder.ToString()); 127 | 128 | return splitArray; 129 | } 130 | 131 | internal static object ParseValue(Type type, string json) 132 | { 133 | if (type == typeof(string)) 134 | { 135 | if (json.Length <= 2) 136 | return string.Empty; 137 | StringBuilder parseStringBuilder = new StringBuilder(json.Length); 138 | for (int i = 1; i < json.Length - 1; ++i) 139 | { 140 | if (json[i] == '\\' && i + 1 < json.Length - 1) 141 | { 142 | int j = "\"\\nrtbf/".IndexOf(json[i + 1]); 143 | if (j >= 0) 144 | { 145 | parseStringBuilder.Append("\"\\\n\r\t\b\f/"[j]); 146 | ++i; 147 | continue; 148 | } 149 | if (json[i + 1] == 'u' && i + 5 < json.Length - 1) 150 | { 151 | UInt32 c = 0; 152 | if (UInt32.TryParse(json.Substring(i + 2, 4), System.Globalization.NumberStyles.AllowHexSpecifier, null, out c)) 153 | { 154 | parseStringBuilder.Append((char)c); 155 | i += 5; 156 | continue; 157 | } 158 | } 159 | } 160 | parseStringBuilder.Append(json[i]); 161 | } 162 | return parseStringBuilder.ToString(); 163 | } 164 | if (type.IsPrimitive) 165 | { 166 | var result = Convert.ChangeType(json, type, System.Globalization.CultureInfo.InvariantCulture); 167 | return result; 168 | } 169 | if (type == typeof(decimal)) 170 | { 171 | decimal result; 172 | decimal.TryParse(json, System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out result); 173 | return result; 174 | } 175 | if (type == typeof(DateTime)) 176 | { 177 | DateTime result; 178 | DateTime.TryParse(json.Replace("\"",""), System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None, out result); 179 | return result; 180 | } 181 | if (json == "null") 182 | { 183 | return null; 184 | } 185 | if (type.IsEnum) 186 | { 187 | if (json[0] == '"') 188 | json = json.Substring(1, json.Length - 2); 189 | try 190 | { 191 | return Enum.Parse(type, json, false); 192 | } 193 | catch 194 | { 195 | return 0; 196 | } 197 | } 198 | if (type.IsArray) 199 | { 200 | Type arrayType = type.GetElementType(); 201 | if (json[0] != '[' || json[json.Length - 1] != ']') 202 | return null; 203 | 204 | List elems = Split(json); 205 | Array newArray = Array.CreateInstance(arrayType, elems.Count); 206 | for (int i = 0; i < elems.Count; i++) 207 | newArray.SetValue(ParseValue(arrayType, elems[i]), i); 208 | splitArrayPool.Push(elems); 209 | return newArray; 210 | } 211 | if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(List<>)) 212 | { 213 | Type listType = type.GetGenericArguments()[0]; 214 | if (json[0] != '[' || json[json.Length - 1] != ']') 215 | return null; 216 | 217 | List elems = Split(json); 218 | var list = (IList)type.GetConstructor(new Type[] { typeof(int) }).Invoke(new object[] { elems.Count }); 219 | for (int i = 0; i < elems.Count; i++) 220 | list.Add(ParseValue(listType, elems[i])); 221 | splitArrayPool.Push(elems); 222 | return list; 223 | } 224 | if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Dictionary<,>)) 225 | { 226 | Type keyType, valueType; 227 | { 228 | Type[] args = type.GetGenericArguments(); 229 | keyType = args[0]; 230 | valueType = args[1]; 231 | } 232 | 233 | //Refuse to parse dictionary keys that aren't of type string 234 | if (keyType != typeof(string)) 235 | return null; 236 | //Must be a valid dictionary element 237 | if (json[0] != '{' || json[json.Length - 1] != '}') 238 | return null; 239 | //The list is split into key/value pairs only, this means the split must be divisible by 2 to be valid JSON 240 | List elems = Split(json); 241 | if (elems.Count % 2 != 0) 242 | return null; 243 | 244 | var dictionary = (IDictionary)type.GetConstructor(new Type[] { typeof(int) }).Invoke(new object[] { elems.Count / 2 }); 245 | for (int i = 0; i < elems.Count; i += 2) 246 | { 247 | if (elems[i].Length <= 2) 248 | continue; 249 | string keyValue = elems[i].Substring(1, elems[i].Length - 2); 250 | object val = ParseValue(valueType, elems[i + 1]); 251 | dictionary[keyValue] = val; 252 | } 253 | return dictionary; 254 | } 255 | if (type == typeof(object)) 256 | { 257 | return ParseAnonymousValue(json); 258 | } 259 | if (json[0] == '{' && json[json.Length - 1] == '}') 260 | { 261 | return ParseObject(type, json); 262 | } 263 | 264 | return null; 265 | } 266 | 267 | static object ParseAnonymousValue(string json) 268 | { 269 | if (json.Length == 0) 270 | return null; 271 | if (json[0] == '{' && json[json.Length - 1] == '}') 272 | { 273 | List elems = Split(json); 274 | if (elems.Count % 2 != 0) 275 | return null; 276 | var dict = new Dictionary(elems.Count / 2); 277 | for (int i = 0; i < elems.Count; i += 2) 278 | dict[elems[i].Substring(1, elems[i].Length - 2)] = ParseAnonymousValue(elems[i + 1]); 279 | return dict; 280 | } 281 | if (json[0] == '[' && json[json.Length - 1] == ']') 282 | { 283 | List items = Split(json); 284 | var finalList = new List(items.Count); 285 | for (int i = 0; i < items.Count; i++) 286 | finalList.Add(ParseAnonymousValue(items[i])); 287 | return finalList; 288 | } 289 | if (json[0] == '"' && json[json.Length - 1] == '"') 290 | { 291 | string str = json.Substring(1, json.Length - 2); 292 | return str.Replace("\\", string.Empty); 293 | } 294 | if (char.IsDigit(json[0]) || json[0] == '-') 295 | { 296 | if (json.Contains(".")) 297 | { 298 | double result; 299 | double.TryParse(json, System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out result); 300 | return result; 301 | } 302 | else 303 | { 304 | int result; 305 | int.TryParse(json, out result); 306 | return result; 307 | } 308 | } 309 | if (json == "true") 310 | return true; 311 | if (json == "false") 312 | return false; 313 | // handles json == "null" as well as invalid JSON 314 | return null; 315 | } 316 | 317 | static Dictionary CreateMemberNameDictionary(T[] members) where T : MemberInfo 318 | { 319 | Dictionary nameToMember = new Dictionary(StringComparer.OrdinalIgnoreCase); 320 | for (int i = 0; i < members.Length; i++) 321 | { 322 | T member = members[i]; 323 | if (member.IsDefined(typeof(IgnoreDataMemberAttribute), true)) 324 | continue; 325 | 326 | string name = member.Name; 327 | if (member.IsDefined(typeof(DataMemberAttribute), true)) 328 | { 329 | DataMemberAttribute dataMemberAttribute = (DataMemberAttribute)Attribute.GetCustomAttribute(member, typeof(DataMemberAttribute), true); 330 | if (!string.IsNullOrEmpty(dataMemberAttribute.Name)) 331 | name = dataMemberAttribute.Name; 332 | } 333 | 334 | nameToMember.Add(name, member); 335 | } 336 | 337 | return nameToMember; 338 | } 339 | 340 | static object ParseObject(Type type, string json) 341 | { 342 | object instance = FormatterServices.GetUninitializedObject(type); 343 | 344 | //The list is split into key/value pairs only, this means the split must be divisible by 2 to be valid JSON 345 | List elems = Split(json); 346 | if (elems.Count % 2 != 0) 347 | return instance; 348 | 349 | Dictionary nameToField; 350 | Dictionary nameToProperty; 351 | if (!fieldInfoCache.TryGetValue(type, out nameToField)) 352 | { 353 | nameToField = CreateMemberNameDictionary(type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.FlattenHierarchy)); 354 | fieldInfoCache.Add(type, nameToField); 355 | } 356 | if (!propertyInfoCache.TryGetValue(type, out nameToProperty)) 357 | { 358 | nameToProperty = CreateMemberNameDictionary(type.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.FlattenHierarchy)); 359 | propertyInfoCache.Add(type, nameToProperty); 360 | } 361 | 362 | for (int i = 0; i < elems.Count; i += 2) 363 | { 364 | if (elems[i].Length <= 2) 365 | continue; 366 | string key = elems[i].Substring(1, elems[i].Length - 2); 367 | string value = elems[i + 1]; 368 | 369 | FieldInfo fieldInfo; 370 | PropertyInfo propertyInfo; 371 | if (nameToField.TryGetValue(key, out fieldInfo)) 372 | fieldInfo.SetValue(instance, ParseValue(fieldInfo.FieldType, value)); 373 | else if (nameToProperty.TryGetValue(key, out propertyInfo)) 374 | propertyInfo.SetValue(instance, ParseValue(propertyInfo.PropertyType, value), null); 375 | } 376 | 377 | return instance; 378 | } 379 | } 380 | } -------------------------------------------------------------------------------- /UnityCSharpPatch/Packages/com.kandreyc.unity-csharp-patch/Editor/Utils/TinyJson.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ef8e76551dbd42eb93351d12aba5de42 3 | timeCreated: 1721086345 -------------------------------------------------------------------------------- /UnityCSharpPatch/Packages/com.kandreyc.unity-csharp-patch/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "displayName": "Unity CSharp Patch", 3 | "name": "com.kandreyc.unity-csharp-patch", 4 | "version": "1.0.0", 5 | "unity": "2022.3", 6 | "description": "Package allows to set custom (newer) version of C# per AssemblyDefinition (.asmdef)." 7 | } 8 | -------------------------------------------------------------------------------- /UnityCSharpPatch/Packages/com.kandreyc.unity-csharp-patch/package.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6ccc3df0abbde4a97948ed30ef05e2ae 3 | PackageManifestImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /UnityCSharpPatch/Packages/com.test.local-inner-package/InnerTest.cs: -------------------------------------------------------------------------------- 1 | public class InnerTest; -------------------------------------------------------------------------------- /UnityCSharpPatch/Packages/com.test.local-inner-package/InnerTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 664144f396d44be2aa964644d746bbf4 3 | timeCreated: 1721143279 -------------------------------------------------------------------------------- /UnityCSharpPatch/Packages/com.test.local-inner-package/LocalInnerPackage.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "LocalInnerPackage" 3 | } 4 | -------------------------------------------------------------------------------- /UnityCSharpPatch/Packages/com.test.local-inner-package/LocalInnerPackage.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 032eecceb1b5f4b9f9d6440e10d7e58d 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /UnityCSharpPatch/Packages/com.test.local-inner-package/csc.rsp: -------------------------------------------------------------------------------- 1 | -langVersion:12 2 | -nullable:enable -------------------------------------------------------------------------------- /UnityCSharpPatch/Packages/com.test.local-inner-package/csc.rsp.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2e3350677c8514fcb8dd1b49e7a6a7e0 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /UnityCSharpPatch/Packages/com.test.local-inner-package/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "displayName": "Local Inner Package", 3 | "name": "com.test.local-inner-package", 4 | "version": "1.0.0", 5 | "unity": "2022.3", 6 | "description": "" 7 | } 8 | -------------------------------------------------------------------------------- /UnityCSharpPatch/Packages/com.test.local-inner-package/package.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: befed11aec3e9426e89f783f7a2b3166 3 | PackageManifestImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /UnityCSharpPatch/Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.test.local-outer-package": "file:../AnotherPackages/com.test.local-outer-package", 4 | "com.unity.feature.development": "1.0.1", 5 | "com.unity.ide.rider": "3.0.34", 6 | "com.unity.ugui": "1.0.0", 7 | "com.unity.modules.androidjni": "1.0.0" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /UnityCSharpPatch/Packages/packages-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.kandreyc.unity-csharp-patch": { 4 | "version": "file:com.kandreyc.unity-csharp-patch", 5 | "depth": 0, 6 | "source": "embedded", 7 | "dependencies": {} 8 | }, 9 | "com.test.local-inner-package": { 10 | "version": "file:com.test.local-inner-package", 11 | "depth": 0, 12 | "source": "embedded", 13 | "dependencies": {} 14 | }, 15 | "com.test.local-outer-package": { 16 | "version": "file:../AnotherPackages/com.test.local-outer-package", 17 | "depth": 0, 18 | "source": "local", 19 | "dependencies": {} 20 | }, 21 | "com.unity.editorcoroutines": { 22 | "version": "1.0.0", 23 | "depth": 1, 24 | "source": "registry", 25 | "dependencies": {}, 26 | "url": "https://packages.unity.com" 27 | }, 28 | "com.unity.ext.nunit": { 29 | "version": "1.0.6", 30 | "depth": 1, 31 | "source": "registry", 32 | "dependencies": {}, 33 | "url": "https://packages.unity.com" 34 | }, 35 | "com.unity.feature.development": { 36 | "version": "1.0.1", 37 | "depth": 0, 38 | "source": "builtin", 39 | "dependencies": { 40 | "com.unity.ide.visualstudio": "2.0.22", 41 | "com.unity.ide.rider": "3.0.31", 42 | "com.unity.ide.vscode": "1.2.5", 43 | "com.unity.editorcoroutines": "1.0.0", 44 | "com.unity.performance.profile-analyzer": "1.2.2", 45 | "com.unity.test-framework": "1.1.33", 46 | "com.unity.testtools.codecoverage": "1.2.6" 47 | } 48 | }, 49 | "com.unity.ide.rider": { 50 | "version": "3.0.34", 51 | "depth": 0, 52 | "source": "registry", 53 | "dependencies": { 54 | "com.unity.ext.nunit": "1.0.6" 55 | }, 56 | "url": "https://packages.unity.com" 57 | }, 58 | "com.unity.ide.visualstudio": { 59 | "version": "2.0.22", 60 | "depth": 1, 61 | "source": "registry", 62 | "dependencies": { 63 | "com.unity.test-framework": "1.1.9" 64 | }, 65 | "url": "https://packages.unity.com" 66 | }, 67 | "com.unity.ide.vscode": { 68 | "version": "1.2.5", 69 | "depth": 1, 70 | "source": "registry", 71 | "dependencies": {}, 72 | "url": "https://packages.unity.com" 73 | }, 74 | "com.unity.performance.profile-analyzer": { 75 | "version": "1.2.2", 76 | "depth": 1, 77 | "source": "registry", 78 | "dependencies": {}, 79 | "url": "https://packages.unity.com" 80 | }, 81 | "com.unity.settings-manager": { 82 | "version": "2.0.1", 83 | "depth": 2, 84 | "source": "registry", 85 | "dependencies": {}, 86 | "url": "https://packages.unity.com" 87 | }, 88 | "com.unity.test-framework": { 89 | "version": "1.1.33", 90 | "depth": 1, 91 | "source": "registry", 92 | "dependencies": { 93 | "com.unity.ext.nunit": "1.0.6", 94 | "com.unity.modules.imgui": "1.0.0", 95 | "com.unity.modules.jsonserialize": "1.0.0" 96 | }, 97 | "url": "https://packages.unity.com" 98 | }, 99 | "com.unity.testtools.codecoverage": { 100 | "version": "1.2.6", 101 | "depth": 1, 102 | "source": "registry", 103 | "dependencies": { 104 | "com.unity.test-framework": "1.0.16", 105 | "com.unity.settings-manager": "1.0.1" 106 | }, 107 | "url": "https://packages.unity.com" 108 | }, 109 | "com.unity.ugui": { 110 | "version": "1.0.0", 111 | "depth": 0, 112 | "source": "builtin", 113 | "dependencies": { 114 | "com.unity.modules.ui": "1.0.0", 115 | "com.unity.modules.imgui": "1.0.0" 116 | } 117 | }, 118 | "com.unity.modules.androidjni": { 119 | "version": "1.0.0", 120 | "depth": 0, 121 | "source": "builtin", 122 | "dependencies": {} 123 | }, 124 | "com.unity.modules.imgui": { 125 | "version": "1.0.0", 126 | "depth": 1, 127 | "source": "builtin", 128 | "dependencies": {} 129 | }, 130 | "com.unity.modules.jsonserialize": { 131 | "version": "1.0.0", 132 | "depth": 2, 133 | "source": "builtin", 134 | "dependencies": {} 135 | }, 136 | "com.unity.modules.ui": { 137 | "version": "1.0.0", 138 | "depth": 1, 139 | "source": "builtin", 140 | "dependencies": {} 141 | } 142 | } 143 | } 144 | -------------------------------------------------------------------------------- /UnityCSharpPatch/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_EnableOutputSuspension: 1 16 | m_SpatializerPlugin: 17 | m_AmbisonicDecoderPlugin: 18 | m_DisableAudio: 0 19 | m_VirtualizeEffects: 1 20 | m_RequestedDSPBufferSize: 0 21 | -------------------------------------------------------------------------------- /UnityCSharpPatch/ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /UnityCSharpPatch/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 14 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_DefaultMaxDepenetrationVelocity: 10 11 | m_SleepThreshold: 0.005 12 | m_DefaultContactOffset: 0.01 13 | m_DefaultSolverIterations: 6 14 | m_DefaultSolverVelocityIterations: 1 15 | m_QueriesHitBackfaces: 0 16 | m_QueriesHitTriggers: 1 17 | m_EnableAdaptiveForce: 0 18 | m_ClothInterCollisionDistance: 0.1 19 | m_ClothInterCollisionStiffness: 0.2 20 | m_ContactsGeneration: 1 21 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 22 | m_SimulationMode: 0 23 | m_AutoSyncTransforms: 0 24 | m_ReuseCollisionCallbacks: 0 25 | m_InvokeCollisionCallbacks: 1 26 | m_ClothInterCollisionSettingsToggle: 0 27 | m_ClothGravity: {x: 0, y: -9.81, z: 0} 28 | m_ContactPairsMode: 0 29 | m_BroadphaseType: 0 30 | m_WorldBounds: 31 | m_Center: {x: 0, y: 0, z: 0} 32 | m_Extent: {x: 250, y: 250, z: 250} 33 | m_WorldSubdivisions: 8 34 | m_FrictionType: 0 35 | m_EnableEnhancedDeterminism: 0 36 | m_EnableUnifiedHeightmaps: 1 37 | m_ImprovedPatchFriction: 0 38 | m_SolverType: 0 39 | m_DefaultMaxAngularSpeed: 50 40 | m_FastMotionThreshold: 3.4028235e+38 41 | -------------------------------------------------------------------------------- /UnityCSharpPatch/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: 8 | - enabled: 1 9 | path: Assets/Scene.unity 10 | guid: 56ef2c2d96cd042288056bc28f725b14 11 | m_configObjects: {} 12 | -------------------------------------------------------------------------------- /UnityCSharpPatch/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 12 7 | m_SerializationMode: 2 8 | m_LineEndingsForNewScripts: 1 9 | m_DefaultBehaviorMode: 0 10 | m_PrefabRegularEnvironment: {fileID: 0} 11 | m_PrefabUIEnvironment: {fileID: 0} 12 | m_SpritePackerMode: 0 13 | m_SpritePackerCacheSize: 10 14 | m_SpritePackerPaddingPower: 1 15 | m_Bc7TextureCompressor: 0 16 | m_EtcTextureCompressorBehavior: 1 17 | m_EtcTextureFastCompressor: 1 18 | m_EtcTextureNormalCompressor: 2 19 | m_EtcTextureBestCompressor: 4 20 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;asmref;rsp;java;cpp;c;mm;m;h 21 | m_ProjectGenerationRootNamespace: 22 | m_EnableTextureStreamingInEditMode: 1 23 | m_EnableTextureStreamingInPlayMode: 1 24 | m_EnableEditorAsyncCPUTextureLoading: 0 25 | m_AsyncShaderCompilation: 1 26 | m_PrefabModeAllowAutoSave: 1 27 | m_EnterPlayModeOptionsEnabled: 0 28 | m_EnterPlayModeOptions: 3 29 | m_GameObjectNamingDigits: 1 30 | m_GameObjectNamingScheme: 0 31 | m_AssetNamingUsesSpace: 1 32 | m_InspectorUseIMGUIDefaultInspector: 0 33 | m_UseLegacyProbeSampleCount: 0 34 | m_SerializeInlineMappingsOnOneLine: 1 35 | m_DisableCookiesInLightmapper: 0 36 | m_AssetPipelineMode: 1 37 | m_RefreshImportMode: 0 38 | m_CacheServerMode: 0 39 | m_CacheServerEndpoint: 40 | m_CacheServerNamespacePrefix: default 41 | m_CacheServerEnableDownload: 1 42 | m_CacheServerEnableUpload: 1 43 | m_CacheServerEnableAuth: 0 44 | m_CacheServerEnableTls: 0 45 | m_CacheServerValidationMode: 2 46 | m_CacheServerDownloadBatchSize: 128 47 | m_EnableEnlightenBakedGI: 0 48 | -------------------------------------------------------------------------------- /UnityCSharpPatch/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 15 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_DepthNormals: 17 | m_Mode: 1 18 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 19 | m_MotionVectors: 20 | m_Mode: 1 21 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 22 | m_LightHalo: 23 | m_Mode: 1 24 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LensFlare: 26 | m_Mode: 1 27 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 28 | m_VideoShadersIncludeMode: 2 29 | m_AlwaysIncludedShaders: 30 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 31 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 32 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10783, guid: 0000000000000000f000000000000000, type: 0} 37 | m_PreloadedShaders: [] 38 | m_PreloadShadersBatchTimeLimit: -1 39 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} 40 | m_CustomRenderPipeline: {fileID: 0} 41 | m_TransparencySortMode: 0 42 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 43 | m_DefaultRenderingPath: 1 44 | m_DefaultMobileRenderingPath: 1 45 | m_TierSettings: [] 46 | m_LightmapStripping: 0 47 | m_FogStripping: 0 48 | m_InstancingStripping: 0 49 | m_BrgStripping: 0 50 | m_LightmapKeepPlain: 1 51 | m_LightmapKeepDirCombined: 1 52 | m_LightmapKeepDynamicPlain: 1 53 | m_LightmapKeepDynamicDirCombined: 1 54 | m_LightmapKeepShadowMask: 1 55 | m_LightmapKeepSubtractive: 1 56 | m_FogKeepLinear: 1 57 | m_FogKeepExp: 1 58 | m_FogKeepExp2: 1 59 | m_AlbedoSwatchInfos: [] 60 | m_LightsUseLinearIntensity: 0 61 | m_LightsUseColorTemperature: 0 62 | m_DefaultRenderingLayerMask: 1 63 | m_LogWhenShaderIsCompiled: 0 64 | m_SRPDefaultSettings: {} 65 | m_LightProbeOutsideHullStrategy: 1 66 | m_CameraRelativeLightCulling: 0 67 | m_CameraRelativeShadowCulling: 0 68 | -------------------------------------------------------------------------------- /UnityCSharpPatch/ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!13 &1 4 | InputManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Axes: 8 | - serializedVersion: 3 9 | m_Name: Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: 0.001 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: 0.001 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: 0.001 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: 0.001 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left shift 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: 0.001 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: 0.1 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: 0.1 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: 0.1 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: 0.19 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: 0.19 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: 0.001 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: 0.001 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: 0.001 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: 0.001 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: 0.001 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: 0.001 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | m_UsePhysicalKeys: 1 297 | -------------------------------------------------------------------------------- /UnityCSharpPatch/ProjectSettings/MemorySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!387306366 &1 4 | MemorySettings: 5 | m_ObjectHideFlags: 0 6 | m_EditorMemorySettings: 7 | m_MainAllocatorBlockSize: -1 8 | m_ThreadAllocatorBlockSize: -1 9 | m_MainGfxBlockSize: -1 10 | m_ThreadGfxBlockSize: -1 11 | m_CacheBlockSize: -1 12 | m_TypetreeBlockSize: -1 13 | m_ProfilerBlockSize: -1 14 | m_ProfilerEditorBlockSize: -1 15 | m_BucketAllocatorGranularity: -1 16 | m_BucketAllocatorBucketsCount: -1 17 | m_BucketAllocatorBlockSize: -1 18 | m_BucketAllocatorBlockCount: -1 19 | m_ProfilerBucketAllocatorGranularity: -1 20 | m_ProfilerBucketAllocatorBucketsCount: -1 21 | m_ProfilerBucketAllocatorBlockSize: -1 22 | m_ProfilerBucketAllocatorBlockCount: -1 23 | m_TempAllocatorSizeMain: -1 24 | m_JobTempAllocatorBlockSize: -1 25 | m_BackgroundJobTempAllocatorBlockSize: -1 26 | m_JobTempAllocatorReducedBlockSize: -1 27 | m_TempAllocatorSizeGIBakingWorker: -1 28 | m_TempAllocatorSizeNavMeshWorker: -1 29 | m_TempAllocatorSizeAudioWorker: -1 30 | m_TempAllocatorSizeCloudWorker: -1 31 | m_TempAllocatorSizeGfx: -1 32 | m_TempAllocatorSizeJobWorker: -1 33 | m_TempAllocatorSizeBackgroundWorker: -1 34 | m_TempAllocatorSizePreloadManager: -1 35 | m_PlatformMemorySettings: {} 36 | -------------------------------------------------------------------------------- /UnityCSharpPatch/ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 3 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | buildHeightMesh: 0 88 | maxJobWorkers: 0 89 | preserveTilesOutsideBounds: 0 90 | debug: 91 | m_Flags: 0 92 | m_SettingNames: 93 | - Humanoid 94 | -------------------------------------------------------------------------------- /UnityCSharpPatch/ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 53 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_EnablePreReleasePackages: 0 16 | m_AdvancedSettingsExpanded: 1 17 | m_ScopedRegistriesSettingsExpanded: 1 18 | m_SeeAllPackageVersions: 0 19 | m_DismissPreviewPackagesInUse: 0 20 | oneTimeWarningShown: 0 21 | m_Registries: 22 | - m_Id: main 23 | m_Name: 24 | m_Url: https://packages.unity.com 25 | m_Scopes: [] 26 | m_IsDefault: 1 27 | m_Capabilities: 7 28 | m_ConfigSource: 0 29 | m_UserSelectedRegistryName: 30 | m_UserAddingNewScopedRegistry: 0 31 | m_RegistryInfoDraft: 32 | m_Modified: 0 33 | m_ErrorMessage: 34 | m_UserModificationsInstanceId: -892 35 | m_OriginalInstanceId: -894 36 | m_LoadAssets: 0 37 | -------------------------------------------------------------------------------- /UnityCSharpPatch/ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "m_Dictionary": { 3 | "m_DictionaryValues": [] 4 | } 5 | } -------------------------------------------------------------------------------- /UnityCSharpPatch/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 6 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_SimulationMode: 0 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 1 46 | m_AutoSyncTransforms: 0 47 | m_GizmoOptions: 10 48 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 49 | -------------------------------------------------------------------------------- /UnityCSharpPatch/ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_DefaultPresets: {} 8 | -------------------------------------------------------------------------------- /UnityCSharpPatch/ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!129 &1 4 | PlayerSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 26 7 | productGUID: 801b56751303240d79b9b31f978fc56e 8 | AndroidProfiler: 0 9 | AndroidFilterTouchesWhenObscured: 0 10 | AndroidEnableSustainedPerformanceMode: 0 11 | defaultScreenOrientation: 4 12 | targetDevice: 2 13 | useOnDemandResources: 0 14 | accelerometerFrequency: 60 15 | companyName: DefaultCompany 16 | productName: UnityCSharpPatch 17 | defaultCursor: {fileID: 0} 18 | cursorHotspot: {x: 0, y: 0} 19 | m_SplashScreenBackgroundColor: {r: 0.12156863, g: 0.12156863, b: 0.1254902, a: 1} 20 | m_ShowUnitySplashScreen: 1 21 | m_ShowUnitySplashLogo: 1 22 | m_SplashScreenOverlayOpacity: 1 23 | m_SplashScreenAnimation: 1 24 | m_SplashScreenLogoStyle: 1 25 | m_SplashScreenDrawMode: 0 26 | m_SplashScreenBackgroundAnimationZoom: 1 27 | m_SplashScreenLogoAnimationZoom: 1 28 | m_SplashScreenBackgroundLandscapeAspect: 1 29 | m_SplashScreenBackgroundPortraitAspect: 1 30 | m_SplashScreenBackgroundLandscapeUvs: 31 | serializedVersion: 2 32 | x: 0 33 | y: 0 34 | width: 1 35 | height: 1 36 | m_SplashScreenBackgroundPortraitUvs: 37 | serializedVersion: 2 38 | x: 0 39 | y: 0 40 | width: 1 41 | height: 1 42 | m_SplashScreenLogos: [] 43 | m_VirtualRealitySplashScreen: {fileID: 0} 44 | m_HolographicTrackingLossScreen: {fileID: 0} 45 | defaultScreenWidth: 1920 46 | defaultScreenHeight: 1080 47 | defaultScreenWidthWeb: 960 48 | defaultScreenHeightWeb: 600 49 | m_StereoRenderingPath: 0 50 | m_ActiveColorSpace: 0 51 | unsupportedMSAAFallback: 0 52 | m_SpriteBatchVertexThreshold: 300 53 | m_MTRendering: 1 54 | mipStripping: 0 55 | numberOfMipsStripped: 0 56 | numberOfMipsStrippedPerMipmapLimitGroup: {} 57 | m_StackTraceTypes: 010000000100000001000000010000000100000001000000 58 | iosShowActivityIndicatorOnLoading: -1 59 | androidShowActivityIndicatorOnLoading: -1 60 | iosUseCustomAppBackgroundBehavior: 0 61 | allowedAutorotateToPortrait: 1 62 | allowedAutorotateToPortraitUpsideDown: 1 63 | allowedAutorotateToLandscapeRight: 1 64 | allowedAutorotateToLandscapeLeft: 1 65 | useOSAutorotation: 1 66 | use32BitDisplayBuffer: 1 67 | preserveFramebufferAlpha: 0 68 | disableDepthAndStencilBuffers: 0 69 | androidStartInFullscreen: 1 70 | androidRenderOutsideSafeArea: 1 71 | androidUseSwappy: 1 72 | androidBlitType: 0 73 | androidResizableWindow: 0 74 | androidDefaultWindowWidth: 1920 75 | androidDefaultWindowHeight: 1080 76 | androidMinimumWindowWidth: 400 77 | androidMinimumWindowHeight: 300 78 | androidFullscreenMode: 1 79 | androidAutoRotationBehavior: 1 80 | defaultIsNativeResolution: 1 81 | macRetinaSupport: 1 82 | runInBackground: 0 83 | captureSingleScreen: 0 84 | muteOtherAudioSources: 0 85 | Prepare IOS For Recording: 0 86 | Force IOS Speakers When Recording: 0 87 | audioSpatialExperience: 0 88 | deferSystemGesturesMode: 0 89 | hideHomeButton: 0 90 | submitAnalytics: 1 91 | usePlayerLog: 1 92 | dedicatedServerOptimizations: 0 93 | bakeCollisionMeshes: 0 94 | forceSingleInstance: 0 95 | useFlipModelSwapchain: 1 96 | resizableWindow: 0 97 | useMacAppStoreValidation: 0 98 | macAppStoreCategory: public.app-category.games 99 | gpuSkinning: 0 100 | xboxPIXTextureCapture: 0 101 | xboxEnableAvatar: 0 102 | xboxEnableKinect: 0 103 | xboxEnableKinectAutoTracking: 0 104 | xboxEnableFitness: 0 105 | visibleInBackground: 1 106 | allowFullscreenSwitch: 1 107 | fullscreenMode: 1 108 | xboxSpeechDB: 0 109 | xboxEnableHeadOrientation: 0 110 | xboxEnableGuest: 0 111 | xboxEnablePIXSampling: 0 112 | metalFramebufferOnly: 0 113 | xboxOneResolution: 0 114 | xboxOneSResolution: 0 115 | xboxOneXResolution: 3 116 | xboxOneMonoLoggingLevel: 0 117 | xboxOneLoggingLevel: 1 118 | xboxOneDisableEsram: 0 119 | xboxOneEnableTypeOptimization: 0 120 | xboxOnePresentImmediateThreshold: 0 121 | switchQueueCommandMemory: 1048576 122 | switchQueueControlMemory: 16384 123 | switchQueueComputeMemory: 262144 124 | switchNVNShaderPoolsGranularity: 33554432 125 | switchNVNDefaultPoolsGranularity: 16777216 126 | switchNVNOtherPoolsGranularity: 16777216 127 | switchGpuScratchPoolGranularity: 2097152 128 | switchAllowGpuScratchShrinking: 0 129 | switchNVNMaxPublicTextureIDCount: 0 130 | switchNVNMaxPublicSamplerIDCount: 0 131 | switchNVNGraphicsFirmwareMemory: 32 132 | switchMaxWorkerMultiple: 8 133 | stadiaPresentMode: 0 134 | stadiaTargetFramerate: 0 135 | vulkanNumSwapchainBuffers: 3 136 | vulkanEnableSetSRGBWrite: 0 137 | vulkanEnablePreTransform: 0 138 | vulkanEnableLateAcquireNextImage: 0 139 | vulkanEnableCommandBufferRecycling: 1 140 | loadStoreDebugModeEnabled: 0 141 | visionOSBundleVersion: 1.0 142 | tvOSBundleVersion: 1.0 143 | bundleVersion: 1.0 144 | preloadedAssets: [] 145 | metroInputSource: 0 146 | wsaTransparentSwapchain: 0 147 | m_HolographicPauseOnTrackingLoss: 1 148 | xboxOneDisableKinectGpuReservation: 1 149 | xboxOneEnable7thCore: 1 150 | vrSettings: 151 | enable360StereoCapture: 0 152 | isWsaHolographicRemotingEnabled: 0 153 | enableFrameTimingStats: 0 154 | enableOpenGLProfilerGPURecorders: 1 155 | allowHDRDisplaySupport: 0 156 | useHDRDisplay: 0 157 | hdrBitDepth: 0 158 | m_ColorGamuts: 00000000 159 | targetPixelDensity: 30 160 | resolutionScalingMode: 0 161 | resetResolutionOnWindowResize: 0 162 | androidSupportedAspectRatio: 1 163 | androidMaxAspectRatio: 2.1 164 | applicationIdentifier: 165 | Android: com.DefaultCompany.UnityCSharpPatch 166 | Standalone: com.DefaultCompany.UnityCSharpPatch 167 | iPhone: com.DefaultCompany.UnityCSharpPatch 168 | buildNumber: 169 | Standalone: 0 170 | VisionOS: 0 171 | iPhone: 0 172 | tvOS: 0 173 | overrideDefaultApplicationIdentifier: 0 174 | AndroidBundleVersionCode: 1 175 | AndroidMinSdkVersion: 22 176 | AndroidTargetSdkVersion: 0 177 | AndroidPreferredInstallLocation: 1 178 | aotOptions: 179 | stripEngineCode: 1 180 | iPhoneStrippingLevel: 0 181 | iPhoneScriptCallOptimization: 0 182 | ForceInternetPermission: 0 183 | ForceSDCardPermission: 0 184 | CreateWallpaper: 0 185 | APKExpansionFiles: 0 186 | keepLoadedShadersAlive: 0 187 | StripUnusedMeshComponents: 0 188 | strictShaderVariantMatching: 0 189 | VertexChannelCompressionMask: 4054 190 | iPhoneSdkVersion: 988 191 | iOSTargetOSVersionString: 12.0 192 | tvOSSdkVersion: 0 193 | tvOSRequireExtendedGameController: 0 194 | tvOSTargetOSVersionString: 12.0 195 | VisionOSSdkVersion: 0 196 | VisionOSTargetOSVersionString: 1.0 197 | uIPrerenderedIcon: 0 198 | uIRequiresPersistentWiFi: 0 199 | uIRequiresFullScreen: 1 200 | uIStatusBarHidden: 1 201 | uIExitOnSuspend: 0 202 | uIStatusBarStyle: 0 203 | appleTVSplashScreen: {fileID: 0} 204 | appleTVSplashScreen2x: {fileID: 0} 205 | tvOSSmallIconLayers: [] 206 | tvOSSmallIconLayers2x: [] 207 | tvOSLargeIconLayers: [] 208 | tvOSLargeIconLayers2x: [] 209 | tvOSTopShelfImageLayers: [] 210 | tvOSTopShelfImageLayers2x: [] 211 | tvOSTopShelfImageWideLayers: [] 212 | tvOSTopShelfImageWideLayers2x: [] 213 | iOSLaunchScreenType: 0 214 | iOSLaunchScreenPortrait: {fileID: 0} 215 | iOSLaunchScreenLandscape: {fileID: 0} 216 | iOSLaunchScreenBackgroundColor: 217 | serializedVersion: 2 218 | rgba: 0 219 | iOSLaunchScreenFillPct: 100 220 | iOSLaunchScreenSize: 100 221 | iOSLaunchScreenCustomXibPath: 222 | iOSLaunchScreeniPadType: 0 223 | iOSLaunchScreeniPadImage: {fileID: 0} 224 | iOSLaunchScreeniPadBackgroundColor: 225 | serializedVersion: 2 226 | rgba: 0 227 | iOSLaunchScreeniPadFillPct: 100 228 | iOSLaunchScreeniPadSize: 100 229 | iOSLaunchScreeniPadCustomXibPath: 230 | iOSLaunchScreenCustomStoryboardPath: 231 | iOSLaunchScreeniPadCustomStoryboardPath: 232 | iOSDeviceRequirements: [] 233 | iOSURLSchemes: [] 234 | macOSURLSchemes: [] 235 | iOSBackgroundModes: 0 236 | iOSMetalForceHardShadows: 0 237 | metalEditorSupport: 1 238 | metalAPIValidation: 1 239 | metalCompileShaderBinary: 0 240 | iOSRenderExtraFrameOnPause: 0 241 | iosCopyPluginsCodeInsteadOfSymlink: 0 242 | appleDeveloperTeamID: 243 | iOSManualSigningProvisioningProfileID: 244 | tvOSManualSigningProvisioningProfileID: 245 | VisionOSManualSigningProvisioningProfileID: 246 | iOSManualSigningProvisioningProfileType: 0 247 | tvOSManualSigningProvisioningProfileType: 0 248 | VisionOSManualSigningProvisioningProfileType: 0 249 | appleEnableAutomaticSigning: 0 250 | iOSRequireARKit: 0 251 | iOSAutomaticallyDetectAndAddCapabilities: 1 252 | appleEnableProMotion: 0 253 | shaderPrecisionModel: 0 254 | clonedFromGUID: 00000000000000000000000000000000 255 | templatePackageId: 256 | templateDefaultScene: 257 | useCustomMainManifest: 0 258 | useCustomLauncherManifest: 0 259 | useCustomMainGradleTemplate: 0 260 | useCustomLauncherGradleManifest: 0 261 | useCustomBaseGradleTemplate: 0 262 | useCustomGradlePropertiesTemplate: 0 263 | useCustomGradleSettingsTemplate: 0 264 | useCustomProguardFile: 0 265 | AndroidTargetArchitectures: 2 266 | AndroidTargetDevices: 0 267 | AndroidSplashScreenScale: 0 268 | androidSplashScreen: {fileID: 0} 269 | AndroidKeystoreName: 270 | AndroidKeyaliasName: 271 | AndroidEnableArmv9SecurityFeatures: 0 272 | AndroidBuildApkPerCpuArchitecture: 0 273 | AndroidTVCompatibility: 0 274 | AndroidIsGame: 1 275 | AndroidEnableTango: 0 276 | androidEnableBanner: 1 277 | androidUseLowAccuracyLocation: 0 278 | androidUseCustomKeystore: 0 279 | m_AndroidBanners: 280 | - width: 320 281 | height: 180 282 | banner: {fileID: 0} 283 | androidGamepadSupportLevel: 0 284 | chromeosInputEmulation: 1 285 | AndroidMinifyRelease: 0 286 | AndroidMinifyDebug: 0 287 | AndroidValidateAppBundleSize: 1 288 | AndroidAppBundleSizeToValidate: 150 289 | m_BuildTargetIcons: [] 290 | m_BuildTargetPlatformIcons: 291 | - m_BuildTarget: iPhone 292 | m_Icons: 293 | - m_Textures: [] 294 | m_Width: 180 295 | m_Height: 180 296 | m_Kind: 0 297 | m_SubKind: iPhone 298 | - m_Textures: [] 299 | m_Width: 120 300 | m_Height: 120 301 | m_Kind: 0 302 | m_SubKind: iPhone 303 | - m_Textures: [] 304 | m_Width: 167 305 | m_Height: 167 306 | m_Kind: 0 307 | m_SubKind: iPad 308 | - m_Textures: [] 309 | m_Width: 152 310 | m_Height: 152 311 | m_Kind: 0 312 | m_SubKind: iPad 313 | - m_Textures: [] 314 | m_Width: 76 315 | m_Height: 76 316 | m_Kind: 0 317 | m_SubKind: iPad 318 | - m_Textures: [] 319 | m_Width: 120 320 | m_Height: 120 321 | m_Kind: 3 322 | m_SubKind: iPhone 323 | - m_Textures: [] 324 | m_Width: 80 325 | m_Height: 80 326 | m_Kind: 3 327 | m_SubKind: iPhone 328 | - m_Textures: [] 329 | m_Width: 80 330 | m_Height: 80 331 | m_Kind: 3 332 | m_SubKind: iPad 333 | - m_Textures: [] 334 | m_Width: 40 335 | m_Height: 40 336 | m_Kind: 3 337 | m_SubKind: iPad 338 | - m_Textures: [] 339 | m_Width: 87 340 | m_Height: 87 341 | m_Kind: 1 342 | m_SubKind: iPhone 343 | - m_Textures: [] 344 | m_Width: 58 345 | m_Height: 58 346 | m_Kind: 1 347 | m_SubKind: iPhone 348 | - m_Textures: [] 349 | m_Width: 29 350 | m_Height: 29 351 | m_Kind: 1 352 | m_SubKind: iPhone 353 | - m_Textures: [] 354 | m_Width: 58 355 | m_Height: 58 356 | m_Kind: 1 357 | m_SubKind: iPad 358 | - m_Textures: [] 359 | m_Width: 29 360 | m_Height: 29 361 | m_Kind: 1 362 | m_SubKind: iPad 363 | - m_Textures: [] 364 | m_Width: 60 365 | m_Height: 60 366 | m_Kind: 2 367 | m_SubKind: iPhone 368 | - m_Textures: [] 369 | m_Width: 40 370 | m_Height: 40 371 | m_Kind: 2 372 | m_SubKind: iPhone 373 | - m_Textures: [] 374 | m_Width: 40 375 | m_Height: 40 376 | m_Kind: 2 377 | m_SubKind: iPad 378 | - m_Textures: [] 379 | m_Width: 20 380 | m_Height: 20 381 | m_Kind: 2 382 | m_SubKind: iPad 383 | - m_Textures: [] 384 | m_Width: 1024 385 | m_Height: 1024 386 | m_Kind: 4 387 | m_SubKind: App Store 388 | - m_BuildTarget: Android 389 | m_Icons: 390 | - m_Textures: [] 391 | m_Width: 432 392 | m_Height: 432 393 | m_Kind: 2 394 | m_SubKind: 395 | - m_Textures: [] 396 | m_Width: 324 397 | m_Height: 324 398 | m_Kind: 2 399 | m_SubKind: 400 | - m_Textures: [] 401 | m_Width: 216 402 | m_Height: 216 403 | m_Kind: 2 404 | m_SubKind: 405 | - m_Textures: [] 406 | m_Width: 162 407 | m_Height: 162 408 | m_Kind: 2 409 | m_SubKind: 410 | - m_Textures: [] 411 | m_Width: 108 412 | m_Height: 108 413 | m_Kind: 2 414 | m_SubKind: 415 | - m_Textures: [] 416 | m_Width: 81 417 | m_Height: 81 418 | m_Kind: 2 419 | m_SubKind: 420 | - m_Textures: [] 421 | m_Width: 192 422 | m_Height: 192 423 | m_Kind: 1 424 | m_SubKind: 425 | - m_Textures: [] 426 | m_Width: 144 427 | m_Height: 144 428 | m_Kind: 1 429 | m_SubKind: 430 | - m_Textures: [] 431 | m_Width: 96 432 | m_Height: 96 433 | m_Kind: 1 434 | m_SubKind: 435 | - m_Textures: [] 436 | m_Width: 72 437 | m_Height: 72 438 | m_Kind: 1 439 | m_SubKind: 440 | - m_Textures: [] 441 | m_Width: 48 442 | m_Height: 48 443 | m_Kind: 1 444 | m_SubKind: 445 | - m_Textures: [] 446 | m_Width: 36 447 | m_Height: 36 448 | m_Kind: 1 449 | m_SubKind: 450 | - m_Textures: [] 451 | m_Width: 192 452 | m_Height: 192 453 | m_Kind: 0 454 | m_SubKind: 455 | - m_Textures: [] 456 | m_Width: 144 457 | m_Height: 144 458 | m_Kind: 0 459 | m_SubKind: 460 | - m_Textures: [] 461 | m_Width: 96 462 | m_Height: 96 463 | m_Kind: 0 464 | m_SubKind: 465 | - m_Textures: [] 466 | m_Width: 72 467 | m_Height: 72 468 | m_Kind: 0 469 | m_SubKind: 470 | - m_Textures: [] 471 | m_Width: 48 472 | m_Height: 48 473 | m_Kind: 0 474 | m_SubKind: 475 | - m_Textures: [] 476 | m_Width: 36 477 | m_Height: 36 478 | m_Kind: 0 479 | m_SubKind: 480 | m_BuildTargetBatching: [] 481 | m_BuildTargetShaderSettings: [] 482 | m_BuildTargetGraphicsJobs: [] 483 | m_BuildTargetGraphicsJobMode: [] 484 | m_BuildTargetGraphicsAPIs: [] 485 | m_BuildTargetVRSettings: [] 486 | m_DefaultShaderChunkSizeInMB: 16 487 | m_DefaultShaderChunkCount: 0 488 | openGLRequireES31: 0 489 | openGLRequireES31AEP: 0 490 | openGLRequireES32: 0 491 | m_TemplateCustomTags: {} 492 | mobileMTRendering: 493 | Android: 1 494 | VisionOS: 1 495 | iPhone: 1 496 | tvOS: 1 497 | m_BuildTargetGroupLightmapEncodingQuality: [] 498 | m_BuildTargetGroupHDRCubemapEncodingQuality: [] 499 | m_BuildTargetGroupLightmapSettings: [] 500 | m_BuildTargetGroupLoadStoreDebugModeSettings: [] 501 | m_BuildTargetNormalMapEncoding: [] 502 | m_BuildTargetDefaultTextureCompressionFormat: [] 503 | playModeTestRunnerEnabled: 0 504 | runPlayModeTestAsEditModeTest: 0 505 | actionOnDotNetUnhandledException: 1 506 | enableInternalProfiler: 0 507 | logObjCUncaughtExceptions: 1 508 | enableCrashReportAPI: 0 509 | cameraUsageDescription: 510 | locationUsageDescription: 511 | microphoneUsageDescription: 512 | bluetoothUsageDescription: 513 | macOSTargetOSVersion: 10.13.0 514 | switchNMETAOverride: 515 | switchNetLibKey: 516 | switchSocketMemoryPoolSize: 6144 517 | switchSocketAllocatorPoolSize: 128 518 | switchSocketConcurrencyLimit: 14 519 | switchScreenResolutionBehavior: 2 520 | switchUseCPUProfiler: 0 521 | switchEnableFileSystemTrace: 0 522 | switchLTOSetting: 0 523 | switchApplicationID: 0x01004b9000490000 524 | switchNSODependencies: 525 | switchCompilerFlags: 526 | switchTitleNames_0: 527 | switchTitleNames_1: 528 | switchTitleNames_2: 529 | switchTitleNames_3: 530 | switchTitleNames_4: 531 | switchTitleNames_5: 532 | switchTitleNames_6: 533 | switchTitleNames_7: 534 | switchTitleNames_8: 535 | switchTitleNames_9: 536 | switchTitleNames_10: 537 | switchTitleNames_11: 538 | switchTitleNames_12: 539 | switchTitleNames_13: 540 | switchTitleNames_14: 541 | switchTitleNames_15: 542 | switchPublisherNames_0: 543 | switchPublisherNames_1: 544 | switchPublisherNames_2: 545 | switchPublisherNames_3: 546 | switchPublisherNames_4: 547 | switchPublisherNames_5: 548 | switchPublisherNames_6: 549 | switchPublisherNames_7: 550 | switchPublisherNames_8: 551 | switchPublisherNames_9: 552 | switchPublisherNames_10: 553 | switchPublisherNames_11: 554 | switchPublisherNames_12: 555 | switchPublisherNames_13: 556 | switchPublisherNames_14: 557 | switchPublisherNames_15: 558 | switchIcons_0: {fileID: 0} 559 | switchIcons_1: {fileID: 0} 560 | switchIcons_2: {fileID: 0} 561 | switchIcons_3: {fileID: 0} 562 | switchIcons_4: {fileID: 0} 563 | switchIcons_5: {fileID: 0} 564 | switchIcons_6: {fileID: 0} 565 | switchIcons_7: {fileID: 0} 566 | switchIcons_8: {fileID: 0} 567 | switchIcons_9: {fileID: 0} 568 | switchIcons_10: {fileID: 0} 569 | switchIcons_11: {fileID: 0} 570 | switchIcons_12: {fileID: 0} 571 | switchIcons_13: {fileID: 0} 572 | switchIcons_14: {fileID: 0} 573 | switchIcons_15: {fileID: 0} 574 | switchSmallIcons_0: {fileID: 0} 575 | switchSmallIcons_1: {fileID: 0} 576 | switchSmallIcons_2: {fileID: 0} 577 | switchSmallIcons_3: {fileID: 0} 578 | switchSmallIcons_4: {fileID: 0} 579 | switchSmallIcons_5: {fileID: 0} 580 | switchSmallIcons_6: {fileID: 0} 581 | switchSmallIcons_7: {fileID: 0} 582 | switchSmallIcons_8: {fileID: 0} 583 | switchSmallIcons_9: {fileID: 0} 584 | switchSmallIcons_10: {fileID: 0} 585 | switchSmallIcons_11: {fileID: 0} 586 | switchSmallIcons_12: {fileID: 0} 587 | switchSmallIcons_13: {fileID: 0} 588 | switchSmallIcons_14: {fileID: 0} 589 | switchSmallIcons_15: {fileID: 0} 590 | switchManualHTML: 591 | switchAccessibleURLs: 592 | switchLegalInformation: 593 | switchMainThreadStackSize: 1048576 594 | switchPresenceGroupId: 595 | switchLogoHandling: 0 596 | switchReleaseVersion: 0 597 | switchDisplayVersion: 1.0.0 598 | switchStartupUserAccount: 0 599 | switchSupportedLanguagesMask: 0 600 | switchLogoType: 0 601 | switchApplicationErrorCodeCategory: 602 | switchUserAccountSaveDataSize: 0 603 | switchUserAccountSaveDataJournalSize: 0 604 | switchApplicationAttribute: 0 605 | switchCardSpecSize: -1 606 | switchCardSpecClock: -1 607 | switchRatingsMask: 0 608 | switchRatingsInt_0: 0 609 | switchRatingsInt_1: 0 610 | switchRatingsInt_2: 0 611 | switchRatingsInt_3: 0 612 | switchRatingsInt_4: 0 613 | switchRatingsInt_5: 0 614 | switchRatingsInt_6: 0 615 | switchRatingsInt_7: 0 616 | switchRatingsInt_8: 0 617 | switchRatingsInt_9: 0 618 | switchRatingsInt_10: 0 619 | switchRatingsInt_11: 0 620 | switchRatingsInt_12: 0 621 | switchLocalCommunicationIds_0: 622 | switchLocalCommunicationIds_1: 623 | switchLocalCommunicationIds_2: 624 | switchLocalCommunicationIds_3: 625 | switchLocalCommunicationIds_4: 626 | switchLocalCommunicationIds_5: 627 | switchLocalCommunicationIds_6: 628 | switchLocalCommunicationIds_7: 629 | switchParentalControl: 0 630 | switchAllowsScreenshot: 1 631 | switchAllowsVideoCapturing: 1 632 | switchAllowsRuntimeAddOnContentInstall: 0 633 | switchDataLossConfirmation: 0 634 | switchUserAccountLockEnabled: 0 635 | switchSystemResourceMemory: 16777216 636 | switchSupportedNpadStyles: 22 637 | switchNativeFsCacheSize: 32 638 | switchIsHoldTypeHorizontal: 1 639 | switchSupportedNpadCount: 8 640 | switchEnableTouchScreen: 1 641 | switchSocketConfigEnabled: 0 642 | switchTcpInitialSendBufferSize: 32 643 | switchTcpInitialReceiveBufferSize: 64 644 | switchTcpAutoSendBufferSizeMax: 256 645 | switchTcpAutoReceiveBufferSizeMax: 256 646 | switchUdpSendBufferSize: 9 647 | switchUdpReceiveBufferSize: 42 648 | switchSocketBufferEfficiency: 4 649 | switchSocketInitializeEnabled: 1 650 | switchNetworkInterfaceManagerInitializeEnabled: 1 651 | switchUseNewStyleFilepaths: 1 652 | switchUseLegacyFmodPriorities: 0 653 | switchUseMicroSleepForYield: 1 654 | switchEnableRamDiskSupport: 0 655 | switchMicroSleepForYieldTime: 25 656 | switchRamDiskSpaceSize: 12 657 | ps4NPAgeRating: 12 658 | ps4NPTitleSecret: 659 | ps4NPTrophyPackPath: 660 | ps4ParentalLevel: 11 661 | ps4ContentID: ED1633-NPXX51362_00-0000000000000000 662 | ps4Category: 0 663 | ps4MasterVersion: 01.00 664 | ps4AppVersion: 01.00 665 | ps4AppType: 0 666 | ps4ParamSfxPath: 667 | ps4VideoOutPixelFormat: 0 668 | ps4VideoOutInitialWidth: 1920 669 | ps4VideoOutBaseModeInitialWidth: 1920 670 | ps4VideoOutReprojectionRate: 60 671 | ps4PronunciationXMLPath: 672 | ps4PronunciationSIGPath: 673 | ps4BackgroundImagePath: 674 | ps4StartupImagePath: 675 | ps4StartupImagesFolder: 676 | ps4IconImagesFolder: 677 | ps4SaveDataImagePath: 678 | ps4SdkOverride: 679 | ps4BGMPath: 680 | ps4ShareFilePath: 681 | ps4ShareOverlayImagePath: 682 | ps4PrivacyGuardImagePath: 683 | ps4ExtraSceSysFile: 684 | ps4NPtitleDatPath: 685 | ps4RemotePlayKeyAssignment: -1 686 | ps4RemotePlayKeyMappingDir: 687 | ps4PlayTogetherPlayerCount: 0 688 | ps4EnterButtonAssignment: 2 689 | ps4ApplicationParam1: 0 690 | ps4ApplicationParam2: 0 691 | ps4ApplicationParam3: 0 692 | ps4ApplicationParam4: 0 693 | ps4DownloadDataSize: 0 694 | ps4GarlicHeapSize: 2048 695 | ps4ProGarlicHeapSize: 2560 696 | playerPrefsMaxSize: 32768 697 | ps4Passcode: iNDA8ADkIGcti1qv9ohcwiPsJtl61984 698 | ps4pnSessions: 1 699 | ps4pnPresence: 1 700 | ps4pnFriends: 1 701 | ps4pnGameCustomData: 1 702 | playerPrefsSupport: 0 703 | enableApplicationExit: 0 704 | resetTempFolder: 1 705 | restrictedAudioUsageRights: 0 706 | ps4UseResolutionFallback: 0 707 | ps4ReprojectionSupport: 0 708 | ps4UseAudio3dBackend: 0 709 | ps4UseLowGarlicFragmentationMode: 1 710 | ps4SocialScreenEnabled: 0 711 | ps4ScriptOptimizationLevel: 2 712 | ps4Audio3dVirtualSpeakerCount: 14 713 | ps4attribCpuUsage: 0 714 | ps4PatchPkgPath: 715 | ps4PatchLatestPkgPath: 716 | ps4PatchChangeinfoPath: 717 | ps4PatchDayOne: 0 718 | ps4attribUserManagement: 0 719 | ps4attribMoveSupport: 0 720 | ps4attrib3DSupport: 0 721 | ps4attribShareSupport: 0 722 | ps4attribExclusiveVR: 0 723 | ps4disableAutoHideSplash: 0 724 | ps4videoRecordingFeaturesUsed: 0 725 | ps4contentSearchFeaturesUsed: 0 726 | ps4CompatibilityPS5: 0 727 | ps4AllowPS5Detection: 0 728 | ps4GPU800MHz: 1 729 | ps4attribEyeToEyeDistanceSettingVR: 0 730 | ps4IncludedModules: [] 731 | ps4attribVROutputEnabled: 0 732 | monoEnv: 733 | splashScreenBackgroundSourceLandscape: {fileID: 0} 734 | splashScreenBackgroundSourcePortrait: {fileID: 0} 735 | blurSplashScreenBackground: 1 736 | spritePackerPolicy: 737 | webGLMemorySize: 32 738 | webGLExceptionSupport: 1 739 | webGLNameFilesAsHashes: 0 740 | webGLShowDiagnostics: 0 741 | webGLDataCaching: 1 742 | webGLDebugSymbols: 0 743 | webGLEmscriptenArgs: 744 | webGLModulesDirectory: 745 | webGLTemplate: APPLICATION:Default 746 | webGLAnalyzeBuildSize: 0 747 | webGLUseEmbeddedResources: 0 748 | webGLCompressionFormat: 1 749 | webGLWasmArithmeticExceptions: 0 750 | webGLLinkerTarget: 1 751 | webGLThreadsSupport: 0 752 | webGLDecompressionFallback: 0 753 | webGLInitialMemorySize: 32 754 | webGLMaximumMemorySize: 2048 755 | webGLMemoryGrowthMode: 2 756 | webGLMemoryLinearGrowthStep: 16 757 | webGLMemoryGeometricGrowthStep: 0.2 758 | webGLMemoryGeometricGrowthCap: 96 759 | webGLPowerPreference: 2 760 | scriptingDefineSymbols: {} 761 | additionalCompilerArguments: {} 762 | platformArchitecture: {} 763 | scriptingBackend: 764 | Android: 1 765 | Standalone: 0 766 | il2cppCompilerConfiguration: {} 767 | il2cppCodeGeneration: {} 768 | managedStrippingLevel: {} 769 | incrementalIl2cppBuild: {} 770 | suppressCommonWarnings: 1 771 | allowUnsafeCode: 0 772 | useDeterministicCompilation: 1 773 | additionalIl2CppArgs: 774 | scriptingRuntimeVersion: 1 775 | gcIncremental: 1 776 | gcWBarrierValidation: 0 777 | apiCompatibilityLevelPerPlatform: {} 778 | m_RenderingPath: 1 779 | m_MobileRenderingPath: 1 780 | metroPackageName: UnityCSharpPatch 781 | metroPackageVersion: 782 | metroCertificatePath: 783 | metroCertificatePassword: 784 | metroCertificateSubject: 785 | metroCertificateIssuer: 786 | metroCertificateNotAfter: 0000000000000000 787 | metroApplicationDescription: UnityCSharpPatch 788 | wsaImages: {} 789 | metroTileShortName: 790 | metroTileShowName: 0 791 | metroMediumTileShowName: 0 792 | metroLargeTileShowName: 0 793 | metroWideTileShowName: 0 794 | metroSupportStreamingInstall: 0 795 | metroLastRequiredScene: 0 796 | metroDefaultTileSize: 1 797 | metroTileForegroundText: 2 798 | metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} 799 | metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, a: 1} 800 | metroSplashScreenUseBackgroundColor: 0 801 | syncCapabilities: 0 802 | platformCapabilities: {} 803 | metroTargetDeviceFamilies: {} 804 | metroFTAName: 805 | metroFTAFileTypes: [] 806 | metroProtocolName: 807 | vcxProjDefaultLanguage: 808 | XboxOneProductId: 809 | XboxOneUpdateKey: 810 | XboxOneSandboxId: 811 | XboxOneContentId: 812 | XboxOneTitleId: 813 | XboxOneSCId: 814 | XboxOneGameOsOverridePath: 815 | XboxOnePackagingOverridePath: 816 | XboxOneAppManifestOverridePath: 817 | XboxOneVersion: 1.0.0.0 818 | XboxOnePackageEncryption: 0 819 | XboxOnePackageUpdateGranularity: 2 820 | XboxOneDescription: 821 | XboxOneLanguage: 822 | - enus 823 | XboxOneCapability: [] 824 | XboxOneGameRating: {} 825 | XboxOneIsContentPackage: 0 826 | XboxOneEnhancedXboxCompatibilityMode: 0 827 | XboxOneEnableGPUVariability: 1 828 | XboxOneSockets: {} 829 | XboxOneSplashScreen: {fileID: 0} 830 | XboxOneAllowedProductIds: [] 831 | XboxOnePersistentLocalStorageSize: 0 832 | XboxOneXTitleMemory: 8 833 | XboxOneOverrideIdentityName: 834 | XboxOneOverrideIdentityPublisher: 835 | vrEditorSettings: {} 836 | cloudServicesEnabled: {} 837 | luminIcon: 838 | m_Name: 839 | m_ModelFolderPath: 840 | m_PortalFolderPath: 841 | luminCert: 842 | m_CertPath: 843 | m_SignPackage: 1 844 | luminIsChannelApp: 0 845 | luminVersion: 846 | m_VersionCode: 1 847 | m_VersionName: 848 | hmiPlayerDataPath: 849 | hmiForceSRGBBlit: 1 850 | embeddedLinuxEnableGamepadInput: 1 851 | hmiLogStartupTiming: 0 852 | hmiCpuConfiguration: 853 | apiCompatibilityLevel: 6 854 | activeInputHandler: 0 855 | windowsGamepadBackendHint: 0 856 | cloudProjectId: 857 | framebufferDepthMemorylessMode: 0 858 | qualitySettingsNames: [] 859 | projectName: 860 | organizationId: 861 | cloudEnabled: 0 862 | legacyClampBlendShapeWeights: 0 863 | hmiLoadingImage: {fileID: 0} 864 | platformRequiresReadableAssets: 0 865 | virtualTexturingSupportEnabled: 0 866 | insecureHttpOption: 0 867 | -------------------------------------------------------------------------------- /UnityCSharpPatch/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2022.3.50f1 2 | m_EditorVersionWithRevision: 2022.3.50f1 (c3db7f8bf9b1) 3 | -------------------------------------------------------------------------------- /UnityCSharpPatch/ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 5 8 | m_QualitySettings: 9 | - serializedVersion: 3 10 | name: Very Low 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | shadowmaskMode: 0 21 | skinWeights: 1 22 | globalTextureMipmapLimit: 1 23 | textureMipmapLimitSettings: [] 24 | anisotropicTextures: 0 25 | antiAliasing: 0 26 | softParticles: 0 27 | softVegetation: 0 28 | realtimeReflectionProbes: 0 29 | billboardsFaceCameraPosition: 0 30 | useLegacyDetailDistribution: 0 31 | vSyncCount: 0 32 | realtimeGICPUUsage: 25 33 | lodBias: 0.3 34 | maximumLODLevel: 0 35 | enableLODCrossFade: 1 36 | streamingMipmapsActive: 0 37 | streamingMipmapsAddAllCameras: 1 38 | streamingMipmapsMemoryBudget: 512 39 | streamingMipmapsRenderersPerFrame: 512 40 | streamingMipmapsMaxLevelReduction: 2 41 | streamingMipmapsMaxFileIORequests: 1024 42 | particleRaycastBudget: 4 43 | asyncUploadTimeSlice: 2 44 | asyncUploadBufferSize: 16 45 | asyncUploadPersistentBuffer: 1 46 | resolutionScalingFixedDPIFactor: 1 47 | customRenderPipeline: {fileID: 0} 48 | terrainQualityOverrides: 0 49 | terrainPixelError: 1 50 | terrainDetailDensityScale: 1 51 | terrainBasemapDistance: 1000 52 | terrainDetailDistance: 80 53 | terrainTreeDistance: 5000 54 | terrainBillboardStart: 50 55 | terrainFadeLength: 5 56 | terrainMaxTrees: 50 57 | excludedTargetPlatforms: [] 58 | - serializedVersion: 3 59 | name: Low 60 | pixelLightCount: 0 61 | shadows: 0 62 | shadowResolution: 0 63 | shadowProjection: 1 64 | shadowCascades: 1 65 | shadowDistance: 20 66 | shadowNearPlaneOffset: 3 67 | shadowCascade2Split: 0.33333334 68 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 69 | shadowmaskMode: 0 70 | skinWeights: 2 71 | globalTextureMipmapLimit: 0 72 | textureMipmapLimitSettings: [] 73 | anisotropicTextures: 0 74 | antiAliasing: 0 75 | softParticles: 0 76 | softVegetation: 0 77 | realtimeReflectionProbes: 0 78 | billboardsFaceCameraPosition: 0 79 | useLegacyDetailDistribution: 0 80 | vSyncCount: 0 81 | realtimeGICPUUsage: 25 82 | lodBias: 0.4 83 | maximumLODLevel: 0 84 | enableLODCrossFade: 1 85 | streamingMipmapsActive: 0 86 | streamingMipmapsAddAllCameras: 1 87 | streamingMipmapsMemoryBudget: 512 88 | streamingMipmapsRenderersPerFrame: 512 89 | streamingMipmapsMaxLevelReduction: 2 90 | streamingMipmapsMaxFileIORequests: 1024 91 | particleRaycastBudget: 16 92 | asyncUploadTimeSlice: 2 93 | asyncUploadBufferSize: 16 94 | asyncUploadPersistentBuffer: 1 95 | resolutionScalingFixedDPIFactor: 1 96 | customRenderPipeline: {fileID: 0} 97 | terrainQualityOverrides: 0 98 | terrainPixelError: 1 99 | terrainDetailDensityScale: 1 100 | terrainBasemapDistance: 1000 101 | terrainDetailDistance: 80 102 | terrainTreeDistance: 5000 103 | terrainBillboardStart: 50 104 | terrainFadeLength: 5 105 | terrainMaxTrees: 50 106 | excludedTargetPlatforms: [] 107 | - serializedVersion: 3 108 | name: Medium 109 | pixelLightCount: 1 110 | shadows: 1 111 | shadowResolution: 0 112 | shadowProjection: 1 113 | shadowCascades: 1 114 | shadowDistance: 20 115 | shadowNearPlaneOffset: 3 116 | shadowCascade2Split: 0.33333334 117 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 118 | shadowmaskMode: 0 119 | skinWeights: 2 120 | globalTextureMipmapLimit: 0 121 | textureMipmapLimitSettings: [] 122 | anisotropicTextures: 1 123 | antiAliasing: 0 124 | softParticles: 0 125 | softVegetation: 0 126 | realtimeReflectionProbes: 0 127 | billboardsFaceCameraPosition: 0 128 | useLegacyDetailDistribution: 0 129 | vSyncCount: 1 130 | realtimeGICPUUsage: 25 131 | lodBias: 0.7 132 | maximumLODLevel: 0 133 | enableLODCrossFade: 1 134 | streamingMipmapsActive: 0 135 | streamingMipmapsAddAllCameras: 1 136 | streamingMipmapsMemoryBudget: 512 137 | streamingMipmapsRenderersPerFrame: 512 138 | streamingMipmapsMaxLevelReduction: 2 139 | streamingMipmapsMaxFileIORequests: 1024 140 | particleRaycastBudget: 64 141 | asyncUploadTimeSlice: 2 142 | asyncUploadBufferSize: 16 143 | asyncUploadPersistentBuffer: 1 144 | resolutionScalingFixedDPIFactor: 1 145 | customRenderPipeline: {fileID: 0} 146 | terrainQualityOverrides: 0 147 | terrainPixelError: 1 148 | terrainDetailDensityScale: 1 149 | terrainBasemapDistance: 1000 150 | terrainDetailDistance: 80 151 | terrainTreeDistance: 5000 152 | terrainBillboardStart: 50 153 | terrainFadeLength: 5 154 | terrainMaxTrees: 50 155 | excludedTargetPlatforms: [] 156 | - serializedVersion: 3 157 | name: High 158 | pixelLightCount: 2 159 | shadows: 2 160 | shadowResolution: 1 161 | shadowProjection: 1 162 | shadowCascades: 2 163 | shadowDistance: 40 164 | shadowNearPlaneOffset: 3 165 | shadowCascade2Split: 0.33333334 166 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 167 | shadowmaskMode: 1 168 | skinWeights: 2 169 | globalTextureMipmapLimit: 0 170 | textureMipmapLimitSettings: [] 171 | anisotropicTextures: 1 172 | antiAliasing: 0 173 | softParticles: 0 174 | softVegetation: 1 175 | realtimeReflectionProbes: 1 176 | billboardsFaceCameraPosition: 1 177 | useLegacyDetailDistribution: 0 178 | vSyncCount: 1 179 | realtimeGICPUUsage: 50 180 | lodBias: 1 181 | maximumLODLevel: 0 182 | enableLODCrossFade: 1 183 | streamingMipmapsActive: 0 184 | streamingMipmapsAddAllCameras: 1 185 | streamingMipmapsMemoryBudget: 512 186 | streamingMipmapsRenderersPerFrame: 512 187 | streamingMipmapsMaxLevelReduction: 2 188 | streamingMipmapsMaxFileIORequests: 1024 189 | particleRaycastBudget: 256 190 | asyncUploadTimeSlice: 2 191 | asyncUploadBufferSize: 16 192 | asyncUploadPersistentBuffer: 1 193 | resolutionScalingFixedDPIFactor: 1 194 | customRenderPipeline: {fileID: 0} 195 | terrainQualityOverrides: 0 196 | terrainPixelError: 1 197 | terrainDetailDensityScale: 1 198 | terrainBasemapDistance: 1000 199 | terrainDetailDistance: 80 200 | terrainTreeDistance: 5000 201 | terrainBillboardStart: 50 202 | terrainFadeLength: 5 203 | terrainMaxTrees: 50 204 | excludedTargetPlatforms: [] 205 | - serializedVersion: 3 206 | name: Very High 207 | pixelLightCount: 3 208 | shadows: 2 209 | shadowResolution: 2 210 | shadowProjection: 1 211 | shadowCascades: 2 212 | shadowDistance: 70 213 | shadowNearPlaneOffset: 3 214 | shadowCascade2Split: 0.33333334 215 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 216 | shadowmaskMode: 1 217 | skinWeights: 4 218 | globalTextureMipmapLimit: 0 219 | textureMipmapLimitSettings: [] 220 | anisotropicTextures: 2 221 | antiAliasing: 2 222 | softParticles: 1 223 | softVegetation: 1 224 | realtimeReflectionProbes: 1 225 | billboardsFaceCameraPosition: 1 226 | useLegacyDetailDistribution: 0 227 | vSyncCount: 1 228 | realtimeGICPUUsage: 50 229 | lodBias: 1.5 230 | maximumLODLevel: 0 231 | enableLODCrossFade: 1 232 | streamingMipmapsActive: 0 233 | streamingMipmapsAddAllCameras: 1 234 | streamingMipmapsMemoryBudget: 512 235 | streamingMipmapsRenderersPerFrame: 512 236 | streamingMipmapsMaxLevelReduction: 2 237 | streamingMipmapsMaxFileIORequests: 1024 238 | particleRaycastBudget: 1024 239 | asyncUploadTimeSlice: 2 240 | asyncUploadBufferSize: 16 241 | asyncUploadPersistentBuffer: 1 242 | resolutionScalingFixedDPIFactor: 1 243 | customRenderPipeline: {fileID: 0} 244 | terrainQualityOverrides: 0 245 | terrainPixelError: 1 246 | terrainDetailDensityScale: 1 247 | terrainBasemapDistance: 1000 248 | terrainDetailDistance: 80 249 | terrainTreeDistance: 5000 250 | terrainBillboardStart: 50 251 | terrainFadeLength: 5 252 | terrainMaxTrees: 50 253 | excludedTargetPlatforms: [] 254 | - serializedVersion: 3 255 | name: Ultra 256 | pixelLightCount: 4 257 | shadows: 2 258 | shadowResolution: 2 259 | shadowProjection: 1 260 | shadowCascades: 4 261 | shadowDistance: 150 262 | shadowNearPlaneOffset: 3 263 | shadowCascade2Split: 0.33333334 264 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 265 | shadowmaskMode: 1 266 | skinWeights: 255 267 | globalTextureMipmapLimit: 0 268 | textureMipmapLimitSettings: [] 269 | anisotropicTextures: 2 270 | antiAliasing: 2 271 | softParticles: 1 272 | softVegetation: 1 273 | realtimeReflectionProbes: 1 274 | billboardsFaceCameraPosition: 1 275 | useLegacyDetailDistribution: 0 276 | vSyncCount: 1 277 | realtimeGICPUUsage: 100 278 | lodBias: 2 279 | maximumLODLevel: 0 280 | enableLODCrossFade: 1 281 | streamingMipmapsActive: 0 282 | streamingMipmapsAddAllCameras: 1 283 | streamingMipmapsMemoryBudget: 512 284 | streamingMipmapsRenderersPerFrame: 512 285 | streamingMipmapsMaxLevelReduction: 2 286 | streamingMipmapsMaxFileIORequests: 1024 287 | particleRaycastBudget: 4096 288 | asyncUploadTimeSlice: 2 289 | asyncUploadBufferSize: 16 290 | asyncUploadPersistentBuffer: 1 291 | resolutionScalingFixedDPIFactor: 1 292 | customRenderPipeline: {fileID: 0} 293 | terrainQualityOverrides: 0 294 | terrainPixelError: 1 295 | terrainDetailDensityScale: 1 296 | terrainBasemapDistance: 1000 297 | terrainDetailDistance: 80 298 | terrainTreeDistance: 5000 299 | terrainBillboardStart: 50 300 | terrainFadeLength: 5 301 | terrainMaxTrees: 50 302 | excludedTargetPlatforms: [] 303 | m_TextureMipmapLimitGroupNames: [] 304 | m_PerPlatformDefaultQuality: 305 | Android: 2 306 | EmbeddedLinux: 5 307 | GameCoreScarlett: 5 308 | GameCoreXboxOne: 5 309 | LinuxHeadlessSimulation: 5 310 | Nintendo Switch: 5 311 | PS4: 5 312 | PS5: 5 313 | QNX: 5 314 | Server: 5 315 | Stadia: 5 316 | Standalone: 5 317 | VisionOS: 5 318 | WebGL: 3 319 | Windows Store Apps: 5 320 | XboxOne: 5 321 | iPhone: 2 322 | tvOS: 2 323 | -------------------------------------------------------------------------------- /UnityCSharpPatch/ProjectSettings/SceneTemplateSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "templatePinStates": [], 3 | "dependencyTypeInfos": [ 4 | { 5 | "userAdded": false, 6 | "type": "UnityEngine.AnimationClip", 7 | "defaultInstantiationMode": 0 8 | }, 9 | { 10 | "userAdded": false, 11 | "type": "UnityEditor.Animations.AnimatorController", 12 | "defaultInstantiationMode": 0 13 | }, 14 | { 15 | "userAdded": false, 16 | "type": "UnityEngine.AnimatorOverrideController", 17 | "defaultInstantiationMode": 0 18 | }, 19 | { 20 | "userAdded": false, 21 | "type": "UnityEditor.Audio.AudioMixerController", 22 | "defaultInstantiationMode": 0 23 | }, 24 | { 25 | "userAdded": false, 26 | "type": "UnityEngine.ComputeShader", 27 | "defaultInstantiationMode": 1 28 | }, 29 | { 30 | "userAdded": false, 31 | "type": "UnityEngine.Cubemap", 32 | "defaultInstantiationMode": 0 33 | }, 34 | { 35 | "userAdded": false, 36 | "type": "UnityEngine.GameObject", 37 | "defaultInstantiationMode": 0 38 | }, 39 | { 40 | "userAdded": false, 41 | "type": "UnityEditor.LightingDataAsset", 42 | "defaultInstantiationMode": 0 43 | }, 44 | { 45 | "userAdded": false, 46 | "type": "UnityEngine.LightingSettings", 47 | "defaultInstantiationMode": 0 48 | }, 49 | { 50 | "userAdded": false, 51 | "type": "UnityEngine.Material", 52 | "defaultInstantiationMode": 0 53 | }, 54 | { 55 | "userAdded": false, 56 | "type": "UnityEditor.MonoScript", 57 | "defaultInstantiationMode": 1 58 | }, 59 | { 60 | "userAdded": false, 61 | "type": "UnityEngine.PhysicMaterial", 62 | "defaultInstantiationMode": 0 63 | }, 64 | { 65 | "userAdded": false, 66 | "type": "UnityEngine.PhysicsMaterial2D", 67 | "defaultInstantiationMode": 0 68 | }, 69 | { 70 | "userAdded": false, 71 | "type": "UnityEngine.Rendering.PostProcessing.PostProcessProfile", 72 | "defaultInstantiationMode": 0 73 | }, 74 | { 75 | "userAdded": false, 76 | "type": "UnityEngine.Rendering.PostProcessing.PostProcessResources", 77 | "defaultInstantiationMode": 0 78 | }, 79 | { 80 | "userAdded": false, 81 | "type": "UnityEngine.Rendering.VolumeProfile", 82 | "defaultInstantiationMode": 0 83 | }, 84 | { 85 | "userAdded": false, 86 | "type": "UnityEditor.SceneAsset", 87 | "defaultInstantiationMode": 1 88 | }, 89 | { 90 | "userAdded": false, 91 | "type": "UnityEngine.Shader", 92 | "defaultInstantiationMode": 1 93 | }, 94 | { 95 | "userAdded": false, 96 | "type": "UnityEngine.ShaderVariantCollection", 97 | "defaultInstantiationMode": 1 98 | }, 99 | { 100 | "userAdded": false, 101 | "type": "UnityEngine.Texture", 102 | "defaultInstantiationMode": 0 103 | }, 104 | { 105 | "userAdded": false, 106 | "type": "UnityEngine.Texture2D", 107 | "defaultInstantiationMode": 0 108 | }, 109 | { 110 | "userAdded": false, 111 | "type": "UnityEngine.Timeline.TimelineAsset", 112 | "defaultInstantiationMode": 0 113 | } 114 | ], 115 | "defaultDependencyTypeInfo": { 116 | "userAdded": false, 117 | "type": "", 118 | "defaultInstantiationMode": 1 119 | }, 120 | "newSceneOverride": 0 121 | } -------------------------------------------------------------------------------- /UnityCSharpPatch/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /UnityCSharpPatch/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /UnityCSharpPatch/ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_DashboardUrl: https://dashboard.unity3d.com 13 | m_TestInitMode: 0 14 | CrashReportingSettings: 15 | m_EventUrl: https://perf-events.cloud.unity3d.com 16 | m_Enabled: 0 17 | m_LogBufferSize: 10 18 | m_CaptureEditorExceptions: 1 19 | UnityPurchasingSettings: 20 | m_Enabled: 0 21 | m_TestMode: 0 22 | UnityAnalyticsSettings: 23 | m_Enabled: 0 24 | m_TestMode: 0 25 | m_InitializeOnStartup: 1 26 | m_PackageRequiringCoreStatsPresent: 0 27 | UnityAdsSettings: 28 | m_Enabled: 0 29 | m_InitializeOnStartup: 1 30 | m_TestMode: 0 31 | m_IosGameId: 32 | m_AndroidGameId: 33 | m_GameIds: {} 34 | m_GameId: 35 | PerformanceReportingSettings: 36 | m_Enabled: 0 37 | -------------------------------------------------------------------------------- /UnityCSharpPatch/ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_StripUpdateShader: {fileID: 0} 10 | m_EmptyShader: {fileID: 0} 11 | m_RenderPipeSettingsPath: 12 | m_FixedTimeStep: 0.016666668 13 | m_MaxDeltaTime: 0.05 14 | m_MaxScrubTime: 30 15 | m_CompiledVersion: 0 16 | m_RuntimeVersion: 0 17 | m_RuntimeResources: {fileID: 0} 18 | m_BatchEmptyLifetime: 300 19 | -------------------------------------------------------------------------------- /UnityCSharpPatch/ProjectSettings/VersionControlSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!890905787 &1 4 | VersionControlSettings: 5 | m_ObjectHideFlags: 0 6 | m_Mode: Visible Meta Files 7 | m_CollabEditorSettings: 8 | inProgressEnabled: 1 9 | -------------------------------------------------------------------------------- /UnityEditorPatch/.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | *.*~ 3 | project.lock.json 4 | .DS_Store 5 | *.pyc 6 | nupkg/ 7 | 8 | # Visual Studio Code 9 | .vscode/ 10 | 11 | # Rider 12 | .idea/ 13 | 14 | # Visual Studio 15 | .vs/ 16 | 17 | # Fleet 18 | .fleet/ 19 | 20 | # Code Rush 21 | .cr/ 22 | 23 | # User-specific files 24 | *.suo 25 | *.user 26 | *.userosscache 27 | *.sln.docstates 28 | 29 | # Build results 30 | [Dd]ebug/ 31 | [Dd]ebugPublic/ 32 | [Rr]elease/ 33 | [Rr]eleases/ 34 | x64/ 35 | x86/ 36 | build/ 37 | bld/ 38 | [Bb]in/ 39 | [Oo]bj/ 40 | [Oo]ut/ 41 | msbuild.log 42 | msbuild.err 43 | msbuild.wrn -------------------------------------------------------------------------------- /UnityEditorPatch/Extensions/ModuleDefinitionExtensions.cs: -------------------------------------------------------------------------------- 1 | using AsmResolver.DotNet; 2 | 3 | namespace UnityEditorPatch.Extensions; 4 | 5 | public static class ModuleDefinitionExtensions 6 | { 7 | public static TypeDefinition? GetTypeByFullName(this ModuleDefinition module, string typeName) 8 | { 9 | ArgumentNullException.ThrowIfNull(module); 10 | 11 | foreach (TypeDefinition type in module.GetAllTypes()) 12 | { 13 | if (type.FullName == typeName) 14 | { 15 | return type; 16 | } 17 | } 18 | 19 | return null; 20 | } 21 | 22 | public static AssemblyReference? GetAssemblyReferenceByName(this ModuleDefinition module, string name) 23 | { 24 | ArgumentNullException.ThrowIfNull(module); 25 | ArgumentNullException.ThrowIfNull(name); 26 | 27 | foreach (AssemblyReference reference in module.AssemblyReferences) 28 | { 29 | if (reference.Name == name) 30 | { 31 | return reference; 32 | } 33 | } 34 | 35 | return null; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /UnityEditorPatch/Extensions/TypeDefinitionExtensions.cs: -------------------------------------------------------------------------------- 1 | using AsmResolver.DotNet; 2 | 3 | namespace UnityEditorPatch.Extensions; 4 | 5 | public static class TypeDefinitionExtensions 6 | { 7 | public static MethodDefinition? GetMethodByName(this TypeDefinition type, string name) 8 | { 9 | ArgumentNullException.ThrowIfNull(type); 10 | ArgumentNullException.ThrowIfNull(name); 11 | 12 | foreach (MethodDefinition method in type.Methods) 13 | { 14 | if (method.Name == name) 15 | { 16 | return method; 17 | } 18 | } 19 | 20 | return null; 21 | } 22 | 23 | public static MethodDefinition? GetDefaultConstructor(this TypeDefinition type) 24 | { 25 | ArgumentNullException.ThrowIfNull(type); 26 | 27 | foreach (MethodDefinition method in type.Methods) 28 | { 29 | if (method.IsConstructor && method.Parameters.Count == 0) 30 | { 31 | return method; 32 | } 33 | } 34 | 35 | return null; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /UnityEditorPatch/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /UnityEditorPatch/FodyWeavers.xsd: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks 13 | 14 | 15 | 16 | 17 | A list of assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks. 18 | 19 | 20 | 21 | 22 | A list of runtime assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks 23 | 24 | 25 | 26 | 27 | A list of runtime assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks. 28 | 29 | 30 | 31 | 32 | A list of unmanaged 32 bit assembly names to include, delimited with line breaks. 33 | 34 | 35 | 36 | 37 | A list of unmanaged 64 bit assembly names to include, delimited with line breaks. 38 | 39 | 40 | 41 | 42 | The order of preloaded assemblies, delimited with line breaks. 43 | 44 | 45 | 46 | 47 | 48 | This will copy embedded files to disk before loading them into memory. This is helpful for some scenarios that expected an assembly to be loaded from a physical file. 49 | 50 | 51 | 52 | 53 | Controls if .pdbs for reference assemblies are also embedded. 54 | 55 | 56 | 57 | 58 | Controls if runtime assemblies are also embedded. 59 | 60 | 61 | 62 | 63 | Controls whether the runtime assemblies are embedded with their full path or only with their assembly name. 64 | 65 | 66 | 67 | 68 | Embedded assemblies are compressed by default, and uncompressed when they are loaded. You can turn compression off with this option. 69 | 70 | 71 | 72 | 73 | As part of Costura, embedded assemblies are no longer included as part of the build. This cleanup can be turned off. 74 | 75 | 76 | 77 | 78 | Costura by default will load as part of the module initialization. This flag disables that behavior. Make sure you call CosturaUtility.Initialize() somewhere in your code. 79 | 80 | 81 | 82 | 83 | Costura will by default use assemblies with a name like 'resources.dll' as a satellite resource and prepend the output path. This flag disables that behavior. 84 | 85 | 86 | 87 | 88 | A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with | 89 | 90 | 91 | 92 | 93 | A list of assembly names to include from the default action of "embed all Copy Local references", delimited with |. 94 | 95 | 96 | 97 | 98 | A list of runtime assembly names to exclude from the default action of "embed all Copy Local references", delimited with | 99 | 100 | 101 | 102 | 103 | A list of runtime assembly names to include from the default action of "embed all Copy Local references", delimited with |. 104 | 105 | 106 | 107 | 108 | A list of unmanaged 32 bit assembly names to include, delimited with |. 109 | 110 | 111 | 112 | 113 | A list of unmanaged 64 bit assembly names to include, delimited with |. 114 | 115 | 116 | 117 | 118 | The order of preloaded assemblies, delimited with |. 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. 127 | 128 | 129 | 130 | 131 | A comma-separated list of error codes that can be safely ignored in assembly verification. 132 | 133 | 134 | 135 | 136 | 'false' to turn off automatic generation of the XML Schema file. 137 | 138 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /UnityEditorPatch/InfoProviders/Editor/EditorInfo.cs: -------------------------------------------------------------------------------- 1 | #pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. 2 | 3 | namespace UnityEditorPatch.InfoProviders.Editor; 4 | 5 | public class EditorInfo 6 | { 7 | public bool IsPatched { get; init; } 8 | public string Version { get; init; } 9 | public string Location { get; init; } 10 | public string ContentLocation { get; init; } 11 | public string RuntimeLocation { get; init; } 12 | public string RoslynLocation { get; init; } 13 | public string[] SourceGeneratorLocations { get; init; } 14 | } 15 | 16 | #pragma warning restore CS8618 17 | -------------------------------------------------------------------------------- /UnityEditorPatch/InfoProviders/Editor/EditorInfoProvider.cs: -------------------------------------------------------------------------------- 1 | using UnityEditorPatch.Interactors; 2 | using System.Runtime.InteropServices; 3 | using static System.Runtime.InteropServices.RuntimeInformation; 4 | 5 | namespace UnityEditorPatch.InfoProviders.Editor; 6 | 7 | public static class EditorInfoProvider 8 | { 9 | public static bool TryGet(string lookupPath, out EditorInfo info) 10 | { 11 | var contentPath = GetContentPath(lookupPath); 12 | Console.WriteLine($"Content Path -> {contentPath}"); 13 | var runtimePath = Path.Combine(contentPath, "NetCoreRuntime"); 14 | var roslynPath = Path.Combine(contentPath, "DotNetSdkRoslyn"); 15 | var sourceGeneratorLocations = new[] 16 | { 17 | Path.Combine(contentPath, "Tools", "Unity.SourceGenerators", "Unity.SourceGenerators.dll"), 18 | Path.Combine(contentPath, "Tools", "Compilation", "Unity.SourceGenerators", "Unity.SourceGenerators.dll") 19 | }.Where(File.Exists).ToArray(); 20 | 21 | if (!IsDirectoriesExists(contentPath, runtimePath, roslynPath) || sourceGeneratorLocations.Length is 0) 22 | { 23 | info = default!; 24 | return false; 25 | } 26 | 27 | info = new EditorInfo 28 | { 29 | Location = lookupPath, 30 | RoslynLocation = roslynPath, 31 | ContentLocation = contentPath, 32 | RuntimeLocation = runtimePath, 33 | Version = Path.GetFileName(lookupPath), 34 | IsPatched = Backup.IsBackupExist(contentPath), 35 | SourceGeneratorLocations = sourceGeneratorLocations 36 | }; 37 | 38 | return true; 39 | } 40 | 41 | private static string GetContentPath(string lookupPath) 42 | { 43 | if (IsOSPlatform(OSPlatform.OSX)) 44 | { 45 | return Path.Combine(lookupPath, "Unity.app", "Contents"); 46 | } 47 | 48 | if (IsOSPlatform(OSPlatform.Linux) || IsOSPlatform(OSPlatform.Windows)) 49 | { 50 | return Path.Combine(lookupPath, "Editor", "Data"); 51 | } 52 | 53 | return lookupPath; 54 | } 55 | 56 | private static bool IsDirectoriesExists(params string[] paths) 57 | { 58 | return paths.All(Directory.Exists); 59 | } 60 | } -------------------------------------------------------------------------------- /UnityEditorPatch/InfoProviders/Sdk/SDKInfo.cs: -------------------------------------------------------------------------------- 1 | #pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. 2 | 3 | using NuGet.Versioning; 4 | 5 | namespace UnityEditorPatch.InfoProviders.Sdk; 6 | 7 | public class SDKInfo 8 | { 9 | public string Location { get; init; } 10 | public string SDKLocation { get; init; } 11 | 12 | public string RoslynLocation { get; init; } 13 | public NuGetVersion Version { get; init; } 14 | public string LatestCSharpVersion { get; init; } 15 | } 16 | 17 | #pragma warning restore CS8618 -------------------------------------------------------------------------------- /UnityEditorPatch/InfoProviders/Sdk/SDKInfoProvider.cs: -------------------------------------------------------------------------------- 1 | using NuGet.Versioning; 2 | using System.Runtime.Loader; 3 | using UnityEditorPatch.Utilities; 4 | using System.Text.RegularExpressions; 5 | 6 | namespace UnityEditorPatch.InfoProviders.Sdk; 7 | 8 | public static partial class SDKInfoProvider 9 | { 10 | [GeneratedRegex(@"(\d+\.\d+\.\d+(?:-[\w\.]+)?)[\s]\[(.+)\]", RegexOptions.Multiline)] 11 | private static partial Regex SDKInfoRegex(); 12 | 13 | public static bool TryGet(out SDKInfo info, bool allowPrerelease) 14 | { 15 | // this version is used by unity 16 | var minVersion = SemanticVersion.Parse("6.0.21"); 17 | 18 | if (!TryGetSdks(out var sdks, allowPrerelease)) 19 | { 20 | info = null!; 21 | return false; 22 | } 23 | 24 | Console.WriteLine("dotnet sdks:"); 25 | foreach (var sdkInfo in sdks) 26 | { 27 | Console.WriteLine($"- {sdkInfo.Version} (C# {sdkInfo.LatestCSharpVersion}) at {sdkInfo.SDKLocation}"); 28 | } 29 | 30 | var selectedSDK = sdks.LastOrDefault(sdk => sdk.Version > minVersion); 31 | 32 | if (selectedSDK is not null) 33 | { 34 | Console.WriteLine($"Selected Sdk: {selectedSDK.Version} (C# {selectedSDK.LatestCSharpVersion}) at {selectedSDK.SDKLocation}"); 35 | Console.WriteLine(); 36 | info = selectedSDK; 37 | return true; 38 | } 39 | 40 | info = null!; 41 | return false; 42 | } 43 | 44 | private static bool TryGetSdks(out IReadOnlyCollection sdks, bool allowPrerelease) 45 | { 46 | sdks = GetSdks(allowPrerelease).OrderBy(sdk => sdk.Version).ToArray(); 47 | return sdks.Count > 0; 48 | } 49 | 50 | private static IEnumerable GetSdks(bool allowPrerelease) 51 | { 52 | var listSdks = ProcessUtility.ReadOutputFrom(command: "dotnet", withArgument: "--list-sdks"); 53 | 54 | foreach (Match match in SDKInfoRegex().Matches(listSdks)) 55 | { 56 | var path = match.Groups[2].Value; 57 | var version = match.Groups[1].Value; 58 | var sdkLocation = Path.Combine(path, version); 59 | var dotnetLocation = Path.GetDirectoryName(path); 60 | var roslynLocation = Path.Combine(sdkLocation, "Roslyn", "bincore"); 61 | 62 | if (!NuGetVersion.TryParse(version, out var nugetVersion)) continue; 63 | if (!allowPrerelease && nugetVersion.IsPrerelease) continue; 64 | if (!Directory.Exists(path) || !Directory.Exists(sdkLocation) || !Directory.Exists(dotnetLocation)) continue; 65 | 66 | yield return new SDKInfo 67 | { 68 | Version = nugetVersion, 69 | SDKLocation = sdkLocation, 70 | Location = dotnetLocation, 71 | RoslynLocation = roslynLocation, 72 | LatestCSharpVersion = GetLatestCSharpVersion(roslynLocation) 73 | }; 74 | } 75 | } 76 | 77 | private static string GetLatestCSharpVersion(string roslynLocation) 78 | { 79 | AssemblyLoadContext context = null!; 80 | 81 | try 82 | { 83 | context = new WeakAssemblyLoadContext(roslynLocation); 84 | // Load the bundled Roslyn installation. 85 | var assembly = context.LoadFromAssemblyPath(Path.Combine(roslynLocation, "Microsoft.CodeAnalysis.CSharp.dll")); 86 | 87 | // We need the LanguageVersion and LanguageVersionFacts types. 88 | var versions = assembly.GetType("Microsoft.CodeAnalysis.CSharp.LanguageVersion")!; 89 | var facts = assembly.GetType("Microsoft.CodeAnalysis.CSharp.LanguageVersionFacts")!; 90 | 91 | // Retrieve the value of LanguageVersion.Latest, which we will resolve to a LangVersion string. 92 | var version = Enum.Parse(versions, "Latest"); 93 | 94 | // Convert from "Latest" to a specific version. 95 | version = facts.GetMethod("MapSpecifiedToEffectiveVersion")!.Invoke(null, [version]); 96 | 97 | // Map the version to a LangVersion string. 98 | return (string)facts.GetMethod("ToDisplayString")!.Invoke(null, [version])!; 99 | } 100 | catch (Exception) 101 | { 102 | return "none"; 103 | } 104 | finally 105 | { 106 | context.Unload(); 107 | } 108 | } 109 | } -------------------------------------------------------------------------------- /UnityEditorPatch/InfoProviders/Sdk/WeakAssemblyLoadContext.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.Loader; 3 | 4 | namespace UnityEditorPatch.InfoProviders.Sdk; 5 | 6 | public class WeakAssemblyLoadContext(string mainAssemblyToLoadPath) : AssemblyLoadContext(isCollectible: true) 7 | { 8 | private readonly AssemblyDependencyResolver _resolver = new(mainAssemblyToLoadPath); 9 | 10 | protected override Assembly Load(AssemblyName assemblyName) 11 | { 12 | var assemblyPath = _resolver.ResolveAssemblyToPath(assemblyName); 13 | 14 | if (assemblyPath == null) 15 | { 16 | var assumedPath = Path.Combine(mainAssemblyToLoadPath, assemblyName.Name + ".dll"); 17 | if (File.Exists(assumedPath)) 18 | { 19 | assemblyPath = assumedPath; 20 | } 21 | } 22 | 23 | return assemblyPath != null ? LoadFromAssemblyPath(assemblyPath) : null!; 24 | } 25 | } -------------------------------------------------------------------------------- /UnityEditorPatch/Input/ApplyPatchOptions.cs: -------------------------------------------------------------------------------- 1 | #pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. 2 | 3 | using CommandLine; 4 | 5 | namespace UnityEditorPatch.Input; 6 | 7 | [Verb("apply", HelpText = "Apply patch.")] 8 | public class ApplyPatchOptions 9 | { 10 | [Option("editor", Required = true, HelpText = "Path to the Unity Editor.")] 11 | public string EditorPath { get; set; } 12 | 13 | [Option("allow-prerelease", HelpText = "Allow prerelease versions of SDKs.")] 14 | public bool AllowPrerelease { get; set; } 15 | } 16 | 17 | #pragma warning restore CS8618 -------------------------------------------------------------------------------- /UnityEditorPatch/Input/RevertPatchOptions.cs: -------------------------------------------------------------------------------- 1 | #pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. 2 | 3 | using CommandLine; 4 | 5 | namespace UnityEditorPatch.Input; 6 | 7 | [Verb("revert", HelpText = "Revert applied patch.")] 8 | public class RevertPatchOptions 9 | { 10 | [Option("editor", Required = true, HelpText = "Path to the Unity Editor.")] 11 | public string EditorPath { get; set; } 12 | } 13 | 14 | #pragma warning restore CS8618 -------------------------------------------------------------------------------- /UnityEditorPatch/Interactors/Backup.cs: -------------------------------------------------------------------------------- 1 | using UnityEditorPatch.InfoProviders.Editor; 2 | using UnityEditorPatch.Utilities; 3 | 4 | namespace UnityEditorPatch.Interactors; 5 | 6 | public static class Backup 7 | { 8 | private const string BackupDirectory = "__patch_backup"; 9 | 10 | public static bool IsBackupExist(string editorLocation) 11 | { 12 | return Directory.Exists(Path.Combine(editorLocation, BackupDirectory)); 13 | } 14 | 15 | public static bool TryPerform(EditorInfo info) 16 | { 17 | try 18 | { 19 | if (IsBackupExist(info.ContentLocation)) 20 | { 21 | return false; 22 | } 23 | 24 | var backupPath = Path.Combine(info.ContentLocation, BackupDirectory); 25 | 26 | Directory.CreateDirectory(backupPath); 27 | FileSystemUtility.CopyDirectory(info.RoslynLocation, BackupLocation(backupPath, info.RoslynLocation, relativeTo: info.ContentLocation)); 28 | FileSystemUtility.CopyDirectory(info.RuntimeLocation, BackupLocation(backupPath, info.RuntimeLocation, relativeTo: info.ContentLocation)); 29 | 30 | foreach (var sourceGeneratorLocation in info.SourceGeneratorLocations) 31 | { 32 | FileSystemUtility.CopyFile(sourceGeneratorLocation, BackupLocation(backupPath, sourceGeneratorLocation, relativeTo: info.ContentLocation)); 33 | } 34 | } 35 | catch (Exception) 36 | { 37 | return false; 38 | } 39 | 40 | return true; 41 | } 42 | 43 | public static bool TryRestore(EditorInfo info) 44 | { 45 | try 46 | { 47 | if (!IsBackupExist(info.ContentLocation)) 48 | { 49 | return false; 50 | } 51 | 52 | var backupPath = Path.Combine(info.ContentLocation, BackupDirectory); 53 | 54 | FileSystemUtility.ReplaceDirectory(info.RoslynLocation, with: BackupLocation(backupPath, info.RoslynLocation, relativeTo: info.ContentLocation)); 55 | FileSystemUtility.ReplaceDirectory(info.RuntimeLocation, with: BackupLocation(backupPath, info.RuntimeLocation, relativeTo: info.ContentLocation)); 56 | 57 | foreach (var sourceGeneratorLocation in info.SourceGeneratorLocations) 58 | { 59 | FileSystemUtility.ReplaceFile(sourceGeneratorLocation, BackupLocation(backupPath, sourceGeneratorLocation, relativeTo: info.ContentLocation)); 60 | } 61 | 62 | Directory.Delete(backupPath, recursive: true); 63 | } 64 | catch (Exception) 65 | { 66 | return false; 67 | } 68 | 69 | return true; 70 | } 71 | 72 | private static string BackupLocation(string backupLocation, string location, string relativeTo) 73 | { 74 | var relativeLocation = Path.GetRelativePath(relativeTo, location); 75 | return Path.Combine(backupLocation, relativeLocation); 76 | } 77 | } -------------------------------------------------------------------------------- /UnityEditorPatch/Interactors/DotNetPatch.cs: -------------------------------------------------------------------------------- 1 | using UnityEditorPatch.InfoProviders.Editor; 2 | using UnityEditorPatch.InfoProviders.Sdk; 3 | using UnityEditorPatch.Utilities; 4 | 5 | namespace UnityEditorPatch.Interactors; 6 | 7 | public class DotNetPatch 8 | { 9 | public static bool TryPerform(SDKInfo sdkInfo, EditorInfo editorInfo) 10 | { 11 | try 12 | { 13 | FileSystemUtility.ReplaceDirectory(editorInfo.RuntimeLocation, with: sdkInfo.Location); 14 | FileSystemUtility.ReplaceDirectory(editorInfo.RoslynLocation, with: sdkInfo.RoslynLocation); 15 | } 16 | catch (Exception) 17 | { 18 | return false; 19 | } 20 | 21 | return true; 22 | } 23 | } -------------------------------------------------------------------------------- /UnityEditorPatch/Interactors/PatchApplier.cs: -------------------------------------------------------------------------------- 1 | using UnityEditorPatch.InfoProviders.Editor; 2 | using UnityEditorPatch.InfoProviders.Sdk; 3 | 4 | namespace UnityEditorPatch.Interactors; 5 | 6 | public static class PatchApplier 7 | { 8 | public static Result Perform(string editorPath, bool allowPrerelease) 9 | { 10 | if (!SDKInfoProvider.TryGet(out var sdkInfo, allowPrerelease)) 11 | { 12 | return Result.Error("Failed to select dotnet sdk."); 13 | } 14 | 15 | if (!EditorInfoProvider.TryGet(editorPath, out var editorInfo)) 16 | { 17 | return Result.Error("Failed to get unity editor info."); 18 | } 19 | 20 | Console.WriteLine($"Editor: {editorInfo.Version}"); 21 | 22 | if (editorInfo.IsPatched) 23 | { 24 | return Result.Error("Patch already applied."); 25 | } 26 | 27 | if (!Backup.TryPerform(editorInfo)) 28 | { 29 | return Result.Error("Failed to perform backup before patching."); 30 | } 31 | 32 | if (!SourceGeneratorPatch.TryPerform(editorInfo)) 33 | { 34 | return Result.Error("Failed to patch source generator."); 35 | } 36 | 37 | if (!DotNetPatch.TryPerform(sdkInfo, editorInfo)) 38 | { 39 | return Result.Error("Failed to patch dotnet runtime / sdk."); 40 | } 41 | 42 | return Result.Success("Patch is applied."); 43 | } 44 | } -------------------------------------------------------------------------------- /UnityEditorPatch/Interactors/PatchReverter.cs: -------------------------------------------------------------------------------- 1 | using UnityEditorPatch.InfoProviders.Editor; 2 | 3 | namespace UnityEditorPatch.Interactors; 4 | 5 | public static class PatchReverter 6 | { 7 | public static Result Perform(string editorPath) 8 | { 9 | if (!EditorInfoProvider.TryGet(editorPath, out var editorInfo)) 10 | { 11 | return Result.Error("Failed to get unity editor info."); 12 | } 13 | 14 | Console.WriteLine($"Editor: {editorInfo.Version}"); 15 | 16 | if (!editorInfo.IsPatched) 17 | { 18 | return Result.Error("Failed to restore. Editor is not patched or backup data is missing."); 19 | } 20 | 21 | if (!Backup.TryRestore(editorInfo)) 22 | { 23 | return Result.Error("Failed to restore patched data."); 24 | } 25 | 26 | return Result.Success("Patch is reverted."); 27 | } 28 | } -------------------------------------------------------------------------------- /UnityEditorPatch/Interactors/SourceGeneratorPatch.cs: -------------------------------------------------------------------------------- 1 | using AsmResolver.DotNet; 2 | using AsmResolver.DotNet.Signatures; 3 | using AsmResolver.DotNet.Signatures.Types; 4 | using UnityEditorPatch.Extensions; 5 | using UnityEditorPatch.InfoProviders.Editor; 6 | 7 | namespace UnityEditorPatch.Interactors; 8 | 9 | // 10 | // Starting with Unity 2022, Unity.SourceGenerators.dll is used by Unity to process 11 | // .cs files and discover MonoBehaviour implementations in them. However, currently 12 | // it uses the NamespaceDeclarationSyntax class, not BaseNamespaceDeclarationSyntax 13 | // which causes it to fail on FileScopedNamespaceDeclarationSyntax. 14 | // 15 | // We patch the TypeNameHelper.GetTypeInformation function to replace all references 16 | // to NamespaceDeclarationSyntax with BaseNamespaceDeclarationSyntax, which fixes it. 17 | // 18 | public static class SourceGeneratorPatch 19 | { 20 | private const string TargetMethod = "GetTypeInformation"; 21 | private const string TargetType = "Unity.MonoScriptGenerator.TypeNameHelper"; 22 | private const string CodeAnalysisAssembly = "Microsoft.CodeAnalysis.CSharp"; 23 | private const string SyntaxName = "BaseNamespaceDeclarationSyntax"; 24 | private const string SyntaxNamespace = "Microsoft.CodeAnalysis.CSharp.Syntax"; 25 | private const string NamespaceDeclarationSyntax = "Microsoft.CodeAnalysis.CSharp.Syntax.NamespaceDeclarationSyntax"; 26 | 27 | public static bool TryPerform(EditorInfo info) 28 | { 29 | var isAnyPatched = false; 30 | foreach (var sourceGeneratorLocation in info.SourceGeneratorLocations) 31 | { 32 | if (!TryPatchSourceGenerator(sourceGeneratorLocation)) continue; 33 | 34 | isAnyPatched = true; 35 | Console.WriteLine($"Patched source generator at {Path.GetRelativePath(info.Location, sourceGeneratorLocation)}."); 36 | } 37 | 38 | return isAnyPatched; 39 | } 40 | 41 | private static bool TryPatchSourceGenerator(string path) 42 | { 43 | var assembly = AssemblyDefinition.FromFile(path); 44 | var module = assembly.Modules[0]; 45 | var target = module.GetTypeByFullName(TargetType); 46 | var method = target?.GetMethodByName(TargetMethod); 47 | var patches = 0; 48 | 49 | if (target is null || method is null) 50 | { 51 | return false; 52 | } 53 | 54 | if (method.CilMethodBody is not { Instructions: var instructions } body) 55 | { 56 | return false; 57 | } 58 | 59 | var baseNamespaceDeclarationSyntax = module.DefaultImporter.ImportType( 60 | new TypeReference(module.GetAssemblyReferenceByName(CodeAnalysisAssembly), SyntaxNamespace, SyntaxName) 61 | ); 62 | 63 | foreach (var local in body.LocalVariables) 64 | { 65 | if (local.VariableType is not TypeDefOrRefSignature { FullName: NamespaceDeclarationSyntax }) continue; 66 | 67 | local.VariableType = new TypeDefOrRefSignature(baseNamespaceDeclarationSyntax); 68 | patches++; 69 | } 70 | 71 | foreach (var instruction in instructions) 72 | { 73 | switch (instruction.Operand) 74 | { 75 | case TypeReference { FullName: NamespaceDeclarationSyntax }: 76 | { 77 | instruction.Operand = baseNamespaceDeclarationSyntax; 78 | patches++; 79 | break; 80 | } 81 | case MemberReference { IsMethod: true, Parent: TypeReference { FullName: NamespaceDeclarationSyntax } } member: 82 | { 83 | var reference = new MemberReference(baseNamespaceDeclarationSyntax, member.Name, 84 | member.Signature as MemberSignature); 85 | instruction.Operand = module.DefaultImporter.ImportMethod(reference); 86 | patches++; 87 | break; 88 | } 89 | } 90 | } 91 | 92 | if (patches > 0) 93 | { 94 | assembly.Write(path); 95 | } 96 | 97 | return true; 98 | } 99 | } -------------------------------------------------------------------------------- /UnityEditorPatch/Program.cs: -------------------------------------------------------------------------------- 1 | using CommandLine; 2 | using UnityEditorPatch; 3 | using UnityEditorPatch.Input; 4 | using UnityEditorPatch.Interactors; 5 | 6 | var result = Parser.Default 7 | .ParseArguments(args) 8 | .MapResult 9 | ( 10 | options => PatchReverter.Perform(options.EditorPath), 11 | options => PatchApplier.Perform(options.EditorPath, options.AllowPrerelease), 12 | errors => Result.Error(errors.Select(e => e.ToString()).ToArray()!) 13 | ); 14 | 15 | Console.WriteLine(); 16 | Console.WriteLine(result); -------------------------------------------------------------------------------- /UnityEditorPatch/Result.cs: -------------------------------------------------------------------------------- 1 | using System.Text; 2 | 3 | namespace UnityEditorPatch; 4 | 5 | public class Result 6 | { 7 | public bool IsSucceed { get; private init; } 8 | public string[] Errors { get; private init; } = []; 9 | public string Message { get; private init; } = string.Empty; 10 | 11 | public static Result Success(string message) => new() 12 | { 13 | IsSucceed = true, 14 | Message = message 15 | }; 16 | 17 | public static Result Error(params string[] errors) => new() 18 | { 19 | Errors = errors, 20 | IsSucceed = false 21 | }; 22 | 23 | public override string ToString() 24 | { 25 | var stringBuilder = new StringBuilder(); 26 | 27 | if (IsSucceed) 28 | { 29 | stringBuilder.AppendLine($"SUCCESS: {Message}"); 30 | } 31 | else 32 | { 33 | foreach (var error in Errors) 34 | { 35 | stringBuilder.AppendLine($"ERROR: {error}"); 36 | } 37 | } 38 | 39 | return stringBuilder.ToString(); 40 | } 41 | } -------------------------------------------------------------------------------- /UnityEditorPatch/UnityEditorPatch.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | None 8 | false 9 | enable 10 | false 11 | true 12 | AnyCPU 13 | Debug;Release 14 | UnityEditorPatch 15 | 16 | 17 | 18 | 19 | 20 | 21 | all 22 | 23 | 24 | all 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /UnityEditorPatch/UnityEditorPatch.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnityEditorPatch", "UnityEditorPatch.csproj", "{5F679E1F-99F8-4829-B2FF-3E7372009D4D}" 4 | EndProject 5 | Global 6 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 7 | Debug|Any CPU = Debug|Any CPU 8 | Release|Any CPU = Release|Any CPU 9 | EndGlobalSection 10 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 11 | {5F679E1F-99F8-4829-B2FF-3E7372009D4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 12 | {5F679E1F-99F8-4829-B2FF-3E7372009D4D}.Debug|Any CPU.Build.0 = Debug|Any CPU 13 | {5F679E1F-99F8-4829-B2FF-3E7372009D4D}.Release|Any CPU.ActiveCfg = Release|Any CPU 14 | {5F679E1F-99F8-4829-B2FF-3E7372009D4D}.Release|Any CPU.Build.0 = Release|Any CPU 15 | EndGlobalSection 16 | EndGlobal 17 | -------------------------------------------------------------------------------- /UnityEditorPatch/Utilities/FileSystemUtility.cs: -------------------------------------------------------------------------------- 1 | namespace UnityEditorPatch.Utilities; 2 | 3 | public static class FileSystemUtility 4 | { 5 | public static void CopyDirectory(string sourceDirectory, string targetDirectory) 6 | { 7 | Console.WriteLine($"Copying directory '{sourceDirectory}' -> {targetDirectory}"); 8 | CopyDirectoryInternal(sourceDirectory, targetDirectory); 9 | } 10 | 11 | private static void CopyDirectoryInternal(string sourceDirectory, string targetDirectory) 12 | { 13 | Directory.CreateDirectory(targetDirectory); 14 | 15 | foreach (var file in Directory.GetFiles(sourceDirectory)) 16 | { 17 | File.Copy(file, Path.Combine(targetDirectory, Path.GetFileName(file)), true); 18 | } 19 | 20 | foreach (var directory in Directory.GetDirectories(sourceDirectory)) 21 | { 22 | CopyDirectoryInternal(directory, Path.Combine(targetDirectory, Path.GetFileName(directory))); 23 | } 24 | } 25 | 26 | public static void ReplaceDirectory(string directory, string with) 27 | { 28 | if (!Directory.Exists(with)) return; 29 | 30 | Console.WriteLine($"Replacing directory '{directory}' -> '{with}'"); 31 | Directory.Delete(directory, recursive: true); 32 | Directory.CreateDirectory(directory); 33 | CopyDirectoryInternal(with, directory); 34 | } 35 | 36 | public static void ReplaceFile(string file, string with) 37 | { 38 | if (!File.Exists(with)) return; 39 | 40 | Console.WriteLine($"Replacing file '{file}' -> '{with}'"); 41 | File.Delete(file); 42 | File.Copy(with, file); 43 | } 44 | 45 | public static void CopyFile(string file, string destination) 46 | { 47 | Console.WriteLine($"Copying file '{file}' -> {destination}"); 48 | 49 | var destinationDirectory = Path.GetDirectoryName(destination); 50 | if (!string.IsNullOrEmpty(destinationDirectory)) 51 | { 52 | Directory.CreateDirectory(destinationDirectory); 53 | } 54 | 55 | File.Copy(file, destination); 56 | } 57 | } -------------------------------------------------------------------------------- /UnityEditorPatch/Utilities/ProcessUtility.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | 3 | namespace UnityEditorPatch.Utilities; 4 | 5 | public static class ProcessUtility 6 | { 7 | public static string ReadOutputFrom(string command, string withArgument) 8 | { 9 | try 10 | { 11 | var processStartInfo = new ProcessStartInfo 12 | { 13 | FileName = command, 14 | Arguments = withArgument, 15 | RedirectStandardOutput = true, 16 | UseShellExecute = false, 17 | CreateNoWindow = true 18 | }; 19 | 20 | using var reader = Process.Start(processStartInfo)!.StandardOutput; 21 | 22 | return reader.ReadToEnd(); 23 | } 24 | catch (Exception) 25 | { 26 | return string.Empty; 27 | } 28 | } 29 | } --------------------------------------------------------------------------------