├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── bug-report.yaml │ ├── feature-request.yaml │ └── improvement-request.yaml ├── PULL_REQUEST_TEMPLATE.md └── workflows │ ├── build.yaml │ ├── package.yaml │ └── release.yaml ├── .gitignore ├── .vsconfig ├── Assets ├── Example.meta ├── Example │ ├── Example.cs │ ├── Example.cs.meta │ ├── Example.unity │ ├── Example.unity.meta │ ├── Example_Generics.cs │ └── Example_Generics.cs.meta ├── MackySoft.meta ├── MackySoft │ ├── MackySoft.SerializeReferenceExtensions.meta │ └── MackySoft.SerializeReferenceExtensions │ │ ├── Editor.meta │ │ ├── Editor │ │ ├── AdvancedTypePopup.cs │ │ ├── AdvancedTypePopup.cs.meta │ │ ├── MackySoft.SerializeReferenceExtensions.Editor.asmdef │ │ ├── MackySoft.SerializeReferenceExtensions.Editor.asmdef.meta │ │ ├── ManagedReferenceContextualPropertyMenu.cs │ │ ├── ManagedReferenceContextualPropertyMenu.cs.meta │ │ ├── ManagedReferenceUtility.cs │ │ ├── ManagedReferenceUtility.cs.meta │ │ ├── PropertyDrawerCache.cs │ │ ├── PropertyDrawerCache.cs.meta │ │ ├── SerializedPropertyExtensions.cs │ │ ├── SerializedPropertyExtensions.cs.meta │ │ ├── SubclassSelectorDrawer.cs │ │ ├── SubclassSelectorDrawer.cs.meta │ │ ├── TypeMenuUtility.cs │ │ ├── TypeMenuUtility.cs.meta │ │ ├── TypeSearch.cs │ │ └── TypeSearch.cs.meta │ │ ├── Runtime.meta │ │ ├── Runtime │ │ ├── AddTypeMenuAttribute.cs │ │ ├── AddTypeMenuAttribute.cs.meta │ │ ├── HideInTypeMenuAttribute.cs │ │ ├── HideInTypeMenuAttribute.cs.meta │ │ ├── MackySoft.SerializeReferenceExtensions.asmdef │ │ ├── MackySoft.SerializeReferenceExtensions.asmdef.meta │ │ ├── SubclassSelectorAttribute.cs │ │ └── SubclassSelectorAttribute.cs.meta │ │ ├── Samples~ │ │ ├── GetStarted.meta │ │ └── GetStarted │ │ │ ├── GetStarted.unity │ │ │ ├── GetStarted.unity.meta │ │ │ ├── Prefabs.meta │ │ │ ├── Prefabs │ │ │ ├── Cube.prefab │ │ │ └── Cube.prefab.meta │ │ │ ├── Scripts.meta │ │ │ └── Scripts │ │ │ ├── Runtime.meta │ │ │ └── Runtime │ │ │ ├── Example.cs │ │ │ ├── Example.cs.meta │ │ │ ├── MackySoft.SerializeReferenceExtensions.Example.GetStarted.asmdef │ │ │ └── MackySoft.SerializeReferenceExtensions.Example.GetStarted.asmdef.meta │ │ ├── package.json │ │ └── package.json.meta ├── PackageTools.meta └── PackageTools │ ├── Editor.meta │ └── Editor │ ├── UnityPackageExporter.cs │ └── UnityPackageExporter.cs.meta ├── LICENSE ├── Packages ├── 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 ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── TimelineSettings.asset ├── UnityConnectSettings.asset ├── VFXManager.asset ├── VersionControlSettings.asset ├── XRSettings.asset └── boot.config └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-report.yaml: -------------------------------------------------------------------------------- 1 | name: Bug Report 2 | description: File a bug report 3 | title: "[BUG] " 4 | labels: ["bug"] 5 | assignees: 6 | - mackysoft 7 | body: 8 | - type: markdown 9 | attributes: 10 | value: | 11 | Thanks for taking the time to fill out this bug report! 12 | - type: textarea 13 | id: what-happened 14 | attributes: 15 | label: What happened? 16 | description: Also tell us, what did you expect to happen? 17 | placeholder: Tell us what you see! 18 | value: "A bug happened!" 19 | validations: 20 | required: true 21 | - type: input 22 | id: version 23 | attributes: 24 | label: Package Version 25 | description: What version of this package were you running? 26 | placeholder: ex. 1.1.2 27 | validations: 28 | required: true 29 | - type: input 30 | id: unity-version 31 | attributes: 32 | label: Unity Version 33 | description: What version of Unity were you running? 34 | placeholder: ex. 2020.3.24f1 -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-request.yaml: -------------------------------------------------------------------------------- 1 | name: Feature Request 2 | description: Suggest an idea for this library 3 | title: "[FEATURE] " 4 | labels: ["enhancement"] 5 | assignees: 6 | - mackysoft 7 | body: 8 | - type: markdown 9 | attributes: 10 | value: | 11 | Thanks for taking the time to fill out this feature request! 12 | - type: textarea 13 | id: feature-description 14 | attributes: 15 | label: Feature description 16 | validations: 17 | required: true 18 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/improvement-request.yaml: -------------------------------------------------------------------------------- 1 | name: Improvement Request 2 | description: Suggest an improve for this library 3 | title: "[IMPROVE] " 4 | labels: ["enhancement"] 5 | assignees: 6 | - mackysoft 7 | body: 8 | - type: markdown 9 | attributes: 10 | value: | 11 | Thanks for taking the time to fill out this improvement request! 12 | - type: textarea 13 | id: improvement-description 14 | attributes: 15 | label: Improvement description 16 | validations: 17 | required: true 18 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Description 2 | 3 | 6 | 7 | 8 | 9 | ## Changes made 10 | 11 | 14 | 15 | - -------------------------------------------------------------------------------- /.github/workflows/build.yaml: -------------------------------------------------------------------------------- 1 | name: Build 2 | 3 | on: 4 | pull_request: {} 5 | push: { branches: [main] } 6 | 7 | jobs: 8 | build: 9 | name: ${{ matrix.targetPlatform }} 10 | if: "((github.event_name == 'push' && github.repository_owner == 'mackysoft') || startsWith(github.event.pull_request.head.label, 'mackysoft:'))" 11 | runs-on: ubuntu-latest 12 | strategy: 13 | fail-fast: false 14 | matrix: 15 | targetPlatform: 16 | - StandaloneOSX # Build a macOS standalone (Intel 64-bit). 17 | - StandaloneWindows # Build a Windows standalone. 18 | - StandaloneWindows64 # Build a Windows 64-bit standalone. 19 | - StandaloneLinux64 # Build a Linux 64-bit standalone. 20 | - iOS # Build an iOS player. 21 | - Android # Build an Android .apk standalone app. 22 | - WebGL # WebGL. 23 | 24 | steps: 25 | # Checkout 26 | - name: Checkout 27 | uses: actions/checkout@v2 28 | with: 29 | fetch-depth: 0 30 | lfs: true 31 | 32 | # Cache 33 | - name: Cache 34 | uses: actions/cache@v2 35 | with: 36 | path: Library 37 | key: Library-${{ matrix.targetPlatform }} 38 | restore-keys: Library- 39 | 40 | # Build 41 | - name: Build 42 | uses: game-ci/unity-builder@v2 43 | env: 44 | UNITY_LICENSE: ${{ secrets.UNITY_LICENSE_2020 }} 45 | with: 46 | targetPlatform: ${{ matrix.targetPlatform }} -------------------------------------------------------------------------------- /.github/workflows/package.yaml: -------------------------------------------------------------------------------- 1 | name: Export Package 2 | 3 | on: 4 | pull_request: {} 5 | push: { branches: [main] } 6 | 7 | env: 8 | UNITY_LICENSE: ${{ secrets.UNITY_LICENSE_2020 }} 9 | 10 | jobs: 11 | build: 12 | name: Build UnityPackage 13 | runs-on: ubuntu-latest 14 | steps: 15 | # Checkout 16 | - name: Checkout repository 17 | uses: actions/checkout@v4 18 | with: 19 | lfs: true 20 | 21 | # Cache 22 | - name: Cache 23 | uses: actions/cache@v2 24 | with: 25 | path: Library 26 | key: Library 27 | restore-keys: Library- 28 | 29 | # Build 30 | - name: Build .unitypackage 31 | uses: game-ci/unity-builder@v4 32 | env: 33 | UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} 34 | UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} 35 | UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} 36 | with: 37 | unityVersion: 2021.3.29f1 38 | buildMethod: MackySoft.PackageTools.Editor.UnityPackageExporter.Export 39 | 40 | # Upload 41 | - name: Upload .unitypackage 42 | uses: actions/upload-artifact@v4 43 | with: 44 | name: Unity Package 45 | path: Build -------------------------------------------------------------------------------- /.github/workflows/release.yaml: -------------------------------------------------------------------------------- 1 | name: Release 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | tag: 7 | description: "tag: git tag you want create. (sample 1.0.0)" 8 | required: true 9 | 10 | env: 11 | GIT_TAG: ${{ github.event.inputs.tag }} 12 | 13 | jobs: 14 | update-packagejson: 15 | runs-on: ubuntu-latest 16 | env: 17 | TARGET_FILE: ./Assets/MackySoft/MackySoft.SerializeReferenceExtensions/package.json 18 | outputs: 19 | sha: ${{ steps.commit.outputs.sha }} 20 | steps: 21 | - uses: actions/checkout@v4 22 | - name: Output package.json (Before) 23 | run: cat ${{ env.TARGET_FILE}} 24 | 25 | - name: Update package.json to version ${{ env.GIT_TAG }} 26 | run: sed -i -e "s/\(\"version\":\) \"\(.*\)\",/\1 \"${{ env.GIT_TAG }}\",/" ${{ env.TARGET_FILE }} 27 | 28 | - name: Check update 29 | id: check_update 30 | run: | 31 | cat ${{ env.TARGET_FILE}} 32 | git diff --exit-code || echo "::set-output name=changed::1" 33 | 34 | - name: Commit files 35 | id: commit 36 | if: steps.check_update.outputs.changed == '1' 37 | run: | 38 | git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" 39 | git config --local user.name "github-actions[bot]" 40 | git commit -m "feat: Update package.json to ${{ env.GIT_TAG }}" -a 41 | echo "::set-output name=sha::$(git rev-parse HEAD)" 42 | 43 | - name: Check sha 44 | run: echo "SHA ${SHA}" 45 | env: 46 | SHA: ${{ steps.commit.outputs.sha }} 47 | 48 | - name: Create Tag 49 | if: steps.check_update.outputs.changed == '1' 50 | run: git tag ${{ env.GIT_TAG }} 51 | 52 | - name: Push changes 53 | if: steps.check_update.outputs.changed == '1' 54 | uses: ad-m/github-push-action@master 55 | with: 56 | github_token: ${{ secrets.GITHUB_TOKEN }} 57 | branch: ${{ github.ref }} 58 | tags: true 59 | 60 | build: 61 | needs: [update-packagejson] 62 | strategy: 63 | matrix: 64 | unity: ["2021.3.29f1"] 65 | include: 66 | - unityVersion: 2021.3.29f1 67 | license: UNITY_LICENSE 68 | runs-on: ubuntu-latest 69 | timeout-minutes: 15 70 | steps: 71 | - run: echo ${{ needs.update-packagejson.outputs.sha }} 72 | - uses: actions/checkout@v4 73 | with: 74 | ref: ${{ needs.update-packagejson.outputs.sha }} 75 | 76 | - name: Export unitypackage 77 | uses: game-ci/unity-builder@v4 78 | env: 79 | UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} 80 | UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} 81 | UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} 82 | with: 83 | projectPath: . 84 | unityVersion: ${{ matrix.unityVersion }} 85 | targetPlatform: StandaloneLinux64 86 | buildMethod: MackySoft.PackageTools.Editor.UnityPackageExporter.Export 87 | versioning: None 88 | 89 | - name: check all .meta is commited 90 | run: | 91 | if git ls-files --others --exclude-standard -t | grep --regexp='[.]meta$'; then 92 | echo "Detected .meta file generated. Do you forgot commit a .meta file?" 93 | exit 1 94 | else 95 | echo "Great, all .meta files are commited." 96 | fi 97 | working-directory: . 98 | 99 | # Store artifacts. 100 | - uses: actions/upload-artifact@v4 101 | with: 102 | name: SerializeReference-Extensions.unitypackage 103 | path: ./Build/SerializeReference-Extensions.unitypackage 104 | 105 | create-release: 106 | needs: [update-packagejson, build] 107 | runs-on: ubuntu-latest 108 | steps: 109 | # Create Releases 110 | - uses: actions/create-release@v1 111 | id: create_release 112 | env: 113 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 114 | with: 115 | tag_name: ${{ env.GIT_TAG }} 116 | release_name: ${{ env.GIT_TAG }} 117 | commitish: ${{ needs.update-packagejson.outputs.sha }} 118 | draft: true 119 | prerelease: false 120 | 121 | # Download(All) Artifacts to current directory 122 | - uses: actions/download-artifact@v4 123 | 124 | # Upload to Releases(unitypackage) 125 | - uses: actions/upload-release-asset@v1 126 | env: 127 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 128 | with: 129 | upload_url: ${{ steps.create_release.outputs.upload_url }} 130 | asset_path: ./SerializeReference-Extensions.unitypackage/SerializeReference-Extensions.unitypackage 131 | asset_name: SerializeReference-Extensions.unitypackage 132 | asset_content_type: application/octet-stream -------------------------------------------------------------------------------- /.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/* 73 | 74 | # Visual Studio Code directory 75 | .vscode/ 76 | 77 | # Plugins 78 | /[Aa]ssets/[Pp]lugins.meta 79 | /[Aa]ssets/[Pp]lugins/ 80 | 81 | # Documentation 82 | Documentation/api/ 83 | Documentation/index.* 84 | _site/ 85 | Assets/**/obj* 86 | -------------------------------------------------------------------------------- /.vsconfig: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0", 3 | "components": [ 4 | "Microsoft.VisualStudio.Workload.ManagedGame" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /Assets/Example.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1fa875a00fbff0347b96e37e1dc81575 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Example/Example.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System; 3 | using UnityEditor; 4 | using UnityEngine; 5 | 6 | [Serializable] 7 | public abstract class Food 8 | { 9 | public string name; 10 | 11 | public float kcal; 12 | } 13 | 14 | [Serializable] 15 | public class Apple : Food 16 | { 17 | public Apple () 18 | { 19 | name = "Apple"; 20 | kcal = 100f; 21 | } 22 | } 23 | 24 | [Serializable] 25 | public class Peach : Food 26 | { 27 | public Peach () 28 | { 29 | name = "Peach"; 30 | kcal = 100f; 31 | } 32 | } 33 | 34 | [Serializable] 35 | public class Grape : Food 36 | { 37 | public Grape () 38 | { 39 | name = "Grape"; 40 | kcal = 100f; 41 | } 42 | } 43 | 44 | [Serializable] 45 | [HideInTypeMenu] 46 | public class Banana : Food 47 | { 48 | public Banana () 49 | { 50 | name = "Banana"; 51 | kcal = 100f; 52 | } 53 | } 54 | 55 | public class Example : MonoBehaviour 56 | { 57 | 58 | [SerializeReference] 59 | public Food food1 = new Apple(); 60 | 61 | [SerializeReference] 62 | public Food food2 = new Peach(); 63 | 64 | [SerializeReference] 65 | public Food food3 = new Grape(); 66 | 67 | [SerializeReference, SubclassSelector] 68 | public Food foodOne = new Apple(); 69 | 70 | [SerializeReference, SubclassSelector] 71 | public Food foodTwo = new Peach(); 72 | 73 | // UseToStringAsLabel support on UNITY_2021_3_OR_NEWER 74 | [SerializeReference, SubclassSelector(UseToStringAsLabel = true)] 75 | public Food foodThree = new Grape(); 76 | 77 | [SerializeReference] 78 | public List foodsOne = new List 79 | { 80 | new Apple(), 81 | new Peach(), 82 | new Grape() 83 | }; 84 | 85 | [SerializeReference, SubclassSelector] 86 | public List foodsTwo = new List 87 | { 88 | new Apple(), 89 | new Peach(), 90 | new Grape() 91 | }; 92 | } 93 | 94 | #if UNITY_EDITOR 95 | 96 | /// These classes are in a folder named "Editor" in the project 97 | 98 | [CustomPropertyDrawer(typeof(Peach), true)] 99 | public class PeachDrawer : PropertyDrawer 100 | { 101 | public override void OnGUI (Rect position, SerializedProperty property, GUIContent label) 102 | { 103 | position.height = EditorGUIUtility.singleLineHeight; 104 | EditorGUI.PropertyField(position, property.FindPropertyRelative("name")); 105 | 106 | position.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; 107 | EditorGUI.PropertyField(position, property.FindPropertyRelative("kcal")); 108 | } 109 | 110 | public override float GetPropertyHeight (SerializedProperty property, GUIContent label) 111 | { 112 | return EditorGUIUtility.singleLineHeight * 2 + EditorGUIUtility.standardVerticalSpacing * 1; 113 | } 114 | } 115 | 116 | [CustomPropertyDrawer(typeof(Apple), true)] 117 | public class AppleDrawer : PropertyDrawer 118 | { 119 | public override void OnGUI (Rect position, SerializedProperty property, GUIContent label) 120 | { 121 | EditorGUI.LabelField(position, "I'm an apple!"); 122 | } 123 | 124 | public override float GetPropertyHeight (SerializedProperty property, GUIContent label) 125 | { 126 | return EditorGUIUtility.singleLineHeight; 127 | } 128 | } 129 | #endif -------------------------------------------------------------------------------- /Assets/Example/Example.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2be69d932204e464fb7da2e0d53eab25 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Example/Example.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: 10 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_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &3 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 12 47 | m_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_ReflectionCompression: 2 70 | m_MixedBakeMode: 2 71 | m_BakeBackend: 1 72 | m_PVRSampling: 1 73 | m_PVRDirectSampleCount: 32 74 | m_PVRSampleCount: 512 75 | m_PVRBounces: 2 76 | m_PVREnvironmentSampleCount: 256 77 | m_PVREnvironmentReferencePointCount: 2048 78 | m_PVRFilteringMode: 1 79 | m_PVRDenoiserTypeDirect: 1 80 | m_PVRDenoiserTypeIndirect: 1 81 | m_PVRDenoiserTypeAO: 1 82 | m_PVRFilterTypeDirect: 0 83 | m_PVRFilterTypeIndirect: 0 84 | m_PVRFilterTypeAO: 0 85 | m_PVREnvironmentMIS: 1 86 | m_PVRCulling: 1 87 | m_PVRFilteringGaussRadiusDirect: 1 88 | m_PVRFilteringGaussRadiusIndirect: 5 89 | m_PVRFilteringGaussRadiusAO: 2 90 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 91 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 92 | m_PVRFilteringAtrousPositionSigmaAO: 1 93 | m_ExportTrainingData: 0 94 | m_TrainingDataDestination: TrainingData 95 | m_LightProbeSampleCountMultiplier: 4 96 | m_LightingDataAsset: {fileID: 0} 97 | m_LightingSettings: {fileID: 0} 98 | --- !u!196 &4 99 | NavMeshSettings: 100 | serializedVersion: 2 101 | m_ObjectHideFlags: 0 102 | m_BuildSettings: 103 | serializedVersion: 3 104 | agentTypeID: 0 105 | agentRadius: 0.5 106 | agentHeight: 2 107 | agentSlope: 45 108 | agentClimb: 0.4 109 | ledgeDropHeight: 0 110 | maxJumpAcrossDistance: 0 111 | minRegionArea: 2 112 | manualCellSize: 0 113 | cellSize: 0.16666667 114 | manualTileSize: 0 115 | tileSize: 256 116 | buildHeightMesh: 0 117 | maxJobWorkers: 0 118 | preserveTilesOutsideBounds: 0 119 | debug: 120 | m_Flags: 0 121 | m_NavMeshData: {fileID: 0} 122 | --- !u!1 &126803971 123 | GameObject: 124 | m_ObjectHideFlags: 0 125 | m_CorrespondingSourceObject: {fileID: 0} 126 | m_PrefabInstance: {fileID: 0} 127 | m_PrefabAsset: {fileID: 0} 128 | serializedVersion: 6 129 | m_Component: 130 | - component: {fileID: 126803974} 131 | - component: {fileID: 126803973} 132 | - component: {fileID: 126803972} 133 | m_Layer: 0 134 | m_Name: Main Camera 135 | m_TagString: MainCamera 136 | m_Icon: {fileID: 0} 137 | m_NavMeshLayer: 0 138 | m_StaticEditorFlags: 0 139 | m_IsActive: 1 140 | --- !u!81 &126803972 141 | AudioListener: 142 | m_ObjectHideFlags: 0 143 | m_CorrespondingSourceObject: {fileID: 0} 144 | m_PrefabInstance: {fileID: 0} 145 | m_PrefabAsset: {fileID: 0} 146 | m_GameObject: {fileID: 126803971} 147 | m_Enabled: 1 148 | --- !u!20 &126803973 149 | Camera: 150 | m_ObjectHideFlags: 0 151 | m_CorrespondingSourceObject: {fileID: 0} 152 | m_PrefabInstance: {fileID: 0} 153 | m_PrefabAsset: {fileID: 0} 154 | m_GameObject: {fileID: 126803971} 155 | m_Enabled: 1 156 | serializedVersion: 2 157 | m_ClearFlags: 1 158 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} 159 | m_projectionMatrixMode: 1 160 | m_GateFitMode: 2 161 | m_FOVAxisMode: 0 162 | m_Iso: 200 163 | m_ShutterSpeed: 0.005 164 | m_Aperture: 16 165 | m_FocusDistance: 10 166 | m_FocalLength: 50 167 | m_BladeCount: 5 168 | m_Curvature: {x: 2, y: 11} 169 | m_BarrelClipping: 0.25 170 | m_Anamorphism: 0 171 | m_SensorSize: {x: 36, y: 24} 172 | m_LensShift: {x: 0, y: 0} 173 | m_NormalizedViewPortRect: 174 | serializedVersion: 2 175 | x: 0 176 | y: 0 177 | width: 1 178 | height: 1 179 | near clip plane: 0.3 180 | far clip plane: 1000 181 | field of view: 60 182 | orthographic: 0 183 | orthographic size: 5 184 | m_Depth: -1 185 | m_CullingMask: 186 | serializedVersion: 2 187 | m_Bits: 4294967295 188 | m_RenderingPath: -1 189 | m_TargetTexture: {fileID: 0} 190 | m_TargetDisplay: 0 191 | m_TargetEye: 3 192 | m_HDR: 1 193 | m_AllowMSAA: 1 194 | m_AllowDynamicResolution: 0 195 | m_ForceIntoRT: 0 196 | m_OcclusionCulling: 1 197 | m_StereoConvergence: 10 198 | m_StereoSeparation: 0.022 199 | --- !u!4 &126803974 200 | Transform: 201 | m_ObjectHideFlags: 0 202 | m_CorrespondingSourceObject: {fileID: 0} 203 | m_PrefabInstance: {fileID: 0} 204 | m_PrefabAsset: {fileID: 0} 205 | m_GameObject: {fileID: 126803971} 206 | serializedVersion: 2 207 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 208 | m_LocalPosition: {x: 0, y: 1, z: -10} 209 | m_LocalScale: {x: 1, y: 1, z: 1} 210 | m_ConstrainProportionsScale: 0 211 | m_Children: [] 212 | m_Father: {fileID: 0} 213 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 214 | --- !u!1 &586792171 215 | GameObject: 216 | m_ObjectHideFlags: 0 217 | m_CorrespondingSourceObject: {fileID: 0} 218 | m_PrefabInstance: {fileID: 0} 219 | m_PrefabAsset: {fileID: 0} 220 | serializedVersion: 6 221 | m_Component: 222 | - component: {fileID: 586792173} 223 | - component: {fileID: 586792172} 224 | m_Layer: 0 225 | m_Name: Example 226 | m_TagString: Untagged 227 | m_Icon: {fileID: 0} 228 | m_NavMeshLayer: 0 229 | m_StaticEditorFlags: 0 230 | m_IsActive: 1 231 | --- !u!114 &586792172 232 | MonoBehaviour: 233 | m_ObjectHideFlags: 0 234 | m_CorrespondingSourceObject: {fileID: 0} 235 | m_PrefabInstance: {fileID: 0} 236 | m_PrefabAsset: {fileID: 0} 237 | m_GameObject: {fileID: 586792171} 238 | m_Enabled: 1 239 | m_EditorHideFlags: 0 240 | m_Script: {fileID: 11500000, guid: 2be69d932204e464fb7da2e0d53eab25, type: 3} 241 | m_Name: 242 | m_EditorClassIdentifier: 243 | food1: 244 | rid: 9020349853700980763 245 | food2: 246 | rid: 9020349853700980764 247 | food3: 248 | rid: 9020349853700980765 249 | foodOne: 250 | rid: 9020349853700980766 251 | foodTwo: 252 | rid: 9020349853700980767 253 | foodThree: 254 | rid: 9020349853700980768 255 | foodsOne: 256 | - rid: 9020349853700980769 257 | - rid: 9020349853700980770 258 | - rid: 9020349853700980771 259 | foodsTwo: 260 | - rid: 9020349853700980772 261 | - rid: 9020349853700980773 262 | - rid: 9020349853700980774 263 | references: 264 | version: 2 265 | RefIds: 266 | - rid: 9020349853700980763 267 | type: {class: Apple, ns: , asm: Assembly-CSharp} 268 | data: 269 | name: Apple 270 | kcal: 100 271 | - rid: 9020349853700980764 272 | type: {class: Peach, ns: , asm: Assembly-CSharp} 273 | data: 274 | name: Peach 275 | kcal: 100 276 | - rid: 9020349853700980765 277 | type: {class: Grape, ns: , asm: Assembly-CSharp} 278 | data: 279 | name: Grape 280 | kcal: 100 281 | - rid: 9020349853700980766 282 | type: {class: Apple, ns: , asm: Assembly-CSharp} 283 | data: 284 | name: Apple 285 | kcal: 100 286 | - rid: 9020349853700980767 287 | type: {class: Peach, ns: , asm: Assembly-CSharp} 288 | data: 289 | name: Peach 290 | kcal: 100 291 | - rid: 9020349853700980768 292 | type: {class: Grape, ns: , asm: Assembly-CSharp} 293 | data: 294 | name: Grape 295 | kcal: 100 296 | - rid: 9020349853700980769 297 | type: {class: Apple, ns: , asm: Assembly-CSharp} 298 | data: 299 | name: Apple 300 | kcal: 100 301 | - rid: 9020349853700980770 302 | type: {class: Peach, ns: , asm: Assembly-CSharp} 303 | data: 304 | name: Peach 305 | kcal: 100 306 | - rid: 9020349853700980771 307 | type: {class: Grape, ns: , asm: Assembly-CSharp} 308 | data: 309 | name: Grape 310 | kcal: 100 311 | - rid: 9020349853700980772 312 | type: {class: Apple, ns: , asm: Assembly-CSharp} 313 | data: 314 | name: Apple 315 | kcal: 100 316 | - rid: 9020349853700980773 317 | type: {class: Peach, ns: , asm: Assembly-CSharp} 318 | data: 319 | name: Peach 320 | kcal: 100 321 | - rid: 9020349853700980774 322 | type: {class: Grape, ns: , asm: Assembly-CSharp} 323 | data: 324 | name: Grape 325 | kcal: 100 326 | --- !u!4 &586792173 327 | Transform: 328 | m_ObjectHideFlags: 0 329 | m_CorrespondingSourceObject: {fileID: 0} 330 | m_PrefabInstance: {fileID: 0} 331 | m_PrefabAsset: {fileID: 0} 332 | m_GameObject: {fileID: 586792171} 333 | serializedVersion: 2 334 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 335 | m_LocalPosition: {x: 0, y: 0, z: 0} 336 | m_LocalScale: {x: 1, y: 1, z: 1} 337 | m_ConstrainProportionsScale: 0 338 | m_Children: [] 339 | m_Father: {fileID: 0} 340 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 341 | --- !u!1 &994260143 342 | GameObject: 343 | m_ObjectHideFlags: 0 344 | m_CorrespondingSourceObject: {fileID: 0} 345 | m_PrefabInstance: {fileID: 0} 346 | m_PrefabAsset: {fileID: 0} 347 | serializedVersion: 6 348 | m_Component: 349 | - component: {fileID: 994260145} 350 | - component: {fileID: 994260144} 351 | m_Layer: 0 352 | m_Name: Example_Generics 353 | m_TagString: Untagged 354 | m_Icon: {fileID: 0} 355 | m_NavMeshLayer: 0 356 | m_StaticEditorFlags: 0 357 | m_IsActive: 1 358 | --- !u!114 &994260144 359 | MonoBehaviour: 360 | m_ObjectHideFlags: 0 361 | m_CorrespondingSourceObject: {fileID: 0} 362 | m_PrefabInstance: {fileID: 0} 363 | m_PrefabAsset: {fileID: 0} 364 | m_GameObject: {fileID: 994260143} 365 | m_Enabled: 1 366 | m_EditorHideFlags: 0 367 | m_Script: {fileID: 11500000, guid: dff76005e1dfac84287448b12c4b160e, type: 3} 368 | m_Name: 369 | m_EditorClassIdentifier: 370 | contravarianceActions: 371 | - rid: 3354424774140624943 372 | covarianceActions: 373 | - rid: 3354424774140624944 374 | references: 375 | version: 2 376 | RefIds: 377 | - rid: 3354424774140624943 378 | type: {class: DerivedAction1, ns: , asm: Assembly-CSharp} 379 | data: 380 | - rid: 3354424774140624944 381 | type: {class: NetworkActorAction1, ns: , asm: Assembly-CSharp} 382 | data: 383 | --- !u!4 &994260145 384 | Transform: 385 | m_ObjectHideFlags: 0 386 | m_CorrespondingSourceObject: {fileID: 0} 387 | m_PrefabInstance: {fileID: 0} 388 | m_PrefabAsset: {fileID: 0} 389 | m_GameObject: {fileID: 994260143} 390 | serializedVersion: 2 391 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 392 | m_LocalPosition: {x: 0, y: 0, z: 0} 393 | m_LocalScale: {x: 1, y: 1, z: 1} 394 | m_ConstrainProportionsScale: 0 395 | m_Children: [] 396 | m_Father: {fileID: 0} 397 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 398 | --- !u!1 &1127138992 399 | GameObject: 400 | m_ObjectHideFlags: 0 401 | m_CorrespondingSourceObject: {fileID: 0} 402 | m_PrefabInstance: {fileID: 0} 403 | m_PrefabAsset: {fileID: 0} 404 | serializedVersion: 6 405 | m_Component: 406 | - component: {fileID: 1127138994} 407 | - component: {fileID: 1127138993} 408 | m_Layer: 0 409 | m_Name: Directional Light 410 | m_TagString: Untagged 411 | m_Icon: {fileID: 0} 412 | m_NavMeshLayer: 0 413 | m_StaticEditorFlags: 0 414 | m_IsActive: 1 415 | --- !u!108 &1127138993 416 | Light: 417 | m_ObjectHideFlags: 0 418 | m_CorrespondingSourceObject: {fileID: 0} 419 | m_PrefabInstance: {fileID: 0} 420 | m_PrefabAsset: {fileID: 0} 421 | m_GameObject: {fileID: 1127138992} 422 | m_Enabled: 1 423 | serializedVersion: 11 424 | m_Type: 1 425 | m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} 426 | m_Intensity: 1 427 | m_Range: 10 428 | m_SpotAngle: 30 429 | m_InnerSpotAngle: 21.80208 430 | m_CookieSize: 10 431 | m_Shadows: 432 | m_Type: 2 433 | m_Resolution: -1 434 | m_CustomResolution: -1 435 | m_Strength: 1 436 | m_Bias: 0.05 437 | m_NormalBias: 0.4 438 | m_NearPlane: 0.2 439 | m_CullingMatrixOverride: 440 | e00: 1 441 | e01: 0 442 | e02: 0 443 | e03: 0 444 | e10: 0 445 | e11: 1 446 | e12: 0 447 | e13: 0 448 | e20: 0 449 | e21: 0 450 | e22: 1 451 | e23: 0 452 | e30: 0 453 | e31: 0 454 | e32: 0 455 | e33: 1 456 | m_UseCullingMatrixOverride: 0 457 | m_Cookie: {fileID: 0} 458 | m_DrawHalo: 0 459 | m_Flare: {fileID: 0} 460 | m_RenderMode: 0 461 | m_CullingMask: 462 | serializedVersion: 2 463 | m_Bits: 4294967295 464 | m_RenderingLayerMask: 1 465 | m_Lightmapping: 4 466 | m_LightShadowCasterMode: 0 467 | m_AreaSize: {x: 1, y: 1} 468 | m_BounceIntensity: 1 469 | m_ColorTemperature: 6570 470 | m_UseColorTemperature: 0 471 | m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} 472 | m_UseBoundingSphereOverride: 0 473 | m_UseViewFrustumForShadowCasterCull: 1 474 | m_ShadowRadius: 0 475 | m_ShadowAngle: 0 476 | --- !u!4 &1127138994 477 | Transform: 478 | m_ObjectHideFlags: 0 479 | m_CorrespondingSourceObject: {fileID: 0} 480 | m_PrefabInstance: {fileID: 0} 481 | m_PrefabAsset: {fileID: 0} 482 | m_GameObject: {fileID: 1127138992} 483 | serializedVersion: 2 484 | m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} 485 | m_LocalPosition: {x: 0, y: 3, z: 0} 486 | m_LocalScale: {x: 1, y: 1, z: 1} 487 | m_ConstrainProportionsScale: 0 488 | m_Children: [] 489 | m_Father: {fileID: 0} 490 | m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} 491 | --- !u!1660057539 &9223372036854775807 492 | SceneRoots: 493 | m_ObjectHideFlags: 0 494 | m_Roots: 495 | - {fileID: 126803974} 496 | - {fileID: 1127138994} 497 | - {fileID: 586792173} 498 | - {fileID: 994260145} 499 | -------------------------------------------------------------------------------- /Assets/Example/Example.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: edbf6cf086198fc4dbd84a5a8d648144 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Example/Example_Generics.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public interface IActor { } 6 | public interface IStandardActor : IActor { } 7 | public interface INetworkActor : IActor { } 8 | 9 | public interface IContravarianceAction where T : IActor { 10 | void DoAction (T actor); 11 | } 12 | 13 | public interface ICovarianceAction where T : IActor 14 | { 15 | T Actor { get; } 16 | } 17 | 18 | public interface IActorAction : IContravarianceAction, ICovarianceAction { } 19 | public interface IStandardActorAction : IContravarianceAction, ICovarianceAction { } 20 | public interface INetworkActorAction : IContravarianceAction, ICovarianceAction { } 21 | 22 | [Serializable] 23 | public sealed class StandardActorAction : IContravarianceAction, ICovarianceAction 24 | { 25 | public void DoAction (IStandardActor actor) 26 | { 27 | } 28 | public IStandardActor Actor => null; 29 | } 30 | 31 | [Serializable] 32 | public sealed class ActorAction : IContravarianceAction, ICovarianceAction 33 | { 34 | public void DoAction (IActor actor) 35 | { 36 | } 37 | public IActor Actor => null; 38 | } 39 | 40 | [Serializable] 41 | public abstract class BaseAction : IContravarianceAction, ICovarianceAction where T : IActor 42 | { 43 | public void DoAction (T actor) { 44 | } 45 | public T Actor => default; 46 | } 47 | 48 | [Serializable] 49 | public sealed class DerivedAction1 : BaseAction { } 50 | 51 | [Serializable] 52 | public sealed class DerivedAction2 : BaseAction { } 53 | 54 | [Serializable] 55 | public sealed class DerivedAction3 : BaseAction { } 56 | 57 | [Serializable] 58 | public sealed class NetworkActorAction1 : INetworkActorAction 59 | { 60 | public void DoAction (INetworkActor actor) 61 | { 62 | } 63 | public INetworkActor Actor => null; 64 | } 65 | 66 | [Serializable] 67 | public sealed class NetworkActorAction2 : IContravarianceAction, ICovarianceAction 68 | { 69 | public void DoAction (INetworkActor actor) 70 | { 71 | } 72 | public INetworkActor Actor => null; 73 | } 74 | 75 | [Serializable] 76 | public sealed class NetworkActorAction3 : IContravarianceAction, ICovarianceAction 77 | { 78 | public void DoAction (IActor actor) 79 | { 80 | } 81 | public IActor Actor => null; 82 | } 83 | 84 | public class Example_Generics : MonoBehaviour 85 | { 86 | 87 | [SerializeReference, SubclassSelector] 88 | public List> contravarianceActions = new List>(); 89 | 90 | [SerializeReference, SubclassSelector] 91 | public List> covarianceActions = new List>(); 92 | 93 | } 94 | -------------------------------------------------------------------------------- /Assets/Example/Example_Generics.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dff76005e1dfac84287448b12c4b160e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/MackySoft.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c28b603014d990147886ca54f079164b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7e5165dfe32313c4c9e5293049b47082 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c2e3f930f98af54688ea68073acb278 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Editor/AdvancedTypePopup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | using UnityEditor; 6 | using UnityEditor.IMGUI.Controls; 7 | 8 | namespace MackySoft.SerializeReferenceExtensions.Editor { 9 | 10 | public class AdvancedTypePopupItem : AdvancedDropdownItem { 11 | 12 | public Type Type { get; } 13 | 14 | public AdvancedTypePopupItem (Type type,string name) : base(name) { 15 | Type = type; 16 | } 17 | 18 | } 19 | 20 | /// 21 | /// A type popup with a fuzzy finder. 22 | /// 23 | public class AdvancedTypePopup : AdvancedDropdown { 24 | 25 | const int kMaxNamespaceNestCount = 16; 26 | 27 | public static void AddTo (AdvancedDropdownItem root,IEnumerable types) { 28 | int itemCount = 0; 29 | 30 | // Add null item. 31 | var nullItem = new AdvancedTypePopupItem(null,TypeMenuUtility.k_NullDisplayName) { 32 | id = itemCount++ 33 | }; 34 | root.AddChild(nullItem); 35 | 36 | Type[] typeArray = types.OrderByType().ToArray(); 37 | 38 | // Single namespace if the root has one namespace and the nest is unbranched. 39 | bool isSingleNamespace = true; 40 | string[] namespaces = new string[kMaxNamespaceNestCount]; 41 | foreach (Type type in typeArray) { 42 | string[] splittedTypePath = TypeMenuUtility.GetSplittedTypePath(type); 43 | if (splittedTypePath.Length <= 1) { 44 | continue; 45 | } 46 | // If they explicitly want sub category, let them do. 47 | if (TypeMenuUtility.GetAttribute(type) != null) { 48 | isSingleNamespace = false; 49 | break; 50 | } 51 | for (int k = 0;(splittedTypePath.Length - 1) > k;k++) { 52 | string ns = namespaces[k]; 53 | if (ns == null) { 54 | namespaces[k] = splittedTypePath[k]; 55 | } 56 | else if (ns != splittedTypePath[k]) { 57 | isSingleNamespace = false; 58 | break; 59 | } 60 | } 61 | 62 | if (!isSingleNamespace) { 63 | break; 64 | } 65 | } 66 | 67 | // Add type items. 68 | foreach (Type type in typeArray) { 69 | string[] splittedTypePath = TypeMenuUtility.GetSplittedTypePath(type); 70 | if (splittedTypePath.Length == 0) { 71 | continue; 72 | } 73 | 74 | AdvancedDropdownItem parent = root; 75 | 76 | // Add namespace items. 77 | if (!isSingleNamespace) { 78 | for (int k = 0;(splittedTypePath.Length - 1) > k;k++) { 79 | AdvancedDropdownItem foundItem = GetItem(parent,splittedTypePath[k]); 80 | if (foundItem != null) { 81 | parent = foundItem; 82 | } 83 | else { 84 | var newItem = new AdvancedDropdownItem(splittedTypePath[k]) { 85 | id = itemCount++, 86 | }; 87 | parent.AddChild(newItem); 88 | parent = newItem; 89 | } 90 | } 91 | } 92 | 93 | // Add type item. 94 | var item = new AdvancedTypePopupItem(type,ObjectNames.NicifyVariableName(splittedTypePath[splittedTypePath.Length - 1])) { 95 | id = itemCount++ 96 | }; 97 | parent.AddChild(item); 98 | } 99 | } 100 | 101 | static AdvancedDropdownItem GetItem (AdvancedDropdownItem parent,string name) { 102 | foreach (AdvancedDropdownItem item in parent.children) { 103 | if (item.name == name) { 104 | return item; 105 | } 106 | } 107 | return null; 108 | } 109 | 110 | static readonly float k_HeaderHeight = EditorGUIUtility.singleLineHeight * 2f; 111 | 112 | Type[] m_Types; 113 | 114 | public event Action OnItemSelected; 115 | 116 | public AdvancedTypePopup (IEnumerable types,int maxLineCount,AdvancedDropdownState state) : base(state) { 117 | SetTypes(types); 118 | minimumSize = new Vector2(minimumSize.x,EditorGUIUtility.singleLineHeight * maxLineCount + k_HeaderHeight); 119 | } 120 | 121 | public void SetTypes (IEnumerable types) { 122 | m_Types = types.ToArray(); 123 | } 124 | 125 | protected override AdvancedDropdownItem BuildRoot () { 126 | var root = new AdvancedDropdownItem("Select Type"); 127 | AddTo(root,m_Types); 128 | return root; 129 | } 130 | 131 | protected override void ItemSelected (AdvancedDropdownItem item) { 132 | base.ItemSelected(item); 133 | if (item is AdvancedTypePopupItem typePopupItem) { 134 | OnItemSelected?.Invoke(typePopupItem); 135 | } 136 | } 137 | 138 | } 139 | } -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Editor/AdvancedTypePopup.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9d8065888a2f3464e9252691fa1376a2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Editor/MackySoft.SerializeReferenceExtensions.Editor.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "MackySoft.SerializeReferenceExtensions.Editor", 3 | "rootNamespace": "", 4 | "references": [ 5 | "GUID:49b49c76ee64f6b41bf28ef951cb0e50" 6 | ], 7 | "includePlatforms": [ 8 | "Editor" 9 | ], 10 | "excludePlatforms": [], 11 | "allowUnsafeCode": false, 12 | "overrideReferences": false, 13 | "precompiledReferences": [], 14 | "autoReferenced": true, 15 | "defineConstraints": [], 16 | "versionDefines": [], 17 | "noEngineReferences": false 18 | } -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Editor/MackySoft.SerializeReferenceExtensions.Editor.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e6234d6c1f7bf4e4db20eddc411c00b8 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Editor/ManagedReferenceContextualPropertyMenu.cs: -------------------------------------------------------------------------------- 1 | // NOTE: managedReferenceValue getter is available only in Unity 2021.3 or later. 2 | #if UNITY_2021_3_OR_NEWER 3 | using System; 4 | using UnityEditor; 5 | using UnityEngine; 6 | 7 | namespace MackySoft.SerializeReferenceExtensions.Editor 8 | { 9 | public static class ManagedReferenceContextualPropertyMenu 10 | { 11 | 12 | const string kCopiedPropertyPathKey = "SerializeReferenceExtensions.CopiedPropertyPath"; 13 | const string kClipboardKey = "SerializeReferenceExtensions.CopyAndPasteProperty"; 14 | 15 | static readonly GUIContent kPasteContent = new GUIContent("Paste Property"); 16 | static readonly GUIContent kNewInstanceContent = new GUIContent("New Instance"); 17 | static readonly GUIContent kResetAndNewInstanceContent = new GUIContent("Reset and New Instance"); 18 | 19 | [InitializeOnLoadMethod] 20 | static void Initialize () 21 | { 22 | EditorApplication.contextualPropertyMenu += OnContextualPropertyMenu; 23 | } 24 | 25 | static void OnContextualPropertyMenu (GenericMenu menu, SerializedProperty property) 26 | { 27 | if (property.propertyType == SerializedPropertyType.ManagedReference) 28 | { 29 | // NOTE: When the callback function is called, the SerializedProperty is rewritten to the property that was being moused over at the time, 30 | // so a new SerializedProperty instance must be created. 31 | SerializedProperty clonedProperty = property.Copy(); 32 | 33 | menu.AddItem(new GUIContent($"Copy \"{property.propertyPath}\" property"), false, Copy, clonedProperty); 34 | 35 | string copiedPropertyPath = SessionState.GetString(kCopiedPropertyPathKey, string.Empty); 36 | if (!string.IsNullOrEmpty(copiedPropertyPath)) 37 | { 38 | menu.AddItem(new GUIContent($"Paste \"{copiedPropertyPath}\" property"), false, Paste, clonedProperty); 39 | } 40 | else 41 | { 42 | menu.AddDisabledItem(kPasteContent); 43 | } 44 | 45 | menu.AddSeparator(""); 46 | 47 | bool hasInstance = clonedProperty.managedReferenceValue != null; 48 | if (hasInstance) 49 | { 50 | menu.AddItem(kNewInstanceContent, false, NewInstance, clonedProperty); 51 | menu.AddItem(kResetAndNewInstanceContent, false, ResetAndNewInstance, clonedProperty); 52 | } 53 | else 54 | { 55 | menu.AddDisabledItem(kNewInstanceContent); 56 | menu.AddDisabledItem(kResetAndNewInstanceContent); 57 | } 58 | } 59 | } 60 | 61 | static void Copy (object customData) 62 | { 63 | SerializedProperty property = (SerializedProperty)customData; 64 | string json = JsonUtility.ToJson(property.managedReferenceValue); 65 | SessionState.SetString(kCopiedPropertyPathKey, property.propertyPath); 66 | SessionState.SetString(kClipboardKey, json); 67 | } 68 | 69 | static void Paste (object customData) 70 | { 71 | SerializedProperty property = (SerializedProperty)customData; 72 | string json = SessionState.GetString(kClipboardKey, string.Empty); 73 | if (string.IsNullOrEmpty(json)) 74 | { 75 | return; 76 | } 77 | 78 | Undo.RecordObject(property.serializedObject.targetObject, "Paste Property"); 79 | JsonUtility.FromJsonOverwrite(json, property.managedReferenceValue); 80 | property.serializedObject.ApplyModifiedProperties(); 81 | } 82 | 83 | static void NewInstance (object customData) 84 | { 85 | SerializedProperty property = (SerializedProperty)customData; 86 | string json = JsonUtility.ToJson(property.managedReferenceValue); 87 | 88 | Undo.RecordObject(property.serializedObject.targetObject, "New Instance"); 89 | property.managedReferenceValue = JsonUtility.FromJson(json, property.managedReferenceValue.GetType()); 90 | property.serializedObject.ApplyModifiedProperties(); 91 | 92 | Debug.Log($"Create new instance of \"{property.propertyPath}\"."); 93 | } 94 | 95 | static void ResetAndNewInstance (object customData) 96 | { 97 | SerializedProperty property = (SerializedProperty)customData; 98 | 99 | Undo.RecordObject(property.serializedObject.targetObject, "Reset and New Instance"); 100 | property.managedReferenceValue = Activator.CreateInstance(property.managedReferenceValue.GetType()); 101 | property.serializedObject.ApplyModifiedProperties(); 102 | 103 | Debug.Log($"Reset property and created new instance of \"{property.propertyPath}\"."); 104 | } 105 | } 106 | } 107 | #endif -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Editor/ManagedReferenceContextualPropertyMenu.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 734d3eb8da4785b49919aea6db62d877 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Editor/ManagedReferenceUtility.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reflection; 3 | using UnityEditor; 4 | using UnityEngine; 5 | 6 | namespace MackySoft.SerializeReferenceExtensions.Editor 7 | { 8 | 9 | public static class ManagedReferenceUtility { 10 | 11 | public static object SetManagedReference (this SerializedProperty property,Type type) { 12 | object result = null; 13 | 14 | #if UNITY_2021_3_OR_NEWER 15 | // NOTE: managedReferenceValue getter is available only in Unity 2021.3 or later. 16 | if ((type != null) && (property.managedReferenceValue != null)) 17 | { 18 | // Restore an previous values from json. 19 | string json = JsonUtility.ToJson(property.managedReferenceValue); 20 | result = JsonUtility.FromJson(json, type); 21 | } 22 | #endif 23 | 24 | if (result == null) 25 | { 26 | result = (type != null) ? Activator.CreateInstance(type) : null; 27 | } 28 | 29 | property.managedReferenceValue = result; 30 | return result; 31 | 32 | } 33 | 34 | public static Type GetType (string typeName) { 35 | if (string.IsNullOrEmpty(typeName)) 36 | { 37 | return null; 38 | } 39 | 40 | int splitIndex = typeName.IndexOf(' '); 41 | var assembly = Assembly.Load(typeName.Substring(0,splitIndex)); 42 | return assembly.GetType(typeName.Substring(splitIndex + 1)); 43 | } 44 | 45 | } 46 | } -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Editor/ManagedReferenceUtility.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 065a93e92875c4440b7c2168bead041a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Editor/PropertyDrawerCache.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEditor; 4 | using System.Reflection; 5 | 6 | namespace MackySoft.SerializeReferenceExtensions.Editor 7 | { 8 | public static class PropertyDrawerCache 9 | { 10 | 11 | static readonly Dictionary s_Caches = new Dictionary(); 12 | 13 | public static bool TryGetPropertyDrawer (Type type,out PropertyDrawer drawer) 14 | { 15 | if (!s_Caches.TryGetValue(type,out drawer)) 16 | { 17 | Type drawerType = GetCustomPropertyDrawerType(type); 18 | drawer = (drawerType != null) ? (PropertyDrawer)Activator.CreateInstance(drawerType) : null; 19 | 20 | s_Caches.Add(type, drawer); 21 | } 22 | return (drawer != null); 23 | } 24 | 25 | static Type GetCustomPropertyDrawerType (Type type) 26 | { 27 | Type[] interfaceTypes = type.GetInterfaces(); 28 | 29 | var types = TypeCache.GetTypesWithAttribute(); 30 | foreach (Type drawerType in types) 31 | { 32 | var customPropertyDrawerAttributes = drawerType.GetCustomAttributes(typeof(CustomPropertyDrawer), true); 33 | foreach (CustomPropertyDrawer customPropertyDrawer in customPropertyDrawerAttributes) 34 | { 35 | var field = customPropertyDrawer.GetType().GetField("m_Type", BindingFlags.NonPublic | BindingFlags.Instance); 36 | if (field != null) 37 | { 38 | var fieldType = field.GetValue(customPropertyDrawer) as Type; 39 | if (fieldType != null) 40 | { 41 | if (fieldType == type) 42 | { 43 | return drawerType; 44 | } 45 | 46 | // If the property drawer also allows for being applied to child classes, check if they match 47 | var useForChildrenField = customPropertyDrawer.GetType().GetField("m_UseForChildren", BindingFlags.NonPublic | BindingFlags.Instance); 48 | if (useForChildrenField != null) 49 | { 50 | object useForChildrenValue = useForChildrenField.GetValue(customPropertyDrawer); 51 | if (useForChildrenValue is bool && (bool)useForChildrenValue) 52 | { 53 | // Check interfaces 54 | if (Array.Exists(interfaceTypes, interfaceType => interfaceType == fieldType)) 55 | { 56 | return drawerType; 57 | } 58 | 59 | // Check derived types 60 | Type baseType = type.BaseType; 61 | while (baseType != null) 62 | { 63 | if (baseType == fieldType) 64 | { 65 | return drawerType; 66 | } 67 | 68 | baseType = baseType.BaseType; 69 | } 70 | } 71 | } 72 | } 73 | } 74 | } 75 | } 76 | return null; 77 | } 78 | 79 | } 80 | } -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Editor/PropertyDrawerCache.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 075fe3cc9403a8947bc325d8515e9a69 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Editor/SerializedPropertyExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEditor; 3 | 4 | namespace MackySoft.SerializeReferenceExtensions.Editor 5 | { 6 | public static class SerializedPropertyExtensions 7 | { 8 | public static IEnumerable GetChildProperties (this SerializedProperty parent, int depth = 1) 9 | { 10 | parent = parent.Copy(); 11 | 12 | int depthOfParent = parent.depth; 13 | var enumerator = parent.GetEnumerator(); 14 | 15 | while (enumerator.MoveNext()) 16 | { 17 | if (enumerator.Current is not SerializedProperty childProperty) 18 | { 19 | continue; 20 | } 21 | if (childProperty.depth > (depthOfParent + depth)) 22 | { 23 | continue; 24 | } 25 | yield return childProperty.Copy(); 26 | } 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Editor/SerializedPropertyExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b934aeca38cb7a24cabd6047fe0e298a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Editor/SubclassSelectorDrawer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | using UnityEditor; 6 | using UnityEditor.IMGUI.Controls; 7 | 8 | namespace MackySoft.SerializeReferenceExtensions.Editor 9 | { 10 | 11 | [CustomPropertyDrawer(typeof(SubclassSelectorAttribute))] 12 | public class SubclassSelectorDrawer : PropertyDrawer { 13 | 14 | struct TypePopupCache { 15 | public AdvancedTypePopup TypePopup { get; } 16 | public AdvancedDropdownState State { get; } 17 | public TypePopupCache (AdvancedTypePopup typePopup,AdvancedDropdownState state) { 18 | TypePopup = typePopup; 19 | State = state; 20 | } 21 | } 22 | 23 | const int k_MaxTypePopupLineCount = 13; 24 | 25 | static readonly GUIContent k_NullDisplayName = new GUIContent(TypeMenuUtility.k_NullDisplayName); 26 | static readonly GUIContent k_IsNotManagedReferenceLabel = new GUIContent("The property type is not manage reference."); 27 | 28 | readonly Dictionary m_TypePopups = new Dictionary(); 29 | readonly Dictionary m_TypeNameCaches = new Dictionary(); 30 | 31 | SerializedProperty m_TargetProperty; 32 | 33 | public override void OnGUI (Rect position, SerializedProperty property, GUIContent label) 34 | { 35 | EditorGUI.BeginProperty(position, label, property); 36 | 37 | if (property.propertyType == SerializedPropertyType.ManagedReference) 38 | { 39 | // Render label first to avoid label overlap for lists 40 | Rect foldoutLabelRect = new Rect(position); 41 | foldoutLabelRect.height = EditorGUIUtility.singleLineHeight; 42 | 43 | // NOTE: IndentedRect should be disabled as it causes extra indentation. 44 | //foldoutLabelRect = EditorGUI.IndentedRect(foldoutLabelRect); 45 | Rect popupPosition = EditorGUI.PrefixLabel(foldoutLabelRect, label); 46 | 47 | #if UNITY_2021_3_OR_NEWER 48 | // Override the label text with the ToString() of the managed reference. 49 | var subclassSelectorAttribute = (SubclassSelectorAttribute)attribute; 50 | if (subclassSelectorAttribute.UseToStringAsLabel && !property.hasMultipleDifferentValues) 51 | { 52 | object managedReferenceValue = property.managedReferenceValue; 53 | if (managedReferenceValue != null) 54 | { 55 | label.text = managedReferenceValue.ToString(); 56 | } 57 | } 58 | #endif 59 | 60 | // Draw the subclass selector popup. 61 | if (EditorGUI.DropdownButton(popupPosition, GetTypeName(property), FocusType.Keyboard)) 62 | { 63 | TypePopupCache popup = GetTypePopup(property); 64 | m_TargetProperty = property; 65 | popup.TypePopup.Show(popupPosition); 66 | } 67 | 68 | // Draw the foldout. 69 | if (!string.IsNullOrEmpty(property.managedReferenceFullTypename)) 70 | { 71 | Rect foldoutRect = new Rect(position); 72 | foldoutRect.height = EditorGUIUtility.singleLineHeight; 73 | 74 | #if UNITY_2022_2_OR_NEWER && !UNITY_6000_0_OR_NEWER 75 | // NOTE: Position x must be adjusted. 76 | // FIXME: Is there a more essential solution...? 77 | // The most promising is UI Toolkit, but it is currently unable to reproduce all of SubclassSelector features. (Complete provision of contextual menu, e.g.) 78 | // 2021.3: No adjustment 79 | // 2022.1: No adjustment 80 | // 2022.2: Adjustment required 81 | // 2022.3: Adjustment required 82 | // 2023.1: Adjustment required 83 | // 2023.2: Adjustment required 84 | // 6000.0: No adjustment 85 | foldoutRect.x -= 12; 86 | #endif 87 | 88 | property.isExpanded = EditorGUI.Foldout(foldoutRect, property.isExpanded, GUIContent.none, true); 89 | } 90 | 91 | // Draw property if expanded. 92 | if (property.isExpanded) 93 | { 94 | using (new EditorGUI.IndentLevelScope()) 95 | { 96 | // Check if a custom property drawer exists for this type. 97 | PropertyDrawer customDrawer = GetCustomPropertyDrawer(property); 98 | if (customDrawer != null) 99 | { 100 | // Draw the property with custom property drawer. 101 | Rect indentedRect = position; 102 | float foldoutDifference = EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; 103 | indentedRect.height = customDrawer.GetPropertyHeight(property, label); 104 | indentedRect.y += foldoutDifference; 105 | customDrawer.OnGUI(indentedRect, property, label); 106 | } 107 | else 108 | { 109 | // Draw the properties of the child elements. 110 | // NOTE: In the following code, since the foldout layout isn't working properly, I'll iterate through the properties of the child elements myself. 111 | // EditorGUI.PropertyField(position, property, GUIContent.none, true); 112 | 113 | Rect childPosition = position; 114 | childPosition.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; 115 | foreach (SerializedProperty childProperty in property.GetChildProperties()) 116 | { 117 | float height = EditorGUI.GetPropertyHeight(childProperty, new GUIContent(childProperty.displayName, childProperty.tooltip), true); 118 | childPosition.height = height; 119 | EditorGUI.PropertyField(childPosition, childProperty, true); 120 | 121 | childPosition.y += height + EditorGUIUtility.standardVerticalSpacing; 122 | } 123 | } 124 | } 125 | } 126 | } 127 | else 128 | { 129 | EditorGUI.LabelField(position, label, k_IsNotManagedReferenceLabel); 130 | } 131 | 132 | EditorGUI.EndProperty(); 133 | } 134 | 135 | PropertyDrawer GetCustomPropertyDrawer (SerializedProperty property) 136 | { 137 | Type propertyType = ManagedReferenceUtility.GetType(property.managedReferenceFullTypename); 138 | if (propertyType != null && PropertyDrawerCache.TryGetPropertyDrawer(propertyType, out PropertyDrawer drawer)) 139 | { 140 | return drawer; 141 | } 142 | return null; 143 | } 144 | 145 | TypePopupCache GetTypePopup (SerializedProperty property) { 146 | // Cache this string. This property internally call Assembly.GetName, which result in a large allocation. 147 | string managedReferenceFieldTypename = property.managedReferenceFieldTypename; 148 | 149 | if (!m_TypePopups.TryGetValue(managedReferenceFieldTypename,out TypePopupCache result)) { 150 | var state = new AdvancedDropdownState(); 151 | 152 | Type baseType = ManagedReferenceUtility.GetType(managedReferenceFieldTypename); 153 | var popup = new AdvancedTypePopup( 154 | TypeSearch.GetTypes(baseType), 155 | k_MaxTypePopupLineCount, 156 | state 157 | ); 158 | popup.OnItemSelected += item => { 159 | Type type = item.Type; 160 | 161 | // Apply changes to individual serialized objects. 162 | foreach (var targetObject in m_TargetProperty.serializedObject.targetObjects) { 163 | SerializedObject individualObject = new SerializedObject(targetObject); 164 | SerializedProperty individualProperty = individualObject.FindProperty(m_TargetProperty.propertyPath); 165 | object obj = individualProperty.SetManagedReference(type); 166 | individualProperty.isExpanded = (obj != null); 167 | 168 | individualObject.ApplyModifiedProperties(); 169 | individualObject.Update(); 170 | } 171 | }; 172 | 173 | result = new TypePopupCache(popup, state); 174 | m_TypePopups.Add(managedReferenceFieldTypename, result); 175 | } 176 | return result; 177 | } 178 | 179 | GUIContent GetTypeName (SerializedProperty property) { 180 | // Cache this string. 181 | string managedReferenceFullTypename = property.managedReferenceFullTypename; 182 | 183 | if (string.IsNullOrEmpty(managedReferenceFullTypename)) { 184 | return k_NullDisplayName; 185 | } 186 | if (m_TypeNameCaches.TryGetValue(managedReferenceFullTypename,out GUIContent cachedTypeName)) { 187 | return cachedTypeName; 188 | } 189 | 190 | Type type = ManagedReferenceUtility.GetType(managedReferenceFullTypename); 191 | string typeName = null; 192 | 193 | AddTypeMenuAttribute typeMenu = TypeMenuUtility.GetAttribute(type); 194 | if (typeMenu != null) { 195 | typeName = typeMenu.GetTypeNameWithoutPath(); 196 | if (!string.IsNullOrWhiteSpace(typeName)) { 197 | typeName = ObjectNames.NicifyVariableName(typeName); 198 | } 199 | } 200 | 201 | if (string.IsNullOrWhiteSpace(typeName)) { 202 | typeName = ObjectNames.NicifyVariableName(type.Name); 203 | } 204 | 205 | GUIContent result = new GUIContent(typeName); 206 | m_TypeNameCaches.Add(managedReferenceFullTypename,result); 207 | return result; 208 | } 209 | 210 | public override float GetPropertyHeight (SerializedProperty property,GUIContent label) { 211 | PropertyDrawer customDrawer = GetCustomPropertyDrawer(property); 212 | if (customDrawer != null) 213 | { 214 | return property.isExpanded ? EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing + customDrawer.GetPropertyHeight(property,label):EditorGUIUtility.singleLineHeight; 215 | } 216 | else 217 | { 218 | return property.isExpanded ? EditorGUI.GetPropertyHeight(property,true) : EditorGUIUtility.singleLineHeight; 219 | } 220 | } 221 | 222 | } 223 | } 224 | -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Editor/SubclassSelectorDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 976888d4f5359f94d8c5417f313acf29 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Editor/TypeMenuUtility.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Collections.Generic; 4 | using UnityEditor; 5 | 6 | namespace MackySoft.SerializeReferenceExtensions.Editor 7 | { 8 | public static class TypeMenuUtility { 9 | 10 | public const string k_NullDisplayName = ""; 11 | 12 | public static AddTypeMenuAttribute GetAttribute (Type type) { 13 | return Attribute.GetCustomAttribute(type,typeof(AddTypeMenuAttribute)) as AddTypeMenuAttribute; 14 | } 15 | 16 | public static string[] GetSplittedTypePath (Type type) { 17 | AddTypeMenuAttribute typeMenu = GetAttribute(type); 18 | if (typeMenu != null) { 19 | return typeMenu.GetSplittedMenuName(); 20 | } else { 21 | int splitIndex = type.FullName.LastIndexOf('.'); 22 | if (splitIndex >= 0) { 23 | return new string[] { type.FullName.Substring(0,splitIndex),type.FullName.Substring(splitIndex + 1) }; 24 | } else { 25 | return new string[] { type.Name }; 26 | } 27 | } 28 | } 29 | 30 | public static IEnumerable OrderByType (this IEnumerable source) { 31 | return source.OrderBy(type => { 32 | if (type == null) { 33 | return -999; 34 | } 35 | return GetAttribute(type)?.Order ?? 0; 36 | }).ThenBy(type => { 37 | if (type == null) { 38 | return null; 39 | } 40 | return GetAttribute(type)?.MenuName ?? type.Name; 41 | }); 42 | } 43 | 44 | } 45 | } -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Editor/TypeMenuUtility.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e692b945af3941745a7004b5b25c5f3b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Editor/TypeSearch.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Collections.Generic; 4 | using UnityEditor; 5 | using System.Reflection; 6 | 7 | namespace MackySoft.SerializeReferenceExtensions.Editor 8 | { 9 | public static class TypeSearch 10 | { 11 | 12 | #if UNITY_2023_2_OR_NEWER 13 | static readonly Dictionary> m_TypeCache = new Dictionary>(); 14 | #endif 15 | 16 | public static IEnumerable GetTypes (Type baseType) 17 | { 18 | #if UNITY_2023_2_OR_NEWER 19 | // NOTE: This is a generics solution for Unity 2023.2 and later. 20 | // 2023.2 because SerializeReference supports generic type instances and because the behaviour is stable. 21 | if (baseType.IsGenericType) 22 | { 23 | return GetTypesWithGeneric(baseType); 24 | } 25 | else 26 | { 27 | return GetTypesUsingTypeCache(baseType); 28 | } 29 | #else 30 | return GetTypesUsingTypeCache(baseType); 31 | #endif 32 | } 33 | 34 | static IEnumerable GetTypesUsingTypeCache (Type baseType) 35 | { 36 | return TypeCache.GetTypesDerivedFrom(baseType) 37 | .Append(baseType) 38 | .Where(IsValidType); 39 | } 40 | 41 | #if UNITY_2023_2_OR_NEWER 42 | static IEnumerable GetTypesWithGeneric (Type baseType) 43 | { 44 | if (m_TypeCache.TryGetValue(baseType, out List result)) 45 | { 46 | return result; 47 | } 48 | 49 | result = new List(); 50 | Type genericTypeDefinition = null; 51 | Type[] targetTypeArguments = null; 52 | Type[] genericTypeParameters = null; 53 | 54 | if (baseType.IsGenericType) 55 | { 56 | genericTypeDefinition = baseType.GetGenericTypeDefinition(); 57 | targetTypeArguments = baseType.GetGenericArguments(); 58 | genericTypeParameters = genericTypeDefinition.GetGenericArguments(); 59 | } 60 | else 61 | { 62 | genericTypeDefinition = baseType; 63 | targetTypeArguments = Type.EmptyTypes; 64 | genericTypeParameters = Type.EmptyTypes; 65 | } 66 | 67 | IEnumerable types = AppDomain.CurrentDomain.GetAssemblies() 68 | .SelectMany(x => x.GetTypes()) 69 | .Where(IsValidType); 70 | 71 | foreach (Type type in types) 72 | { 73 | Type[] interfaceTypes = type.GetInterfaces(); 74 | foreach (Type interfaceType in interfaceTypes) 75 | { 76 | if (!interfaceType.IsGenericType || interfaceType.GetGenericTypeDefinition() != genericTypeDefinition) 77 | { 78 | continue; 79 | } 80 | 81 | Type[] sourceTypeArguments = interfaceType.GetGenericArguments(); 82 | 83 | bool allParametersMatch = true; 84 | 85 | for (int i = 0; i < genericTypeParameters.Length; i++) 86 | { 87 | var variance = genericTypeParameters[i].GenericParameterAttributes & GenericParameterAttributes.VarianceMask; 88 | 89 | Type sourceTypeArgument = sourceTypeArguments[i]; 90 | Type targetTypeArgument = targetTypeArguments[i]; 91 | 92 | if (variance == GenericParameterAttributes.Contravariant) 93 | { 94 | if (!sourceTypeArgument.IsAssignableFrom(targetTypeArgument)) 95 | { 96 | allParametersMatch = false; 97 | break; 98 | } 99 | } 100 | else if (variance == GenericParameterAttributes.Covariant) 101 | { 102 | if (!targetTypeArgument.IsAssignableFrom(sourceTypeArgument)) 103 | { 104 | allParametersMatch = false; 105 | break; 106 | } 107 | } 108 | else 109 | { 110 | if (sourceTypeArgument != targetTypeArgument) 111 | { 112 | allParametersMatch = false; 113 | break; 114 | } 115 | } 116 | } 117 | 118 | if (allParametersMatch) 119 | { 120 | result.Add(type); 121 | break; 122 | } 123 | } 124 | } 125 | 126 | m_TypeCache.Add(baseType, result); 127 | return result; 128 | } 129 | #endif 130 | 131 | static bool IsValidType (Type type) 132 | { 133 | return 134 | (type.IsPublic || type.IsNestedPublic || type.IsNestedPrivate) && 135 | !type.IsAbstract && 136 | !type.IsGenericType && 137 | !typeof(UnityEngine.Object).IsAssignableFrom(type) && 138 | Attribute.IsDefined(type, typeof(SerializableAttribute)) && 139 | !Attribute.IsDefined(type, typeof(HideInTypeMenuAttribute)); 140 | } 141 | } 142 | } -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Editor/TypeSearch.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5ea24172520aa2646954c1d246e7ba5d -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Runtime.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 22951adae52ad9b459b1e39c626ef8b5 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Runtime/AddTypeMenuAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | /// 4 | /// An attribute that overrides the name of the type displayed in the SubclassSelector popup. 5 | /// 6 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Interface,AllowMultiple = false,Inherited = false)] 7 | public sealed class AddTypeMenuAttribute : Attribute { 8 | 9 | public string MenuName { get; } 10 | 11 | public int Order { get; } 12 | 13 | public AddTypeMenuAttribute (string menuName,int order = 0) { 14 | MenuName = menuName; 15 | Order = order; 16 | } 17 | 18 | static readonly char[] k_Separeters = new char[] { '/' }; 19 | 20 | /// 21 | /// Returns the menu name split by the '/' separator. 22 | /// 23 | public string[] GetSplittedMenuName () { 24 | return !string.IsNullOrWhiteSpace(MenuName) ? MenuName.Split(k_Separeters,StringSplitOptions.RemoveEmptyEntries) : Array.Empty(); 25 | } 26 | 27 | /// 28 | /// Returns the display name without the path. 29 | /// 30 | public string GetTypeNameWithoutPath () { 31 | string[] splittedDisplayName = GetSplittedMenuName(); 32 | return (splittedDisplayName.Length != 0) ? splittedDisplayName[splittedDisplayName.Length - 1] : null; 33 | } 34 | 35 | } -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Runtime/AddTypeMenuAttribute.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 679eba7e17def6847b382e7656079b5f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Runtime/HideInTypeMenuAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | /// 4 | /// An attribute that hides the type in the SubclassSelector. 5 | /// 6 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Interface, AllowMultiple = false, Inherited = false)] 7 | public sealed class HideInTypeMenuAttribute : Attribute { 8 | 9 | } -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Runtime/HideInTypeMenuAttribute.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9f48f5d86a108b94a9c26381f5ce678c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Runtime/MackySoft.SerializeReferenceExtensions.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "MackySoft.SerializeReferenceExtensions", 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 | } -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Runtime/MackySoft.SerializeReferenceExtensions.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 49b49c76ee64f6b41bf28ef951cb0e50 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Runtime/SubclassSelectorAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | /// 5 | /// Attribute to specify the type of the field serialized by the SerializeReference attribute in the inspector. 6 | /// 7 | [AttributeUsage(AttributeTargets.Field, AllowMultiple = false)] 8 | public sealed class SubclassSelectorAttribute : PropertyAttribute 9 | { 10 | 11 | #if UNITY_2021_3_OR_NEWER 12 | // NOTE: Use managedReferenceValue getter to invoke instance method in SubclassSelectorDrawer. 13 | public bool UseToStringAsLabel { get; set; } 14 | #endif 15 | 16 | } -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Runtime/SubclassSelectorAttribute.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3addd6c6c68d9d74185d9dce466fa9af 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Samples~/GetStarted.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9db229195025447418ba34a8323eda5a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Samples~/GetStarted/GetStarted.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_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &3 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 12 47 | m_GIWorkflowMode: 1 48 | m_GISettings: 49 | serializedVersion: 2 50 | m_BounceScale: 1 51 | m_IndirectOutputScale: 1 52 | m_AlbedoBoost: 1 53 | m_EnvironmentLightingMode: 0 54 | m_EnableBakedLightmaps: 1 55 | m_EnableRealtimeLightmaps: 0 56 | m_LightmapEditorSettings: 57 | serializedVersion: 12 58 | m_Resolution: 2 59 | m_BakeResolution: 40 60 | m_AtlasSize: 1024 61 | m_AO: 0 62 | m_AOMaxDistance: 1 63 | m_CompAOExponent: 1 64 | m_CompAOExponentDirect: 0 65 | m_ExtractAmbientOcclusion: 0 66 | m_Padding: 2 67 | m_LightmapParameters: {fileID: 0} 68 | m_LightmapsBakeMode: 1 69 | m_TextureCompression: 1 70 | m_FinalGather: 0 71 | m_FinalGatherFiltering: 1 72 | m_FinalGatherRayCount: 256 73 | m_ReflectionCompression: 2 74 | m_MixedBakeMode: 2 75 | m_BakeBackend: 1 76 | m_PVRSampling: 1 77 | m_PVRDirectSampleCount: 32 78 | m_PVRSampleCount: 512 79 | m_PVRBounces: 2 80 | m_PVREnvironmentSampleCount: 256 81 | m_PVREnvironmentReferencePointCount: 2048 82 | m_PVRFilteringMode: 1 83 | m_PVRDenoiserTypeDirect: 1 84 | m_PVRDenoiserTypeIndirect: 1 85 | m_PVRDenoiserTypeAO: 1 86 | m_PVRFilterTypeDirect: 0 87 | m_PVRFilterTypeIndirect: 0 88 | m_PVRFilterTypeAO: 0 89 | m_PVREnvironmentMIS: 1 90 | m_PVRCulling: 1 91 | m_PVRFilteringGaussRadiusDirect: 1 92 | m_PVRFilteringGaussRadiusIndirect: 5 93 | m_PVRFilteringGaussRadiusAO: 2 94 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 95 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 96 | m_PVRFilteringAtrousPositionSigmaAO: 1 97 | m_ExportTrainingData: 0 98 | m_TrainingDataDestination: TrainingData 99 | m_LightProbeSampleCountMultiplier: 4 100 | m_LightingDataAsset: {fileID: 0} 101 | m_LightingSettings: {fileID: 0} 102 | --- !u!196 &4 103 | NavMeshSettings: 104 | serializedVersion: 2 105 | m_ObjectHideFlags: 0 106 | m_BuildSettings: 107 | serializedVersion: 2 108 | agentTypeID: 0 109 | agentRadius: 0.5 110 | agentHeight: 2 111 | agentSlope: 45 112 | agentClimb: 0.4 113 | ledgeDropHeight: 0 114 | maxJumpAcrossDistance: 0 115 | minRegionArea: 2 116 | manualCellSize: 0 117 | cellSize: 0.16666667 118 | manualTileSize: 0 119 | tileSize: 256 120 | accuratePlacement: 0 121 | maxJobWorkers: 0 122 | preserveTilesOutsideBounds: 0 123 | debug: 124 | m_Flags: 0 125 | m_NavMeshData: {fileID: 0} 126 | --- !u!1 &569630748 127 | GameObject: 128 | m_ObjectHideFlags: 0 129 | m_CorrespondingSourceObject: {fileID: 0} 130 | m_PrefabInstance: {fileID: 0} 131 | m_PrefabAsset: {fileID: 0} 132 | serializedVersion: 6 133 | m_Component: 134 | - component: {fileID: 569630751} 135 | - component: {fileID: 569630750} 136 | - component: {fileID: 569630749} 137 | m_Layer: 0 138 | m_Name: Main Camera 139 | m_TagString: MainCamera 140 | m_Icon: {fileID: 0} 141 | m_NavMeshLayer: 0 142 | m_StaticEditorFlags: 0 143 | m_IsActive: 1 144 | --- !u!81 &569630749 145 | AudioListener: 146 | m_ObjectHideFlags: 0 147 | m_CorrespondingSourceObject: {fileID: 0} 148 | m_PrefabInstance: {fileID: 0} 149 | m_PrefabAsset: {fileID: 0} 150 | m_GameObject: {fileID: 569630748} 151 | m_Enabled: 1 152 | --- !u!20 &569630750 153 | Camera: 154 | m_ObjectHideFlags: 0 155 | m_CorrespondingSourceObject: {fileID: 0} 156 | m_PrefabInstance: {fileID: 0} 157 | m_PrefabAsset: {fileID: 0} 158 | m_GameObject: {fileID: 569630748} 159 | m_Enabled: 1 160 | serializedVersion: 2 161 | m_ClearFlags: 1 162 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} 163 | m_projectionMatrixMode: 1 164 | m_GateFitMode: 2 165 | m_FOVAxisMode: 0 166 | m_SensorSize: {x: 36, y: 24} 167 | m_LensShift: {x: 0, y: 0} 168 | m_FocalLength: 50 169 | m_NormalizedViewPortRect: 170 | serializedVersion: 2 171 | x: 0 172 | y: 0 173 | width: 1 174 | height: 1 175 | near clip plane: 0.3 176 | far clip plane: 1000 177 | field of view: 60 178 | orthographic: 0 179 | orthographic size: 5 180 | m_Depth: -1 181 | m_CullingMask: 182 | serializedVersion: 2 183 | m_Bits: 4294967295 184 | m_RenderingPath: -1 185 | m_TargetTexture: {fileID: 0} 186 | m_TargetDisplay: 0 187 | m_TargetEye: 3 188 | m_HDR: 1 189 | m_AllowMSAA: 1 190 | m_AllowDynamicResolution: 0 191 | m_ForceIntoRT: 0 192 | m_OcclusionCulling: 1 193 | m_StereoConvergence: 10 194 | m_StereoSeparation: 0.022 195 | --- !u!4 &569630751 196 | Transform: 197 | m_ObjectHideFlags: 0 198 | m_CorrespondingSourceObject: {fileID: 0} 199 | m_PrefabInstance: {fileID: 0} 200 | m_PrefabAsset: {fileID: 0} 201 | m_GameObject: {fileID: 569630748} 202 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 203 | m_LocalPosition: {x: 0, y: 1, z: -10} 204 | m_LocalScale: {x: 1, y: 1, z: 1} 205 | m_Children: [] 206 | m_Father: {fileID: 0} 207 | m_RootOrder: 0 208 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 209 | --- !u!1 &774496582 210 | GameObject: 211 | m_ObjectHideFlags: 0 212 | m_CorrespondingSourceObject: {fileID: 0} 213 | m_PrefabInstance: {fileID: 0} 214 | m_PrefabAsset: {fileID: 0} 215 | serializedVersion: 6 216 | m_Component: 217 | - component: {fileID: 774496584} 218 | - component: {fileID: 774496583} 219 | m_Layer: 0 220 | m_Name: Example 221 | m_TagString: Untagged 222 | m_Icon: {fileID: 0} 223 | m_NavMeshLayer: 0 224 | m_StaticEditorFlags: 0 225 | m_IsActive: 1 226 | --- !u!114 &774496583 227 | MonoBehaviour: 228 | m_ObjectHideFlags: 0 229 | m_CorrespondingSourceObject: {fileID: 0} 230 | m_PrefabInstance: {fileID: 0} 231 | m_PrefabAsset: {fileID: 0} 232 | m_GameObject: {fileID: 774496582} 233 | m_Enabled: 1 234 | m_EditorHideFlags: 0 235 | m_Script: {fileID: 11500000, guid: 2b84d01d3056a974585aa0791b5434f7, type: 3} 236 | m_Name: 237 | m_EditorClassIdentifier: 238 | m_Command: 239 | id: 0 240 | m_Commands: 241 | - id: 1 242 | - id: 2 243 | - id: 3 244 | - id: 4 245 | references: 246 | version: 1 247 | 00000000: 248 | type: {class: DebugCommand, ns: MackySoft.SerializeReferenceExtensions.Example, asm: MackySoft.SerializeReferenceExtensions.Example.GetStarted} 249 | data: 250 | m_Message: Hello world 251 | 00000001: 252 | type: {class: InstantiateCommand, ns: MackySoft.SerializeReferenceExtensions.Example, asm: MackySoft.SerializeReferenceExtensions.Example.GetStarted} 253 | data: 254 | m_Prefab: {fileID: 111724559944437223, guid: 4f11d1aa1b8a3114a96570cafa19d7c6, type: 3} 255 | 00000002: 256 | type: {class: AddTypeMenuCommand, ns: MackySoft.SerializeReferenceExtensions.Example, asm: MackySoft.SerializeReferenceExtensions.Example.GetStarted} 257 | 00000003: 258 | type: {class: Example/NestedCommand, ns: MackySoft.SerializeReferenceExtensions.Example, asm: MackySoft.SerializeReferenceExtensions.Example.GetStarted} 259 | 00000004: 260 | type: {class: StructCommand, ns: MackySoft.SerializeReferenceExtensions.Example, asm: MackySoft.SerializeReferenceExtensions.Example.GetStarted} 261 | --- !u!4 &774496584 262 | Transform: 263 | m_ObjectHideFlags: 0 264 | m_CorrespondingSourceObject: {fileID: 0} 265 | m_PrefabInstance: {fileID: 0} 266 | m_PrefabAsset: {fileID: 0} 267 | m_GameObject: {fileID: 774496582} 268 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 269 | m_LocalPosition: {x: 0, y: 0, z: 0} 270 | m_LocalScale: {x: 1, y: 1, z: 1} 271 | m_Children: [] 272 | m_Father: {fileID: 0} 273 | m_RootOrder: 2 274 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 275 | --- !u!1 &975868111 276 | GameObject: 277 | m_ObjectHideFlags: 0 278 | m_CorrespondingSourceObject: {fileID: 0} 279 | m_PrefabInstance: {fileID: 0} 280 | m_PrefabAsset: {fileID: 0} 281 | serializedVersion: 6 282 | m_Component: 283 | - component: {fileID: 975868113} 284 | - component: {fileID: 975868112} 285 | m_Layer: 0 286 | m_Name: Directional Light 287 | m_TagString: Untagged 288 | m_Icon: {fileID: 0} 289 | m_NavMeshLayer: 0 290 | m_StaticEditorFlags: 0 291 | m_IsActive: 1 292 | --- !u!108 &975868112 293 | Light: 294 | m_ObjectHideFlags: 0 295 | m_CorrespondingSourceObject: {fileID: 0} 296 | m_PrefabInstance: {fileID: 0} 297 | m_PrefabAsset: {fileID: 0} 298 | m_GameObject: {fileID: 975868111} 299 | m_Enabled: 1 300 | serializedVersion: 10 301 | m_Type: 1 302 | m_Shape: 0 303 | m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} 304 | m_Intensity: 1 305 | m_Range: 10 306 | m_SpotAngle: 30 307 | m_InnerSpotAngle: 21.80208 308 | m_CookieSize: 10 309 | m_Shadows: 310 | m_Type: 2 311 | m_Resolution: -1 312 | m_CustomResolution: -1 313 | m_Strength: 1 314 | m_Bias: 0.05 315 | m_NormalBias: 0.4 316 | m_NearPlane: 0.2 317 | m_CullingMatrixOverride: 318 | e00: 1 319 | e01: 0 320 | e02: 0 321 | e03: 0 322 | e10: 0 323 | e11: 1 324 | e12: 0 325 | e13: 0 326 | e20: 0 327 | e21: 0 328 | e22: 1 329 | e23: 0 330 | e30: 0 331 | e31: 0 332 | e32: 0 333 | e33: 1 334 | m_UseCullingMatrixOverride: 0 335 | m_Cookie: {fileID: 0} 336 | m_DrawHalo: 0 337 | m_Flare: {fileID: 0} 338 | m_RenderMode: 0 339 | m_CullingMask: 340 | serializedVersion: 2 341 | m_Bits: 4294967295 342 | m_RenderingLayerMask: 1 343 | m_Lightmapping: 4 344 | m_LightShadowCasterMode: 0 345 | m_AreaSize: {x: 1, y: 1} 346 | m_BounceIntensity: 1 347 | m_ColorTemperature: 6570 348 | m_UseColorTemperature: 0 349 | m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} 350 | m_UseBoundingSphereOverride: 0 351 | m_UseViewFrustumForShadowCasterCull: 1 352 | m_ShadowRadius: 0 353 | m_ShadowAngle: 0 354 | --- !u!4 &975868113 355 | Transform: 356 | m_ObjectHideFlags: 0 357 | m_CorrespondingSourceObject: {fileID: 0} 358 | m_PrefabInstance: {fileID: 0} 359 | m_PrefabAsset: {fileID: 0} 360 | m_GameObject: {fileID: 975868111} 361 | m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} 362 | m_LocalPosition: {x: 0, y: 3, z: 0} 363 | m_LocalScale: {x: 1, y: 1, z: 1} 364 | m_Children: [] 365 | m_Father: {fileID: 0} 366 | m_RootOrder: 1 367 | m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} 368 | -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Samples~/GetStarted/GetStarted.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: caa2e2321fb56dd4d9ffe9d2eb4c9d40 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Samples~/GetStarted/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aff237c0fdbbd154fabb42e71af33595 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Samples~/GetStarted/Prefabs/Cube.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &111724559944437223 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 7844039312731577035} 12 | - component: {fileID: 7033977310718730041} 13 | - component: {fileID: 173357017671563023} 14 | - component: {fileID: 980438190118507531} 15 | m_Layer: 0 16 | m_Name: Cube 17 | m_TagString: Untagged 18 | m_Icon: {fileID: 0} 19 | m_NavMeshLayer: 0 20 | m_StaticEditorFlags: 0 21 | m_IsActive: 1 22 | --- !u!4 &7844039312731577035 23 | Transform: 24 | m_ObjectHideFlags: 0 25 | m_CorrespondingSourceObject: {fileID: 0} 26 | m_PrefabInstance: {fileID: 0} 27 | m_PrefabAsset: {fileID: 0} 28 | m_GameObject: {fileID: 111724559944437223} 29 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 30 | m_LocalPosition: {x: 0, y: 0, z: 0} 31 | m_LocalScale: {x: 1, y: 1, z: 1} 32 | m_Children: [] 33 | m_Father: {fileID: 0} 34 | m_RootOrder: 0 35 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 36 | --- !u!33 &7033977310718730041 37 | MeshFilter: 38 | m_ObjectHideFlags: 0 39 | m_CorrespondingSourceObject: {fileID: 0} 40 | m_PrefabInstance: {fileID: 0} 41 | m_PrefabAsset: {fileID: 0} 42 | m_GameObject: {fileID: 111724559944437223} 43 | m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} 44 | --- !u!23 &173357017671563023 45 | MeshRenderer: 46 | m_ObjectHideFlags: 0 47 | m_CorrespondingSourceObject: {fileID: 0} 48 | m_PrefabInstance: {fileID: 0} 49 | m_PrefabAsset: {fileID: 0} 50 | m_GameObject: {fileID: 111724559944437223} 51 | m_Enabled: 1 52 | m_CastShadows: 1 53 | m_ReceiveShadows: 1 54 | m_DynamicOccludee: 1 55 | m_MotionVectors: 1 56 | m_LightProbeUsage: 1 57 | m_ReflectionProbeUsage: 1 58 | m_RayTracingMode: 2 59 | m_RayTraceProcedural: 0 60 | m_RenderingLayerMask: 1 61 | m_RendererPriority: 0 62 | m_Materials: 63 | - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} 64 | m_StaticBatchInfo: 65 | firstSubMesh: 0 66 | subMeshCount: 0 67 | m_StaticBatchRoot: {fileID: 0} 68 | m_ProbeAnchor: {fileID: 0} 69 | m_LightProbeVolumeOverride: {fileID: 0} 70 | m_ScaleInLightmap: 1 71 | m_ReceiveGI: 1 72 | m_PreserveUVs: 0 73 | m_IgnoreNormalsForChartDetection: 0 74 | m_ImportantGI: 0 75 | m_StitchLightmapSeams: 1 76 | m_SelectedEditorRenderState: 3 77 | m_MinimumChartSize: 4 78 | m_AutoUVMaxDistance: 0.5 79 | m_AutoUVMaxAngle: 89 80 | m_LightmapParameters: {fileID: 0} 81 | m_SortingLayerID: 0 82 | m_SortingLayer: 0 83 | m_SortingOrder: 0 84 | m_AdditionalVertexStreams: {fileID: 0} 85 | --- !u!65 &980438190118507531 86 | BoxCollider: 87 | m_ObjectHideFlags: 0 88 | m_CorrespondingSourceObject: {fileID: 0} 89 | m_PrefabInstance: {fileID: 0} 90 | m_PrefabAsset: {fileID: 0} 91 | m_GameObject: {fileID: 111724559944437223} 92 | m_Material: {fileID: 0} 93 | m_IsTrigger: 0 94 | m_Enabled: 1 95 | serializedVersion: 2 96 | m_Size: {x: 1, y: 1, z: 1} 97 | m_Center: {x: 0, y: 0, z: 0} 98 | -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Samples~/GetStarted/Prefabs/Cube.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4f11d1aa1b8a3114a96570cafa19d7c6 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Samples~/GetStarted/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 51fab0f576d5ab94d83f0992b42b5b7c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Samples~/GetStarted/Scripts/Runtime.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4e0addacfe5c5744faea3f1a2db541d6 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Samples~/GetStarted/Scripts/Runtime/Example.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_2019_3_OR_NEWER 2 | 3 | #pragma warning disable CA1034 // Nested types should not be visible 4 | #pragma warning disable CA2235 // Mark all non-serializable fields 5 | 6 | using System; 7 | using UnityEngine; 8 | 9 | namespace MackySoft.SerializeReferenceExtensions.Example { 10 | 11 | public class Example : MonoBehaviour { 12 | 13 | // The type that implements ICommand will be displayed in the popup. 14 | [SerializeReference, SubclassSelector] 15 | ICommand m_Command; 16 | 17 | // Collection support 18 | [SerializeReference, SubclassSelector] 19 | ICommand[] m_Commands = Array.Empty(); 20 | 21 | void Start () { 22 | m_Command?.Execute(); 23 | 24 | foreach (ICommand command in m_Commands) { 25 | command?.Execute(); 26 | } 27 | } 28 | 29 | // Nested type support 30 | [Serializable] 31 | public class NestedCommand : ICommand { 32 | public void Execute () { 33 | Debug.Log("Execute NestedCommand"); 34 | } 35 | } 36 | 37 | } 38 | 39 | public interface ICommand { 40 | void Execute (); 41 | } 42 | 43 | [Serializable] 44 | public class DebugCommand : ICommand { 45 | [SerializeField] 46 | string m_Message; 47 | public void Execute () { 48 | Debug.Log(m_Message); 49 | } 50 | } 51 | 52 | [Serializable] 53 | public class InstantiateCommand : ICommand { 54 | 55 | [SerializeField] 56 | GameObject m_Prefab; 57 | 58 | public void Execute () { 59 | UnityEngine.Object.Instantiate(m_Prefab,Vector3.zero,Quaternion.identity); 60 | } 61 | } 62 | 63 | // Menu override support 64 | [AddTypeMenu("Example/Add Type Menu Command")] 65 | [Serializable] 66 | public class AddTypeMenuCommand : ICommand { 67 | public void Execute () { 68 | Debug.Log("Execute AddTypeMenuCommand"); 69 | } 70 | } 71 | 72 | [Serializable] 73 | public struct StructCommand : ICommand { 74 | public void Execute () { 75 | Debug.Log("Execute StructCommand"); 76 | } 77 | } 78 | 79 | } 80 | #endif -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Samples~/GetStarted/Scripts/Runtime/Example.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2b84d01d3056a974585aa0791b5434f7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Samples~/GetStarted/Scripts/Runtime/MackySoft.SerializeReferenceExtensions.Example.GetStarted.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "MackySoft.SerializeReferenceExtensions.Example.GetStarted", 3 | "rootNamespace": "", 4 | "references": [ 5 | "GUID:49b49c76ee64f6b41bf28ef951cb0e50" 6 | ], 7 | "includePlatforms": [], 8 | "excludePlatforms": [], 9 | "allowUnsafeCode": false, 10 | "overrideReferences": false, 11 | "precompiledReferences": [], 12 | "autoReferenced": true, 13 | "defineConstraints": [ 14 | "UNITY_2019_3_OR_NEWER" 15 | ], 16 | "versionDefines": [], 17 | "noEngineReferences": false 18 | } -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Samples~/GetStarted/Scripts/Runtime/MackySoft.SerializeReferenceExtensions.Example.GetStarted.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f61e449ae64e31243b5fc7a70dc8391a 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.mackysoft.serializereference-extensions", 3 | "displayName": "SerializeReference Extensions", 4 | "author": { "name": "MackySoft", "url": "https://github.com/mackysoft" }, 5 | "version": "1.6.1", 6 | "unity": "2021.3", 7 | "description": "Provide popup to specify the type of the field serialized by the [SerializeReference] attribute in the inspector.", 8 | "keywords": [ "SerializeReference", "Editor" ], 9 | "license": "MIT", 10 | "dependencies": {}, 11 | "samples": [ 12 | { 13 | "displayName": "Get Started", 14 | "description": "", 15 | "path": "Samples~/GetStarted" 16 | } 17 | ] 18 | } -------------------------------------------------------------------------------- /Assets/MackySoft/MackySoft.SerializeReferenceExtensions/package.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eda2c3e2d06229b4bb2c21d541f92f49 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/PackageTools.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5bddc361c940411409071c6fcf515202 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/PackageTools/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dcc1148481889924d91760737bcc6516 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/PackageTools/Editor/UnityPackageExporter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Linq; 3 | using UnityEngine; 4 | using UnityEditor; 5 | 6 | namespace MackySoft.PackageTools.Editor { 7 | 8 | public static class UnityPackageExporter { 9 | 10 | // The name of the unitypackage to output. 11 | const string k_PackageName = "SerializeReference-Extensions"; 12 | 13 | // The path to the package under the `Assets/` folder. 14 | const string k_PackagePath = "MackySoft"; 15 | 16 | // Path to export to. 17 | const string k_ExportPath = "Build"; 18 | 19 | const string k_SearchPattern = "*"; 20 | const string k_PackageToolsFolderName = "PackageTools"; 21 | const string k_ResourcesFolderName = "Resources"; 22 | 23 | [MenuItem("Tools/SerializeReference Extensions/Export Package")] 24 | public static void Export () { 25 | ExportPackage($"{k_ExportPath}/{k_PackageName}.unitypackage"); 26 | } 27 | 28 | 29 | public static string ExportPackage (string exportPath) { 30 | // Ensure export path. 31 | var dir = new FileInfo(exportPath).Directory; 32 | if (dir != null && !dir.Exists) { 33 | dir.Create(); 34 | } 35 | 36 | // Export 37 | AssetDatabase.ExportPackage( 38 | GetAssetPaths(), 39 | exportPath, 40 | ExportPackageOptions.Default 41 | ); 42 | 43 | return Path.GetFullPath(exportPath); 44 | } 45 | 46 | public static string[] GetAssetPaths () { 47 | var path = Path.Combine(Application.dataPath,k_PackagePath); 48 | var assets = Directory.EnumerateFiles(path,k_SearchPattern,SearchOption.AllDirectories) 49 | .Where(x => !x.Contains(k_PackageToolsFolderName) && !x.Contains(k_ResourcesFolderName)) 50 | .Select(x => "Assets" + x.Replace(Application.dataPath,"").Replace(@"\","/")) 51 | .ToArray(); 52 | return assets; 53 | } 54 | 55 | } 56 | } -------------------------------------------------------------------------------- /Assets/PackageTools/Editor/UnityPackageExporter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 18e0101a13bd4d541a4622e86ec18b4e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Hiroya Aramaki 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.ide.rider": "3.0.28", 4 | "com.unity.ide.visualstudio": "2.0.22", 5 | "com.unity.ide.vscode": "1.2.5", 6 | "com.unity.test-framework": "1.1.33", 7 | "com.unity.modules.ai": "1.0.0", 8 | "com.unity.modules.androidjni": "1.0.0", 9 | "com.unity.modules.animation": "1.0.0", 10 | "com.unity.modules.assetbundle": "1.0.0", 11 | "com.unity.modules.audio": "1.0.0", 12 | "com.unity.modules.cloth": "1.0.0", 13 | "com.unity.modules.director": "1.0.0", 14 | "com.unity.modules.imageconversion": "1.0.0", 15 | "com.unity.modules.imgui": "1.0.0", 16 | "com.unity.modules.jsonserialize": "1.0.0", 17 | "com.unity.modules.particlesystem": "1.0.0", 18 | "com.unity.modules.physics": "1.0.0", 19 | "com.unity.modules.physics2d": "1.0.0", 20 | "com.unity.modules.screencapture": "1.0.0", 21 | "com.unity.modules.terrain": "1.0.0", 22 | "com.unity.modules.terrainphysics": "1.0.0", 23 | "com.unity.modules.tilemap": "1.0.0", 24 | "com.unity.modules.ui": "1.0.0", 25 | "com.unity.modules.uielements": "1.0.0", 26 | "com.unity.modules.umbra": "1.0.0", 27 | "com.unity.modules.unityanalytics": "1.0.0", 28 | "com.unity.modules.unitywebrequest": "1.0.0", 29 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 30 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 31 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 32 | "com.unity.modules.unitywebrequestwww": "1.0.0", 33 | "com.unity.modules.vehicles": "1.0.0", 34 | "com.unity.modules.video": "1.0.0", 35 | "com.unity.modules.vr": "1.0.0", 36 | "com.unity.modules.wind": "1.0.0", 37 | "com.unity.modules.xr": "1.0.0" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Packages/packages-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.ext.nunit": { 4 | "version": "1.0.6", 5 | "depth": 1, 6 | "source": "registry", 7 | "dependencies": {}, 8 | "url": "https://packages.unity.com" 9 | }, 10 | "com.unity.ide.rider": { 11 | "version": "3.0.28", 12 | "depth": 0, 13 | "source": "registry", 14 | "dependencies": { 15 | "com.unity.ext.nunit": "1.0.6" 16 | }, 17 | "url": "https://packages.unity.com" 18 | }, 19 | "com.unity.ide.visualstudio": { 20 | "version": "2.0.22", 21 | "depth": 0, 22 | "source": "registry", 23 | "dependencies": { 24 | "com.unity.test-framework": "1.1.9" 25 | }, 26 | "url": "https://packages.unity.com" 27 | }, 28 | "com.unity.ide.vscode": { 29 | "version": "1.2.5", 30 | "depth": 0, 31 | "source": "registry", 32 | "dependencies": {}, 33 | "url": "https://packages.unity.com" 34 | }, 35 | "com.unity.test-framework": { 36 | "version": "1.1.33", 37 | "depth": 0, 38 | "source": "registry", 39 | "dependencies": { 40 | "com.unity.ext.nunit": "1.0.6", 41 | "com.unity.modules.imgui": "1.0.0", 42 | "com.unity.modules.jsonserialize": "1.0.0" 43 | }, 44 | "url": "https://packages.unity.com" 45 | }, 46 | "com.unity.modules.ai": { 47 | "version": "1.0.0", 48 | "depth": 0, 49 | "source": "builtin", 50 | "dependencies": {} 51 | }, 52 | "com.unity.modules.androidjni": { 53 | "version": "1.0.0", 54 | "depth": 0, 55 | "source": "builtin", 56 | "dependencies": {} 57 | }, 58 | "com.unity.modules.animation": { 59 | "version": "1.0.0", 60 | "depth": 0, 61 | "source": "builtin", 62 | "dependencies": {} 63 | }, 64 | "com.unity.modules.assetbundle": { 65 | "version": "1.0.0", 66 | "depth": 0, 67 | "source": "builtin", 68 | "dependencies": {} 69 | }, 70 | "com.unity.modules.audio": { 71 | "version": "1.0.0", 72 | "depth": 0, 73 | "source": "builtin", 74 | "dependencies": {} 75 | }, 76 | "com.unity.modules.cloth": { 77 | "version": "1.0.0", 78 | "depth": 0, 79 | "source": "builtin", 80 | "dependencies": { 81 | "com.unity.modules.physics": "1.0.0" 82 | } 83 | }, 84 | "com.unity.modules.director": { 85 | "version": "1.0.0", 86 | "depth": 0, 87 | "source": "builtin", 88 | "dependencies": { 89 | "com.unity.modules.audio": "1.0.0", 90 | "com.unity.modules.animation": "1.0.0" 91 | } 92 | }, 93 | "com.unity.modules.imageconversion": { 94 | "version": "1.0.0", 95 | "depth": 0, 96 | "source": "builtin", 97 | "dependencies": {} 98 | }, 99 | "com.unity.modules.imgui": { 100 | "version": "1.0.0", 101 | "depth": 0, 102 | "source": "builtin", 103 | "dependencies": {} 104 | }, 105 | "com.unity.modules.jsonserialize": { 106 | "version": "1.0.0", 107 | "depth": 0, 108 | "source": "builtin", 109 | "dependencies": {} 110 | }, 111 | "com.unity.modules.particlesystem": { 112 | "version": "1.0.0", 113 | "depth": 0, 114 | "source": "builtin", 115 | "dependencies": {} 116 | }, 117 | "com.unity.modules.physics": { 118 | "version": "1.0.0", 119 | "depth": 0, 120 | "source": "builtin", 121 | "dependencies": {} 122 | }, 123 | "com.unity.modules.physics2d": { 124 | "version": "1.0.0", 125 | "depth": 0, 126 | "source": "builtin", 127 | "dependencies": {} 128 | }, 129 | "com.unity.modules.screencapture": { 130 | "version": "1.0.0", 131 | "depth": 0, 132 | "source": "builtin", 133 | "dependencies": { 134 | "com.unity.modules.imageconversion": "1.0.0" 135 | } 136 | }, 137 | "com.unity.modules.subsystems": { 138 | "version": "1.0.0", 139 | "depth": 1, 140 | "source": "builtin", 141 | "dependencies": { 142 | "com.unity.modules.jsonserialize": "1.0.0" 143 | } 144 | }, 145 | "com.unity.modules.terrain": { 146 | "version": "1.0.0", 147 | "depth": 0, 148 | "source": "builtin", 149 | "dependencies": {} 150 | }, 151 | "com.unity.modules.terrainphysics": { 152 | "version": "1.0.0", 153 | "depth": 0, 154 | "source": "builtin", 155 | "dependencies": { 156 | "com.unity.modules.physics": "1.0.0", 157 | "com.unity.modules.terrain": "1.0.0" 158 | } 159 | }, 160 | "com.unity.modules.tilemap": { 161 | "version": "1.0.0", 162 | "depth": 0, 163 | "source": "builtin", 164 | "dependencies": { 165 | "com.unity.modules.physics2d": "1.0.0" 166 | } 167 | }, 168 | "com.unity.modules.ui": { 169 | "version": "1.0.0", 170 | "depth": 0, 171 | "source": "builtin", 172 | "dependencies": {} 173 | }, 174 | "com.unity.modules.uielements": { 175 | "version": "1.0.0", 176 | "depth": 0, 177 | "source": "builtin", 178 | "dependencies": { 179 | "com.unity.modules.ui": "1.0.0", 180 | "com.unity.modules.imgui": "1.0.0", 181 | "com.unity.modules.jsonserialize": "1.0.0", 182 | "com.unity.modules.uielementsnative": "1.0.0" 183 | } 184 | }, 185 | "com.unity.modules.uielementsnative": { 186 | "version": "1.0.0", 187 | "depth": 1, 188 | "source": "builtin", 189 | "dependencies": { 190 | "com.unity.modules.ui": "1.0.0", 191 | "com.unity.modules.imgui": "1.0.0", 192 | "com.unity.modules.jsonserialize": "1.0.0" 193 | } 194 | }, 195 | "com.unity.modules.umbra": { 196 | "version": "1.0.0", 197 | "depth": 0, 198 | "source": "builtin", 199 | "dependencies": {} 200 | }, 201 | "com.unity.modules.unityanalytics": { 202 | "version": "1.0.0", 203 | "depth": 0, 204 | "source": "builtin", 205 | "dependencies": { 206 | "com.unity.modules.unitywebrequest": "1.0.0", 207 | "com.unity.modules.jsonserialize": "1.0.0" 208 | } 209 | }, 210 | "com.unity.modules.unitywebrequest": { 211 | "version": "1.0.0", 212 | "depth": 0, 213 | "source": "builtin", 214 | "dependencies": {} 215 | }, 216 | "com.unity.modules.unitywebrequestassetbundle": { 217 | "version": "1.0.0", 218 | "depth": 0, 219 | "source": "builtin", 220 | "dependencies": { 221 | "com.unity.modules.assetbundle": "1.0.0", 222 | "com.unity.modules.unitywebrequest": "1.0.0" 223 | } 224 | }, 225 | "com.unity.modules.unitywebrequestaudio": { 226 | "version": "1.0.0", 227 | "depth": 0, 228 | "source": "builtin", 229 | "dependencies": { 230 | "com.unity.modules.unitywebrequest": "1.0.0", 231 | "com.unity.modules.audio": "1.0.0" 232 | } 233 | }, 234 | "com.unity.modules.unitywebrequesttexture": { 235 | "version": "1.0.0", 236 | "depth": 0, 237 | "source": "builtin", 238 | "dependencies": { 239 | "com.unity.modules.unitywebrequest": "1.0.0", 240 | "com.unity.modules.imageconversion": "1.0.0" 241 | } 242 | }, 243 | "com.unity.modules.unitywebrequestwww": { 244 | "version": "1.0.0", 245 | "depth": 0, 246 | "source": "builtin", 247 | "dependencies": { 248 | "com.unity.modules.unitywebrequest": "1.0.0", 249 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 250 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 251 | "com.unity.modules.audio": "1.0.0", 252 | "com.unity.modules.assetbundle": "1.0.0", 253 | "com.unity.modules.imageconversion": "1.0.0" 254 | } 255 | }, 256 | "com.unity.modules.vehicles": { 257 | "version": "1.0.0", 258 | "depth": 0, 259 | "source": "builtin", 260 | "dependencies": { 261 | "com.unity.modules.physics": "1.0.0" 262 | } 263 | }, 264 | "com.unity.modules.video": { 265 | "version": "1.0.0", 266 | "depth": 0, 267 | "source": "builtin", 268 | "dependencies": { 269 | "com.unity.modules.audio": "1.0.0", 270 | "com.unity.modules.ui": "1.0.0", 271 | "com.unity.modules.unitywebrequest": "1.0.0" 272 | } 273 | }, 274 | "com.unity.modules.vr": { 275 | "version": "1.0.0", 276 | "depth": 0, 277 | "source": "builtin", 278 | "dependencies": { 279 | "com.unity.modules.jsonserialize": "1.0.0", 280 | "com.unity.modules.physics": "1.0.0", 281 | "com.unity.modules.xr": "1.0.0" 282 | } 283 | }, 284 | "com.unity.modules.wind": { 285 | "version": "1.0.0", 286 | "depth": 0, 287 | "source": "builtin", 288 | "dependencies": {} 289 | }, 290 | "com.unity.modules.xr": { 291 | "version": "1.0.0", 292 | "depth": 0, 293 | "source": "builtin", 294 | "dependencies": { 295 | "com.unity.modules.physics": "1.0.0", 296 | "com.unity.modules.jsonserialize": "1.0.0", 297 | "com.unity.modules.subsystems": "1.0.0" 298 | } 299 | } 300 | } 301 | } 302 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_SpatializerPlugin: 16 | m_AmbisonicDecoderPlugin: 17 | m_DisableAudio: 0 18 | m_VirtualizeEffects: 1 19 | m_RequestedDSPBufferSize: 1024 20 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 11 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 0 23 | m_ReuseCollisionCallbacks: 1 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ContactPairsMode: 0 26 | m_BroadphaseType: 0 27 | m_WorldBounds: 28 | m_Center: {x: 0, y: 0, z: 0} 29 | m_Extent: {x: 250, y: 250, z: 250} 30 | m_WorldSubdivisions: 8 31 | m_FrictionType: 0 32 | m_EnableEnhancedDeterminism: 0 33 | m_EnableUnifiedHeightmaps: 1 34 | m_DefaultMaxAngluarSpeed: 7 35 | -------------------------------------------------------------------------------- /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/Example/Example.unity 10 | guid: edbf6cf086198fc4dbd84a5a8d648144 11 | m_configObjects: {} 12 | -------------------------------------------------------------------------------- /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: 11 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 0 10 | m_DefaultBehaviorMode: 0 11 | m_PrefabRegularEnvironment: {fileID: 0} 12 | m_PrefabUIEnvironment: {fileID: 0} 13 | m_SpritePackerMode: 0 14 | m_SpritePackerPaddingPower: 1 15 | m_EtcTextureCompressorBehavior: 1 16 | m_EtcTextureFastCompressor: 1 17 | m_EtcTextureNormalCompressor: 2 18 | m_EtcTextureBestCompressor: 4 19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref 20 | m_ProjectGenerationRootNamespace: 21 | m_CollabEditorSettings: 22 | inProgressEnabled: 1 23 | m_EnableTextureStreamingInEditMode: 1 24 | m_EnableTextureStreamingInPlayMode: 1 25 | m_AsyncShaderCompilation: 1 26 | m_EnterPlayModeOptionsEnabled: 0 27 | m_EnterPlayModeOptions: 3 28 | m_ShowLightmapResolutionOverlay: 1 29 | m_UseLegacyProbeSampleCount: 0 30 | m_SerializeInlineMappingsOnOneLine: 1 -------------------------------------------------------------------------------- /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: 13 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | m_PreloadedShaders: [] 39 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 40 | type: 0} 41 | m_CustomRenderPipeline: {fileID: 0} 42 | m_TransparencySortMode: 0 43 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 44 | m_DefaultRenderingPath: 1 45 | m_DefaultMobileRenderingPath: 1 46 | m_TierSettings: [] 47 | m_LightmapStripping: 0 48 | m_FogStripping: 0 49 | m_InstancingStripping: 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_LogWhenShaderIsCompiled: 0 63 | m_AllowEnlightenSupportForUpgradedProject: 0 64 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_EnablePreviewPackages: 0 16 | m_EnablePackageDependencies: 0 17 | m_AdvancedSettingsExpanded: 1 18 | m_ScopedRegistriesSettingsExpanded: 1 19 | oneTimeWarningShown: 0 20 | m_Registries: 21 | - m_Id: main 22 | m_Name: 23 | m_Url: https://packages.unity.com 24 | m_Scopes: [] 25 | m_IsDefault: 1 26 | m_Capabilities: 7 27 | m_UserSelectedRegistryName: 28 | m_UserAddingNewScopedRegistry: 0 29 | m_RegistryInfoDraft: 30 | m_ErrorMessage: 31 | m_Original: 32 | m_Id: 33 | m_Name: 34 | m_Url: 35 | m_Scopes: [] 36 | m_IsDefault: 0 37 | m_Capabilities: 0 38 | m_Modified: 0 39 | m_Name: 40 | m_Url: 41 | m_Scopes: 42 | - 43 | m_SelectedScopeIndex: 0 44 | -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_AutoSimulation: 1 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 1 46 | m_AutoSyncTransforms: 0 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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: 22 7 | productGUID: ea12b7a598230b541b648ea6bbd72e83 8 | AndroidProfiler: 0 9 | AndroidFilterTouchesWhenObscured: 0 10 | AndroidEnableSustainedPerformanceMode: 0 11 | defaultScreenOrientation: 4 12 | targetDevice: 2 13 | useOnDemandResources: 0 14 | accelerometerFrequency: 60 15 | companyName: MackySoft 16 | productName: Unity-SerializeReferenceExtensions 17 | defaultCursor: {fileID: 0} 18 | cursorHotspot: {x: 0, y: 0} 19 | m_SplashScreenBackgroundColor: {r: 0.13725491, 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: 1024 46 | defaultScreenHeight: 768 47 | defaultScreenWidthWeb: 960 48 | defaultScreenHeightWeb: 600 49 | m_StereoRenderingPath: 0 50 | m_ActiveColorSpace: 0 51 | m_MTRendering: 1 52 | mipStripping: 0 53 | numberOfMipsStripped: 0 54 | m_StackTraceTypes: 010000000100000001000000010000000100000001000000 55 | iosShowActivityIndicatorOnLoading: -1 56 | androidShowActivityIndicatorOnLoading: -1 57 | iosUseCustomAppBackgroundBehavior: 0 58 | iosAllowHTTPDownload: 1 59 | allowedAutorotateToPortrait: 1 60 | allowedAutorotateToPortraitUpsideDown: 1 61 | allowedAutorotateToLandscapeRight: 1 62 | allowedAutorotateToLandscapeLeft: 1 63 | useOSAutorotation: 1 64 | use32BitDisplayBuffer: 1 65 | preserveFramebufferAlpha: 0 66 | disableDepthAndStencilBuffers: 0 67 | androidStartInFullscreen: 1 68 | androidRenderOutsideSafeArea: 1 69 | androidUseSwappy: 1 70 | androidBlitType: 0 71 | defaultIsNativeResolution: 1 72 | macRetinaSupport: 1 73 | runInBackground: 1 74 | captureSingleScreen: 0 75 | muteOtherAudioSources: 0 76 | Prepare IOS For Recording: 0 77 | Force IOS Speakers When Recording: 0 78 | deferSystemGesturesMode: 0 79 | hideHomeButton: 0 80 | submitAnalytics: 1 81 | usePlayerLog: 1 82 | bakeCollisionMeshes: 0 83 | forceSingleInstance: 0 84 | useFlipModelSwapchain: 1 85 | resizableWindow: 0 86 | useMacAppStoreValidation: 0 87 | macAppStoreCategory: public.app-category.games 88 | gpuSkinning: 1 89 | xboxPIXTextureCapture: 0 90 | xboxEnableAvatar: 0 91 | xboxEnableKinect: 0 92 | xboxEnableKinectAutoTracking: 0 93 | xboxEnableFitness: 0 94 | visibleInBackground: 1 95 | allowFullscreenSwitch: 1 96 | fullscreenMode: 1 97 | xboxSpeechDB: 0 98 | xboxEnableHeadOrientation: 0 99 | xboxEnableGuest: 0 100 | xboxEnablePIXSampling: 0 101 | metalFramebufferOnly: 0 102 | xboxOneResolution: 0 103 | xboxOneSResolution: 0 104 | xboxOneXResolution: 3 105 | xboxOneMonoLoggingLevel: 0 106 | xboxOneLoggingLevel: 1 107 | xboxOneDisableEsram: 0 108 | xboxOneEnableTypeOptimization: 0 109 | xboxOnePresentImmediateThreshold: 0 110 | switchQueueCommandMemory: 0 111 | switchQueueControlMemory: 16384 112 | switchQueueComputeMemory: 262144 113 | switchNVNShaderPoolsGranularity: 33554432 114 | switchNVNDefaultPoolsGranularity: 16777216 115 | switchNVNOtherPoolsGranularity: 16777216 116 | switchNVNMaxPublicTextureIDCount: 0 117 | switchNVNMaxPublicSamplerIDCount: 0 118 | stadiaPresentMode: 0 119 | stadiaTargetFramerate: 0 120 | vulkanNumSwapchainBuffers: 3 121 | vulkanEnableSetSRGBWrite: 0 122 | vulkanEnablePreTransform: 0 123 | vulkanEnableLateAcquireNextImage: 0 124 | m_SupportedAspectRatios: 125 | 4:3: 1 126 | 5:4: 1 127 | 16:10: 1 128 | 16:9: 1 129 | Others: 1 130 | bundleVersion: 0.1 131 | preloadedAssets: [] 132 | metroInputSource: 0 133 | wsaTransparentSwapchain: 0 134 | m_HolographicPauseOnTrackingLoss: 1 135 | xboxOneDisableKinectGpuReservation: 1 136 | xboxOneEnable7thCore: 1 137 | vrSettings: 138 | enable360StereoCapture: 0 139 | isWsaHolographicRemotingEnabled: 0 140 | enableFrameTimingStats: 0 141 | useHDRDisplay: 0 142 | D3DHDRBitDepth: 0 143 | m_ColorGamuts: 00000000 144 | targetPixelDensity: 30 145 | resolutionScalingMode: 0 146 | androidSupportedAspectRatio: 1 147 | androidMaxAspectRatio: 2.1 148 | applicationIdentifier: 149 | Standalone: com.MackySoft.Unity-SerializeReferenceExtensions 150 | buildNumber: 151 | Standalone: 0 152 | iPhone: 0 153 | tvOS: 0 154 | overrideDefaultApplicationIdentifier: 0 155 | AndroidBundleVersionCode: 1 156 | AndroidMinSdkVersion: 19 157 | AndroidTargetSdkVersion: 0 158 | AndroidPreferredInstallLocation: 1 159 | aotOptions: 160 | stripEngineCode: 1 161 | iPhoneStrippingLevel: 0 162 | iPhoneScriptCallOptimization: 0 163 | ForceInternetPermission: 0 164 | ForceSDCardPermission: 0 165 | CreateWallpaper: 0 166 | APKExpansionFiles: 0 167 | keepLoadedShadersAlive: 0 168 | StripUnusedMeshComponents: 1 169 | VertexChannelCompressionMask: 4054 170 | iPhoneSdkVersion: 988 171 | iOSTargetOSVersionString: 11.0 172 | tvOSSdkVersion: 0 173 | tvOSRequireExtendedGameController: 0 174 | tvOSTargetOSVersionString: 11.0 175 | uIPrerenderedIcon: 0 176 | uIRequiresPersistentWiFi: 0 177 | uIRequiresFullScreen: 1 178 | uIStatusBarHidden: 1 179 | uIExitOnSuspend: 0 180 | uIStatusBarStyle: 0 181 | appleTVSplashScreen: {fileID: 0} 182 | appleTVSplashScreen2x: {fileID: 0} 183 | tvOSSmallIconLayers: [] 184 | tvOSSmallIconLayers2x: [] 185 | tvOSLargeIconLayers: [] 186 | tvOSLargeIconLayers2x: [] 187 | tvOSTopShelfImageLayers: [] 188 | tvOSTopShelfImageLayers2x: [] 189 | tvOSTopShelfImageWideLayers: [] 190 | tvOSTopShelfImageWideLayers2x: [] 191 | iOSLaunchScreenType: 0 192 | iOSLaunchScreenPortrait: {fileID: 0} 193 | iOSLaunchScreenLandscape: {fileID: 0} 194 | iOSLaunchScreenBackgroundColor: 195 | serializedVersion: 2 196 | rgba: 0 197 | iOSLaunchScreenFillPct: 100 198 | iOSLaunchScreenSize: 100 199 | iOSLaunchScreenCustomXibPath: 200 | iOSLaunchScreeniPadType: 0 201 | iOSLaunchScreeniPadImage: {fileID: 0} 202 | iOSLaunchScreeniPadBackgroundColor: 203 | serializedVersion: 2 204 | rgba: 0 205 | iOSLaunchScreeniPadFillPct: 100 206 | iOSLaunchScreeniPadSize: 100 207 | iOSLaunchScreeniPadCustomXibPath: 208 | iOSLaunchScreenCustomStoryboardPath: 209 | iOSLaunchScreeniPadCustomStoryboardPath: 210 | iOSDeviceRequirements: [] 211 | iOSURLSchemes: [] 212 | iOSBackgroundModes: 0 213 | iOSMetalForceHardShadows: 0 214 | metalEditorSupport: 1 215 | metalAPIValidation: 1 216 | iOSRenderExtraFrameOnPause: 0 217 | iosCopyPluginsCodeInsteadOfSymlink: 0 218 | appleDeveloperTeamID: 219 | iOSManualSigningProvisioningProfileID: 220 | tvOSManualSigningProvisioningProfileID: 221 | iOSManualSigningProvisioningProfileType: 0 222 | tvOSManualSigningProvisioningProfileType: 0 223 | appleEnableAutomaticSigning: 0 224 | iOSRequireARKit: 0 225 | iOSAutomaticallyDetectAndAddCapabilities: 1 226 | appleEnableProMotion: 0 227 | shaderPrecisionModel: 0 228 | clonedFromGUID: c0afd0d1d80e3634a9dac47e8a0426ea 229 | templatePackageId: com.unity.template.3d@5.0.4 230 | templateDefaultScene: Assets/Scenes/SampleScene.unity 231 | useCustomMainManifest: 0 232 | useCustomLauncherManifest: 0 233 | useCustomMainGradleTemplate: 0 234 | useCustomLauncherGradleManifest: 0 235 | useCustomBaseGradleTemplate: 0 236 | useCustomGradlePropertiesTemplate: 0 237 | useCustomProguardFile: 0 238 | AndroidTargetArchitectures: 1 239 | AndroidSplashScreenScale: 0 240 | androidSplashScreen: {fileID: 0} 241 | AndroidKeystoreName: 242 | AndroidKeyaliasName: 243 | AndroidBuildApkPerCpuArchitecture: 0 244 | AndroidTVCompatibility: 0 245 | AndroidIsGame: 1 246 | AndroidEnableTango: 0 247 | androidEnableBanner: 1 248 | androidUseLowAccuracyLocation: 0 249 | androidUseCustomKeystore: 0 250 | m_AndroidBanners: 251 | - width: 320 252 | height: 180 253 | banner: {fileID: 0} 254 | androidGamepadSupportLevel: 0 255 | AndroidMinifyWithR8: 0 256 | AndroidMinifyRelease: 0 257 | AndroidMinifyDebug: 0 258 | AndroidValidateAppBundleSize: 1 259 | AndroidAppBundleSizeToValidate: 150 260 | m_BuildTargetIcons: [] 261 | m_BuildTargetPlatformIcons: [] 262 | m_BuildTargetBatching: 263 | - m_BuildTarget: Standalone 264 | m_StaticBatching: 1 265 | m_DynamicBatching: 0 266 | - m_BuildTarget: tvOS 267 | m_StaticBatching: 1 268 | m_DynamicBatching: 0 269 | - m_BuildTarget: Android 270 | m_StaticBatching: 1 271 | m_DynamicBatching: 0 272 | - m_BuildTarget: iPhone 273 | m_StaticBatching: 1 274 | m_DynamicBatching: 0 275 | - m_BuildTarget: WebGL 276 | m_StaticBatching: 0 277 | m_DynamicBatching: 0 278 | m_BuildTargetGraphicsJobs: 279 | - m_BuildTarget: MacStandaloneSupport 280 | m_GraphicsJobs: 0 281 | - m_BuildTarget: Switch 282 | m_GraphicsJobs: 1 283 | - m_BuildTarget: MetroSupport 284 | m_GraphicsJobs: 1 285 | - m_BuildTarget: AppleTVSupport 286 | m_GraphicsJobs: 0 287 | - m_BuildTarget: BJMSupport 288 | m_GraphicsJobs: 1 289 | - m_BuildTarget: LinuxStandaloneSupport 290 | m_GraphicsJobs: 1 291 | - m_BuildTarget: PS4Player 292 | m_GraphicsJobs: 1 293 | - m_BuildTarget: iOSSupport 294 | m_GraphicsJobs: 0 295 | - m_BuildTarget: WindowsStandaloneSupport 296 | m_GraphicsJobs: 1 297 | - m_BuildTarget: XboxOnePlayer 298 | m_GraphicsJobs: 1 299 | - m_BuildTarget: LuminSupport 300 | m_GraphicsJobs: 0 301 | - m_BuildTarget: AndroidPlayer 302 | m_GraphicsJobs: 0 303 | - m_BuildTarget: WebGLSupport 304 | m_GraphicsJobs: 0 305 | m_BuildTargetGraphicsJobMode: 306 | - m_BuildTarget: PS4Player 307 | m_GraphicsJobMode: 0 308 | - m_BuildTarget: XboxOnePlayer 309 | m_GraphicsJobMode: 0 310 | m_BuildTargetGraphicsAPIs: 311 | - m_BuildTarget: AndroidPlayer 312 | m_APIs: 150000000b000000 313 | m_Automatic: 0 314 | - m_BuildTarget: iOSSupport 315 | m_APIs: 10000000 316 | m_Automatic: 1 317 | - m_BuildTarget: AppleTVSupport 318 | m_APIs: 10000000 319 | m_Automatic: 1 320 | - m_BuildTarget: WebGLSupport 321 | m_APIs: 0b000000 322 | m_Automatic: 1 323 | m_BuildTargetVRSettings: 324 | - m_BuildTarget: Standalone 325 | m_Enabled: 0 326 | m_Devices: 327 | - Oculus 328 | - OpenVR 329 | openGLRequireES31: 0 330 | openGLRequireES31AEP: 0 331 | openGLRequireES32: 0 332 | m_TemplateCustomTags: {} 333 | mobileMTRendering: 334 | Android: 1 335 | iPhone: 1 336 | tvOS: 1 337 | m_BuildTargetGroupLightmapEncodingQuality: [] 338 | m_BuildTargetGroupLightmapSettings: [] 339 | m_BuildTargetNormalMapEncoding: [] 340 | playModeTestRunnerEnabled: 0 341 | runPlayModeTestAsEditModeTest: 0 342 | actionOnDotNetUnhandledException: 1 343 | enableInternalProfiler: 0 344 | logObjCUncaughtExceptions: 1 345 | enableCrashReportAPI: 0 346 | cameraUsageDescription: 347 | locationUsageDescription: 348 | microphoneUsageDescription: 349 | switchNMETAOverride: 350 | switchNetLibKey: 351 | switchSocketMemoryPoolSize: 6144 352 | switchSocketAllocatorPoolSize: 128 353 | switchSocketConcurrencyLimit: 14 354 | switchScreenResolutionBehavior: 2 355 | switchUseCPUProfiler: 0 356 | switchUseGOLDLinker: 0 357 | switchApplicationID: 0x01004b9000490000 358 | switchNSODependencies: 359 | switchTitleNames_0: 360 | switchTitleNames_1: 361 | switchTitleNames_2: 362 | switchTitleNames_3: 363 | switchTitleNames_4: 364 | switchTitleNames_5: 365 | switchTitleNames_6: 366 | switchTitleNames_7: 367 | switchTitleNames_8: 368 | switchTitleNames_9: 369 | switchTitleNames_10: 370 | switchTitleNames_11: 371 | switchTitleNames_12: 372 | switchTitleNames_13: 373 | switchTitleNames_14: 374 | switchTitleNames_15: 375 | switchPublisherNames_0: 376 | switchPublisherNames_1: 377 | switchPublisherNames_2: 378 | switchPublisherNames_3: 379 | switchPublisherNames_4: 380 | switchPublisherNames_5: 381 | switchPublisherNames_6: 382 | switchPublisherNames_7: 383 | switchPublisherNames_8: 384 | switchPublisherNames_9: 385 | switchPublisherNames_10: 386 | switchPublisherNames_11: 387 | switchPublisherNames_12: 388 | switchPublisherNames_13: 389 | switchPublisherNames_14: 390 | switchPublisherNames_15: 391 | switchIcons_0: {fileID: 0} 392 | switchIcons_1: {fileID: 0} 393 | switchIcons_2: {fileID: 0} 394 | switchIcons_3: {fileID: 0} 395 | switchIcons_4: {fileID: 0} 396 | switchIcons_5: {fileID: 0} 397 | switchIcons_6: {fileID: 0} 398 | switchIcons_7: {fileID: 0} 399 | switchIcons_8: {fileID: 0} 400 | switchIcons_9: {fileID: 0} 401 | switchIcons_10: {fileID: 0} 402 | switchIcons_11: {fileID: 0} 403 | switchIcons_12: {fileID: 0} 404 | switchIcons_13: {fileID: 0} 405 | switchIcons_14: {fileID: 0} 406 | switchIcons_15: {fileID: 0} 407 | switchSmallIcons_0: {fileID: 0} 408 | switchSmallIcons_1: {fileID: 0} 409 | switchSmallIcons_2: {fileID: 0} 410 | switchSmallIcons_3: {fileID: 0} 411 | switchSmallIcons_4: {fileID: 0} 412 | switchSmallIcons_5: {fileID: 0} 413 | switchSmallIcons_6: {fileID: 0} 414 | switchSmallIcons_7: {fileID: 0} 415 | switchSmallIcons_8: {fileID: 0} 416 | switchSmallIcons_9: {fileID: 0} 417 | switchSmallIcons_10: {fileID: 0} 418 | switchSmallIcons_11: {fileID: 0} 419 | switchSmallIcons_12: {fileID: 0} 420 | switchSmallIcons_13: {fileID: 0} 421 | switchSmallIcons_14: {fileID: 0} 422 | switchSmallIcons_15: {fileID: 0} 423 | switchManualHTML: 424 | switchAccessibleURLs: 425 | switchLegalInformation: 426 | switchMainThreadStackSize: 1048576 427 | switchPresenceGroupId: 428 | switchLogoHandling: 0 429 | switchReleaseVersion: 0 430 | switchDisplayVersion: 1.0.0 431 | switchStartupUserAccount: 0 432 | switchTouchScreenUsage: 0 433 | switchSupportedLanguagesMask: 0 434 | switchLogoType: 0 435 | switchApplicationErrorCodeCategory: 436 | switchUserAccountSaveDataSize: 0 437 | switchUserAccountSaveDataJournalSize: 0 438 | switchApplicationAttribute: 0 439 | switchCardSpecSize: -1 440 | switchCardSpecClock: -1 441 | switchRatingsMask: 0 442 | switchRatingsInt_0: 0 443 | switchRatingsInt_1: 0 444 | switchRatingsInt_2: 0 445 | switchRatingsInt_3: 0 446 | switchRatingsInt_4: 0 447 | switchRatingsInt_5: 0 448 | switchRatingsInt_6: 0 449 | switchRatingsInt_7: 0 450 | switchRatingsInt_8: 0 451 | switchRatingsInt_9: 0 452 | switchRatingsInt_10: 0 453 | switchRatingsInt_11: 0 454 | switchRatingsInt_12: 0 455 | switchLocalCommunicationIds_0: 456 | switchLocalCommunicationIds_1: 457 | switchLocalCommunicationIds_2: 458 | switchLocalCommunicationIds_3: 459 | switchLocalCommunicationIds_4: 460 | switchLocalCommunicationIds_5: 461 | switchLocalCommunicationIds_6: 462 | switchLocalCommunicationIds_7: 463 | switchParentalControl: 0 464 | switchAllowsScreenshot: 1 465 | switchAllowsVideoCapturing: 1 466 | switchAllowsRuntimeAddOnContentInstall: 0 467 | switchDataLossConfirmation: 0 468 | switchUserAccountLockEnabled: 0 469 | switchSystemResourceMemory: 16777216 470 | switchSupportedNpadStyles: 22 471 | switchNativeFsCacheSize: 32 472 | switchIsHoldTypeHorizontal: 0 473 | switchSupportedNpadCount: 8 474 | switchSocketConfigEnabled: 0 475 | switchTcpInitialSendBufferSize: 32 476 | switchTcpInitialReceiveBufferSize: 64 477 | switchTcpAutoSendBufferSizeMax: 256 478 | switchTcpAutoReceiveBufferSizeMax: 256 479 | switchUdpSendBufferSize: 9 480 | switchUdpReceiveBufferSize: 42 481 | switchSocketBufferEfficiency: 4 482 | switchSocketInitializeEnabled: 1 483 | switchNetworkInterfaceManagerInitializeEnabled: 1 484 | switchPlayerConnectionEnabled: 1 485 | switchUseNewStyleFilepaths: 0 486 | ps4NPAgeRating: 12 487 | ps4NPTitleSecret: 488 | ps4NPTrophyPackPath: 489 | ps4ParentalLevel: 11 490 | ps4ContentID: ED1633-NPXX51362_00-0000000000000000 491 | ps4Category: 0 492 | ps4MasterVersion: 01.00 493 | ps4AppVersion: 01.00 494 | ps4AppType: 0 495 | ps4ParamSfxPath: 496 | ps4VideoOutPixelFormat: 0 497 | ps4VideoOutInitialWidth: 1920 498 | ps4VideoOutBaseModeInitialWidth: 1920 499 | ps4VideoOutReprojectionRate: 60 500 | ps4PronunciationXMLPath: 501 | ps4PronunciationSIGPath: 502 | ps4BackgroundImagePath: 503 | ps4StartupImagePath: 504 | ps4StartupImagesFolder: 505 | ps4IconImagesFolder: 506 | ps4SaveDataImagePath: 507 | ps4SdkOverride: 508 | ps4BGMPath: 509 | ps4ShareFilePath: 510 | ps4ShareOverlayImagePath: 511 | ps4PrivacyGuardImagePath: 512 | ps4ExtraSceSysFile: 513 | ps4NPtitleDatPath: 514 | ps4RemotePlayKeyAssignment: -1 515 | ps4RemotePlayKeyMappingDir: 516 | ps4PlayTogetherPlayerCount: 0 517 | ps4EnterButtonAssignment: 1 518 | ps4ApplicationParam1: 0 519 | ps4ApplicationParam2: 0 520 | ps4ApplicationParam3: 0 521 | ps4ApplicationParam4: 0 522 | ps4DownloadDataSize: 0 523 | ps4GarlicHeapSize: 2048 524 | ps4ProGarlicHeapSize: 2560 525 | playerPrefsMaxSize: 32768 526 | ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ 527 | ps4pnSessions: 1 528 | ps4pnPresence: 1 529 | ps4pnFriends: 1 530 | ps4pnGameCustomData: 1 531 | playerPrefsSupport: 0 532 | enableApplicationExit: 0 533 | resetTempFolder: 1 534 | restrictedAudioUsageRights: 0 535 | ps4UseResolutionFallback: 0 536 | ps4ReprojectionSupport: 0 537 | ps4UseAudio3dBackend: 0 538 | ps4UseLowGarlicFragmentationMode: 1 539 | ps4SocialScreenEnabled: 0 540 | ps4ScriptOptimizationLevel: 0 541 | ps4Audio3dVirtualSpeakerCount: 14 542 | ps4attribCpuUsage: 0 543 | ps4PatchPkgPath: 544 | ps4PatchLatestPkgPath: 545 | ps4PatchChangeinfoPath: 546 | ps4PatchDayOne: 0 547 | ps4attribUserManagement: 0 548 | ps4attribMoveSupport: 0 549 | ps4attrib3DSupport: 0 550 | ps4attribShareSupport: 0 551 | ps4attribExclusiveVR: 0 552 | ps4disableAutoHideSplash: 0 553 | ps4videoRecordingFeaturesUsed: 0 554 | ps4contentSearchFeaturesUsed: 0 555 | ps4CompatibilityPS5: 0 556 | ps4GPU800MHz: 1 557 | ps4attribEyeToEyeDistanceSettingVR: 0 558 | ps4IncludedModules: [] 559 | ps4attribVROutputEnabled: 0 560 | monoEnv: 561 | splashScreenBackgroundSourceLandscape: {fileID: 0} 562 | splashScreenBackgroundSourcePortrait: {fileID: 0} 563 | blurSplashScreenBackground: 1 564 | spritePackerPolicy: 565 | webGLMemorySize: 16 566 | webGLExceptionSupport: 1 567 | webGLNameFilesAsHashes: 0 568 | webGLDataCaching: 1 569 | webGLDebugSymbols: 0 570 | webGLEmscriptenArgs: 571 | webGLModulesDirectory: 572 | webGLTemplate: APPLICATION:Default 573 | webGLAnalyzeBuildSize: 0 574 | webGLUseEmbeddedResources: 0 575 | webGLCompressionFormat: 1 576 | webGLWasmArithmeticExceptions: 0 577 | webGLLinkerTarget: 1 578 | webGLThreadsSupport: 0 579 | webGLDecompressionFallback: 0 580 | scriptingDefineSymbols: {} 581 | additionalCompilerArguments: {} 582 | platformArchitecture: {} 583 | scriptingBackend: {} 584 | il2cppCompilerConfiguration: {} 585 | managedStrippingLevel: {} 586 | incrementalIl2cppBuild: {} 587 | suppressCommonWarnings: 1 588 | allowUnsafeCode: 0 589 | useDeterministicCompilation: 1 590 | useReferenceAssemblies: 1 591 | enableRoslynAnalyzers: 1 592 | additionalIl2CppArgs: 593 | scriptingRuntimeVersion: 1 594 | gcIncremental: 1 595 | assemblyVersionValidation: 1 596 | gcWBarrierValidation: 0 597 | apiCompatibilityLevelPerPlatform: {} 598 | m_RenderingPath: 1 599 | m_MobileRenderingPath: 1 600 | metroPackageName: Template_3D 601 | metroPackageVersion: 602 | metroCertificatePath: 603 | metroCertificatePassword: 604 | metroCertificateSubject: 605 | metroCertificateIssuer: 606 | metroCertificateNotAfter: 0000000000000000 607 | metroApplicationDescription: Template_3D 608 | wsaImages: {} 609 | metroTileShortName: 610 | metroTileShowName: 0 611 | metroMediumTileShowName: 0 612 | metroLargeTileShowName: 0 613 | metroWideTileShowName: 0 614 | metroSupportStreamingInstall: 0 615 | metroLastRequiredScene: 0 616 | metroDefaultTileSize: 1 617 | metroTileForegroundText: 2 618 | metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} 619 | metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, a: 1} 620 | metroSplashScreenUseBackgroundColor: 0 621 | platformCapabilities: {} 622 | metroTargetDeviceFamilies: {} 623 | metroFTAName: 624 | metroFTAFileTypes: [] 625 | metroProtocolName: 626 | XboxOneProductId: 627 | XboxOneUpdateKey: 628 | XboxOneSandboxId: 629 | XboxOneContentId: 630 | XboxOneTitleId: 631 | XboxOneSCId: 632 | XboxOneGameOsOverridePath: 633 | XboxOnePackagingOverridePath: 634 | XboxOneAppManifestOverridePath: 635 | XboxOneVersion: 1.0.0.0 636 | XboxOnePackageEncryption: 0 637 | XboxOnePackageUpdateGranularity: 2 638 | XboxOneDescription: 639 | XboxOneLanguage: 640 | - enus 641 | XboxOneCapability: [] 642 | XboxOneGameRating: {} 643 | XboxOneIsContentPackage: 0 644 | XboxOneEnhancedXboxCompatibilityMode: 0 645 | XboxOneEnableGPUVariability: 1 646 | XboxOneSockets: {} 647 | XboxOneSplashScreen: {fileID: 0} 648 | XboxOneAllowedProductIds: [] 649 | XboxOnePersistentLocalStorageSize: 0 650 | XboxOneXTitleMemory: 8 651 | XboxOneOverrideIdentityName: 652 | XboxOneOverrideIdentityPublisher: 653 | vrEditorSettings: {} 654 | cloudServicesEnabled: 655 | UNet: 1 656 | luminIcon: 657 | m_Name: 658 | m_ModelFolderPath: 659 | m_PortalFolderPath: 660 | luminCert: 661 | m_CertPath: 662 | m_SignPackage: 1 663 | luminIsChannelApp: 0 664 | luminVersion: 665 | m_VersionCode: 1 666 | m_VersionName: 667 | apiCompatibilityLevel: 6 668 | activeInputHandler: 0 669 | cloudProjectId: 670 | framebufferDepthMemorylessMode: 0 671 | qualitySettingsNames: [] 672 | projectName: 673 | organizationId: 674 | cloudEnabled: 0 675 | legacyClampBlendShapeWeights: 0 676 | virtualTexturingSupportEnabled: 0 677 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2021.3.29f1 2 | m_EditorVersionWithRevision: 2021.3.29f1 (204d6dc9ae1c) 3 | -------------------------------------------------------------------------------- /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: 2 10 | name: Very Low 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | shadowmaskMode: 0 21 | blendWeights: 1 22 | textureQuality: 1 23 | anisotropicTextures: 0 24 | antiAliasing: 0 25 | softParticles: 0 26 | softVegetation: 0 27 | realtimeReflectionProbes: 0 28 | billboardsFaceCameraPosition: 0 29 | vSyncCount: 0 30 | lodBias: 0.3 31 | maximumLODLevel: 0 32 | streamingMipmapsActive: 0 33 | streamingMipmapsAddAllCameras: 1 34 | streamingMipmapsMemoryBudget: 512 35 | streamingMipmapsRenderersPerFrame: 512 36 | streamingMipmapsMaxLevelReduction: 2 37 | streamingMipmapsMaxFileIORequests: 1024 38 | particleRaycastBudget: 4 39 | asyncUploadTimeSlice: 2 40 | asyncUploadBufferSize: 16 41 | asyncUploadPersistentBuffer: 1 42 | resolutionScalingFixedDPIFactor: 1 43 | excludedTargetPlatforms: [] 44 | - serializedVersion: 2 45 | name: Low 46 | pixelLightCount: 0 47 | shadows: 0 48 | shadowResolution: 0 49 | shadowProjection: 1 50 | shadowCascades: 1 51 | shadowDistance: 20 52 | shadowNearPlaneOffset: 3 53 | shadowCascade2Split: 0.33333334 54 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 55 | shadowmaskMode: 0 56 | blendWeights: 2 57 | textureQuality: 0 58 | anisotropicTextures: 0 59 | antiAliasing: 0 60 | softParticles: 0 61 | softVegetation: 0 62 | realtimeReflectionProbes: 0 63 | billboardsFaceCameraPosition: 0 64 | vSyncCount: 0 65 | lodBias: 0.4 66 | maximumLODLevel: 0 67 | streamingMipmapsActive: 0 68 | streamingMipmapsAddAllCameras: 1 69 | streamingMipmapsMemoryBudget: 512 70 | streamingMipmapsRenderersPerFrame: 512 71 | streamingMipmapsMaxLevelReduction: 2 72 | streamingMipmapsMaxFileIORequests: 1024 73 | particleRaycastBudget: 16 74 | asyncUploadTimeSlice: 2 75 | asyncUploadBufferSize: 16 76 | asyncUploadPersistentBuffer: 1 77 | resolutionScalingFixedDPIFactor: 1 78 | excludedTargetPlatforms: [] 79 | - serializedVersion: 2 80 | name: Medium 81 | pixelLightCount: 1 82 | shadows: 1 83 | shadowResolution: 0 84 | shadowProjection: 1 85 | shadowCascades: 1 86 | shadowDistance: 20 87 | shadowNearPlaneOffset: 3 88 | shadowCascade2Split: 0.33333334 89 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 90 | shadowmaskMode: 0 91 | blendWeights: 2 92 | textureQuality: 0 93 | anisotropicTextures: 1 94 | antiAliasing: 0 95 | softParticles: 0 96 | softVegetation: 0 97 | realtimeReflectionProbes: 0 98 | billboardsFaceCameraPosition: 0 99 | vSyncCount: 1 100 | lodBias: 0.7 101 | maximumLODLevel: 0 102 | streamingMipmapsActive: 0 103 | streamingMipmapsAddAllCameras: 1 104 | streamingMipmapsMemoryBudget: 512 105 | streamingMipmapsRenderersPerFrame: 512 106 | streamingMipmapsMaxLevelReduction: 2 107 | streamingMipmapsMaxFileIORequests: 1024 108 | particleRaycastBudget: 64 109 | asyncUploadTimeSlice: 2 110 | asyncUploadBufferSize: 16 111 | asyncUploadPersistentBuffer: 1 112 | resolutionScalingFixedDPIFactor: 1 113 | excludedTargetPlatforms: [] 114 | - serializedVersion: 2 115 | name: High 116 | pixelLightCount: 2 117 | shadows: 2 118 | shadowResolution: 1 119 | shadowProjection: 1 120 | shadowCascades: 2 121 | shadowDistance: 40 122 | shadowNearPlaneOffset: 3 123 | shadowCascade2Split: 0.33333334 124 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 125 | shadowmaskMode: 1 126 | blendWeights: 2 127 | textureQuality: 0 128 | anisotropicTextures: 1 129 | antiAliasing: 0 130 | softParticles: 0 131 | softVegetation: 1 132 | realtimeReflectionProbes: 1 133 | billboardsFaceCameraPosition: 1 134 | vSyncCount: 1 135 | lodBias: 1 136 | maximumLODLevel: 0 137 | streamingMipmapsActive: 0 138 | streamingMipmapsAddAllCameras: 1 139 | streamingMipmapsMemoryBudget: 512 140 | streamingMipmapsRenderersPerFrame: 512 141 | streamingMipmapsMaxLevelReduction: 2 142 | streamingMipmapsMaxFileIORequests: 1024 143 | particleRaycastBudget: 256 144 | asyncUploadTimeSlice: 2 145 | asyncUploadBufferSize: 16 146 | asyncUploadPersistentBuffer: 1 147 | resolutionScalingFixedDPIFactor: 1 148 | excludedTargetPlatforms: [] 149 | - serializedVersion: 2 150 | name: Very High 151 | pixelLightCount: 3 152 | shadows: 2 153 | shadowResolution: 2 154 | shadowProjection: 1 155 | shadowCascades: 2 156 | shadowDistance: 70 157 | shadowNearPlaneOffset: 3 158 | shadowCascade2Split: 0.33333334 159 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 160 | shadowmaskMode: 1 161 | blendWeights: 4 162 | textureQuality: 0 163 | anisotropicTextures: 2 164 | antiAliasing: 2 165 | softParticles: 1 166 | softVegetation: 1 167 | realtimeReflectionProbes: 1 168 | billboardsFaceCameraPosition: 1 169 | vSyncCount: 1 170 | lodBias: 1.5 171 | maximumLODLevel: 0 172 | streamingMipmapsActive: 0 173 | streamingMipmapsAddAllCameras: 1 174 | streamingMipmapsMemoryBudget: 512 175 | streamingMipmapsRenderersPerFrame: 512 176 | streamingMipmapsMaxLevelReduction: 2 177 | streamingMipmapsMaxFileIORequests: 1024 178 | particleRaycastBudget: 1024 179 | asyncUploadTimeSlice: 2 180 | asyncUploadBufferSize: 16 181 | asyncUploadPersistentBuffer: 1 182 | resolutionScalingFixedDPIFactor: 1 183 | excludedTargetPlatforms: [] 184 | - serializedVersion: 2 185 | name: Ultra 186 | pixelLightCount: 4 187 | shadows: 2 188 | shadowResolution: 2 189 | shadowProjection: 1 190 | shadowCascades: 4 191 | shadowDistance: 150 192 | shadowNearPlaneOffset: 3 193 | shadowCascade2Split: 0.33333334 194 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 195 | shadowmaskMode: 1 196 | blendWeights: 4 197 | textureQuality: 0 198 | anisotropicTextures: 2 199 | antiAliasing: 2 200 | softParticles: 1 201 | softVegetation: 1 202 | realtimeReflectionProbes: 1 203 | billboardsFaceCameraPosition: 1 204 | vSyncCount: 1 205 | lodBias: 2 206 | maximumLODLevel: 0 207 | streamingMipmapsActive: 0 208 | streamingMipmapsAddAllCameras: 1 209 | streamingMipmapsMemoryBudget: 512 210 | streamingMipmapsRenderersPerFrame: 512 211 | streamingMipmapsMaxLevelReduction: 2 212 | streamingMipmapsMaxFileIORequests: 1024 213 | particleRaycastBudget: 4096 214 | asyncUploadTimeSlice: 2 215 | asyncUploadBufferSize: 16 216 | asyncUploadPersistentBuffer: 1 217 | resolutionScalingFixedDPIFactor: 1 218 | excludedTargetPlatforms: [] 219 | m_PerPlatformDefaultQuality: 220 | Android: 2 221 | Lumin: 5 222 | Nintendo 3DS: 5 223 | Nintendo Switch: 5 224 | PS4: 5 225 | PSP2: 2 226 | Stadia: 5 227 | Standalone: 5 228 | WebGL: 3 229 | Windows Store Apps: 5 230 | XboxOne: 5 231 | iPhone: 2 232 | tvOS: 2 233 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ProjectSettings/TimelineSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: a287be6c49135cd4f9b2b8666c39d999, type: 3} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | assetDefaultFramerate: 60 16 | -------------------------------------------------------------------------------- /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_TestInitMode: 0 13 | CrashReportingSettings: 14 | m_EventUrl: https://perf-events.cloud.unity3d.com 15 | m_Enabled: 0 16 | m_LogBufferSize: 10 17 | m_CaptureEditorExceptions: 1 18 | UnityPurchasingSettings: 19 | m_Enabled: 0 20 | m_TestMode: 0 21 | UnityAnalyticsSettings: 22 | m_Enabled: 0 23 | m_TestMode: 0 24 | m_InitializeOnStartup: 1 25 | UnityAdsSettings: 26 | m_Enabled: 0 27 | m_InitializeOnStartup: 1 28 | m_TestMode: 0 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | m_GameIds: {} 32 | m_GameId: 33 | PerformanceReportingSettings: 34 | m_Enabled: 0 35 | -------------------------------------------------------------------------------- /ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_StripUpdateShader: {fileID: 0} 10 | m_RenderPipeSettingsPath: 11 | m_FixedTimeStep: 0.016666668 12 | m_MaxDeltaTime: 0.05 13 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } -------------------------------------------------------------------------------- /ProjectSettings/boot.config: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mackysoft/Unity-SerializeReferenceExtensions/f938fc5d9a9ef46a1669289450d38e17cb39567c/ProjectSettings/boot.config -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Unity SerializeReferenceExtensions 2 | 3 | [![Build](https://github.com/mackysoft/Unity-SerializeReferenceExtensions/actions/workflows/build.yaml/badge.svg)](https://github.com/mackysoft/Unity-SerializeReferenceExtensions/actions/workflows/build.yaml) [![Release](https://img.shields.io/github/v/release/mackysoft/Unity-SerializeReferenceExtensions)](https://github.com/mackysoft/Unity-SerializeReferenceExtensions/releases) [![openupm](https://img.shields.io/npm/v/com.mackysoft.serializereference-extensions?label=openupm®istry_uri=https://package.openupm.com)](https://openupm.com/packages/com.mackysoft.serializereference-extensions/) 4 | 5 | **Inspired by [this post](https://qiita.com/tsukimi_neko/items/7922b2433ed4d8616cce).** 6 | 7 | The `SerializeReference` attribute, added in Unity 2019.3, makes it possible to serialize references to interfaces and abstract classes. 8 | 9 | The `SubclassSelector` attribute allows you to easily set subclasses of those abstract classes in the Editor that are serialized by `SerializeReference` attribute. 10 | 11 | ![SubclassSelector](https://user-images.githubusercontent.com/13536348/118233552-03cd1780-b4cd-11eb-9e5b-4824e8f01f1d.gif) 12 | 13 | #### Features 14 | 15 | - Easily set subclass by popup. 16 | - **[New]** Type finding by fuzzy finder. 17 | - **[New]** Override the type name and path by the `AddTypeMenu` attribute. 18 | - **[New]** Available `CustomPropertyDrawer` for subclasses. 19 | - **[New]** Restore values of previous object from JSON when subclass is changed. (required Unity 2021.3 or later) 20 | - **[New]** Copy & Paste the subclass properties. (required Unity 2021.3 or later) 21 | - **[New]** Clear & reset the subclass properties. (required Unity 2021.3 or later) 22 | - **[New]** Covariance / Contravariance support. (required Unity 2023.2 or later) 23 | 24 | > See below for the reason for the limitation of versions less than Unity 2021.3. 25 | > 26 | > https://blog.unity.com/engine-platform/serializereference-improvements-in-unity-2021-lts 27 | 28 | ## 📥 Installation 29 | 30 | #### Install via `.unitypackage` 31 | 32 | Download any version from releases. 33 | 34 | Releases: https://github.com/mackysoft/Unity-SerializeReferenceExtensions/releases 35 | 36 | #### Install via git URL 37 | 38 | Or, you can add this package by opening PackageManager and entering 39 | 40 | ``` 41 | https://github.com/mackysoft/Unity-SerializeReferenceExtensions.git?path=Assets/MackySoft/MackySoft.SerializeReferenceExtensions 42 | ``` 43 | 44 | from the `Add package from git URL` option. 45 | 46 | If you are specifying a version, enter `#{VERSION}` at the end, as shown below. 47 | 48 | ``` 49 | https://github.com/mackysoft/Unity-SerializeReferenceExtensions.git?path=Assets/MackySoft/MackySoft.SerializeReferenceExtensions#1.1.9 50 | ``` 51 | 52 | #### Install via Open UPM 53 | 54 | Or, you can install this package from the [Open UPM](https://openupm.com/packages/com.mackysoft.serializereference-extensions/) registry. 55 | 56 | More details [here](https://openupm.com/). 57 | 58 | ``` 59 | openupm add com.mackysoft.serializereference-extensions 60 | ``` 61 | 62 | ## 🔰 Usage 63 | 64 | ```cs 65 | using System; 66 | using UnityEngine; 67 | 68 | public class Example : MonoBehaviour { 69 | 70 | // The type that implements ICommand will be displayed in the popup. 71 | [SerializeReference, SubclassSelector] 72 | ICommand m_Command; 73 | 74 | // Collection support 75 | [SerializeReference, SubclassSelector] 76 | ICommand[] m_Commands = Array.Empty(); 77 | 78 | void Start () { 79 | m_Command?.Execute(); 80 | 81 | foreach (ICommand command in m_Commands) { 82 | command?.Execute(); 83 | } 84 | } 85 | 86 | // Nested type support 87 | [Serializable] 88 | public class NestedCommand : ICommand { 89 | public void Execute () { 90 | Debug.Log("Execute NestedCommand"); 91 | } 92 | } 93 | 94 | } 95 | 96 | public interface ICommand { 97 | void Execute (); 98 | } 99 | 100 | [Serializable] 101 | public class DebugCommand : ICommand { 102 | 103 | [SerializeField] 104 | string m_Message; 105 | 106 | public void Execute () { 107 | Debug.Log(m_Message); 108 | } 109 | } 110 | 111 | [Serializable] 112 | public class InstantiateCommand : ICommand { 113 | 114 | [SerializeField] 115 | GameObject m_Prefab; 116 | 117 | public void Execute () { 118 | UnityEngine.Object.Instantiate(m_Prefab,Vector3.zero,Quaternion.identity); 119 | } 120 | } 121 | 122 | // Menu override support 123 | [AddTypeMenu("Example/Add Type Menu Command")] 124 | [Serializable] 125 | public class AddTypeMenuCommand : ICommand { 126 | public void Execute () { 127 | Debug.Log("Execute AddTypeMenuCommand"); 128 | } 129 | } 130 | 131 | [Serializable] 132 | public struct StructCommand : ICommand { 133 | public void Execute () { 134 | Debug.Log("Execute StructCommand"); 135 | } 136 | } 137 | ``` 138 | 139 | #### Supported Types 140 | 141 | The `SubclassSelector` attribute supports types that meet the following conditions. 142 | 143 | - Public or nested private 144 | - Not abstract 145 | - Not generic 146 | - Not unity object 147 | - Serializable attribute is applied. 148 | 149 | 150 | ## ❓ FAQ 151 | 152 | ### If the type is renamed, the reference is lost. 153 | 154 | It is a limitation of `SerializeReference` of Unity. 155 | 156 | When serializing a `SerializeReference` reference, the type name, namespace, and assembly name are used, so if any of these are changed, the reference cannot be resolved during deserialization. 157 | 158 | To solve this problem, `UnityEngine.Scripting.APIUpdating.MovedFromAttribute` can be used. 159 | 160 | Also, [this thread](https://forum.unity.com/threads/serializereference-data-loss-when-class-name-is-changed.736874/) will be helpful. 161 | 162 | #### References 163 | - https://forum.unity.com/threads/serializereference-data-loss-when-class-name-is-changed.736874/ 164 | - https://issuetracker.unity3d.com/issues/serializereference-serialized-reference-data-lost-when-the-class-name-is-refactored 165 | 166 | # ✉ Help & Contribute 167 | 168 | I welcome feature requests and bug reports in [issues](https://github.com/mackysoft/XPool/issues) and [pull requests](https://github.com/mackysoft/XPool/pulls). 169 | 170 | If you feel that my works are worthwhile, I would greatly appreciate it if you could sponsor me. 171 | 172 | GitHub Sponsors: https://github.com/sponsors/mackysoft 173 | --------------------------------------------------------------------------------