diff --git a/.idea/.idea.Infratest/.idea/vcs.xml b/.idea/.idea.Infratest/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/.idea.Infratest/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/.idea.Infratest/.idea/workspace.xml b/.idea/.idea.Infratest/.idea/workspace.xml
index ba31f42..d6a86a3 100644
--- a/.idea/.idea.Infratest/.idea/workspace.xml
+++ b/.idea/.idea.Infratest/.idea/workspace.xml
@@ -4,12 +4,161 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {
"customColor": "",
"associatedIndex": 2
@@ -19,17 +168,20 @@
- {
- "keyToString": {
- "RunOnceActivity.ShowReadmeOnStart": "true",
- "node.js.detected.package.eslint": "true",
- "node.js.detected.package.tslint": "true",
- "node.js.selected.package.eslint": "(autodetect)",
- "node.js.selected.package.tslint": "(autodetect)",
- "nodejs_package_manager_path": "npm",
- "vue.rearranger.settings.migration": "true"
+
+}]]>
@@ -57,10 +209,10 @@
-
+
-
+
@@ -95,4 +278,36 @@
+
+
+
+
+ file://$PROJECT_DIR$/Assets/Code/Example/Liminal/Character/LiminalCharacterController.cs
+ 239
+
+
+
+
+
+
+
+
+
+
+
+ file://$PROJECT_DIR$/Assets/Code/Example/Liminal/Character/LiminalCharacterController.cs
+ 245
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Assets/TutorialInfo.meta b/Assets/AddressableAssetsData.meta
similarity index 77%
rename from Assets/TutorialInfo.meta
rename to Assets/AddressableAssetsData.meta
index a700bca..1c80e00 100644
--- a/Assets/TutorialInfo.meta
+++ b/Assets/AddressableAssetsData.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: ba062aa6c92b140379dbc06b43dd3b9b
+guid: 76a37d2969dbaf94bb633f4cea6406a6
folderAsset: yes
DefaultImporter:
externalObjects: {}
diff --git a/Assets/AddressableAssetsData/AddressableAssetSettings.asset b/Assets/AddressableAssetsData/AddressableAssetSettings.asset
new file mode 100644
index 0000000..6afd719
--- /dev/null
+++ b/Assets/AddressableAssetsData/AddressableAssetSettings.asset
@@ -0,0 +1,117 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!114 &11400000
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 468a46d0ae32c3544b7d98094e6448a9, type: 3}
+ m_Name: AddressableAssetSettings
+ m_EditorClassIdentifier: Unity.Addressables.Editor::UnityEditor.AddressableAssets.Settings.AddressableAssetSettings
+ m_DefaultGroup: d790534e015d692428ac5a9ce7d2ceb6
+ m_currentHash:
+ serializedVersion: 2
+ Hash: 00000000000000000000000000000000
+ m_OptimizeCatalogSize: 0
+ m_BuildRemoteCatalog: 0
+ m_CatalogRequestsTimeout: 0
+ m_DisableCatalogUpdateOnStart: 0
+ m_InternalIdNamingMode: 0
+ m_InternalBundleIdMode: 1
+ m_AssetLoadMode: 0
+ m_BundledAssetProviderType:
+ m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
+ m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider
+ m_AssetBundleProviderType:
+ m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
+ m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider
+ m_IgnoreUnsupportedFilesInBuild: 0
+ m_UniqueBundleIds: 0
+ m_EnableJsonCatalog: 0
+ m_NonRecursiveBuilding: 1
+ m_AllowNestedBundleFolders: 0
+ m_CCDEnabled: 0
+ m_maxConcurrentWebRequests: 3
+ m_UseUWRForLocalBundles: 0
+ m_BundleTimeout: 0
+ m_BundleRetryCount: 0
+ m_BundleRedirectLimit: -1
+ m_SharedBundleSettings: 0
+ m_SharedBundleSettingsCustomGroupIndex: 0
+ m_ContiguousBundles: 1
+ m_StripUnityVersionFromBundleBuild: 0
+ m_DisableVisibleSubAssetRepresentations: 0
+ m_BuiltInBundleNaming: 0
+ mBuiltInBundleCustomNaming:
+ m_MonoScriptBundleNaming: 0
+ m_CheckForContentUpdateRestrictionsOption: 0
+ m_MonoScriptBundleCustomNaming:
+ m_RemoteCatalogBuildPath:
+ m_Id:
+ m_RemoteCatalogLoadPath:
+ m_Id:
+ m_ContentStateBuildPathProfileVariableName:
+ m_CustomContentStateBuildPath:
+ m_ContentStateBuildPath:
+ m_BuildAddressablesWithPlayerBuild: 0
+ m_overridePlayerVersion: '[UnityEditor.PlayerSettings.bundleVersion]'
+ m_GroupAssets:
+ - {fileID: 11400000, guid: cd5d8f0bccfc1e5489a5c528087c4feb, type: 2}
+ m_BuildSettings:
+ m_LogResourceManagerExceptions: 1
+ m_BundleBuildPath: Temp/com.unity.addressables/AssetBundles
+ m_ProfileSettings:
+ m_Profiles:
+ - m_InheritedParent:
+ m_Id: 4d4a686241dde1e4497a09458afd84bb
+ m_ProfileName: Default
+ m_Values:
+ - m_Id: 0625bc81bb6ebfe4badeca8150066832
+ m_Value: '{UnityEngine.AddressableAssets.Addressables.RuntimePath}/[BuildTarget]'
+ - m_Id: 1bb9adf321c2adb418292ec670ab6046
+ m_Value:
+ - m_Id: b355ca0b0b0f746439d7ce9bb4b81fe3
+ m_Value: 'ServerData/[BuildTarget]'
+ - m_Id: c177911d3f5ed754588b22d7ec9ed060
+ m_Value: '[UnityEngine.AddressableAssets.Addressables.BuildPath]/[BuildTarget]'
+ - m_Id: d9deedb924b434d4cb90947cdc187fd0
+ m_Value: '[UnityEditor.EditorUserBuildSettings.activeBuildTarget]'
+ m_ProfileEntryNames:
+ - m_Id: 0625bc81bb6ebfe4badeca8150066832
+ m_Name: Local.LoadPath
+ m_InlineUsage: 0
+ - m_Id: 1bb9adf321c2adb418292ec670ab6046
+ m_Name: Remote.LoadPath
+ m_InlineUsage: 0
+ - m_Id: b355ca0b0b0f746439d7ce9bb4b81fe3
+ m_Name: Remote.BuildPath
+ m_InlineUsage: 0
+ - m_Id: c177911d3f5ed754588b22d7ec9ed060
+ m_Name: Local.BuildPath
+ m_InlineUsage: 0
+ - m_Id: d9deedb924b434d4cb90947cdc187fd0
+ m_Name: BuildTarget
+ m_InlineUsage: 0
+ m_ProfileVersion: 1
+ m_LabelTable:
+ m_LabelNames:
+ - default
+ - SceneConfig
+ - CameraConfig
+ m_SchemaTemplates: []
+ m_GroupTemplateObjects:
+ - {fileID: 11400000, guid: af0b5782a0090884db056705d7776701, type: 2}
+ m_InitializationObjects: []
+ m_CertificateHandlerType:
+ m_AssemblyName:
+ m_ClassName:
+ m_ActivePlayerDataBuilderIndex: 2
+ m_DataBuilders:
+ - {fileID: 11400000, guid: 5828571a72b3c88408152ee845605cf6, type: 2}
+ - {fileID: 11400000, guid: d324b578f252a7142a647b3ce6fe7c0a, type: 2}
+ - {fileID: 11400000, guid: c32f2fcaa3a15e3439364993cf5d280b, type: 2}
+ m_ActiveProfileId: 4d4a686241dde1e4497a09458afd84bb
diff --git a/Assets/AddressableAssetsData/AddressableAssetSettings.asset.meta b/Assets/AddressableAssetsData/AddressableAssetSettings.asset.meta
new file mode 100644
index 0000000..da61392
--- /dev/null
+++ b/Assets/AddressableAssetsData/AddressableAssetSettings.asset.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: c6c4cec5a69c4d144a5dfabd0405f447
+NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 11400000
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/TutorialInfo/Icons.meta b/Assets/AddressableAssetsData/AssetGroupTemplates.meta
similarity index 57%
rename from Assets/TutorialInfo/Icons.meta
rename to Assets/AddressableAssetsData/AssetGroupTemplates.meta
index 1d19fb9..d0d744f 100644
--- a/Assets/TutorialInfo/Icons.meta
+++ b/Assets/AddressableAssetsData/AssetGroupTemplates.meta
@@ -1,9 +1,8 @@
fileFormatVersion: 2
-guid: 8a0c9218a650547d98138cd835033977
+guid: 44b2636e90c07ac43af77e6a70dd70da
folderAsset: yes
-timeCreated: 1484670163
-licenseType: Store
DefaultImporter:
+ externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
diff --git a/Assets/AddressableAssetsData/AssetGroupTemplates/Packed Assets.asset b/Assets/AddressableAssetsData/AssetGroupTemplates/Packed Assets.asset
new file mode 100644
index 0000000..533ab23
--- /dev/null
+++ b/Assets/AddressableAssetsData/AssetGroupTemplates/Packed Assets.asset
@@ -0,0 +1,79 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!114 &-3087431505975437863
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 5834b5087d578d24c926ce20cd31e6d6, type: 3}
+ m_Name: ContentUpdateGroupSchema
+ m_EditorClassIdentifier: Unity.Addressables.Editor::UnityEditor.AddressableAssets.Settings.GroupSchemas.ContentUpdateGroupSchema
+ m_Group: {fileID: 0}
+ m_StaticContent: 0
+--- !u!114 &11400000
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 1a3c5d64ac83548c09dd1678b9f6f1cd, type: 3}
+ m_Name: Packed Assets
+ m_EditorClassIdentifier: Unity.Addressables.Editor::UnityEditor.AddressableAssets.Settings.AddressableAssetGroupTemplate
+ m_SchemaObjects:
+ - {fileID: 4637821248306542994}
+ - {fileID: -3087431505975437863}
+ m_Description: Pack assets into asset bundles.
+ m_Settings: {fileID: 11400000, guid: c6c4cec5a69c4d144a5dfabd0405f447, type: 2}
+--- !u!114 &4637821248306542994
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: e5d17a21594effb4e9591490b009e7aa, type: 3}
+ m_Name: BundledAssetGroupSchema
+ m_EditorClassIdentifier: Unity.Addressables.Editor::UnityEditor.AddressableAssets.Settings.GroupSchemas.BundledAssetGroupSchema
+ m_Group: {fileID: 0}
+ m_InternalBundleIdMode: 1
+ m_Compression: 1
+ m_IncludeAddressInCatalog: 1
+ m_IncludeGUIDInCatalog: 1
+ m_IncludeLabelsInCatalog: 1
+ m_InternalIdNamingMode: 0
+ m_CacheClearBehavior: 0
+ m_IncludeInBuild: 1
+ m_BundledAssetProviderType:
+ m_AssemblyName:
+ m_ClassName:
+ m_StripDownloadOptions: 0
+ m_ForceUniqueProvider: 0
+ m_UseAssetBundleCache: 1
+ m_UseAssetBundleCrc: 1
+ m_UseAssetBundleCrcForCachedBundles: 1
+ m_UseUWRForLocalBundles: 0
+ m_Timeout: 0
+ m_ChunkedTransfer: 0
+ m_RedirectLimit: -1
+ m_RetryCount: 0
+ m_BuildPath:
+ m_Id:
+ m_LoadPath:
+ m_Id:
+ m_BundleMode: 0
+ m_AssetBundleProviderType:
+ m_AssemblyName:
+ m_ClassName:
+ m_UseDefaultSchemaSettings: 0
+ m_SelectedPathPairIndex: 0
+ m_BundleNaming: 0
+ m_AssetLoadMode: 0
diff --git a/Assets/AddressableAssetsData/AssetGroupTemplates/Packed Assets.asset.meta b/Assets/AddressableAssetsData/AssetGroupTemplates/Packed Assets.asset.meta
new file mode 100644
index 0000000..6ba4211
--- /dev/null
+++ b/Assets/AddressableAssetsData/AssetGroupTemplates/Packed Assets.asset.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: af0b5782a0090884db056705d7776701
+NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 11400000
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AddressableAssetsData/AssetGroups.meta b/Assets/AddressableAssetsData/AssetGroups.meta
new file mode 100644
index 0000000..3083292
--- /dev/null
+++ b/Assets/AddressableAssetsData/AssetGroups.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 69dcc014c1bac254f9abce1606c33df7
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AddressableAssetsData/AssetGroups/Default Local Group.asset b/Assets/AddressableAssetsData/AssetGroups/Default Local Group.asset
new file mode 100644
index 0000000..d641127
--- /dev/null
+++ b/Assets/AddressableAssetsData/AssetGroups/Default Local Group.asset
@@ -0,0 +1,82 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!114 &11400000
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: bbb281ee3bf0b054c82ac2347e9e782c, type: 3}
+ m_Name: Default Local Group
+ m_EditorClassIdentifier: Unity.Addressables.Editor::UnityEditor.AddressableAssets.Settings.AddressableAssetGroup
+ m_GroupName: Default Local Group
+ m_GUID: d790534e015d692428ac5a9ce7d2ceb6
+ m_SerializeEntries:
+ - m_GUID: 4a97987e3a94e0f43b1b57b6ddccac23
+ m_Address: Assets/Resources_moved/Configs/Camera/CameraSettingsConfig.asset
+ m_ReadOnly: 0
+ m_SerializedLabels:
+ - CameraConfig
+ FlaggedDuringContentUpdateRestriction: 0
+ - m_GUID: 4ad92ea93f2a0664191607510b1b623d
+ m_Address: Assets/Resources_moved/Configs/Scenes/Gameplay.asset
+ m_ReadOnly: 0
+ m_SerializedLabels:
+ - SceneConfig
+ FlaggedDuringContentUpdateRestriction: 0
+ - m_GUID: 8d54a5646fc9ef34383c560ce3c3d6ff
+ m_Address: Liminal/Settings/InputServiceConfig
+ m_ReadOnly: 0
+ m_SerializedLabels: []
+ FlaggedDuringContentUpdateRestriction: 0
+ - m_GUID: a78f552da8f156b469b95652e4b0209d
+ m_Address: DebugClassConfig
+ m_ReadOnly: 0
+ m_SerializedLabels: []
+ FlaggedDuringContentUpdateRestriction: 0
+ - m_GUID: becf493a34b841e4d8ea927261a05e9b
+ m_Address: Camera/Camera
+ m_ReadOnly: 0
+ m_SerializedLabels: []
+ FlaggedDuringContentUpdateRestriction: 0
+ - m_GUID: c42e39e2fb64cdd45b2ebc4b723d9d0c
+ m_Address: Assets/Resources_moved/Configs/Camera/GameCameraConfig.asset
+ m_ReadOnly: 0
+ m_SerializedLabels: []
+ FlaggedDuringContentUpdateRestriction: 0
+ - m_GUID: c9ba47101ea957549b0379d4e5fae54c
+ m_Address: Assets/Scenes/MainMenu.unity
+ m_ReadOnly: 0
+ m_SerializedLabels: []
+ FlaggedDuringContentUpdateRestriction: 0
+ - m_GUID: d54fabdcc748a594aa0551dcd235c7c2
+ m_Address: ScenesAssetReferences
+ m_ReadOnly: 0
+ m_SerializedLabels: []
+ FlaggedDuringContentUpdateRestriction: 0
+ - m_GUID: df809fbbdc1f51f43b4d42a7896a0919
+ m_Address: Assets/Scenes/Gameplay.unity
+ m_ReadOnly: 0
+ m_SerializedLabels: []
+ FlaggedDuringContentUpdateRestriction: 0
+ - m_GUID: f146779bcd07c524097072c871162bff
+ m_Address: Assets/Resources_moved/Configs/Camera/FPSConfig.asset
+ m_ReadOnly: 0
+ m_SerializedLabels:
+ - CameraConfig
+ FlaggedDuringContentUpdateRestriction: 0
+ - m_GUID: f5e16d3d2576c5a4ca27ea09aeb18733
+ m_Address: Assets/Resources_moved/Configs/Scenes/MainMenu.asset
+ m_ReadOnly: 0
+ m_SerializedLabels:
+ - SceneConfig
+ FlaggedDuringContentUpdateRestriction: 0
+ m_ReadOnly: 0
+ m_Settings: {fileID: 11400000, guid: c6c4cec5a69c4d144a5dfabd0405f447, type: 2}
+ m_SchemaSet:
+ m_Schemas:
+ - {fileID: 11400000, guid: 15788cbd058e4e54d8cdf200fa21904a, type: 2}
+ - {fileID: 11400000, guid: 818d1cfb2f3daeb41942c3e5367f4fbc, type: 2}
diff --git a/Assets/AddressableAssetsData/AssetGroups/Default Local Group.asset.meta b/Assets/AddressableAssetsData/AssetGroups/Default Local Group.asset.meta
new file mode 100644
index 0000000..f346e67
--- /dev/null
+++ b/Assets/AddressableAssetsData/AssetGroups/Default Local Group.asset.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: cd5d8f0bccfc1e5489a5c528087c4feb
+NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 11400000
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas.meta b/Assets/AddressableAssetsData/AssetGroups/Schemas.meta
new file mode 100644
index 0000000..dc75b5b
--- /dev/null
+++ b/Assets/AddressableAssetsData/AssetGroups/Schemas.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 59cf85b8277d19b498da8736741b34f4
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_BundledAssetGroupSchema.asset b/Assets/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_BundledAssetGroupSchema.asset
new file mode 100644
index 0000000..3a056bc
--- /dev/null
+++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_BundledAssetGroupSchema.asset
@@ -0,0 +1,48 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!114 &11400000
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: e5d17a21594effb4e9591490b009e7aa, type: 3}
+ m_Name: Default Local Group_BundledAssetGroupSchema
+ m_EditorClassIdentifier: Unity.Addressables.Editor::UnityEditor.AddressableAssets.Settings.GroupSchemas.BundledAssetGroupSchema
+ m_Group: {fileID: 11400000, guid: cd5d8f0bccfc1e5489a5c528087c4feb, type: 2}
+ m_InternalBundleIdMode: 1
+ m_Compression: 1
+ m_IncludeAddressInCatalog: 1
+ m_IncludeGUIDInCatalog: 1
+ m_IncludeLabelsInCatalog: 1
+ m_InternalIdNamingMode: 0
+ m_CacheClearBehavior: 0
+ m_IncludeInBuild: 1
+ m_BundledAssetProviderType:
+ m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
+ m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider
+ m_StripDownloadOptions: 0
+ m_ForceUniqueProvider: 0
+ m_UseAssetBundleCache: 1
+ m_UseAssetBundleCrc: 1
+ m_UseAssetBundleCrcForCachedBundles: 1
+ m_UseUWRForLocalBundles: 0
+ m_Timeout: 0
+ m_ChunkedTransfer: 0
+ m_RedirectLimit: -1
+ m_RetryCount: 0
+ m_BuildPath:
+ m_Id: c177911d3f5ed754588b22d7ec9ed060
+ m_LoadPath:
+ m_Id: 0625bc81bb6ebfe4badeca8150066832
+ m_BundleMode: 0
+ m_AssetBundleProviderType:
+ m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
+ m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider
+ m_UseDefaultSchemaSettings: 0
+ m_SelectedPathPairIndex: 0
+ m_BundleNaming: 0
+ m_AssetLoadMode: 0
diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_BundledAssetGroupSchema.asset.meta b/Assets/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_BundledAssetGroupSchema.asset.meta
new file mode 100644
index 0000000..7d44416
--- /dev/null
+++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_BundledAssetGroupSchema.asset.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 15788cbd058e4e54d8cdf200fa21904a
+NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 11400000
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_ContentUpdateGroupSchema.asset b/Assets/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_ContentUpdateGroupSchema.asset
new file mode 100644
index 0000000..7538cdc
--- /dev/null
+++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_ContentUpdateGroupSchema.asset
@@ -0,0 +1,16 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!114 &11400000
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 5834b5087d578d24c926ce20cd31e6d6, type: 3}
+ m_Name: Default Local Group_ContentUpdateGroupSchema
+ m_EditorClassIdentifier: Unity.Addressables.Editor::UnityEditor.AddressableAssets.Settings.GroupSchemas.ContentUpdateGroupSchema
+ m_Group: {fileID: 11400000, guid: cd5d8f0bccfc1e5489a5c528087c4feb, type: 2}
+ m_StaticContent: 0
diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_ContentUpdateGroupSchema.asset.meta b/Assets/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_ContentUpdateGroupSchema.asset.meta
new file mode 100644
index 0000000..c6719df
--- /dev/null
+++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_ContentUpdateGroupSchema.asset.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 818d1cfb2f3daeb41942c3e5367f4fbc
+NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 11400000
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AddressableAssetsData/DataBuilders.meta b/Assets/AddressableAssetsData/DataBuilders.meta
new file mode 100644
index 0000000..803d542
--- /dev/null
+++ b/Assets/AddressableAssetsData/DataBuilders.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: df12fa2b84c582c498081bd75e380012
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AddressableAssetsData/DataBuilders/BuildScriptFastMode.asset b/Assets/AddressableAssetsData/DataBuilders/BuildScriptFastMode.asset
new file mode 100644
index 0000000..12ab1d2
--- /dev/null
+++ b/Assets/AddressableAssetsData/DataBuilders/BuildScriptFastMode.asset
@@ -0,0 +1,20 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!114 &11400000
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 88d21199f5d473f4db36845f2318f180, type: 3}
+ m_Name: BuildScriptFastMode
+ m_EditorClassIdentifier: Unity.Addressables.Editor::UnityEditor.AddressableAssets.Build.DataBuilders.BuildScriptFastMode
+ instanceProviderType:
+ m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
+ m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider
+ sceneProviderType:
+ m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
+ m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.SceneProvider
diff --git a/Assets/AddressableAssetsData/DataBuilders/BuildScriptFastMode.asset.meta b/Assets/AddressableAssetsData/DataBuilders/BuildScriptFastMode.asset.meta
new file mode 100644
index 0000000..4cbfcd3
--- /dev/null
+++ b/Assets/AddressableAssetsData/DataBuilders/BuildScriptFastMode.asset.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 5828571a72b3c88408152ee845605cf6
+NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 11400000
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AddressableAssetsData/DataBuilders/BuildScriptPackedMode.asset b/Assets/AddressableAssetsData/DataBuilders/BuildScriptPackedMode.asset
new file mode 100644
index 0000000..d8c59fd
--- /dev/null
+++ b/Assets/AddressableAssetsData/DataBuilders/BuildScriptPackedMode.asset
@@ -0,0 +1,20 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!114 &11400000
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 3e2e0ffa088c91d41a086d0b8cb16bdc, type: 3}
+ m_Name: BuildScriptPackedMode
+ m_EditorClassIdentifier: Unity.Addressables.Editor::UnityEditor.AddressableAssets.Build.DataBuilders.BuildScriptPackedMode
+ instanceProviderType:
+ m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
+ m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider
+ sceneProviderType:
+ m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
+ m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.SceneProvider
diff --git a/Assets/AddressableAssetsData/DataBuilders/BuildScriptPackedMode.asset.meta b/Assets/AddressableAssetsData/DataBuilders/BuildScriptPackedMode.asset.meta
new file mode 100644
index 0000000..a207588
--- /dev/null
+++ b/Assets/AddressableAssetsData/DataBuilders/BuildScriptPackedMode.asset.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: c32f2fcaa3a15e3439364993cf5d280b
+NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 11400000
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AddressableAssetsData/DataBuilders/BuildScriptPackedPlayMode.asset b/Assets/AddressableAssetsData/DataBuilders/BuildScriptPackedPlayMode.asset
new file mode 100644
index 0000000..d566c2c
--- /dev/null
+++ b/Assets/AddressableAssetsData/DataBuilders/BuildScriptPackedPlayMode.asset
@@ -0,0 +1,20 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!114 &11400000
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: ad8c280d42ee0ed41a27db23b43dd2bf, type: 3}
+ m_Name: BuildScriptPackedPlayMode
+ m_EditorClassIdentifier: Unity.Addressables.Editor::UnityEditor.AddressableAssets.Build.DataBuilders.BuildScriptPackedPlayMode
+ instanceProviderType:
+ m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
+ m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider
+ sceneProviderType:
+ m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
+ m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.SceneProvider
diff --git a/Assets/AddressableAssetsData/DataBuilders/BuildScriptPackedPlayMode.asset.meta b/Assets/AddressableAssetsData/DataBuilders/BuildScriptPackedPlayMode.asset.meta
new file mode 100644
index 0000000..ad385fc
--- /dev/null
+++ b/Assets/AddressableAssetsData/DataBuilders/BuildScriptPackedPlayMode.asset.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: d324b578f252a7142a647b3ce6fe7c0a
+NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 11400000
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/AddressableAssetsData/DefaultObject.asset b/Assets/AddressableAssetsData/DefaultObject.asset
new file mode 100644
index 0000000..bec9f72
--- /dev/null
+++ b/Assets/AddressableAssetsData/DefaultObject.asset
@@ -0,0 +1,15 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!114 &11400000
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 3a189bb168d8d90478a09ea08c2f3d72, type: 3}
+ m_Name: DefaultObject
+ m_EditorClassIdentifier: Unity.Addressables.Editor::UnityEditor.AddressableAssets.AddressableAssetSettingsDefaultObject
+ m_AddressableAssetSettingsGuid: c6c4cec5a69c4d144a5dfabd0405f447
diff --git a/Assets/AddressableAssetsData/DefaultObject.asset.meta b/Assets/AddressableAssetsData/DefaultObject.asset.meta
new file mode 100644
index 0000000..b9f5223
--- /dev/null
+++ b/Assets/AddressableAssetsData/DefaultObject.asset.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 4500108910384ba44a8f6f5ec4deb9c3
+NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 11400000
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Code/Debug.meta b/Assets/Code/Debug.meta
deleted file mode 100644
index 6993c75..0000000
--- a/Assets/Code/Debug.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 3487788d480845039f84f7aa89195d0b
-timeCreated: 1765564013
\ No newline at end of file
diff --git a/Assets/Code/Debug/DebugInstaller.cs b/Assets/Code/Debug/DebugInstaller.cs
deleted file mode 100644
index 93bf618..0000000
--- a/Assets/Code/Debug/DebugInstaller.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using Reflex.Core;
-
-namespace Code.Debug
-{
- public class DebugInstaller : IInstaller
- {
- public void InstallBindings(ContainerBuilder containerBuilder)
- {
- containerBuilder.AddSingleton(typeof(DebugStateMachine));
-
- containerBuilder.OnContainerBuilt += Bootstrap;
- }
-
- private void Bootstrap(Container container)
- {
- container.Resolve();
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Code/Debug/DebugInstaller.cs.meta b/Assets/Code/Debug/DebugInstaller.cs.meta
deleted file mode 100644
index 09bf00c..0000000
--- a/Assets/Code/Debug/DebugInstaller.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 35352cf8cf4f4b638e1a1693a704f052
-timeCreated: 1765565958
\ No newline at end of file
diff --git a/Assets/Code/Debug/DebugStateMachine.cs b/Assets/Code/Debug/DebugStateMachine.cs
deleted file mode 100644
index 7c94e5e..0000000
--- a/Assets/Code/Debug/DebugStateMachine.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-using Code.StateMachine;
-
-namespace Code.Debug
-{
- public enum DebugStates
- {
- First,
- Second,
- Third
- }
- public class DebugStateMachineContext
- {
- public int SomeValue;
- }
-
- [Generators.StateMachine(typeof(DebugStateMachineContext), typeof(DebugStates))]
- public partial class DebugStateMachine
- { }
-}
\ No newline at end of file
diff --git a/Assets/Code/Debug/DebugStateMachine.cs.meta b/Assets/Code/Debug/DebugStateMachine.cs.meta
deleted file mode 100644
index 56901ff..0000000
--- a/Assets/Code/Debug/DebugStateMachine.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 71d501bd1540463496c6df3fa0bbb0ca
-timeCreated: 1765564028
\ No newline at end of file
diff --git a/Assets/Code/Debug/States.meta b/Assets/Code/Debug/States.meta
deleted file mode 100644
index 566eaa0..0000000
--- a/Assets/Code/Debug/States.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 6e84c82fd2ce4c449bee71acf27ed874
-timeCreated: 1765566284
\ No newline at end of file
diff --git a/Assets/Code/Debug/States/FirstState.cs b/Assets/Code/Debug/States/FirstState.cs
deleted file mode 100644
index 05379ef..0000000
--- a/Assets/Code/Debug/States/FirstState.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using Code.Generators;
-using Code.StateMachine;
-
-namespace Code.Debug.States
-{
- [State(typeof(DebugStateMachineContext) )]
- public partial class FirstState : BaseState
- {
- public FirstState(DebugStateMachineContext context) : base(context)
- {
- }
-
- public override DebugStates myState => DebugStates.First;
- }
- [State(typeof(DebugStateMachineContext) )]
- public partial class SecondState : BaseState
- {
- public SecondState(DebugStateMachineContext context) : base(context)
- {
- }
-
- public override DebugStates myState => DebugStates.First;
- }
-}
\ No newline at end of file
diff --git a/Assets/Code/Debug/States/FirstState.cs.meta b/Assets/Code/Debug/States/FirstState.cs.meta
deleted file mode 100644
index 6f187ec..0000000
--- a/Assets/Code/Debug/States/FirstState.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 24af5a4d2545481589242a5945bbafa5
-timeCreated: 1765566292
\ No newline at end of file
diff --git a/Assets/Code/Example.meta b/Assets/Code/Example.meta
new file mode 100644
index 0000000..adeca3b
--- /dev/null
+++ b/Assets/Code/Example.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 07cf07a937934e0094469237b5865b60
+timeCreated: 1766350980
\ No newline at end of file
diff --git a/Assets/Code/Example/Liminal.meta b/Assets/Code/Example/Liminal.meta
new file mode 100644
index 0000000..af73c24
--- /dev/null
+++ b/Assets/Code/Example/Liminal.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: b03c560586d24e78b3fee9249e2f3d61
+timeCreated: 1766605332
\ No newline at end of file
diff --git a/Assets/Code/Example/Liminal/Character.meta b/Assets/Code/Example/Liminal/Character.meta
new file mode 100644
index 0000000..91d9068
--- /dev/null
+++ b/Assets/Code/Example/Liminal/Character.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: b44837d95edd481087730e30635ab5fc
+timeCreated: 1766605342
\ No newline at end of file
diff --git a/Assets/Code/Example/Liminal/Character/LiminalCharacterController.cs b/Assets/Code/Example/Liminal/Character/LiminalCharacterController.cs
new file mode 100644
index 0000000..f7bbaef
--- /dev/null
+++ b/Assets/Code/Example/Liminal/Character/LiminalCharacterController.cs
@@ -0,0 +1,483 @@
+using System.Collections.Generic;
+using KinematicCharacterController;
+using UnityEngine;
+
+namespace Code.Example.Liminal.Character
+{
+ public enum CharacterState
+ {
+ Default,
+ }
+
+ public enum OrientationMethod
+ {
+ TowardsCamera,
+ TowardsMovement,
+ }
+
+ public class PlayerCharacterInputs
+ {
+ public float MoveAxisForward;
+ public float MoveAxisRight;
+ public Quaternion CameraRotation;
+ public bool CrouchDown;
+ public bool CrouchUp;
+ }
+
+ public struct AICharacterInputs
+ {
+ public Vector3 MoveVector;
+ public Vector3 LookVector;
+ }
+
+ public enum BonusOrientationMethod
+ {
+ None,
+ TowardsGravity,
+ TowardsGroundSlopeAndGravity,
+ }
+
+ public class LiminalCharacterController : MonoBehaviour, ICharacterController
+ {
+ public KinematicCharacterMotor Motor;
+
+ [Header("Stable Movement")] public float MaxStableMoveSpeed = 10f;
+ public float StableMovementSharpness = 15f;
+ public float OrientationSharpness = 10f;
+ public bool InfinitelySharpRotation;
+ public OrientationMethod OrientationMethod = OrientationMethod.TowardsCamera;
+
+ [Header("Air Movement")] public float MaxAirMoveSpeed = 15f;
+ public float AirAccelerationSpeed = 15f;
+ public float Drag = 0.1f;
+
+ [Header("Misc")] public List IgnoredColliders = new List();
+ public BonusOrientationMethod BonusOrientationMethod = BonusOrientationMethod.None;
+ public float BonusOrientationSharpness = 10f;
+
+ public Vector3 Gravity = new Vector3(0, -30f, 0);
+
+ // public Transform MeshRoot;
+ public float CrouchedCapsuleHeight = 1f;
+
+ public CharacterState CurrentCharacterState { get; private set; }
+
+ private Collider[] _probedColliders = new Collider[8];
+ private RaycastHit[] _probedHits = new RaycastHit[8];
+ private Vector3 _moveInputVector;
+ private Vector3 _lookInputVector;
+ private Vector3 _internalVelocityAdd = Vector3.zero;
+ private bool _shouldBeCrouching = false;
+ private bool _isCrouching = false;
+
+
+ public void Teleport(Vector3 position, Quaternion rotation)
+ {
+ Motor.SetPosition(position);
+ Motor.SetRotation(rotation);
+ }
+
+ private void Awake()
+ {
+ // Handle initial state
+ TransitionToState(CharacterState.Default);
+
+ // Assign the characterController to the motor
+ Motor.CharacterController = this;
+ }
+
+ ///
+ /// Handles movement state transitions and enter/exit callbacks
+ ///
+ public void TransitionToState(CharacterState newState)
+ {
+ CharacterState tmpInitialState = CurrentCharacterState;
+ OnStateExit(tmpInitialState, newState);
+ CurrentCharacterState = newState;
+ OnStateEnter(newState, tmpInitialState);
+ }
+
+ ///
+ /// Event when entering a state
+ ///
+ private void OnStateEnter(CharacterState state, CharacterState fromState)
+ {
+ switch (state)
+ {
+ case CharacterState.Default:
+ {
+ break;
+ }
+ }
+ }
+
+ ///
+ /// Event when exiting a state
+ ///
+ private void OnStateExit(CharacterState state, CharacterState toState)
+ {
+ switch (state)
+ {
+ case CharacterState.Default:
+ {
+ break;
+ }
+ }
+ }
+
+ ///
+ /// This is called every frame by ExamplePlayer in order to tell the character what its inputs are
+ ///
+ public void SetInputs(PlayerCharacterInputs inputs)
+ {
+ // Clamp input
+ Vector3 moveInputVector =
+ Vector3.ClampMagnitude(new Vector3(inputs.MoveAxisRight, 0f, inputs.MoveAxisForward), 1f);
+
+ // Calculate camera direction and rotation on the character plane
+ Vector3 cameraPlanarDirection =
+ Vector3.ProjectOnPlane(inputs.CameraRotation * Vector3.forward, Motor.CharacterUp).normalized;
+ if (cameraPlanarDirection.sqrMagnitude == 0f)
+ {
+ cameraPlanarDirection = Vector3.ProjectOnPlane(inputs.CameraRotation * Vector3.up, Motor.CharacterUp)
+ .normalized;
+ }
+
+ Quaternion cameraPlanarRotation = Quaternion.LookRotation(cameraPlanarDirection, Motor.CharacterUp);
+
+ switch (CurrentCharacterState)
+ {
+ case CharacterState.Default:
+ {
+ // Move and look inputs
+ _moveInputVector = cameraPlanarRotation * moveInputVector;
+
+ switch (OrientationMethod)
+ {
+ case OrientationMethod.TowardsCamera:
+ _lookInputVector = cameraPlanarDirection;
+ break;
+ case OrientationMethod.TowardsMovement:
+ _lookInputVector = _moveInputVector.normalized;
+ break;
+ }
+
+
+ // Crouching input
+ if (inputs.CrouchDown)
+ {
+ _shouldBeCrouching = true;
+
+ if (!_isCrouching)
+ {
+ _isCrouching = true;
+ Motor.SetCapsuleDimensions(0.5f, CrouchedCapsuleHeight, CrouchedCapsuleHeight * 0.5f);
+ // MeshRoot.localScale = new Vector3(1f, 0.5f, 1f);
+ }
+ }
+ else if (inputs.CrouchUp)
+ {
+ _shouldBeCrouching = false;
+ }
+
+ break;
+ }
+ }
+ }
+
+ ///
+ /// This is called every frame by the AI script in order to tell the character what its inputs are
+ ///
+ public void SetInputs(ref AICharacterInputs inputs)
+ {
+ _moveInputVector = inputs.MoveVector;
+ _lookInputVector = inputs.LookVector;
+ }
+
+ private Quaternion _tmpTransientRot;
+
+ ///
+ /// (Called by KinematicCharacterMotor during its update cycle)
+ /// This is called before the character begins its movement update
+ ///
+ public void BeforeCharacterUpdate(float deltaTime)
+ {
+ }
+
+ ///
+ /// (Called by KinematicCharacterMotor during its update cycle)
+ /// This is where you tell your character what its rotation should be right now.
+ /// This is the ONLY place where you should set the character's rotation
+ ///
+ public void UpdateRotation(ref Quaternion currentRotation, float deltaTime)
+ {
+ switch (CurrentCharacterState)
+ {
+ case CharacterState.Default:
+ {
+ if (!InfinitelySharpRotation)
+ {
+ if (_lookInputVector.sqrMagnitude > 0f && OrientationSharpness > 0f)
+ {
+ // Smoothly interpolate from current to target look direction
+ Vector3 smoothedLookInputDirection = Vector3.Slerp(Motor.CharacterForward,
+ _lookInputVector, 1 - Mathf.Exp(-OrientationSharpness * deltaTime)).normalized;
+
+ // Set the current rotation (which will be used by the KinematicCharacterMotor)
+ currentRotation =
+ Quaternion.LookRotation(smoothedLookInputDirection, Motor.CharacterUp);
+ }
+ }
+ else
+ {
+ currentRotation = Quaternion.LookRotation(_lookInputVector, Motor.CharacterUp);
+ }
+
+ Vector3 currentUp = (currentRotation * Vector3.up);
+ if (BonusOrientationMethod == BonusOrientationMethod.TowardsGravity)
+ {
+ // Rotate from current up to invert gravity
+ Vector3 smoothedGravityDir = Vector3.Slerp(currentUp, -Gravity.normalized,
+ 1 - Mathf.Exp(-BonusOrientationSharpness * deltaTime));
+ currentRotation = Quaternion.FromToRotation(currentUp, smoothedGravityDir) * currentRotation;
+ }
+ else if (BonusOrientationMethod == BonusOrientationMethod.TowardsGroundSlopeAndGravity)
+ {
+ if (Motor.GroundingStatus.IsStableOnGround)
+ {
+ Vector3 initialCharacterBottomHemiCenter =
+ Motor.TransientPosition + (currentUp * Motor.Capsule.radius);
+
+ Vector3 smoothedGroundNormal = Vector3.Slerp(Motor.CharacterUp,
+ Motor.GroundingStatus.GroundNormal,
+ 1 - Mathf.Exp(-BonusOrientationSharpness * deltaTime));
+ currentRotation = Quaternion.FromToRotation(currentUp, smoothedGroundNormal) *
+ currentRotation;
+
+ // Move the position to create a rotation around the bottom hemi center instead of around the pivot
+ Motor.SetTransientPosition(initialCharacterBottomHemiCenter +
+ (currentRotation * Vector3.down * Motor.Capsule.radius));
+ }
+ else
+ {
+ Vector3 smoothedGravityDir = Vector3.Slerp(currentUp, -Gravity.normalized,
+ 1 - Mathf.Exp(-BonusOrientationSharpness * deltaTime));
+ currentRotation = Quaternion.FromToRotation(currentUp, smoothedGravityDir) *
+ currentRotation;
+ }
+ }
+ else
+ {
+ Vector3 smoothedGravityDir = Vector3.Slerp(currentUp, Vector3.up,
+ 1 - Mathf.Exp(-BonusOrientationSharpness * deltaTime));
+ currentRotation = Quaternion.FromToRotation(currentUp, smoothedGravityDir) * currentRotation;
+ }
+
+ break;
+ }
+ }
+ }
+
+ ///
+ /// (Called by KinematicCharacterMotor during its update cycle)
+ /// This is where you tell your character what its velocity should be right now.
+ /// This is the ONLY place where you can set the character's velocity
+ ///
+ public void UpdateVelocity(ref Vector3 currentVelocity, float deltaTime)
+ {
+ switch (CurrentCharacterState)
+ {
+ case CharacterState.Default:
+ {
+ // Ground movement
+ if (Motor.GroundingStatus.IsStableOnGround)
+ {
+ float currentVelocityMagnitude = currentVelocity.magnitude;
+
+ Vector3 effectiveGroundNormal = Motor.GroundingStatus.GroundNormal;
+
+ // Reorient velocity on slope
+ currentVelocity = Motor.GetDirectionTangentToSurface(currentVelocity, effectiveGroundNormal) *
+ currentVelocityMagnitude;
+
+ // Calculate target velocity
+ Vector3 inputRight = Vector3.Cross(_moveInputVector, Motor.CharacterUp);
+ Vector3 reorientedInput = Vector3.Cross(effectiveGroundNormal, inputRight).normalized *
+ _moveInputVector.magnitude;
+ Vector3 targetMovementVelocity = reorientedInput * MaxStableMoveSpeed;
+
+ // Smooth movement Velocity
+ currentVelocity = Vector3.Lerp(currentVelocity, targetMovementVelocity,
+ 1f - Mathf.Exp(-StableMovementSharpness * deltaTime));
+ }
+ // Air movement
+ else
+ {
+ // Add move input
+ if (_moveInputVector.sqrMagnitude > 0f)
+ {
+ Vector3 addedVelocity = _moveInputVector * AirAccelerationSpeed * deltaTime;
+
+ Vector3 currentVelocityOnInputsPlane =
+ Vector3.ProjectOnPlane(currentVelocity, Motor.CharacterUp);
+
+ // Limit air velocity from inputs
+ if (currentVelocityOnInputsPlane.magnitude < MaxAirMoveSpeed)
+ {
+ // clamp addedVel to make total vel not exceed max vel on inputs plane
+ Vector3 newTotal = Vector3.ClampMagnitude(currentVelocityOnInputsPlane + addedVelocity,
+ MaxAirMoveSpeed);
+ addedVelocity = newTotal - currentVelocityOnInputsPlane;
+ }
+ else
+ {
+ // Make sure added vel doesn't go in the direction of the already-exceeding velocity
+ if (Vector3.Dot(currentVelocityOnInputsPlane, addedVelocity) > 0f)
+ {
+ addedVelocity = Vector3.ProjectOnPlane(addedVelocity,
+ currentVelocityOnInputsPlane.normalized);
+ }
+ }
+
+ // Prevent air-climbing sloped walls
+ if (Motor.GroundingStatus.FoundAnyGround)
+ {
+ if (Vector3.Dot(currentVelocity + addedVelocity, addedVelocity) > 0f)
+ {
+ Vector3 perpenticularObstructionNormal = Vector3
+ .Cross(Vector3.Cross(Motor.CharacterUp, Motor.GroundingStatus.GroundNormal),
+ Motor.CharacterUp).normalized;
+ addedVelocity =
+ Vector3.ProjectOnPlane(addedVelocity, perpenticularObstructionNormal);
+ }
+ }
+
+ // Apply added velocity
+ currentVelocity += addedVelocity;
+ }
+
+ // Gravity
+ currentVelocity += Gravity * deltaTime;
+
+ // Drag
+ currentVelocity *= (1f / (1f + (Drag * deltaTime)));
+ }
+
+ // Take into account additive velocity
+ if (_internalVelocityAdd.sqrMagnitude > 0f)
+ {
+ currentVelocity += _internalVelocityAdd;
+ _internalVelocityAdd = Vector3.zero;
+ }
+
+ break;
+ }
+ }
+ }
+
+ ///
+ /// (Called by KinematicCharacterMotor during its update cycle)
+ /// This is called after the character has finished its movement update
+ ///
+ public void AfterCharacterUpdate(float deltaTime)
+ {
+ switch (CurrentCharacterState)
+ {
+ case CharacterState.Default:
+ {
+ // Handle uncrouching
+ if (_isCrouching && !_shouldBeCrouching)
+ {
+ // Do an overlap test with the character's standing height to see if there are any obstructions
+ Motor.SetCapsuleDimensions(0.5f, 2f, 1f);
+ if (Motor.CharacterOverlap(
+ Motor.TransientPosition,
+ Motor.TransientRotation,
+ _probedColliders,
+ Motor.CollidableLayers,
+ QueryTriggerInteraction.Ignore) > 0)
+ {
+ // If obstructions, just stick to crouching dimensions
+ Motor.SetCapsuleDimensions(0.5f, CrouchedCapsuleHeight, CrouchedCapsuleHeight * 0.5f);
+ }
+ else
+ {
+ // If no obstructions, uncrouch
+ // MeshRoot.localScale = new Vector3(1f, 1f, 1f);
+ _isCrouching = false;
+ }
+ }
+
+ break;
+ }
+ }
+ }
+
+ public void PostGroundingUpdate(float deltaTime)
+ {
+ // Handle landing and leaving ground
+ if (Motor.GroundingStatus.IsStableOnGround && !Motor.LastGroundingStatus.IsStableOnGround)
+ {
+ OnLanded();
+ }
+ else if (!Motor.GroundingStatus.IsStableOnGround && Motor.LastGroundingStatus.IsStableOnGround)
+ {
+ OnLeaveStableGround();
+ }
+ }
+
+ public bool IsColliderValidForCollisions(Collider coll)
+ {
+ if (IgnoredColliders.Count == 0)
+ {
+ return true;
+ }
+
+ if (IgnoredColliders.Contains(coll))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ public void OnGroundHit(Collider hitCollider, Vector3 hitNormal, Vector3 hitPoint,
+ ref HitStabilityReport hitStabilityReport)
+ {
+ }
+
+ public void OnMovementHit(Collider hitCollider, Vector3 hitNormal, Vector3 hitPoint,
+ ref HitStabilityReport hitStabilityReport)
+ {
+ }
+
+ public void AddVelocity(Vector3 velocity)
+ {
+ switch (CurrentCharacterState)
+ {
+ case CharacterState.Default:
+ {
+ _internalVelocityAdd += velocity;
+ break;
+ }
+ }
+ }
+
+ public void ProcessHitStabilityReport(Collider hitCollider, Vector3 hitNormal, Vector3 hitPoint,
+ Vector3 atCharacterPosition, Quaternion atCharacterRotation, ref HitStabilityReport hitStabilityReport)
+ {
+ }
+
+ protected void OnLanded()
+ {
+ }
+
+ protected void OnLeaveStableGround()
+ {
+ }
+
+ public void OnDiscreteCollisionDetected(Collider hitCollider)
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Example/Liminal/Character/LiminalCharacterController.cs.meta b/Assets/Code/Example/Liminal/Character/LiminalCharacterController.cs.meta
new file mode 100644
index 0000000..f34d214
--- /dev/null
+++ b/Assets/Code/Example/Liminal/Character/LiminalCharacterController.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: ba1cb0200be742ec8d680ad8b2d662cb
+timeCreated: 1766610552
\ No newline at end of file
diff --git a/Assets/Code/Example/Liminal/Player.meta b/Assets/Code/Example/Liminal/Player.meta
new file mode 100644
index 0000000..4857217
--- /dev/null
+++ b/Assets/Code/Example/Liminal/Player.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: d7569a6973424ff5802b1635c5338316
+timeCreated: 1766611137
\ No newline at end of file
diff --git a/Assets/Code/Example/Liminal/Player/PlayerAnimator.cs b/Assets/Code/Example/Liminal/Player/PlayerAnimator.cs
new file mode 100644
index 0000000..4570af9
--- /dev/null
+++ b/Assets/Code/Example/Liminal/Player/PlayerAnimator.cs
@@ -0,0 +1,18 @@
+using KinematicCharacterController;
+using UnityEngine;
+
+namespace Code.Example.Liminal.Player
+{
+ public class PlayerAnimator : MonoBehaviour
+ {
+ private static readonly int Velocity = Animator.StringToHash("Velocity");
+
+ [SerializeField] private Animator animator;
+ [SerializeField] private KinematicCharacterMotor characterMotor;
+
+ private void Update()
+ {
+ animator.SetFloat(Velocity, characterMotor.Velocity.magnitude);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Example/Liminal/Player/PlayerAnimator.cs.meta b/Assets/Code/Example/Liminal/Player/PlayerAnimator.cs.meta
new file mode 100644
index 0000000..b837bd3
--- /dev/null
+++ b/Assets/Code/Example/Liminal/Player/PlayerAnimator.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: e79636518658432a99481e476aeebc66
+timeCreated: 1766610269
\ No newline at end of file
diff --git a/Assets/Code/Example/Liminal/Player/PlayerFactory.cs b/Assets/Code/Example/Liminal/Player/PlayerFactory.cs
new file mode 100644
index 0000000..bda9639
--- /dev/null
+++ b/Assets/Code/Example/Liminal/Player/PlayerFactory.cs
@@ -0,0 +1,7 @@
+namespace Code.Example.Liminal.Player
+{
+ public class PlayerFactory
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Example/Liminal/Player/PlayerFactory.cs.meta b/Assets/Code/Example/Liminal/Player/PlayerFactory.cs.meta
new file mode 100644
index 0000000..8cc273d
--- /dev/null
+++ b/Assets/Code/Example/Liminal/Player/PlayerFactory.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 60b7c1aa1c8c4189a2b442d2b4c628eb
+timeCreated: 1766652945
\ No newline at end of file
diff --git a/Assets/Code/Example/Liminal/Player/PlayerMovementController.cs b/Assets/Code/Example/Liminal/Player/PlayerMovementController.cs
new file mode 100644
index 0000000..86a08c7
--- /dev/null
+++ b/Assets/Code/Example/Liminal/Player/PlayerMovementController.cs
@@ -0,0 +1,74 @@
+using System;
+using Code.Example.Liminal.Character;
+using Code.Infrastructure.Camera;
+using Code.Infrastructure.Camera.CameraStates;
+using Code.Infrastructure.Input;
+using Reflex.Attributes;
+using UnityEngine;
+using UnityEngine.InputSystem;
+
+namespace Code.Example.Liminal.Player
+{
+ public class PlayerMovementController : MonoBehaviour
+ {
+ [SerializeField] private LiminalCharacterController characterController;
+ private PlayerCharacterInputs _currentInputs = new();
+ private IInputService _inputService;
+
+ private CameraStateMachine _cameraStateMachine;
+
+ public Transform PlayerHeadPoint;
+
+ [Inject]
+ private void Construct(IInputService inputService, CameraStateMachine stateMachine)
+ {
+ _inputService = inputService;
+ _inputService.BindActionPerformed((int) ActionMappings.Gameplay, (int) GameplayActions.Move, OnMovePerformed);
+ _inputService.BindActionCancel((int) ActionMappings.Gameplay, (int) GameplayActions.Move, OnMoveCanceled);
+ _inputService.BindActionPerformed((int) ActionMappings.Gameplay, (int) GameplayActions.Crouch, OnCrouchPerformed);
+ _inputService.BindActionCancel((int) ActionMappings.Gameplay, (int) GameplayActions.Crouch, OnCrouchCanceled);
+
+ _cameraStateMachine = stateMachine;
+ ((FirstPersonCameraState)stateMachine.CurrentBaseState).SetPlayer(this);
+
+ }
+
+ private void Awake()
+ {
+ _currentInputs.MoveAxisForward = 0;
+ _currentInputs.MoveAxisRight = 0;
+ _currentInputs.CrouchUp = true;
+ _currentInputs.CrouchDown = false;
+ _currentInputs.CameraRotation = Quaternion.identity;
+ }
+
+ public void SetCameraRotation(Quaternion rotation) => _currentInputs.CameraRotation = rotation;
+ private void OnMovePerformed(InputAction.CallbackContext context)
+ {
+ _currentInputs.MoveAxisForward = context.ReadValue().y;
+ _currentInputs.MoveAxisRight = context.ReadValue().x;
+ }
+
+ private void OnMoveCanceled(InputAction.CallbackContext context)
+ {
+ _currentInputs.MoveAxisForward = 0;
+ _currentInputs.MoveAxisRight = 0;
+ }
+
+ private void OnCrouchPerformed(InputAction.CallbackContext context)
+ {
+ _currentInputs.CrouchDown = true;
+ _currentInputs.CrouchUp = false;
+ }
+
+ private void OnCrouchCanceled(InputAction.CallbackContext context)
+ {
+ _currentInputs.CrouchUp = true;
+ _currentInputs.CrouchDown = false;
+ }
+ private void Update()
+ {
+ characterController.SetInputs(_currentInputs);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Example/Liminal/Player/PlayerMovementController.cs.meta b/Assets/Code/Example/Liminal/Player/PlayerMovementController.cs.meta
new file mode 100644
index 0000000..2f7d1e6
--- /dev/null
+++ b/Assets/Code/Example/Liminal/Player/PlayerMovementController.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 8dd688d33c434f999d0ff7cd0553f1ee
+timeCreated: 1766611089
\ No newline at end of file
diff --git a/Assets/Code/Generators/Attributes.cs b/Assets/Code/Generators/Attributes.cs
deleted file mode 100644
index 54c5c9a..0000000
--- a/Assets/Code/Generators/Attributes.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using System;
-
-namespace Code.Generators
-{
- public class StateMachine : Attribute
- {
- public Type StateMachineContextType;
- public Type StateMachineEnumType;
-
- public StateMachine(Type stateMachineContextType, Type stateMachineEnumType)
- {
- StateMachineContextType = stateMachineContextType;
- StateMachineEnumType = stateMachineEnumType;
- }
- }
-
- public class State : Attribute
- {
- public Type StateMachineContextType;
- public State (Type stateMachineContextType )
- {
- StateMachineContextType = stateMachineContextType;
- }
- }
-
-}
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure.meta b/Assets/Code/Infrastructure.meta
new file mode 100644
index 0000000..0ca0631
--- /dev/null
+++ b/Assets/Code/Infrastructure.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 8ae0afd22327405eb4098d4106118b68
+timeCreated: 1766056068
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/App.meta b/Assets/Code/Infrastructure/App.meta
new file mode 100644
index 0000000..cabf772
--- /dev/null
+++ b/Assets/Code/Infrastructure/App.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 378d32559e654d4b91e761f7f5d4cee6
+timeCreated: 1765572320
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/App/AppStateMachine.cs b/Assets/Code/Infrastructure/App/AppStateMachine.cs
new file mode 100644
index 0000000..4b6c898
--- /dev/null
+++ b/Assets/Code/Infrastructure/App/AppStateMachine.cs
@@ -0,0 +1,25 @@
+using Code.Infrastructure.Camera;
+using Reflex.Attributes;
+
+namespace Code.Infrastructure.App
+{
+ public enum AppStates
+ {
+ Bootstrap,
+ Gameplay,
+ MainMenu
+ }
+
+ public class AppStateMachineContext
+ {
+ [Inject] public SceneLoader.SceneLoader SceneLoader { get; set; }
+ [Inject] public CameraStateMachine Camera { get; set; }
+ }
+
+ [Generators.StateMachine(typeof(AppStateMachineContext),typeof(AppStates))]
+ public partial class AppStateMachine
+ {
+
+ }
+
+}
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/App/AppStateMachine.cs.meta b/Assets/Code/Infrastructure/App/AppStateMachine.cs.meta
new file mode 100644
index 0000000..605294e
--- /dev/null
+++ b/Assets/Code/Infrastructure/App/AppStateMachine.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 5627248405434f028be921cb7916f823
+timeCreated: 1765572329
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/App/PapaInstaller.cs b/Assets/Code/Infrastructure/App/PapaInstaller.cs
new file mode 100644
index 0000000..b428a45
--- /dev/null
+++ b/Assets/Code/Infrastructure/App/PapaInstaller.cs
@@ -0,0 +1,69 @@
+using Code.Infrastructure.Camera;
+using Code.Infrastructure.Configs;
+using Code.Infrastructure.Input;
+using Code.Infrastructure.Loadings;
+using Code.Infrastructure.SceneLoader;
+using Reflex.Core;
+using UnityEngine;
+
+namespace Code.Infrastructure.App
+{
+ public class PapaInstaller : MonoBehaviour, IInstaller, ISceneConfigsLoadedHandle, IInputServiceInitializedHandle, ICameraInitializedHandle
+ {
+ public void InstallBindings(ContainerBuilder containerBuilder)
+ {
+ containerBuilder.AddSingleton(typeof(EventBus.EventBus));
+ containerBuilder.AddSingleton(typeof(ConfigLocator), typeof(IConfigLocator));
+ containerBuilder.AddSingleton(typeof(SceneLoader.SceneLoader));
+ containerBuilder.AddSingleton(typeof(InputService),typeof(IInputService));
+
+ containerBuilder.OnContainerBuilt += Bootstrap;
+
+ containerBuilder.AddSingleton(typeof(AppStateMachine));
+ containerBuilder.AddSingleton(typeof(AppStateMachineContext));
+
+ containerBuilder.AddSingleton(typeof(CameraFactory));
+ containerBuilder.AddSingleton(typeof(CameraStateMachine));
+ containerBuilder.AddSingleton(typeof(CameraStateMachineContext));
+
+ }
+
+ private Loading initialLoading;
+ private Container _thatRightContainer;
+ private void Bootstrap(Container container)
+ {
+ _thatRightContainer = container;
+
+ container.Resolve().Subscribe(this);
+ container.Resolve();
+ container.Resolve();
+ container.Resolve().CreateCameraStateMachine(container.Resolve()).Forget();
+
+ initialLoading = new Loading(3, () => EssentialLoadEnded(container));
+ }
+
+ private void EssentialLoadEnded(Container container)
+ {
+ container.Resolve().SwitchState(AppStates.Bootstrap).AllowStateTransition(AppStates.Gameplay);
+ container.Resolve().Unsubscribe(this);
+ }
+
+ public void SceneConfigsLoaded()
+ {
+ initialLoading.DoProgress();
+ }
+
+ public void InputServiceInitialized()
+ {
+ initialLoading.DoProgress();
+ }
+
+ public void CameraInitialized(CameraStateMachineContext.CameraLoadedData data)
+ {
+ _thatRightContainer.Resolve().cameraLoadedData = data;
+ _thatRightContainer.Resolve().SwitchState(CameraMode.None)
+ .AllowStateTransition(CameraMode.FirstPerson);
+ initialLoading.DoProgress();
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/App/PapaInstaller.cs.meta b/Assets/Code/Infrastructure/App/PapaInstaller.cs.meta
new file mode 100644
index 0000000..0049cc1
--- /dev/null
+++ b/Assets/Code/Infrastructure/App/PapaInstaller.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: e62d9c9e01334727887a684e008440a6
+timeCreated: 1765572590
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/App/SceneInstallers.meta b/Assets/Code/Infrastructure/App/SceneInstallers.meta
new file mode 100644
index 0000000..565be83
--- /dev/null
+++ b/Assets/Code/Infrastructure/App/SceneInstallers.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 30a683bd88f74628b64f7e17315b0c5d
+timeCreated: 1766393607
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/App/SceneInstallers/GameplaySceneInstaller.cs b/Assets/Code/Infrastructure/App/SceneInstallers/GameplaySceneInstaller.cs
new file mode 100644
index 0000000..7918659
--- /dev/null
+++ b/Assets/Code/Infrastructure/App/SceneInstallers/GameplaySceneInstaller.cs
@@ -0,0 +1,19 @@
+using Reflex.Core;
+using UnityEngine;
+
+namespace Code.Infrastructure.App.SceneInstallers
+{
+ public class GameplaySceneInstaller : MonoBehaviour, IInstaller
+ {
+ public void InstallBindings(ContainerBuilder containerBuilder)
+ {
+
+ containerBuilder.OnContainerBuilt += PostInstall;
+ }
+
+ private void PostInstall(Container container)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/App/SceneInstallers/GameplaySceneInstaller.cs.meta b/Assets/Code/Infrastructure/App/SceneInstallers/GameplaySceneInstaller.cs.meta
new file mode 100644
index 0000000..e162528
--- /dev/null
+++ b/Assets/Code/Infrastructure/App/SceneInstallers/GameplaySceneInstaller.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: ab7d8da1f0cc44bf99ae978a6b75847a
+timeCreated: 1768127778
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/App/SceneInstallers/MainMenuSceneInstaller.cs b/Assets/Code/Infrastructure/App/SceneInstallers/MainMenuSceneInstaller.cs
new file mode 100644
index 0000000..3dbeb17
--- /dev/null
+++ b/Assets/Code/Infrastructure/App/SceneInstallers/MainMenuSceneInstaller.cs
@@ -0,0 +1,20 @@
+using Code.Example;
+using Reflex.Core;
+using UnityEngine;
+
+namespace Code.Infrastructure.App.SceneInstallers
+{
+ public class MainMenuSceneInstaller : MonoBehaviour, IInstaller
+ {
+ public void InstallBindings(ContainerBuilder containerBuilder)
+ {
+
+ containerBuilder.OnContainerBuilt += PostInstall;
+ }
+
+ private void PostInstall(Container container)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/App/SceneInstallers/MainMenuSceneInstaller.cs.meta b/Assets/Code/Infrastructure/App/SceneInstallers/MainMenuSceneInstaller.cs.meta
new file mode 100644
index 0000000..da5ad4a
--- /dev/null
+++ b/Assets/Code/Infrastructure/App/SceneInstallers/MainMenuSceneInstaller.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 067978788f51445ca3af5381eafec386
+timeCreated: 1766393632
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/App/States.meta b/Assets/Code/Infrastructure/App/States.meta
new file mode 100644
index 0000000..e39fceb
--- /dev/null
+++ b/Assets/Code/Infrastructure/App/States.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 778cb4118a914d9c8b1cac8bef4295a5
+timeCreated: 1765572459
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/App/States/BootstrapState.cs b/Assets/Code/Infrastructure/App/States/BootstrapState.cs
new file mode 100644
index 0000000..b46f743
--- /dev/null
+++ b/Assets/Code/Infrastructure/App/States/BootstrapState.cs
@@ -0,0 +1,38 @@
+using Code.Infrastructure.Camera;
+using Code.Infrastructure.Generators;
+using Code.Infrastructure.SceneLoader;
+using Cysharp.Threading.Tasks;
+using UnityEngine;
+using UnityEngine.SceneManagement;
+
+namespace Code.Infrastructure.App.States
+{
+ [State(typeof(AppStates),typeof(AppStateMachineContext))]
+ [StateRaisingEvent]
+ public partial class BootstrapState : IOnGameplaySceneLoadedHandler
+ {
+ private EventBus.EventBus _eventBus;
+ public BootstrapState(AppStateMachineContext context, EventBus.EventBus eventBus) : base(context,eventBus)
+ {
+ _eventBus = eventBus;
+ }
+
+ public override AppStates myState => AppStates.Bootstrap;
+ protected override void OnEnterState()
+ {
+ _eventBus.Subscribe(this);
+ Context.Camera.SwitchState(CameraMode.FirstPerson).AllowStateTransition(CameraMode.None);
+ Context.SceneLoader.LoadSceneAsync(SceneId.Gameplay, LoadSceneMode.Single).Forget();
+ }
+
+ protected override void OnExitState()
+ {
+ _eventBus.Unsubscribe(this);
+ }
+
+ public void OnGameplaySceneLoaded()
+ {
+ Debug.Log("Spermageddon");
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/App/States/BootstrapState.cs.meta b/Assets/Code/Infrastructure/App/States/BootstrapState.cs.meta
new file mode 100644
index 0000000..8f6c626
--- /dev/null
+++ b/Assets/Code/Infrastructure/App/States/BootstrapState.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 71df5370ea2e4819bfbdb9cbb8e6c0ab
+timeCreated: 1765572469
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/App/States/GameplayState.cs b/Assets/Code/Infrastructure/App/States/GameplayState.cs
new file mode 100644
index 0000000..6b1b825
--- /dev/null
+++ b/Assets/Code/Infrastructure/App/States/GameplayState.cs
@@ -0,0 +1,31 @@
+using Code.Infrastructure.Camera;
+using Code.Infrastructure.Generators;
+using Code.Infrastructure.SceneLoader;
+using UnityEngine;
+
+namespace Code.Infrastructure.App.States
+{
+ [State(typeof(AppStates),typeof(AppStateMachineContext))]
+ [StateRaisingEvent]
+ public partial class GameplayState : IOnGameplaySceneLoadedHandler
+ {
+ public GameplayState(AppStateMachineContext context, EventBus.EventBus eventBus) : base(context, eventBus)
+ {
+ }
+
+ public override AppStates myState => AppStates.Gameplay;
+ protected override void OnEnterState()
+ {
+ Context.Camera.SwitchState(CameraMode.FirstPerson).AllowStateTransition(CameraMode.None);
+ }
+
+ protected override void OnExitState()
+ {
+ }
+
+ public void OnGameplaySceneLoaded()
+ {
+ Debug.Log("Spermageddon");
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/App/States/GameplayState.cs.meta b/Assets/Code/Infrastructure/App/States/GameplayState.cs.meta
new file mode 100644
index 0000000..0aa89fa
--- /dev/null
+++ b/Assets/Code/Infrastructure/App/States/GameplayState.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: e543193800134f7b858502743ab3a43d
+timeCreated: 1766436900
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/App/States/MainMenuState.cs b/Assets/Code/Infrastructure/App/States/MainMenuState.cs
new file mode 100644
index 0000000..e2a2079
--- /dev/null
+++ b/Assets/Code/Infrastructure/App/States/MainMenuState.cs
@@ -0,0 +1,22 @@
+using Code.Infrastructure.Generators;
+
+namespace Code.Infrastructure.App.States
+{
+ [State(typeof(AppStates),typeof(AppStateMachineContext))]
+ [StateRaisingEvent]
+ public partial class MainMenuState
+ {
+ public MainMenuState(AppStateMachineContext context, EventBus.EventBus eventBus) : base(context,eventBus)
+ {
+ }
+
+ public override AppStates myState => AppStates.MainMenu;
+ protected override void OnEnterState()
+ {
+ }
+
+ protected override void OnExitState()
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/App/States/MainMenuState.cs.meta b/Assets/Code/Infrastructure/App/States/MainMenuState.cs.meta
new file mode 100644
index 0000000..4404d95
--- /dev/null
+++ b/Assets/Code/Infrastructure/App/States/MainMenuState.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 5a17221ff27a400e80c42a2ea60bb4ee
+timeCreated: 1766436796
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/Camera.meta b/Assets/Code/Infrastructure/Camera.meta
new file mode 100644
index 0000000..e8e2d7c
--- /dev/null
+++ b/Assets/Code/Infrastructure/Camera.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: b7c28b6e1fe145b189d52cb829e06521
+timeCreated: 1766655751
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/Camera/CameraFactory.cs b/Assets/Code/Infrastructure/Camera/CameraFactory.cs
new file mode 100644
index 0000000..d841c1a
--- /dev/null
+++ b/Assets/Code/Infrastructure/Camera/CameraFactory.cs
@@ -0,0 +1,61 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Code.Infrastructure.Configs;
+using Cysharp.Threading.Tasks;
+using UnityEngine.AddressableAssets;
+using UnityEngine.ResourceManagement.AsyncOperations;
+using Object = UnityEngine.Object;
+
+namespace Code.Infrastructure.Camera
+{
+ public class CameraFactory : IDisposable
+ {
+ private AsyncOperationHandle _configHandle;
+ private GameCameraConfig _config;
+ private AssetReference _gameCameraConfigReference;
+
+ private AsyncOperationHandle> _settingsConfigsHandle;
+ private Dictionary _settingsConfigs;
+ private string _cameraConfigsLabel;
+
+ private EventBus.EventBus _eventBus;
+ private UnityEngine.Camera _camera;
+ private IDisposable _disposableImplementation;
+
+ public CameraFactory(IConfigLocator configLocator, EventBus.EventBus eventBus)
+ {
+ _gameCameraConfigReference = configLocator.TryGetConfigAssetReference();
+ _cameraConfigsLabel = configLocator.TryGetManyConfigAssetReferences();
+
+ _eventBus = eventBus;
+ }
+
+ public async UniTaskVoid CreateCameraStateMachine(CameraStateMachine stateMachine)
+ {
+ _settingsConfigsHandle = Addressables
+ .LoadAssetsAsync(_cameraConfigsLabel, null, Addressables.MergeMode.Union);
+ await _settingsConfigsHandle.ToUniTask();
+ _settingsConfigs = _settingsConfigsHandle.Result.ToDictionary(x => x.cameraMode);
+
+ _configHandle = Addressables.LoadAssetAsync(_gameCameraConfigReference);
+ await _configHandle.ToUniTask();
+ _config = _configHandle.Result;
+
+ var cameraObject = await Addressables.InstantiateAsync(_config.Camera).ToUniTask();
+ _camera = cameraObject.GetComponent();
+
+ cameraObject.GetComponent().StateMachine = stateMachine;
+ Object.DontDestroyOnLoad(cameraObject);
+
+ _eventBus.RaiseEvent(x => x.CameraInitialized(new(_camera, _settingsConfigs)));
+ }
+
+ public void Dispose()
+ {
+ Addressables.Release(_configHandle);
+ Addressables.Release(_settingsConfigsHandle);
+ Addressables.ReleaseInstance(_camera.gameObject);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/Camera/CameraFactory.cs.meta b/Assets/Code/Infrastructure/Camera/CameraFactory.cs.meta
new file mode 100644
index 0000000..d2ac93f
--- /dev/null
+++ b/Assets/Code/Infrastructure/Camera/CameraFactory.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 4c05e01628b742be94dfd0bbbdfb87fa
+timeCreated: 1767302222
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/Camera/CameraSettings.cs b/Assets/Code/Infrastructure/Camera/CameraSettings.cs
new file mode 100644
index 0000000..0f2e692
--- /dev/null
+++ b/Assets/Code/Infrastructure/Camera/CameraSettings.cs
@@ -0,0 +1,38 @@
+using Code.Infrastructure.Generators;
+using UnityEngine;
+
+namespace Code.Infrastructure.Camera
+{
+ [Config("Configs/Camera/CameraSettings", true)]
+ public class CameraSettings
+ {
+ // Расстояния от персонажа до камеры
+ [ToConfig] public float defaultDistance = 6f; // Стандартное расстояние камеры от цели
+
+ [ToConfig] public float minDistance = 3f; // Минимальное расстояние при зуме
+
+ [ToConfig] public float maxDistance = 10f; // Максимальное расстояние при зуме
+
+ [ToConfig] public float distanceMovementSpeed = 5f; // Множитель скорости изменения дистанции при зуме
+
+ // Скорость поворота камеры
+ [ToConfig] public float rotationSpeed = 0.3f;
+
+ [ToConfig] public float rotationSharpness = 100f; // Коэффициент плавности вращения камеры (чем выше - тем резче)
+
+ [ToConfig] public float followSharpness = 100f; // Коэффициент плавности следования за движущейся целью (чем выше - тем резче)
+
+ [ToConfig] public float minVerticalAngle = -70f; // Минимальный угол наклона камеры (вниз)
+
+ [ToConfig] public float maxVerticalAngle = 70f; // Максимальный угол наклона камеры (вверх)
+
+ [ToConfig] public float defaultVerticalAngle = 10f; // Стандартный угол наклона камеры
+
+ [ToConfig] public float fov = 60; // Комментарии оставляет только нейросеть и долбаёбы, никому и так не будет понятно, что ты высрал
+
+ [ToConfig] public CameraMode cameraMode;
+
+ // Позиция следования по умолчанию
+ [ToConfig] public Vector3 defaultFollowPosition = Vector3.zero;
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/Camera/CameraSettings.cs.meta b/Assets/Code/Infrastructure/Camera/CameraSettings.cs.meta
new file mode 100644
index 0000000..ebfa4be
--- /dev/null
+++ b/Assets/Code/Infrastructure/Camera/CameraSettings.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 5442de773645443b99f8b0733199a854
+timeCreated: 1766657458
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/Camera/CameraStateMachine.cs b/Assets/Code/Infrastructure/Camera/CameraStateMachine.cs
new file mode 100644
index 0000000..e0d83b0
--- /dev/null
+++ b/Assets/Code/Infrastructure/Camera/CameraStateMachine.cs
@@ -0,0 +1,54 @@
+using System.Collections.Generic;
+using Code.Infrastructure.EventBus;
+using Code.Infrastructure.Generators;
+using Code.Infrastructure.Input;
+using Reflex.Attributes;
+using UnityEngine.AddressableAssets;
+
+namespace Code.Infrastructure.Camera
+{
+ public enum CameraMode
+ {
+ None,
+ FirstPerson,
+ Static,
+ Cinematic
+ }
+
+ [Config("Configs/Camera/CameraConfig")]
+ public class GameCamera
+ {
+ [ToConfig] public AssetReference Camera;
+ }
+
+ public interface ICameraInitializedHandle : IGlobalSubscriber
+ {
+ void CameraInitialized(CameraStateMachineContext.CameraLoadedData data);
+ }
+
+ public class CameraStateMachineContext
+ {
+ public class CameraLoadedData
+ {
+ public UnityEngine.Camera Camera;
+ public Dictionary SettingsConfigs;
+
+ public CameraLoadedData(UnityEngine.Camera camera, Dictionary settingsConfigs)
+ {
+ Camera = camera;
+ SettingsConfigs = settingsConfigs;
+ }
+ }
+
+ public CameraLoadedData cameraLoadedData;
+
+ [Inject] public IInputService InputService;
+ [Inject] public EventBus.EventBus EventBus;
+ }
+
+ [Generators.StateMachine(typeof(CameraStateMachineContext), typeof(CameraMode))]
+ public partial class CameraStateMachine
+ {
+ public UnityEngine.Camera Camera => StateMachineContext.cameraLoadedData.Camera;
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/Camera/CameraStateMachine.cs.meta b/Assets/Code/Infrastructure/Camera/CameraStateMachine.cs.meta
new file mode 100644
index 0000000..d8c0905
--- /dev/null
+++ b/Assets/Code/Infrastructure/Camera/CameraStateMachine.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: b220b02510c34ea08257cc951d949fd7
+timeCreated: 1761671720
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/Camera/CameraStateMachineRunner.cs b/Assets/Code/Infrastructure/Camera/CameraStateMachineRunner.cs
new file mode 100644
index 0000000..5020c71
--- /dev/null
+++ b/Assets/Code/Infrastructure/Camera/CameraStateMachineRunner.cs
@@ -0,0 +1,20 @@
+using Code.Infrastructure.Camera.CameraStates;
+using UnityEngine;
+
+namespace Code.Infrastructure.Camera
+{
+ public class CameraStateMachineRunner : MonoBehaviour
+ {
+ public CameraStateMachine StateMachine;
+
+ private void Update()
+ {
+ ((BaseCameraState)StateMachine.CurrentBaseState).Update();
+ }
+
+ private void LateUpdate()
+ {
+ ((BaseCameraState)StateMachine.CurrentBaseState).LateUpdate();
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/Camera/CameraStateMachineRunner.cs.meta b/Assets/Code/Infrastructure/Camera/CameraStateMachineRunner.cs.meta
new file mode 100644
index 0000000..036efb1
--- /dev/null
+++ b/Assets/Code/Infrastructure/Camera/CameraStateMachineRunner.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 293de8ebc2f54fa097ba2f1be8c8ed41
+timeCreated: 1767277431
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/Camera/CameraStates.meta b/Assets/Code/Infrastructure/Camera/CameraStates.meta
new file mode 100644
index 0000000..b72130e
--- /dev/null
+++ b/Assets/Code/Infrastructure/Camera/CameraStates.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: d7399e433dff42a185f62d79b546b059
+timeCreated: 1761671908
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/Camera/CameraStates/BaseCameraState.cs b/Assets/Code/Infrastructure/Camera/CameraStates/BaseCameraState.cs
new file mode 100644
index 0000000..d3fdba8
--- /dev/null
+++ b/Assets/Code/Infrastructure/Camera/CameraStates/BaseCameraState.cs
@@ -0,0 +1,48 @@
+using Code.Infrastructure.StateMachine;
+using UnityEngine;
+
+namespace Code.Infrastructure.Camera.CameraStates
+{
+ // [State(typeof(CameraMode),typeof(CameraStateMachineContext))]
+ public abstract class BaseCameraState : BaseState
+ {
+ protected EventBus.EventBus _eventBus;
+
+
+ // Трансформ объекта, за которым следует камера
+ protected Transform FollowTransform;
+
+ // Позиция следования: текущая сглаженная позиция и горизонтальное направление камеры
+ protected Vector3 CurrentFollowPosition;
+
+ // Целевой вертикальный угол камеры (наклон вверх/вниз)
+ protected float TargetVerticalAngle;
+
+ // Текущая и целевая дистанция камеры от цели
+ protected float CurrentDistance, TargetDistance;
+
+ // Исходные значения дистанции для восстановления
+ protected float OriginalDefaultDistance, OriginalMinDistance, OriginalMaxDistance;
+
+ // Горизонтальное направление камеры (проекция forward на плоскость)
+ protected Vector3 PlanarDirection { get; set; }
+ protected BaseCameraState(CameraStateMachineContext context, EventBus.EventBus eventBus) : base(context, eventBus)
+ {
+ _eventBus = eventBus;
+ }
+
+ // Основной метод обновления камеры, вызываемый извне каждый кадр
+ protected void UpdateWithInput(float deltaTime, Vector3 rotationInput)
+ {
+ // Обработка ввода и позиционирования
+ HandleRotationInput(deltaTime, rotationInput, out var targetRotation);
+ HandlePosition(deltaTime , targetRotation);
+ }
+
+ protected abstract void HandlePosition(float deltaTime, object o);
+
+ protected abstract void HandleRotationInput(float deltaTime, Vector3 rotationInput, out Quaternion q);
+ public abstract void Update();
+ public abstract void LateUpdate();
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/Camera/CameraStates/BaseCameraState.cs.meta b/Assets/Code/Infrastructure/Camera/CameraStates/BaseCameraState.cs.meta
new file mode 100644
index 0000000..7a89b52
--- /dev/null
+++ b/Assets/Code/Infrastructure/Camera/CameraStates/BaseCameraState.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 7901175f2c0646fda8741c4c269ce54b
+timeCreated: 1767127681
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/Camera/CameraStates/FirstPersonCameraState.cs b/Assets/Code/Infrastructure/Camera/CameraStates/FirstPersonCameraState.cs
new file mode 100644
index 0000000..27df251
--- /dev/null
+++ b/Assets/Code/Infrastructure/Camera/CameraStates/FirstPersonCameraState.cs
@@ -0,0 +1,110 @@
+using Code.Example.Liminal.Player;
+using Code.Infrastructure.Generators;
+using Code.Infrastructure.Input;
+using UnityEngine;
+using UnityEngine.InputSystem;
+
+namespace Code.Infrastructure.Camera.CameraStates
+{
+
+ [State(typeof(CameraMode),typeof(CameraStateMachineContext), true)]
+ public partial class FirstPersonCameraState : BaseCameraState
+ {
+ private CameraSettingsConfig _settings;
+
+ public FirstPersonCameraState(CameraStateMachineContext context, EventBus.EventBus eventBus) : base(context, eventBus)
+ {
+ }
+
+ public override CameraMode myState => CameraMode.FirstPerson;
+ protected override void OnEnterState()
+ {
+ _settings = Context.cameraLoadedData.SettingsConfigs[myState];
+
+ Context.InputService.BindActionPerformed((int)ActionMappings.Gameplay, (int) GameplayActions.Look, OnLookPerformed);
+ Context.InputService.BindActionCancel((int)ActionMappings.Gameplay, (int) GameplayActions.Look, OnLookCanceled);
+ }
+ protected override void HandleRotationInput(float deltaTime, Vector3 rotationInput, out Quaternion targetRotation)
+ {
+ // Вращение вокруг вертикальной оси (горизонтальный поворот)
+ var rotationFromInput = Quaternion.Euler(Vector3.up * (rotationInput.x * _settings.rotationSpeed));
+ PlanarDirection = rotationFromInput * PlanarDirection;
+ var planarRotation = Quaternion.LookRotation(PlanarDirection, FollowTransform.up);
+
+ // Вращение вокруг горизонтальной оси (вертикальный наклон)
+ TargetVerticalAngle -= rotationInput.y * _settings.rotationSpeed;
+ TargetVerticalAngle = Mathf.Clamp(TargetVerticalAngle, _settings.minVerticalAngle, _settings.maxVerticalAngle);
+ var verticalRotation = Quaternion.Euler(TargetVerticalAngle, 0, 0);
+
+ // Интерполяция к целевому вращению для плавности
+ targetRotation = Quaternion.Slerp(Context.cameraLoadedData.Camera.transform.rotation, planarRotation * verticalRotation, deltaTime * _settings.rotationSharpness);
+
+ // Применение финального вращения
+ Context.cameraLoadedData.Camera.transform.rotation = targetRotation;
+ }
+
+ protected override void OnExitState()
+ {
+ }
+
+ protected override void HandlePosition(float deltaTime, object targetRotation)
+ {
+ // Плавное следование за целью с использованием экспоненциального сглаживания
+ // CurrentFollowPosition = Vector3.Lerp(CurrentFollowPosition, FollowTransform.position, 1f - Mathf.Exp(-_settings.followSharpness * deltaTime));
+
+ // В FirstPerson режиме камера находится прямо на позиции цели Да ну нахуй чё правда пиздец
+ // var targetPosition = CurrentFollowPosition;
+
+ // Установка финальной позиции камеры Да ну нахуй чё правда пиздец
+ Context.cameraLoadedData.Camera.transform.position = FollowTransform.position;
+ }
+
+ private Vector2 _lookInput;
+
+ private void OnLookPerformed(InputAction.CallbackContext context)
+ {
+ _lookInput = context.ReadValue();
+ }
+
+ private void OnLookCanceled(InputAction.CallbackContext context)
+ {
+ _lookInput = Vector2.zero;
+ }
+
+ public override void Update()
+ {
+ }
+
+ public override void LateUpdate()
+ {
+ // Обновляем камеру только если есть цель для следования
+ // if (FollowTransform)
+ // {
+ // UpdateWithInput(Time.deltaTime, _lookInput);
+ // }
+ if (_playerMovementController)
+ {
+ UpdateWithInput(Time.deltaTime, _lookInput);
+
+ _playerMovementController.SetCameraRotation(Context.cameraLoadedData.Camera.transform.rotation);
+ }
+ }
+
+ public void SetFollowTransform(Transform t)
+ {
+ FollowTransform = t;
+ CurrentFollowPosition = t.position;
+ PlanarDirection = t.forward; // Начальное направление совпадает с направлением цели
+ }
+
+ private PlayerMovementController _playerMovementController;
+ public void SetPlayer(PlayerMovementController playerMovementController)
+ {
+ _playerMovementController = playerMovementController;
+
+ FollowTransform = _playerMovementController.PlayerHeadPoint;
+ CurrentFollowPosition = _playerMovementController.PlayerHeadPoint.position;
+ PlanarDirection = _playerMovementController.PlayerHeadPoint.forward; // Начальное направление совпадает с направлением цели
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/Camera/CameraStates/FirstPersonCameraState.cs.meta b/Assets/Code/Infrastructure/Camera/CameraStates/FirstPersonCameraState.cs.meta
new file mode 100644
index 0000000..7b96f2e
--- /dev/null
+++ b/Assets/Code/Infrastructure/Camera/CameraStates/FirstPersonCameraState.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 850f6325ab66480e9f7d1c03dbb37030
+timeCreated: 1767346203
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/Camera/CameraStates/NoneCameraState.cs b/Assets/Code/Infrastructure/Camera/CameraStates/NoneCameraState.cs
new file mode 100644
index 0000000..17851c8
--- /dev/null
+++ b/Assets/Code/Infrastructure/Camera/CameraStates/NoneCameraState.cs
@@ -0,0 +1,40 @@
+using Code.Infrastructure.Generators;
+using UnityEngine;
+
+namespace Code.Infrastructure.Camera.CameraStates
+{
+ [State(typeof(CameraMode),typeof(CameraStateMachineContext), true)]
+ public partial class NoneCameraState : BaseCameraState
+ {
+ public NoneCameraState(CameraStateMachineContext context, EventBus.EventBus eventBus) : base(context, eventBus)
+ {
+ }
+
+ public override CameraMode myState => CameraMode.None;
+ protected override void OnEnterState()
+ {
+ }
+
+ protected override void OnExitState()
+ {
+ }
+
+ protected override void HandlePosition(float deltaTime, object targetRotation)
+ {
+ throw new System.NotImplementedException();
+ }
+
+ protected override void HandleRotationInput(float deltaTime, Vector3 rotationInput, out Quaternion q)
+ {
+ throw new System.NotImplementedException();
+ }
+
+ public override void Update()
+ {
+ }
+
+ public override void LateUpdate()
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/Camera/CameraStates/NoneCameraState.cs.meta b/Assets/Code/Infrastructure/Camera/CameraStates/NoneCameraState.cs.meta
new file mode 100644
index 0000000..1ccd8f4
--- /dev/null
+++ b/Assets/Code/Infrastructure/Camera/CameraStates/NoneCameraState.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: cb14de48ff13488c8edb4431ac34e5be
+timeCreated: 1767301090
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/Configs.meta b/Assets/Code/Infrastructure/Configs.meta
new file mode 100644
index 0000000..c55d26d
--- /dev/null
+++ b/Assets/Code/Infrastructure/Configs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: ef0499dec5324e12b82f8688c6d3b3d8
+timeCreated: 1765711304
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/Configs/ConfigLocator.cs b/Assets/Code/Infrastructure/Configs/ConfigLocator.cs
new file mode 100644
index 0000000..83914e3
--- /dev/null
+++ b/Assets/Code/Infrastructure/Configs/ConfigLocator.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using Code.Infrastructure.SceneLoader;
+using Cysharp.Threading.Tasks;
+using Reflex.Core;
+using UnityEngine;
+using UnityEngine.AddressableAssets;
+
+namespace Code.Infrastructure.Configs
+{
+ public partial class ConfigLocator : IConfigLocator
+ {
+ private Dictionary _singleConfigReferences = new();
+ private Dictionary _multipleConfigReferences = new();
+
+ public AssetReference TryGetConfigAssetReference() => _singleConfigReferences.GetValueOrDefault(typeof(T), null);
+ public string TryGetManyConfigAssetReferences() => _multipleConfigReferences.GetValueOrDefault(typeof(T), null);
+
+ partial void LoadConfigs();
+
+ public ConfigLocator()
+ {
+ LoadSystemConfigs();
+
+ LoadConfigs();
+ }
+
+ private void LoadSystemConfigs()
+ {
+ SystemConfigsReferences systemConfigsReferences = Resources.Load("SystemConfigsReferences");
+
+ _singleConfigReferences.Add(typeof(ScenesAssetReferences), systemConfigsReferences.scenesAssetReferences);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/Configs/ConfigLocator.cs.meta b/Assets/Code/Infrastructure/Configs/ConfigLocator.cs.meta
new file mode 100644
index 0000000..39f6c6c
--- /dev/null
+++ b/Assets/Code/Infrastructure/Configs/ConfigLocator.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 42496064fd5d42fea1c889f91e6a7e98
+timeCreated: 1765711330
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/Configs/SystemConfigsReferences.cs b/Assets/Code/Infrastructure/Configs/SystemConfigsReferences.cs
new file mode 100644
index 0000000..c8ee89f
--- /dev/null
+++ b/Assets/Code/Infrastructure/Configs/SystemConfigsReferences.cs
@@ -0,0 +1,11 @@
+using UnityEngine;
+using UnityEngine.AddressableAssets;
+
+namespace Code.Infrastructure.Configs
+{
+ [CreateAssetMenu(fileName = "SystemConfigsReferences", menuName = "Configs/SystemConfigsReferences")]
+ public partial class SystemConfigsReferences : ScriptableObject
+ {
+ public AssetReference scenesAssetReferences;
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/Configs/SystemConfigsReferences.cs.meta b/Assets/Code/Infrastructure/Configs/SystemConfigsReferences.cs.meta
new file mode 100644
index 0000000..434781c
--- /dev/null
+++ b/Assets/Code/Infrastructure/Configs/SystemConfigsReferences.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 728b0ad306a64bd28d47fc4d052c5e81
+timeCreated: 1766325607
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/EventBus.meta b/Assets/Code/Infrastructure/EventBus.meta
new file mode 100644
index 0000000..797bb41
--- /dev/null
+++ b/Assets/Code/Infrastructure/EventBus.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 7b34014c0c80c914baed6d14ef39dada
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Code/Infrastructure/EventBus/EventBus.cs b/Assets/Code/Infrastructure/EventBus/EventBus.cs
new file mode 100644
index 0000000..6405360
--- /dev/null
+++ b/Assets/Code/Infrastructure/EventBus/EventBus.cs
@@ -0,0 +1,69 @@
+using System;
+using System.Collections.Generic;
+using Cysharp.Threading.Tasks;
+using UnityEngine;
+
+namespace Code.Infrastructure.EventBus
+{
+ public class EventBus
+ {
+ private Dictionary> s_Subscribers
+ = new();
+
+ public void Subscribe(IGlobalSubscriber subscriber)
+ {
+ List subscriberTypes = EventBusHelper.GetSubscriberTypes(subscriber);
+ foreach (Type t in subscriberTypes)
+ {
+ if (!s_Subscribers.ContainsKey(t))
+ {
+ s_Subscribers[t] = new SubscribersList();
+ }
+ s_Subscribers[t].Add(subscriber);
+ }
+ }
+
+ public void Unsubscribe(IGlobalSubscriber subscriber)
+ {
+ List subscriberTypes = EventBusHelper.GetSubscriberTypes(subscriber);
+ foreach (Type t in subscriberTypes)
+ {
+ if (s_Subscribers.ContainsKey(t))
+ s_Subscribers[t].Remove(subscriber);
+ }
+ }
+
+ public void RaiseEvent(Action action)
+ where TSubscriber : class, IGlobalSubscriber
+ {
+ if (!s_Subscribers.ContainsKey(typeof(TSubscriber))) return;
+
+ SubscribersList subscribers = s_Subscribers[typeof(TSubscriber)];
+
+ subscribers.Executing = true;
+
+ InvokeSubscribers(action, subscribers);
+
+ subscribers.Executing = false;
+ subscribers.Cleanup();
+ }
+
+ private void InvokeSubscribers(Action action, SubscribersList subscribers)
+ where TSubscriber : class, IGlobalSubscriber
+ {
+ for ( int i = 0; i < subscribers.List.Count; i++)
+ {
+ Debug.Log("Invoking " + typeof(TSubscriber).Name);
+ IGlobalSubscriber subscriber = subscribers.List[i];
+ try
+ {
+ action.Invoke(subscriber as TSubscriber);
+ }
+ catch (Exception e)
+ {
+ Debug.LogError(e);
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/EventBus/EventBus.cs.meta b/Assets/Code/Infrastructure/EventBus/EventBus.cs.meta
new file mode 100644
index 0000000..0da7eac
--- /dev/null
+++ b/Assets/Code/Infrastructure/EventBus/EventBus.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: b0547f2543ccf5e47b9ec486f35aa2df
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/EventBus/EventBusHelper.cs b/Assets/Code/Infrastructure/EventBus/EventBusHelper.cs
new file mode 100644
index 0000000..fc0d3c2
--- /dev/null
+++ b/Assets/Code/Infrastructure/EventBus/EventBusHelper.cs
@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Code.Infrastructure.EventBus
+{
+ internal static class EventBusHelper
+ {
+ private static Dictionary> s_CashedSubscriberTypes =
+ new();
+
+ public static List GetSubscriberTypes(
+ IGlobalSubscriber globalSubscriber)
+ {
+ Type type = globalSubscriber.GetType();
+ if (s_CashedSubscriberTypes.ContainsKey(type))
+ {
+ return s_CashedSubscriberTypes[type];
+ }
+
+ List subscriberTypes = type
+ .GetInterfaces()
+ .Where(t => t.GetInterfaces()
+ .Contains(typeof(IGlobalSubscriber)))
+ .ToList();
+
+ s_CashedSubscriberTypes[type] = subscriberTypes;
+ return subscriberTypes;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/EventBus/EventBusHelper.cs.meta b/Assets/Code/Infrastructure/EventBus/EventBusHelper.cs.meta
new file mode 100644
index 0000000..b3bc2d2
--- /dev/null
+++ b/Assets/Code/Infrastructure/EventBus/EventBusHelper.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: ab2b1bcff76d5614dbda77a3c7b24158
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/EventBus/IGlobalSubscriber.cs b/Assets/Code/Infrastructure/EventBus/IGlobalSubscriber.cs
new file mode 100644
index 0000000..19d882b
--- /dev/null
+++ b/Assets/Code/Infrastructure/EventBus/IGlobalSubscriber.cs
@@ -0,0 +1,5 @@
+namespace Code.Infrastructure.EventBus
+{
+ public interface IGlobalSubscriber
+ { }
+}
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/EventBus/IGlobalSubscriber.cs.meta b/Assets/Code/Infrastructure/EventBus/IGlobalSubscriber.cs.meta
new file mode 100644
index 0000000..e8d8c97
--- /dev/null
+++ b/Assets/Code/Infrastructure/EventBus/IGlobalSubscriber.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: fe414b0de24841347b03eec77d1855c0
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/EventBus/SubscribersList.cs b/Assets/Code/Infrastructure/EventBus/SubscribersList.cs
new file mode 100644
index 0000000..886359e
--- /dev/null
+++ b/Assets/Code/Infrastructure/EventBus/SubscribersList.cs
@@ -0,0 +1,46 @@
+using System.Collections.Generic;
+
+namespace Code.Infrastructure.EventBus
+{
+ internal class SubscribersList where TSubscriber : class
+ {
+ private bool m_NeedsCleanUp;
+
+ public bool Executing;
+
+ public readonly List List = new(); // TODO Weakptr
+
+ public void Add(TSubscriber subscriber)
+ {
+ List.Add(subscriber);
+ }
+
+ public void Remove(TSubscriber subscriber)
+ {
+ if (Executing)
+ {
+ var i = List.IndexOf(subscriber);
+ if (i >= 0)
+ {
+ m_NeedsCleanUp = true;
+ List[i] = null;
+ }
+ }
+ else
+ {
+ List.Remove(subscriber);
+ }
+ }
+
+ public void Cleanup()
+ {
+ if (!m_NeedsCleanUp)
+ {
+ return;
+ }
+
+ List.RemoveAll(s => s == null);
+ m_NeedsCleanUp = false;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/EventBus/SubscribersList.cs.meta b/Assets/Code/Infrastructure/EventBus/SubscribersList.cs.meta
new file mode 100644
index 0000000..1ade1d1
--- /dev/null
+++ b/Assets/Code/Infrastructure/EventBus/SubscribersList.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: d364e9c8ac1c255428486d5892d23c1d
\ No newline at end of file
diff --git a/Assets/Code/Generators.meta b/Assets/Code/Infrastructure/Generators.meta
similarity index 100%
rename from Assets/Code/Generators.meta
rename to Assets/Code/Infrastructure/Generators.meta
diff --git a/Assets/Code/Infrastructure/Generators/Attributes.cs b/Assets/Code/Infrastructure/Generators/Attributes.cs
new file mode 100644
index 0000000..27d4574
--- /dev/null
+++ b/Assets/Code/Infrastructure/Generators/Attributes.cs
@@ -0,0 +1,49 @@
+using System;
+
+namespace Code.Infrastructure.Generators
+{
+ public class StateMachine : Attribute
+ {
+ public Type StateMachineContextType;
+ public Type StateMachineEnumType;
+
+ public StateMachine(Type stateMachineContextType, Type stateMachineEnumType)
+ {
+ StateMachineContextType = stateMachineContextType;
+ StateMachineEnumType = stateMachineEnumType;
+ }
+ }
+
+ public class State : Attribute
+ {
+ public Type StateEnum;
+ public Type StateMachineContext;
+ public bool SilentBitch; // Поэтому нейминг переменных очень важен
+
+ public State(Type stateEnum,Type stateMachineContext, bool silentBitch = false)
+ {
+ StateEnum = stateEnum;
+ StateMachineContext = stateMachineContext;
+ SilentBitch = silentBitch;
+ }
+ }
+ public class StateRaisingEvent : Attribute
+ {
+ }
+ public class Config : Attribute
+ {
+ public bool Multiple;
+ public string MenuName;
+ public Config(string menuName, bool multiple = false)
+ {
+ Multiple = multiple;
+ MenuName = menuName;
+ }
+ }
+ public class ToConfig : Attribute
+ {
+ }
+ public class SceneIdEnum : Attribute
+ {
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Generators/Attributes.cs.meta b/Assets/Code/Infrastructure/Generators/Attributes.cs.meta
similarity index 100%
rename from Assets/Code/Generators/Attributes.cs.meta
rename to Assets/Code/Infrastructure/Generators/Attributes.cs.meta
diff --git a/Assets/Code/Infrastructure/Generators/ConfigGenerator.cs b/Assets/Code/Infrastructure/Generators/ConfigGenerator.cs
new file mode 100644
index 0000000..ef22d79
--- /dev/null
+++ b/Assets/Code/Infrastructure/Generators/ConfigGenerator.cs
@@ -0,0 +1,109 @@
+using System.Linq;
+using Unity.VisualScripting;
+using UnityCodeGen;
+using UnityEditor;
+
+namespace Code.Infrastructure.Generators
+{
+ [Generator]
+ public class ConfigGenerator : ICodeGenerator
+ {
+ public void Execute(GeneratorContext context)
+ {
+ var configs = TypeCache.GetTypesWithAttribute();
+
+ var configsCode = "";
+ var configAddCode = "";
+ var configReferencesCode = "";
+ var configReferencesUsingsCode = "";
+ var configOfConfigsCode = "";
+
+ foreach (var cfg in configs)
+ {
+ var configFields = "";
+ var configUsings = "";
+
+ var mem = cfg.GetFields();
+ var members = mem.Where(m => m.HasAttribute()).ToList();
+ foreach (var m in members)
+ {
+ configUsings += $"using {m.FieldType.Namespace};\n";
+ configFields += $"public {m.FieldType.FullName} {m.Name};\n";
+ }
+
+ var attribute = cfg.GetAttribute();
+
+ configUsings += @"
+using UnityEngine;
+using UnityEngine.AddressableAssets;
+";
+ var configCode = $@"
+#pragma warning disable CS0105
+{configUsings}
+namespace {cfg.Namespace}{{
+#pragma warning restore CS0105
+[CreateAssetMenu(fileName = ""{cfg.Name}Config"", menuName = ""{attribute.MenuName}"")]
+public class {cfg.Name}Config : ScriptableObject
+{{
+ {configFields}
+}}
+}}
+";
+ context.AddCode($"{cfg.Name}Config.Generated.cs", configCode);
+
+ configReferencesUsingsCode += $"using {cfg.Namespace};\n";
+
+ if (attribute.Multiple)
+ {
+ configReferencesCode += $"public string {cfg.Name};\n";
+ configAddCode += $@"
+ _multipleConfigReferences.Add(typeof({cfg.FullName}Config), systemConfigsReferences.{cfg.Name});
+";
+ }
+ else
+ {
+ configReferencesCode += $"public AssetReference {cfg.Name};\n";
+ configAddCode += $@"
+ _singleConfigReferences.Add(typeof({cfg.FullName}Config), systemConfigsReferences.{cfg.Name});
+";
+ }
+ }
+ configsCode += $@"
+#pragma warning disable CS0105
+ {configReferencesUsingsCode}
+ using UnityEngine;
+#pragma warning restore CS0105
+
+ namespace Code.Infrastructure.Configs
+ {{
+
+ public partial class ConfigLocator
+ {{
+ partial void LoadConfigs()
+ {{
+ SystemConfigsReferences systemConfigsReferences = Resources.Load(""SystemConfigsReferences"");
+ {configAddCode}
+ //_singleConfigReferences.Add(typeof(ScenesAssetReferences), systemConfigsReferences.scenesAssetReferences);
+ }}
+ }}
+ }}
+ ";
+ context.AddCode($"ConfigLocator.Generated.cs", configsCode);
+
+ configOfConfigsCode += $@"
+#pragma warning disable CS0105
+ {configReferencesUsingsCode}
+ using UnityEngine.AddressableAssets;
+#pragma warning restore CS0105
+
+ namespace Code.Infrastructure.Configs{{
+ public partial class SystemConfigsReferences
+ {{
+ {configReferencesCode}
+ }}
+}}
+";
+ context.AddCode($"SystemConfigsReferences.Generated.cs", configOfConfigsCode);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/Generators/ConfigGenerator.cs.meta b/Assets/Code/Infrastructure/Generators/ConfigGenerator.cs.meta
new file mode 100644
index 0000000..fa3eab1
--- /dev/null
+++ b/Assets/Code/Infrastructure/Generators/ConfigGenerator.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 026403be8eae4546adcb407308031c1d
+timeCreated: 1765660396
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/Generators/SceneLoaderGenerator.cs b/Assets/Code/Infrastructure/Generators/SceneLoaderGenerator.cs
new file mode 100644
index 0000000..3b4cd1e
--- /dev/null
+++ b/Assets/Code/Infrastructure/Generators/SceneLoaderGenerator.cs
@@ -0,0 +1,148 @@
+using System.Linq;
+using Unity.VisualScripting;
+using UnityCodeGen;
+using UnityEditor;
+using UnityEngine;
+
+namespace Code.Infrastructure.Generators
+{
+ [Generator]
+ public class SceneLoaderGenerator : ICodeGenerator
+ {
+ public void Execute(GeneratorContext context)
+ {
+ var Enum = TypeCache.GetTypesWithAttribute();
+
+ var loaderCode = "";
+ var dictionaryCode = "";
+ var interfacesCode = "";
+ var interfacesUsingsCode = $@"
+using Code.Infrastructure.EventBus;
+";
+
+ foreach (var en in Enum)
+ {
+ if (!en.IsEnum) return;
+
+ var members = en.GetFields();
+ foreach (var member in members)
+ {
+ if(member.FieldType.FullName != en.FullName) continue;
+ interfacesCode += $@"
+ public interface IOn{member.Name}SceneLoadedHandler : IGlobalSubscriber
+ {{
+ void On{member.Name}SceneLoaded();
+ }}
+";
+ dictionaryCode += $@"
+
+ _scenesActions.Add(SceneId.{member.Name},() => _eventBus.RaiseEvent(h=> h.On{member.Name}SceneLoaded()));
+";
+ }
+ }
+
+ loaderCode = $@"
+#pragma warning disable CS0105
+{interfacesUsingsCode}
+#pragma warning restore CS0105
+
+namespace Code.Infrastructure.SceneLoader
+{{
+public partial class SceneLoader{{
+partial void SetupScenesInfo(){{
+{dictionaryCode}
+}}
+}}
+{interfacesCode}
+}}
+";
+ context.AddCode($"SceneLoader.Generated.cs", loaderCode);
+// var configsCode = "";
+// var configCode = "";
+// var configUsings = "";
+// var configFields = "";
+// var configAddCode = "";
+// var configReferencesCode = "";
+// var configReferencesUsingsCode = "";
+// var configOfConfigsCode = "";
+//
+// foreach (var cfg in configs)
+// {
+// var mem = cfg.GetFields();
+// var members = mem.Where(m => m.HasAttribute()).ToList();
+// foreach (var m in members)
+// {
+// configUsings += $"using {m.FieldType.Namespace};\n";
+// configFields += $"public {m.FieldType.FullName} {m.Name};\n";
+// }
+//
+// var attribute = cfg.GetAttribute();
+//
+// configUsings += @"
+// using UnityEngine;
+// using UnityEngine.AddressableAssets;
+// ";
+// configCode = $@"
+// {configUsings}
+// namespace {cfg.Namespace}{{
+// [CreateAssetMenu(fileName = ""{cfg.Name}Config"", menuName = ""{attribute.MenuName}"")]
+// public class {cfg.Name}Config : ScriptableObject
+// {{
+// {configFields}
+// }}
+// }}
+// ";
+// context.AddCode($"{cfg.Name}Config.Generated.cs", configCode);
+//
+// configReferencesUsingsCode += $"using {cfg.Namespace};\n";
+//
+// if (attribute.Multiple)
+// {
+// configReferencesCode += $"public String {cfg.Name};\n";
+// configAddCode += $@"
+// _multipleConfigReferences.Add(typeof({cfg.FullName}), systemConfigsReferences.{cfg.Name});
+// ";
+// }
+// else
+// {
+// configReferencesCode += $"public AssetReference {cfg.Name};\n";
+// configAddCode += $@"
+// _singleConfigReferences.Add(typeof({cfg.FullName}Config), systemConfigsReferences.{cfg.Name});
+// ";
+// }
+// }
+// configsCode += $@"
+// {configReferencesUsingsCode}
+// using UnityEngine;
+//
+// namespace Code.Infrastructure.Configs
+// {{
+//
+// public partial class ConfigLocator
+// {{
+// partial void LoadConfigs()
+// {{
+// SystemConfigsReferences systemConfigsReferences = Resources.Load(""SystemConfigsReferences"");
+// {configAddCode}
+// //_singleConfigReferences.Add(typeof(ScenesAssetReferences), systemConfigsReferences.scenesAssetReferences);
+// }}
+// }}
+// }}
+// ";
+// context.AddCode($"ConfigLocator.Generated.cs", configsCode);
+//
+// configOfConfigsCode += $@"
+// {configReferencesUsingsCode}
+// using UnityEngine.AddressableAssets;
+//
+// namespace Code.Infrastructure.Configs{{
+// public partial class SystemConfigsReferences
+// {{
+// {configReferencesCode}
+// }}
+// }}
+// ";
+// context.AddCode($"SystemConfigsReferences.Generated.cs", configOfConfigsCode);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/Generators/SceneLoaderGenerator.cs.meta b/Assets/Code/Infrastructure/Generators/SceneLoaderGenerator.cs.meta
new file mode 100644
index 0000000..ed17cad
--- /dev/null
+++ b/Assets/Code/Infrastructure/Generators/SceneLoaderGenerator.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 92ec56ffd46d4a569bb9a7d436790439
+timeCreated: 1766423754
\ No newline at end of file
diff --git a/Assets/Code/Generators/StateMachineGenerator.cs b/Assets/Code/Infrastructure/Generators/StateMachineGenerator.cs
similarity index 54%
rename from Assets/Code/Generators/StateMachineGenerator.cs
rename to Assets/Code/Infrastructure/Generators/StateMachineGenerator.cs
index 4a1e513..aa9fcf9 100644
--- a/Assets/Code/Generators/StateMachineGenerator.cs
+++ b/Assets/Code/Infrastructure/Generators/StateMachineGenerator.cs
@@ -1,16 +1,21 @@
using System.Linq;
-using Code.StateMachine;
using Unity.VisualScripting;
-using UnityEditor;
using UnityCodeGen;
-using UnityEngine;
+using UnityEditor;
-namespace Code.Generators
+namespace Code.Infrastructure.Generators
{
[Generator]
public class StateMachineGenerator : ICodeGenerator
{
public void Execute(GeneratorContext context)
+ {
+ GenerateStates(context);
+
+ GenerateStateMachine(context);
+ }
+
+ private void GenerateStateMachine(GeneratorContext context)
{
var stateMachines = TypeCache.GetTypesWithAttribute();
@@ -20,20 +25,19 @@ namespace Code.Generators
var states = TypeCache.GetTypesWithAttribute()
.Where(st =>
- st.GetAttribute().StateMachineContextType.FullName ==
+ st.GetAttribute().StateMachineContext.FullName ==
attribute.StateMachineContextType.FullName);
-
- var statesCode = "";
- var statesNamespacesCode = "";
-
+
+ var statesCode = "";
+ var statesNamespacesCode = "";
+
foreach (var st in states)
- {
- var stateAttribute = st.GetAttribute();
+ {
statesNamespacesCode += $@"
using {st.Namespace};
";
statesCode += $@"
-var state{st.Name} = new {st.Name}(StateMachineContext);
+var state{st.Name} = new {st.Name}(StateMachineContext,eventBus);
States.Add(state{st.Name}.myState, state{st.Name});
";
}
@@ -41,18 +45,19 @@ States.Add(state{st.Name}.myState, state{st.Name});
var stateMachineCode =
$@"
//
-using Code.StateMachine;
+#pragma warning disable CS0105
+using Code.Infrastructure.StateMachine;
{statesNamespacesCode}
+#pragma warning restore CS0105
namespace {sm.Namespace}
{{
public partial class {sm.Name} : AbstractStateMachine<{attribute.StateMachineEnumType.FullName},{attribute.StateMachineContextType.FullName}>
{{
- public {sm.Name}()
+ public {sm.Name}({attribute.StateMachineContextType.FullName} context, EventBus.EventBus eventBus) : base(context)
{{
{statesCode}
- CurrentBaseState = States[default({attribute.StateMachineEnumType.FullName})];
}}
protected override bool CheckTransitionAllowed({attribute.StateMachineEnumType.FullName} nextState) => AllowedStates.HasFlag(nextState);
@@ -74,22 +79,53 @@ public partial class {sm.Name} : AbstractStateMachine<{attribute.StateMachineEnu
";
- // var publicFields = t.GetFields()
- // .Where(x => x.IsPublic && !x.IsStatic)
- // .Select(x => $"{x.Name}:{{{x.Name}}}");
-
-// var toString = string.Join(", ", publicFields);
-// var code =
-// $@"//
-// partial class {t.Name}
-// {{
-// public override string ToString()
-// {{
-// return $""{toString}"";
-// }}
-// }}";
context.AddCode($"{sm.FullName}.Generated.cs", stateMachineCode);
}
}
+
+ private void GenerateStates(GeneratorContext context)
+ {
+ var states = TypeCache.GetTypesWithAttribute();
+
+ var statesCode = "";
+ foreach (var st in states)
+ {
+ var attribute = st.GetAttribute();
+
+ var fireStatesCode = "";
+ if(st.HasAttribute()) fireStatesCode = $@"
+protected override void _fireEnterState()
+ {{
+ EventBus.RaiseEvent>(h => h.EnterState());
+ }}
+
+ protected override void _fireExitState()
+ {{
+ EventBus.RaiseEvent>(h => h.ExitState());
+ }}
+";
+ var genetics = "";
+ if(!attribute.SilentBitch) genetics = $@" : BaseState<{attribute.StateEnum.FullName}, {attribute.StateMachineContext.FullName}>";
+
+ statesCode = $@"
+
+// retard-generated
+
+using Code.Infrastructure.StateMachine;
+
+namespace {st.Namespace}
+{{
+ public partial class {st.Name} {genetics}
+ {{
+ {fireStatesCode}
+ }}
+}}
+";
+
+
+ context.AddCode($"{st.FullName}.Generated.cs", statesCode);
+
+ }
+ }
}
}
\ No newline at end of file
diff --git a/Assets/Code/Generators/StateMachineGenerator.cs.meta b/Assets/Code/Infrastructure/Generators/StateMachineGenerator.cs.meta
similarity index 100%
rename from Assets/Code/Generators/StateMachineGenerator.cs.meta
rename to Assets/Code/Infrastructure/Generators/StateMachineGenerator.cs.meta
diff --git a/Assets/Code/Infrastructure/Input.meta b/Assets/Code/Infrastructure/Input.meta
new file mode 100644
index 0000000..f0365bf
--- /dev/null
+++ b/Assets/Code/Infrastructure/Input.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 629db0b5c4ac4624b5bde7022e167b3b
+timeCreated: 1766612368
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/Input/ActionMappings.cs b/Assets/Code/Infrastructure/Input/ActionMappings.cs
new file mode 100644
index 0000000..969ddfb
--- /dev/null
+++ b/Assets/Code/Infrastructure/Input/ActionMappings.cs
@@ -0,0 +1,26 @@
+namespace Code.Infrastructure.Input
+{
+ public enum ActionMappings
+ {
+ MainMenu,
+ Gameplay,
+ Debug
+ }
+ public enum GameplayActions
+ {
+ Move,
+ Crouch,
+ Look,
+ Zoom
+ }
+ public enum DebugActions
+ {
+ Debug1,
+ Debug2,
+ Debug3,
+ Debug4,
+ Debug5,
+ Debug6,
+ Debug7
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/Input/ActionMappings.cs.meta b/Assets/Code/Infrastructure/Input/ActionMappings.cs.meta
new file mode 100644
index 0000000..7ee92eb
--- /dev/null
+++ b/Assets/Code/Infrastructure/Input/ActionMappings.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: dc62fec94fde411ab1420155a5087d64
+timeCreated: 1766613550
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/Input/IInputService.cs b/Assets/Code/Infrastructure/Input/IInputService.cs
new file mode 100644
index 0000000..511f4df
--- /dev/null
+++ b/Assets/Code/Infrastructure/Input/IInputService.cs
@@ -0,0 +1,15 @@
+using System;
+using UnityEngine.InputSystem;
+
+namespace Code.Infrastructure.Input
+{
+ public interface IInputService
+ {
+ void EnableMap(ActionMappings actionMap);
+ void DisableMap(ActionMappings actionMap);
+ void BindActionPerformed(int mapId, int actionId, Action action);
+ void BindActionCancel(int mapId, int actionId, Action action);
+ void UnbindActionPerformed(int mapId, int actionId, Action action);
+ void UnbindActionCanceled(int mapId, int actionId, Action action);
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/Input/IInputService.cs.meta b/Assets/Code/Infrastructure/Input/IInputService.cs.meta
new file mode 100644
index 0000000..eed0bc4
--- /dev/null
+++ b/Assets/Code/Infrastructure/Input/IInputService.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 9443ed0c0d76423f8ecebbd9398bacf3
+timeCreated: 1766614201
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/Input/InputService.cs b/Assets/Code/Infrastructure/Input/InputService.cs
new file mode 100644
index 0000000..7548fd9
--- /dev/null
+++ b/Assets/Code/Infrastructure/Input/InputService.cs
@@ -0,0 +1,62 @@
+using System;
+using Code.Infrastructure.Configs;
+using Code.Infrastructure.EventBus;
+using Code.Infrastructure.Generators;
+using Cysharp.Threading.Tasks;
+using UnityEngine.AddressableAssets;
+using UnityEngine.InputSystem;
+using UnityEngine.ResourceManagement.AsyncOperations;
+
+namespace Code.Infrastructure.Input
+{
+ [Config("Configs/InputService")]
+ public class InputService : IInputService
+ {
+ [ToConfig] public InputActionAsset inputActionAsset;
+ private EventBus.EventBus _eventBus;
+
+ public InputService(IConfigLocator configLocator, EventBus.EventBus eventBus)
+ {
+ _eventBus = eventBus;
+ LoadConfigs(configLocator.TryGetConfigAssetReference()).Forget();
+ }
+
+ private AsyncOperationHandle _configHandle;
+
+ private async UniTaskVoid LoadConfigs(AssetReference configReference)
+ {
+ _configHandle = Addressables.LoadAssetAsync(configReference);
+
+ await _configHandle.ToUniTask();
+
+ inputActionAsset = _configHandle.Result.inputActionAsset;
+
+ inputActionAsset.actionMaps[(int)ActionMappings.Debug].Enable();
+ inputActionAsset.actionMaps[(int)ActionMappings.Gameplay].Enable();
+
+ _eventBus.RaiseEvent(h => h.InputServiceInitialized());
+ }
+
+ public void EnableMap(ActionMappings actionMap) => inputActionAsset.actionMaps[(int)actionMap].Enable();
+ public void DisableMap(ActionMappings actionMap) => inputActionAsset.actionMaps[(int)actionMap].Disable();
+
+ public void BindActionPerformed(int mapId, int actionId, Action action) => inputActionAsset
+ .actionMaps[mapId].actions[actionId].performed += action;
+
+ public void BindActionCancel(int mapId, int actionId, Action action) => inputActionAsset
+ .actionMaps[mapId].actions[actionId].canceled += action;
+
+ public void UnbindActionPerformed(int mapId, int actionId, Action action) =>
+ inputActionAsset
+ .actionMaps[mapId].actions[actionId].performed -= action;
+
+ public void UnbindActionCanceled(int mapId, int actionId, Action action) =>
+ inputActionAsset
+ .actionMaps[mapId].actions[actionId].canceled -= action;
+ }
+
+ public interface IInputServiceInitializedHandle : IGlobalSubscriber
+ {
+ void InputServiceInitialized();
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/Input/InputService.cs.meta b/Assets/Code/Infrastructure/Input/InputService.cs.meta
new file mode 100644
index 0000000..8bff0df
--- /dev/null
+++ b/Assets/Code/Infrastructure/Input/InputService.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 2755e684d68a4f79994f0f92e8327a73
+timeCreated: 1766612399
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/Loadings.meta b/Assets/Code/Infrastructure/Loadings.meta
new file mode 100644
index 0000000..3ec2cf7
--- /dev/null
+++ b/Assets/Code/Infrastructure/Loadings.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: d78dfc7c05e54743bfa99dfeaa7dc064
+timeCreated: 1766483099
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/Loadings/Loading.cs b/Assets/Code/Infrastructure/Loadings/Loading.cs
new file mode 100644
index 0000000..83b4f49
--- /dev/null
+++ b/Assets/Code/Infrastructure/Loadings/Loading.cs
@@ -0,0 +1,29 @@
+using System;
+
+namespace Code.Infrastructure.Loadings
+{
+ public class Loading
+ {
+ private int _progress;
+ private Action _completed;
+ private Action _loadProgress;
+
+ public Loading(int maxProgress, Action completed, Action loadProgress = null)
+ {
+ _progress = maxProgress;
+ MaxProgress = maxProgress;
+
+ _completed = completed;
+ _loadProgress = loadProgress;
+ }
+ public int CurrentProgress => _progress;
+ public int MaxProgress { get; }
+
+ public void DoProgress()
+ {
+ _progress--;
+ _loadProgress?.Invoke(this);
+ if(_progress <= 0) _completed();
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/Loadings/Loading.cs.meta b/Assets/Code/Infrastructure/Loadings/Loading.cs.meta
new file mode 100644
index 0000000..65a594b
--- /dev/null
+++ b/Assets/Code/Infrastructure/Loadings/Loading.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: a1707a55b78d4218b1557d42adb7d961
+timeCreated: 1766483205
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/SceneLoader.meta b/Assets/Code/Infrastructure/SceneLoader.meta
new file mode 100644
index 0000000..ec5b382
--- /dev/null
+++ b/Assets/Code/Infrastructure/SceneLoader.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: b7568293a2874477b2faeb918157ca94
+timeCreated: 1766325345
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/SceneLoader/SceneId.cs b/Assets/Code/Infrastructure/SceneLoader/SceneId.cs
new file mode 100644
index 0000000..8df3341
--- /dev/null
+++ b/Assets/Code/Infrastructure/SceneLoader/SceneId.cs
@@ -0,0 +1,11 @@
+using Code.Infrastructure.Generators;
+
+namespace Code.Infrastructure.SceneLoader
+{
+ [SceneIdEnum]
+ public enum SceneId
+ {
+ MainMenu,
+ Gameplay
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/SceneLoader/SceneId.cs.meta b/Assets/Code/Infrastructure/SceneLoader/SceneId.cs.meta
new file mode 100644
index 0000000..31b12b4
--- /dev/null
+++ b/Assets/Code/Infrastructure/SceneLoader/SceneId.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: af1da0e870d542f2a864d7ddbbe9fb4c
+timeCreated: 1766396924
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/SceneLoader/SceneLoader.cs b/Assets/Code/Infrastructure/SceneLoader/SceneLoader.cs
new file mode 100644
index 0000000..728c8ae
--- /dev/null
+++ b/Assets/Code/Infrastructure/SceneLoader/SceneLoader.cs
@@ -0,0 +1,82 @@
+using System;
+using System.Collections.Generic;
+using Code.Infrastructure.Configs;
+using Code.Infrastructure.EventBus;
+using Code.Infrastructure.Generators;
+using Cysharp.Threading.Tasks;
+using UnityEngine;
+using UnityEngine.AddressableAssets;
+using UnityEngine.ResourceManagement.AsyncOperations;
+using UnityEngine.SceneManagement;
+
+namespace Code.Infrastructure.SceneLoader
+{
+ [Config("Configs/SceneConfig",true)]
+ public class SceneInfo
+ {
+ [ToConfig] public AssetReference SceneAsset;
+ [ToConfig] public SceneId SceneId;
+ }
+ public partial class SceneLoader : IDisposable
+ {
+ private Dictionary _sceneInfos = new();
+ private Dictionary _scenesActions = new();
+
+ private EventBus.EventBus _eventBus;
+
+ partial void SetupScenesInfo();
+
+ private AsyncOperationHandle> _loadHandle;
+
+ public SceneLoader(EventBus.EventBus eventBus, IConfigLocator configLocator)
+ {
+ _eventBus = eventBus;
+ LoadConfigs(configLocator.TryGetManyConfigAssetReferences()).Forget();
+ }
+
+ // TODO типилище
+ public async UniTaskVoid LoadSceneAsync(SceneId id, LoadSceneMode loadMode)
+ {
+ await Addressables.LoadSceneAsync(_sceneInfos[id].SceneAsset, loadMode);
+
+ _scenesActions[id]();
+ }
+
+ private AsyncOperationHandle> _configHandle;
+
+ private async UniTaskVoid LoadConfigs(string configReferences)
+ {
+ _configHandle = Addressables.LoadAssetsAsync(configReferences, OnSceneConfigLoaded, Addressables.MergeMode.Union);
+
+ await _configHandle.ToUniTask();
+
+ SetupScenesInfo();
+ _eventBus.RaiseEvent(h => h.SceneConfigsLoaded());
+ }
+
+
+ private void OnSceneConfigLoaded(SceneInfoConfig sceneInfoConfig)
+ {
+ SceneInfo sceneInfo = new();
+ sceneInfo.SceneId = sceneInfoConfig.SceneId;
+ sceneInfo.SceneAsset = sceneInfoConfig.SceneAsset;
+
+ _sceneInfos.Add(sceneInfoConfig.SceneId, sceneInfo);
+ }
+
+ public void Dispose()
+ {
+ Addressables.Release(_configHandle);
+ }
+
+ }
+
+ public interface ISceneConfigsLoadedHandle : IGlobalSubscriber
+ {
+ void SceneConfigsLoaded();
+ }
+ public interface ILoadedSceneHandle : IGlobalSubscriber
+ {
+ void SceneLoaded(SceneId sceneId);
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/SceneLoader/SceneLoader.cs.meta b/Assets/Code/Infrastructure/SceneLoader/SceneLoader.cs.meta
new file mode 100644
index 0000000..82e3e28
--- /dev/null
+++ b/Assets/Code/Infrastructure/SceneLoader/SceneLoader.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 760817ac86164799ac58327509052257
+timeCreated: 1766325358
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/SceneLoader/ScenesAssetReferences.cs b/Assets/Code/Infrastructure/SceneLoader/ScenesAssetReferences.cs
new file mode 100644
index 0000000..9196154
--- /dev/null
+++ b/Assets/Code/Infrastructure/SceneLoader/ScenesAssetReferences.cs
@@ -0,0 +1,11 @@
+using UnityEngine;
+using UnityEngine.AddressableAssets;
+
+namespace Code.Infrastructure.SceneLoader
+{
+ [CreateAssetMenu(fileName = "ScenesAssetReferences", menuName = "Configs/ScenesAssetReferences")]
+ public class ScenesAssetReferences : ScriptableObject
+ {
+ public AssetReference gameplaySceneReference;
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/SceneLoader/ScenesAssetReferences.cs.meta b/Assets/Code/Infrastructure/SceneLoader/ScenesAssetReferences.cs.meta
new file mode 100644
index 0000000..3900da4
--- /dev/null
+++ b/Assets/Code/Infrastructure/SceneLoader/ScenesAssetReferences.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 9759979f397044a5bcb03ded0d1c9561
+timeCreated: 1766325404
\ No newline at end of file
diff --git a/Assets/Code/StateMachine.meta b/Assets/Code/Infrastructure/StateMachine.meta
similarity index 100%
rename from Assets/Code/StateMachine.meta
rename to Assets/Code/Infrastructure/StateMachine.meta
diff --git a/Assets/Code/StateMachine/AbstractStateMachine.cs b/Assets/Code/Infrastructure/StateMachine/AbstractStateMachine.cs
similarity index 52%
rename from Assets/Code/StateMachine/AbstractStateMachine.cs
rename to Assets/Code/Infrastructure/StateMachine/AbstractStateMachine.cs
index 1acff13..84e9903 100644
--- a/Assets/Code/StateMachine/AbstractStateMachine.cs
+++ b/Assets/Code/Infrastructure/StateMachine/AbstractStateMachine.cs
@@ -1,38 +1,35 @@
+using System;
using System.Collections.Generic;
-using UnityEngine;
+using Code.Infrastructure.EventBus;
-namespace Code.StateMachine
+namespace Code.Infrastructure.StateMachine
{
public abstract class AbstractStateMachine
where TStateMachineContext : new()
{
+ protected AbstractStateMachine(TStateMachineContext stateMachineContext )
+ {
+ StateMachineContext = stateMachineContext;
+ }
+
public TStateEnum CurrentState { get; protected set; }
- public BaseState CurrentBaseState { get; protected set; }
+ public BaseState CurrentBaseState { get; private set; }
private BaseState _previousBaseState;
protected Dictionary> States = new();
+ protected Dictionary StatesTypes = new();
public TStateEnum AllowedStates { get; set; }
- public TStateMachineContext StateMachineContext { get; protected set; } = new();
+ protected TStateMachineContext StateMachineContext { get; }
- // protected virtual void Update()
- // {
- // CurrentBaseState.Tick();
- // }
- //
- // protected void LateUpdate()
- // {
- // CurrentBaseState.LateTick();
- // }
-
// Костыли 2 шт. для флагового енама в шаблонах
protected abstract bool CheckTransitionAllowed(TStateEnum nextState);
protected abstract void ResetAllowedTransitions();
// TODO Если в EnterState вызывается ExitState, то будет гарантированная поломка
- public virtual AbstractStateMachine SwitchState(TStateEnum nextState)
+ public AbstractStateMachine SwitchState(TStateEnum nextState)
{
- if (!CheckTransitionAllowed(nextState))
+ if (!CheckTransitionAllowed(nextState) && CurrentBaseState != null)
{
return null;
}
@@ -43,28 +40,23 @@ namespace Code.StateMachine
CurrentBaseState = States[nextState];
- if (_previousBaseState != null)
- {
- _previousBaseState.OnExited += CurrentBaseState.EnterState;
- _previousBaseState.OnExited += FinishBaseStateTransition;
- _previousBaseState.ExitState();
- }
- else
- {
- CurrentBaseState.EnterState();
- }
+ _previousBaseState?.ExitState();
+
+ CurrentBaseState.EnterState();
CurrentState = nextState;
return this;
}
+ }
- protected virtual void FinishBaseStateTransition()
- {
- _previousBaseState.OnExited -= CurrentBaseState.EnterState;
- _previousBaseState.OnExited -= FinishBaseStateTransition;
+ public interface IEnterStateHandle : IGlobalSubscriber
+ {
+ void EnterState();
+ }
- _previousBaseState = null;
- }
+ public interface IExitStateHandle : IGlobalSubscriber
+ {
+ void ExitState();
}
}
\ No newline at end of file
diff --git a/Assets/Code/StateMachine/AbstractStateMachine.cs.meta b/Assets/Code/Infrastructure/StateMachine/AbstractStateMachine.cs.meta
similarity index 100%
rename from Assets/Code/StateMachine/AbstractStateMachine.cs.meta
rename to Assets/Code/Infrastructure/StateMachine/AbstractStateMachine.cs.meta
diff --git a/Assets/Code/Infrastructure/StateMachine/BaseState.cs b/Assets/Code/Infrastructure/StateMachine/BaseState.cs
new file mode 100644
index 0000000..a9e9dd0
--- /dev/null
+++ b/Assets/Code/Infrastructure/StateMachine/BaseState.cs
@@ -0,0 +1,37 @@
+namespace Code.Infrastructure.StateMachine
+{
+ public abstract class BaseState
+ {
+ public abstract TEnum myState { get; }
+
+ protected BaseState(TStateMachineContext context, EventBus.EventBus eventBus)
+ {
+ Context = context;
+ EventBus = eventBus;
+ }
+
+ protected EventBus.EventBus EventBus;
+ protected TStateMachineContext Context { get; }
+
+ protected virtual void _fireEnterState()
+ {
+ }
+
+ protected virtual void _fireExitState()
+ {
+ }
+
+ protected abstract void OnEnterState();
+ protected abstract void OnExitState();
+ public void EnterState()
+ {
+ OnEnterState();
+ _fireEnterState();
+ }
+ public void ExitState()
+ {
+ OnExitState();
+ _fireExitState();
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/StateMachine/BaseState.cs.meta b/Assets/Code/Infrastructure/StateMachine/BaseState.cs.meta
similarity index 100%
rename from Assets/Code/StateMachine/BaseState.cs.meta
rename to Assets/Code/Infrastructure/StateMachine/BaseState.cs.meta
diff --git a/Assets/Code/StateMachine/BaseState.cs b/Assets/Code/StateMachine/BaseState.cs
deleted file mode 100644
index f0c72b9..0000000
--- a/Assets/Code/StateMachine/BaseState.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-namespace Code.StateMachine
-{
- public abstract class BaseState
- {
- public abstract TEnum myState { get; }
-
- public delegate void Entered();
- public event Entered OnEntered;
-
- public delegate void Exited();
- public event Exited OnExited;
-
- protected BaseState(TStateMachineContext context)
- {
- Context = context;
- }
- public TStateMachineContext Context { get; protected set; }
-
- public virtual void EnterState() => OnEntered?.Invoke();
- public virtual void ExitState() => OnExited?.Invoke();
- }
-}
\ No newline at end of file
diff --git a/Assets/FastScriptReload.meta b/Assets/FastScriptReload.meta
new file mode 100644
index 0000000..985065e
--- /dev/null
+++ b/Assets/FastScriptReload.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 2effcda6ca972d34c85ec6e106aa4021
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/FastScriptReload/Documentation.meta b/Assets/FastScriptReload/Documentation.meta
new file mode 100644
index 0000000..9e5a40b
--- /dev/null
+++ b/Assets/FastScriptReload/Documentation.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: a849b8376c6cae04b8dd2b8743cf2fb1
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/FastScriptReload/Documentation/documentation.md b/Assets/FastScriptReload/Documentation/documentation.md
new file mode 100644
index 0000000..7c626bd
--- /dev/null
+++ b/Assets/FastScriptReload/Documentation/documentation.md
@@ -0,0 +1,708 @@
+# Fast/Live Script Reload
+
+Tool will allow you to iterate quicker on your code. You simply go into play mode, make a change to any file and it'll be compiled on the fly and hot-reloaded in your running play-mode session.
+
+## Getting started
+1) Import
+2) Welcome screen will open - it contains all needed info to get started as well as support links and configuration.
+`You can always get back to this screen via 'Window -> Fast/Live Script Reload -> Start Screen'`
+3) Go to Launch Demo -> Basic Example window
+4) Follow instructions listed there
+
+> During startup asset will check if Unity Auto Refresh is enabled and offer to adjust it in order to work properly. Depending on your workflow you want it in 'EnabledOutsidePlaymode' or 'Disabled' - this is to ensure Unity will not trigger script compilation on changes and will let Fast Script Reload to work.
+
+> Sometimes Unity can be quite stubborn and try to auto-reload scripts even with Auto-Reload turned off, if you can still see standard 'Reloading script assemblies' progress bar on change please go to:
+> 'Window -> Fast Script Reload -> Start Screen -> Reload -> Force prevent assembly reload during playmode'.
+> This way tool will lock reload in code when you enter playmode.
+
+```
+Example scene 'Point' material should automatically detect URP or surface shader
+If it shows pink, please adjust by picking shader manually:
+1) URP: 'Shader Graphs/Point URP'
+2) Surface: 'Graph/Point Surface'
+```
+
+## On-Device Hot-Reload - Live Script reload
+There's an addon to this tool - Live Script Reload - that'll allow you to use same functionality over the network in device build, eg:
+- android (including VR headsets like Quest 2)
+- standalone windows
+
+[Find more details here](https://immersivevrtools.com/redirect/fast-script-reload/live-script-reload-extension)
+
+**Live Script Reload is using Fast Script Reload as a base asset - documentation is combined, if you don't use Live Script Reload you can skip any sections in this document prefixed with [Live-Reload]**
+
+## How Unity Hot Reload functionality is made? Technical Approach Breakdown
+If you'd like to know how tool works from technical point of view - have a look at blog series which gets deeper into the subject:
+
+[1) How to build Hot Reload For Unity](https://immersivevrtools.com/Blog/how-to-build-hot-reload-functionality-for-unity)
+
+[2) Hot Reload - on device, (eg Android / Windows Exe)](https://immersivevrtools.com/Blog/how-to-build-unity-hot-reload-on-device)
+
+## Reporting Compilation Errors
+I've put lots of effort to test various code patterns in various codebases. Still - it's possible you'll find some instances where code would not compile, it's easiest to:
+1) Look at compiler error and compare with generated source code, usually it'll be very obvious why issue is occuring
+2) Refactor problematic part (look at limitations section as they'll explain how)
+3) Let me know via support email and I'll get it fixed
+
+## Executing custom code on hot reload
+Custom code can be executed on hot reload by adding a method to changed script.
+
+**You can see example by adjusting code in 'Graph.cs' file.**
+
+```
+ void OnScriptHotReload()
+ {
+ //do whatever you want to do with access to instance via 'this'
+ }
+```
+
+```
+ static void OnScriptHotReloadNoInstance()
+ {
+ //do whatever you want to do without instance
+ //useful if you've added brand new type
+ // or want to simply execute some code without |any instance created.
+ //Like reload scene, call test function etc
+ }
+```
+
+## EXPERIMENTAL Adding New Fields
+Asset has an experimental support for adding new fields at runtime which will also render in Editor and allow you to tweak values - same as with normal fields.
+
+To enable, please:
+`Window -> Fast Script Reload -> Start Window -> New Fields -> Enable experimental added field support`.
+
+> As this is an experimental feature please expect it to break more often! It'd be great help if you could report any issues via Discord / email.
+
+### New Fields - specific limitations
+
+- outside classes can not call new fields added at runtime
+- new fields will only show in editor if they were already used at least once
+ - eg if you've added a variable into a method, on first call that variable will be initialized and will start showing in editor
+
+### New Fields - performance
+For new fields to work your code will be adjusted. Instead of calling fields directly your code will call into a method that retrieves value from dynamic dictionary.
+
+Due to that there'll be some overhead with:
+- looking up proper object and new-field value in dictionary
+- initializing values
+- use of dynamic type, which will introduce some additional casts
+
+> All that shouldn't really add too much overhead on dev-machine - you may lose few FPS though.
+
+## EXPERIMENTAL In-editor Hot Reload (outside of playmode)
+Asset has an experimental support for hot reload outside of playmode. However with limitations as they are now - it
+is intended for some specific use cases (like iterating on editor scripts).
+
+> **Feature is not intended as a replacement for Unity compile / reload mechanism**
+
+To enable, please:
+`Window -> Fast Script Reload -> Start Window -> Editor Hot-Reload -> Enable Hot-Reload outside of play mode`.
+
+> As this is an experimental feature please expect it to break more often! It'd be great help if you could report any issues via Discord / email.
+
+## Debugging
+Debugging is fully supported although breakpoints in your original file won't be hit.
+
+Once change is compiled, you'll get an option to open generated file [via clickable link in console window] in which you can set breakpoints.
+
+Tool can also auto-open generated files for you on change for simpler access, you can find option via 'Window -> Fast Script Reload -> Start Screen -> Debugging -> Auto open generated source file for debugging'
+
+> Debugging with Rider for Unity 2019 and 2020 is having some issues, you can only open debuggable files with auto-open feature. Clicking a file in console causes subtle static-variables reload (not full domain reload) that'll break your play-session.
+
+### Adding Function Breakpoint
+If for whatever reason debugger breakpoint is not hit you can try setting Function Breakpoint in your IDE.
+
+For type name you want to include `__Patched_`, the `__Patched_` postfix is auto-added by asset to prevent name clash.
+Function name remains unchanged.
+
+## Production Build
+For Fast Script Reload asset code will be excluded from any builds.
+
+For Live Script Reload you should exclude it from final production build, do that via:
+- 'Window -> Fast Script Reload -> Welcome Screen -> Build -> Enable Hot Reload For Build' - untick
+
+**When building via File -> Build Settings - you'll also see Live Script Reload status under 'Build' button. You can click 'Adjust' button which will take you to build page for asset.**
+```This is designed to make sure you don't accidentally build tool into release althoguh best approach would be to ensure your release process takes care of that.```
+
+## User Defined Script Overrides
+For asset to hot reload your changes it needs to make some adjustments to code. This could cause some issues as described in limitations section.
+
+I continuously work on mitigating limitations. When they happen you can help yourself quickly by creating user defined script override.
+
+Those are simply overrides on a per-file / method basis - when specified their contents will be used for final source code. Allowing you to simply fix any issues.
+This is especially helpful with larger files.
+
+### Replacing methods
+You can replace existing methods by specifying their full signature in correct type - contents will be then replaced.
+> If no match for the method signature is found it'll be ignored
+
+For example, let's look at limitation with assigning Singleton to Instance using 'this' keyword
+> That limitation is already solved although it'll serve as a clean example illustrating the feature
+
+Following code:
+```
+public class MySingleton: MonoBehaviour {
+ public static MySingleton Instance;
+
+ void Start() {
+ Instance = this;
+ }
+
+ void SomeOtherMethod() {
+ //some other logic
+ }
+}
+```
+
+Would be rewritten to:
+```
+public class MySingleton__Patched_: MonoBehaviour { //FSR: name change to include __Patched_ postfix to prevent name clashes
+ public static MySingleton Instance;
+
+ void Start() {
+ //assigning 'this' (now of type MySingleton__Patched_) to
+ //'Instance' of type MySingleton will now show compilation error due to type mismach
+ Instance = this;
+ }
+
+ void SomeOtherMethod() {
+ //some other logic
+ }
+}
+```
+
+In that case you can create a user script rewrite override, to do so:
+1) In Unity project panel right-click on 'MySingleton.cs'
+2) Select `Fast Script Reload -> Add \ Open User Script Rewrite Override`
+3) Asset will create override file for you with some template already in (there's also description in top comment how to use)
+
+Override:
+```
+public class MySingleton__Patched_: MonoBehaviour {
+ void Start() { //override will target class specified above and only defined methods, in that case Start()
+ Instance = (MySingleton)(object)this; //contents will be changed as they are visible here, casting to object and then to expected type will correct the issue
+ }
+}
+```
+
+### Adding types
+When your code is recompiled it lands in new assembly. This can cause some issues, for example if your class is using `internal`
+interface - after recompile it won't be able to access that interface.
+
+Following code will fail to compile when changing MyClass as it won't be able to access IInterface which is `internal`:
+```
+//Defined in file MyClass.cs
+public class MyClass: IInterface {
+
+}
+
+//Defined in other file, IInterface.cs
+interface IInterface { //no access modifier for interfaces will infer 'internal' - only available to assembly it's defined in.
+
+}
+```
+
+In that case you can create a user script rewrite override, to do so:
+1) In Unity project panel right-click on 'MyClass.cs'
+2) Select `Fast Script Reload -> Add \ Open User Script Rewrite Override`
+3) Asset will create override file for you with some template already in (there's also description in top comment how to use)
+
+And put following in the override file
+```
+interface IInterface {
+ // add any definitions as needed
+}
+```
+
+This will then be simply added to newly compiled file and interface will be accessible.
+```
+//now both in same assembly/file when hot reloaded
+public class MyClass: IInterface {
+
+}
+
+
+interface IInterface {
+
+}
+```
+
+### Managing existing User Script Rewrite Overrides
+You can see all your overrides by:
+
+1) Right clicking on file in Unity project panel
+2) Clicking `Fast Script Reload -> Show User Script Rewrite Overrides`
+
+This will take you to tool settings window. You can also access it via:
+1) Clicking `Window -> Fast Script Reload -> Start Screen`
+2) Selecting `User Script Rewrite Overrides` side tab
+
+
+## Options
+You can access Welcome Screen / Options via 'Window -> Fast/Live Script Reload -> Start Screen' - it contains useful information as well as options.
+```
+Context menus will be prefixed with used version, either 'Fast Script Reload' or 'Live Script Reload'
+```
+
+### Auto Hot-Reload
+By default tool will pick changes made to any file in playmode. You can add exclusions to that behaviour, more on that later.
+
+You can also manually manage reload, to do so:
+1) Un-tick 'Enable auto Hot-Reload for changed files' in Options -> Reload page
+2) Click Window -> Fast Script Reload -> Force Reload to trigger
+3) or call `FastScriptReloadManager.TriggerReloadForChangedFiles()` method from code
+
+> You can also use Editor -> Hotkeys to bind Force Reload to specific key.
+
+
+### Watch only specific files or folders
+By default FSR watches all files (as specified in global file watcher) - if you want to limit that behaviour to specific files
+please tick 'Specify watched folders/files manually' in 'Reload tab'.
+
+Then you can right click on folder/file in project window and select 'Fast Script Reload -> Watch File / Folder'.
+
+> Technically this adds another File Watcher behind the scenes, you can always adjust those on File Watchers tab.
+
+### Custom file watcher implementation
+In some cases standard file default watcher API can cause issues. You can choose different file watcher implementations via 'Window -> Fast Script Reload -> Start Screen -> File Watchers -> File Watcher implementation'
+
+> DefaultUnity - on some editor versions it could be slow or not trigger at all
+>
+> DirectWindowsApi - (experimental) uses Windows API directly, faster (symlinks not supported)
+>
+> CustomPolling - (experimental) watches files by manual polling for changes, slowest. Make sure to narrow down watchers scope to script folders
+
+### [Live-Reload] Hot-Reload over Network
+With on-device build, your code changes will be distributed over the network in real-time.
+
+By default running application will send a broadcast and try to discover editor running the tool.
+
+Broadcast is initiated from device where build is running on (not from editor) - this means device running editor needs to allow the connection.
+
+### [Live-Reload] Troubleshooting network issues
+If for whatever reason reload over network doesn't work, please:
+
+1) go to 'Window -> Live Script Reload -> Options/Network'
+2) make sure port used is not already used by any other application
+3) make sure your Firewall allows connections on that port
+4) If you think broadcast doesn't work in your network it's best to specify IP Address explicitly (tick 'Force specific UP address for clients to receive Hot-Reload updates' and add IP)
+ - this will allow client (build on device) connect directly to specified address
+
+### [Live-Reload] Connected Client
+In playmode, message will be logged when clients connects. Also Options/Network will display connected client, eg Android phone could be identified as:
+
+`SM-100232 connected from 192.189.168.68:12548`
+
+**Only 1 client can be connected at any time.**
+
+### [Live-Reload] Testing with Editor
+By default, editor will reflect any changes you made without using network. If you want to force editor to behave as networked client:
+1) Press play
+2) Find DontDestroyOnLoadObject 'NetworkedAssemblyChangesLoader' -
+3) tick 'IsDebug'
+4) tick 'Editor Acts as Remote Client'
+5) enable NetworkedAssemblyChangesLoader component
+
+### Managing file exclusions
+Files can be excluded from auto-compilation.
+
+#### via 'Project' context menu
+1) Right click on any *.cs file
+2) Click Fast Script Reload
+3) Add Hot-Reload Exclusion
+
+*You can remove exclusion from same menu*
+
+#### via Exclusions page
+To view all exclusions:
+1) Right click on any *.cs file
+2) Click Fast Script Reload
+3) Click Show Exclusions
+
+#### via class attribute
+You can also add `[PreventHotReload]` attribute to a class to prevent hot reload for that class.
+
+### Batch script changes and reload every N seconds
+Script will batch all your playmode changes and Hot-Reload them in bulk every 3 seconds - you can change duration from 'Reload' options page.
+
+### Disable added/removed fields check
+By default if you add / remove fields, tool will not redirect method calls for recompiled class.
+This is to ensure there are no issues as that is generally not supported.
+
+Some assets however will use IL weaving to adjust your classes (eg Mirror) as a post compile step. In that case it's quite likely hot-reload will still work.
+
+### Managing reference exclusions
+Asset will reference all .dll files that original code is referencing. In some cases that causes compilation error (eg 'Type XYZ is defined in both assembly a.dll and b.dll).
+You can use those options to exclude specific references from being added.
+
+> 'Start Screen -> Exclude References (Advanced) -> adjust as needed'.
+
+## Performance
+
+Your app performance won't be affected in any meaningful way.
+Biggest bit is additional memory used for your re-compiled code.
+Won't be visible unless you make 100s of changes in same play-session.
+
+### File Watchers Performance Overhead
+In some cases watching for file changes is causing significant performance overhead. This is down to the Unity FileWatcher which I'm unable to change or provide suitable replacement for. If you're experiencing this issue please go to `Window -> Fast Script Reload -> File Watcher (Advanced Setup)` and narrow down watchers to specific path where you're working in. You can watch multiple folders in this manner.
+
+## LIMITATIONS -please make sure to read those
+There are some limitation due to the approach taken to Hot-Reload your scripts. I've tried to minimise the impact to standard dev-workflow as much as possible.
+
+In some cases however you may need to use workarounds as described below.
+
+> In most cases you'll be able to use [User Defined Script Overrides](#user-defined-script-overrides) to overcome limitations and make hot reload code compilable.
+
+### Generic methods and classes won't be Hot-Reloaded
+Unfortunately generics will not be Hot-Reloaded, to workaround you'd need to move code to non-generic class / method.
+
+Tool will try to change non-generic methods in those files and will simply skip generic ones.
+
+*Note - you can still Hot-Reload for class implementations that derive from generic base class but are not generic themselves, eg.*
+```
+
+class SingletonImplementation: SingletonBase {
+ public void SomeSpecificFunctionality() {
+ //you can change code here and it'll be Hot-Reloaded as type itself is not generic
+ }
+
+ public void GenericMethod(T arg) {
+ //changes here won't be Hot-Reloaded as method is generic
+ }
+}
+
+class SingletonBase where T: new() {
+ public T Instance;
+
+ public void Init() {
+ Instance = new T(); //if you change this code it won't be Hot-Reloaded as it's in generic type
+ }
+}
+
+```
+
+### Adding new fields
+Experimental support with 1.3, minor limitations remaining:
+- outside classes can not call new fields added at runtime
+- new fields will only show in editor if they were already used at least once
+
+> You need to opt in via start screen -> 'Window -> Fast Script Reload -> Start Screen -> New Fields -> enable'!
+
+### Passing `this` reference to method that expect concrete class implementation
+
+
+`**By default experimental setting 'Enable method calls with 'this' as argument fix' is turned on in options, and should fix 'this' calls/assignment issue.
+If you see issues with that please turn setting off and get in touch via support email.**
+
+Unless experimental setting is on - it'll throw compilation error `The best overloaded method match for xxx has some invalid arguments` - this is due to the fact that changed code is technically different type.
+The code will need to be adjusted to depend on some abstraction instead (before hot-reload).
+
+This code would cause the above error.
+```
+public class EnemyController: MonoBehaviour {
+ EnemyManager m_EnemyManager;
+
+ void Start()
+ {
+ //calling 'this' causes issues as after hot-reload the type of EnemyController will change to 'EnemyController__Patched_'
+ m_EnemyManager.RegisterEnemy(this);
+ }
+}
+
+public class EnemyManager : MonoBehaviour {
+ public void RegisterEnemy(EnemyController enemy) { //RegisterEnemy method expects parameter of concrete type (EnemyController)
+ //impementation
+ }
+}
+```
+
+It could be changed to support Hot-Reload in following way:
+
+
+1) Don't depend on concrete implementations, instead use interfaces/abstraction
+```
+public class EnemyController: MonoBehaviour, IRegistrableEnemy {
+ EnemyManager m_EnemyManager;
+
+ void Start()
+ {
+ //calling this causes issues as after hot-reload the type of EnemyController will change
+ m_EnemyManager.RegisterEnemy(this);
+ }
+}
+
+public class EnemyManager : MonoBehaviour {
+ public void RegisterEnemy(IRegistrableEnemy enemy) { //Using interface will go around error
+ //impementation
+ }
+}
+
+public interface IRegistrableEnemy
+{
+ //implementation
+}
+```
+
+2) Adjust method param to have common base class
+```
+public class EnemyManager : MonoBehaviour {
+ public void RegisterEnemy(MonoBehaviour enemy) { //Using common MonoBehaviour will go around error
+ //impementation
+ }
+}
+```
+
+### Assigning `this` to a field references
+Similar as above, this could cause some trouble although 'Enable method calls with 'this' as argument fix' setting will fix most of the issues.
+
+Especially visible with singletons.
+eg.
+
+```
+public class MySingleton: MonoBehaviour {
+ public static MySingleton Instance;
+
+ void Start() {
+ Instance = this;
+ }
+}
+```
+
+### Calling internal class members from changed code
+> You can use [User Defined Script Overrides](#user-defined-script-overrides) to overcome this limitation
+
+> fixed in unreleased 1.5 - please get in touch if you need a copy before release
+
+Technically, once your changed code is compiled it'll be in a separate assembly. As a result this changed code won't be able to access internal classes from assembly it originated from.
+
+### Extensive use of nested classed / structs
+> You can use [User Defined Script Overrides](#user-defined-script-overrides) to overcome this limitation
+
+If your code-base contains lots of nested classes - you may see more compilation errors.
+
+Easy workaround is to move those nested classes away so they are top-level.
+
+### Creating new public methods
+Hot-reload for new methods will only work with private methods (only called by changed code).
+
+### Adding new references
+When you're trying to reference new code in play-mode session that'll fail if assembly is not yet referencing that (most often happens when using AsmDefs that are not yet referencing each other)
+
+### Changing class that uses extension and passes itself as a reference
+> You can use [User Defined Script Overrides](#user-defined-script-overrides) to overcome this limitation
+
+Changing class that uses extension method and passes itself as a reference will create compiler error.
+
+Generally that shouldn't be an issue, extension methods are primarily used as a syntatic sugar to extend a class that you do not have access to.
+You shouldn't need to create extension methods for types you own (instead those are generally instance methods or base class methods).
+
+Given example:
+```
+public class ExtensionMethodTest
+{
+ public string Name;
+
+ void Update()
+ {
+ this.PrintName();
+ }
+}
+
+//separate extension file
+public static ExtensionMethodTestExtensions
+{
+ public static void PrintName(this ExtensionMethodTest obj)
+ {
+ Debug.Log(obj.Name);
+ }
+}
+```
+
+When changing `ExtensionMethodTest` you'll get compile error. Workaround would be to include method call in your type, eg:
+```
+public class ExtensionMethodTest {
+ public string Name;
+
+ void Update() {
+ this.PrintName();
+ }
+
+ private void PrintName() {
+ Debug.Log(Name);
+ }
+}
+```
+*Arguably that's what should be done in the first place.*
+
+Adjusting classes that use extension methods without passing itself as a reference - will work correctly. eg:
+```
+public class ObjectFromExternalAssembly()
+{
+ //included just to illustrate example, that'd be in compiled assembly
+ //that you can't change and use extension method approach
+
+ public string Name;
+}
+
+public class ExtensionMethodTester
+{
+ void Update()
+ {
+ var t = new ExtensionMethodTest();
+ t.PrintName()
+ }
+}
+
+//separate extension file
+public static ObjectFromExternalAssemblyExtensions
+{
+ public static void PrintName(this ObjectFromExternalAssembly obj)
+ {
+ Debug.Log(obj.Name);
+ }
+}
+```
+
+### Changing class that implements internal interface can trigger compilation error
+> You can use [User Defined Script Overrides](#user-defined-script-overrides) to overcome this limitation
+
+> fixed in unreleased 1.5 - please get in touch if you need a copy before release
+
+If class is implementing interface that's defined in different file as internal (default for no access modifier) - then changes to that class will fail to compile.
+
+eg.
+```
+//file IInterface.cs
+interface IInterface { //default interface access-modifier is 'internal'
+ //declaration
+}
+
+//file ClassImplementingIInterface.cs
+class ClassImplementingIInterface: IInterface {
+ //changing this class will cause CS0122 'IInterface' is inaccessible due to it's protection level
+}
+
+```
+
+> Quick workaround is to declare that interface as public
+>
+
+### Changing class that accesses `private protected` members
+> You can use [User Defined Script Overrides](#user-defined-script-overrides) to overcome this limitation
+
+> fixed in unreleased 1.5 - please get in touch if you need a copy before release
+
+With C# 7.2 `private protected` access modifier was introduced. It works as `protected` access modifier in a sense that inherited classes can access it but.
+Addition of `private` also limits it to same assembly. Your changes are technically compiled into separate assembly and at the moment trying to access `private protected` in changed code will produce compiler error.
+
+> Easiest workaround for now is to declare those `private protected` members as `protected`.
+
+### Limited debugger support for Rider when using Unity 2019 and 2020
+Once breakpoint has been hit it'll stop asset from hot-reloading in that play-session. Newer Unity versions are supporting debugging.
+
+### No IL2CPP support
+Asset runs based on specific .NET functionality, IL2CPP builds will not be supported. Although as this is development workflow aid you can build your APK with Mono backend (android) and change later.
+
+### Partial classes
+Experimental support (on by default). Potentially could have some performance implications as it's file-read heavy in current state. Can be disabled in options if needed.
+
+Your partial class file needs to share name with actual class. eg
+`public class PartialClass`
+
+Needs to be in files
+**PartialClass**XYZ
+
+eg.
+- PartialClass.1.cs
+- PartialClass.2.cs
+
+## FAQ
+### How is this asset different than Live Script Reload?
+Fast Script Reload
+- hot reload in editor
+
+Live Script Reload
+- same hot reload in editor as FSR (includes FSR)
++ **AND hot reload directly in builds / on-device**
++ you don't have to download them both separately, LSR is also 1 package import
++ standalone extension priced at $35, or if you've already bought Fast Script Reload it's $5 upgrade
+
+### Editor makes full reload on any change in playmode
+
+Unity Editor has an option to auto recompile changes. **For tool to work properly you want to have that either disabled or enabled only outside of playmode.**
+
+You can adjusted auto-reload at any time via `Edit -> Preferences -> Asset Pipeline -> Auto Refresh`.
+
+*Tool will also offer to disable auto-refresh on startup.*
+
+It's possible to set auto-refresh to enabled but only outside of playmode. Depending on editor version used this can be found in:
+- `Edit -> Preferences -> General -> Script Changes While Playing -> Recompile After Finished Playing`
+- or `Edit -> Preferences -> Asset Pipeline -> Auto Refresh -> Enabled Outside Playmode`
+
+### VS Code shows console shows errors
+VS Code proj file (csproj) generate with NetFramework version 4.7.1. One of the plugin DLLs is targeting version 4.8.
+Even though VS Code does not compile that code (Unity does) - it'll still show error as it didn't load the library for code-completion.
+
+It's not a plugin issue as such, other dlls will have same troubles.
+Best solution I've found is to force csproj files to be generated with 4.8 version instead.
+This can be achieved with following editor script
+```
+using System.IO;
+using System.Text.RegularExpressions;
+using UnityEditor;
+using UnityEngine;
+
+public class VisualStudioProjectGenerationPostProcess : AssetPostprocessor
+{
+ private static void OnGeneratedCSProjectFiles()
+ {
+ Debug.Log("OnGeneratedCSProjectFiles");
+ var dir = Directory.GetCurrentDirectory();
+ var files = Directory.GetFiles(dir, "*.csproj");
+ foreach (var file in files)
+ ChangeTargetFrameworkInfProjectFiles(file);
+ }
+
+ static void ChangeTargetFrameworkInfProjectFiles(string file)
+ {
+ var text = File.ReadAllText(file);
+ var find = "TargetFrameworkVersion>v4.7.1v4.8 As a one-off you may also need to go to Edit -> Preferences -> External Tools -> click 'Regenerate project files' buttons
+
+### When importing I'm getting error: 'Unable to update following assemblies: (...)/ImmersiveVRTools.Common.Runtime.dll'
+This happens occasionally, especially on upgrade between versions. It's harmless error that'll go away on play mode.
+
+### When upgrading between versions, eg 1.1 to 1.2 example scene cubes are pink
+This is down to reimporting 'Point' prefab. Right now plugin will make sure it's using correct shader eg. URP / Built-in but only on initial import.
+
+To fix please go to `FastScripReload\Examples\Point\Point.prefab` and search for 'Point' shader.
+
+### On Mac hot reload does not trigger when changing files
+It'd seem for some code editors on Mac file changes are not picked up. This seems to be down to editors not updating LastWrite property on save and file watcher can't pick up the change.
+Unfortunately right now only workaround is to use editor that does update it, eg VSCode.
+
+### I removed FSR but my scripts are still not reloading
+FSR initially asks if you want to disable Unity auto-reload. If you select yes, then it'll let you know you should now trigger full reload with CTRL + R.
+That's a Unity setting and it does not change back when removing asset.
+
+> To change go to 'Edit -> Preferences -> Asset Pipeline -> Auto Refresh -> Enabled'
+
+## Roadmap
+- add Mac silicon support
+- ~~add Mac/Linux support~~ (added with 1.1)
+- ~~add debugger support for hot-reloaded scripts~~ (added with 1.2)
+- ~~allow to add new fields (adjustable in Editor)~~ (added with 1.3)
+- better compiler support to work around limitations
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Documentation/documentation.md.meta b/Assets/FastScriptReload/Documentation/documentation.md.meta
new file mode 100644
index 0000000..cb4f192
--- /dev/null
+++ b/Assets/FastScriptReload/Documentation/documentation.md.meta
@@ -0,0 +1,14 @@
+fileFormatVersion: 2
+guid: b15135889062bcf428b025b2fb045da8
+TextScriptImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Documentation/documentation.md
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Documentation/documentation.pdf b/Assets/FastScriptReload/Documentation/documentation.pdf
new file mode 100644
index 0000000..a62ba71
Binary files /dev/null and b/Assets/FastScriptReload/Documentation/documentation.pdf differ
diff --git a/Assets/FastScriptReload/Documentation/documentation.pdf.meta b/Assets/FastScriptReload/Documentation/documentation.pdf.meta
new file mode 100644
index 0000000..02b6858
--- /dev/null
+++ b/Assets/FastScriptReload/Documentation/documentation.pdf.meta
@@ -0,0 +1,14 @@
+fileFormatVersion: 2
+guid: e4d31e46efd843644b0ca6010aa753e4
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Documentation/documentation.pdf
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Documentation/release-notes.md b/Assets/FastScriptReload/Documentation/release-notes.md
new file mode 100644
index 0000000..63ff3e8
--- /dev/null
+++ b/Assets/FastScriptReload/Documentation/release-notes.md
@@ -0,0 +1,70 @@
+1.8
+- Added Unity 6 support
+- Improved extension methods rewriting
+- Partial classes support (contributed by Jlabarca)
+- Unity 2019 / 2020 no longer officially supported
+
+1.7
+- Optional file watching can be done via direct WindowsAPI (contributed by SamPruden)
+- Extended UI to allow for easy choice of file watcher implementation
+
+1.6
+- Added more Unit Tests to ensure various code patterns can be rewritten correctly
+- Added Watch Only Specific Files and Folders mode (contributed by GhatSmith)
+- Added better Odin support for dynamically added fields (contributed by GhatSmith)
+- Updated Roslyn lib version to 4.6.0 for better code parsing (contributed by SamPruden)
+- Improved error handling for code parsing (contributed by SamPruden)
+- Added Custom-File-Watcher implementation (for cases where standard FileWatcher API is causing issues) (contributed by D0rkKnight)
+
+1.5
+- you can now import FSR as a package from github page
+- hot-reloading internal interfaces / classes would no longer cause compilation error
+- OnScriptHotReload method can be added at runtime
+- builder functions will be correctly rewritten
+- hot reload status (red / green) will be visible in project panel next to changed script
+- compilation error reporting will be much improved, project panel will allow to click error next to actual file for more details and workarounds
+- all type declarations that were appended with __Patched_ postfix to avoid name collisions will also have all corresponding identifiers changed
+- OnScriptHotReload methods will also be called in editor-workflow
+
+1.4
+- added experimental editor-mode hot-reload, you'll need to opt in via Start Screen -> Editor Hot-Reload (please read the notes on that page, playmode workflow is still far superior)
+- you can now define User Script Rewrite Overrides - which will allow you to overcome most of existing limitations that cause compilation errors (on a one by one basis)
+- big optimization in how long hot-reload part will take, first call will be unaffected when type cache is build but subsequent calls will be significantly quicker
+- added 'Exclude References' options - this allows to remove specific dll references from dynamically compiled code (as in some cases you may get 'type defined in both assembly x.dll and y.dll'
+- destructors will no longer cause compilation error
+- (options opt-in) script rewriting can optionally emit comment - why change was made to help with troubleshooting issues
+- Unity assembly reload can be forced off via LockAssemblyReload if specified in options - sometimes even though Auto-Refresh is turned off Editor still tries to recompile changes in playmode which prevents FSR from working
+- new fields support (experimental) will be enabled by default
+
+1.3.1
+
+- open source release on github
+
+1.3 - (Experimental) - New fields added in playmode
+
+- New fields can be added and used in code
+- New fields can be adjusted in editor (same as standard fields)
+- New fields will be initialized to whatever value is specified in code or default value
+- Experimental feature - at this stage expect some issues
+- Opt-in - disabled by default to enable go to 'Window -> Fast Script Reload -> Start Screen -> New Fields -> enable'
+
+1.2 - Debugger support
+
+- Added debugger support (see documentation)
+
+1.1 - Mac support / bug fixes
+
+- Added Mac support (only INTEL editor version, SILICON still not supported)
+- Added Linux support
+- fixed namespace clash with Unity.Collections package
+- common code lib will not be included in builds
+- added check for auto-refresh in Editor - will proide guidance and option to adjust as otherwise full editor reload is triggered for changes
+- added workaround for Unity file-watcher returning wrong file path on some editor versions
+- added option to allow disabling DidFieldCountCheck - allowing to detour methods in those cases (eg for Mirror where it'll adjust IL and cause mismatch)
+- added option to configure FileWatcher paths/filters as in some cases watching root directory was causing performance issues
+- added minor initial-load optimisations - using session-state for items that do not need to be resolved on every reload
+
+1.0 - First release, included features:
+
+Fast script reload in editor / play-mode (compiles only changed files and hot-reloads them into current play session)
+Hot-reload on device (in build)
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Documentation/release-notes.md.meta b/Assets/FastScriptReload/Documentation/release-notes.md.meta
new file mode 100644
index 0000000..8463dd0
--- /dev/null
+++ b/Assets/FastScriptReload/Documentation/release-notes.md.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: cd8daa3bb60e4b30b6520184de1abcda
+timeCreated: 1672842170
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Documentation/release-notes.md
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins.meta b/Assets/FastScriptReload/Plugins.meta
new file mode 100644
index 0000000..0e3c0cb
--- /dev/null
+++ b/Assets/FastScriptReload/Plugins.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 6dd277cf0199f5d4cb3ff594111df8ff
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/FastScriptReload/Plugins/Harmony.meta b/Assets/FastScriptReload/Plugins/Harmony.meta
new file mode 100644
index 0000000..116444e
--- /dev/null
+++ b/Assets/FastScriptReload/Plugins/Harmony.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: f67a020a9ad31334ea8792cf175b5d6b
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/FastScriptReload/Plugins/Harmony/HarmonyLicense.txt b/Assets/FastScriptReload/Plugins/Harmony/HarmonyLicense.txt
new file mode 100644
index 0000000..edeae8e
--- /dev/null
+++ b/Assets/FastScriptReload/Plugins/Harmony/HarmonyLicense.txt
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2017 Andreas Pardeike
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Plugins/Harmony/HarmonyLicense.txt.meta b/Assets/FastScriptReload/Plugins/Harmony/HarmonyLicense.txt.meta
new file mode 100644
index 0000000..6be6d4a
--- /dev/null
+++ b/Assets/FastScriptReload/Plugins/Harmony/HarmonyLicense.txt.meta
@@ -0,0 +1,14 @@
+fileFormatVersion: 2
+guid: 22053913c34700a4a9c13b853eea3317
+TextScriptImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Plugins/Harmony/HarmonyLicense.txt
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Harmony/net48.meta b/Assets/FastScriptReload/Plugins/Harmony/net48.meta
new file mode 100644
index 0000000..6602f8f
--- /dev/null
+++ b/Assets/FastScriptReload/Plugins/Harmony/net48.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 1c409188546e50f4a963ad9ae5deda06
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/FastScriptReload/Plugins/Harmony/net48/0Harmony.dll b/Assets/FastScriptReload/Plugins/Harmony/net48/0Harmony.dll
new file mode 100644
index 0000000..e182535
Binary files /dev/null and b/Assets/FastScriptReload/Plugins/Harmony/net48/0Harmony.dll differ
diff --git a/Assets/FastScriptReload/Plugins/Harmony/net48/0Harmony.dll.meta b/Assets/FastScriptReload/Plugins/Harmony/net48/0Harmony.dll.meta
new file mode 100644
index 0000000..a94886b
--- /dev/null
+++ b/Assets/FastScriptReload/Plugins/Harmony/net48/0Harmony.dll.meta
@@ -0,0 +1,84 @@
+fileFormatVersion: 2
+guid: 494e757c92cba704db1d95279f80a30f
+PluginImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ iconMap: {}
+ executionOrder: {}
+ defineConstraints:
+ - UNITY_EDITOR || LiveScriptReload_IncludeInBuild_Enabled
+ isPreloaded: 0
+ isOverridable: 0
+ isExplicitlyReferenced: 1
+ validateReferences: 1
+ platformData:
+ - first:
+ : Any
+ second:
+ enabled: 0
+ settings:
+ Exclude Android: 0
+ Exclude Editor: 0
+ Exclude Linux64: 0
+ Exclude OSXUniversal: 0
+ Exclude Win: 0
+ Exclude Win64: 0
+ - first:
+ Android: Android
+ second:
+ enabled: 1
+ settings:
+ CPU: ARMv7
+ - first:
+ Any:
+ second:
+ enabled: 1
+ settings: {}
+ - first:
+ Editor: Editor
+ second:
+ enabled: 1
+ settings:
+ CPU: AnyCPU
+ DefaultValueInitialized: true
+ OS: AnyOS
+ - first:
+ Standalone: Linux64
+ second:
+ enabled: 1
+ settings:
+ CPU: None
+ - first:
+ Standalone: OSXUniversal
+ second:
+ enabled: 1
+ settings:
+ CPU: None
+ - first:
+ Standalone: Win
+ second:
+ enabled: 1
+ settings:
+ CPU: None
+ - first:
+ Standalone: Win64
+ second:
+ enabled: 1
+ settings:
+ CPU: None
+ - first:
+ Windows Store Apps: WindowsStoreApps
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ userData:
+ assetBundleName:
+ assetBundleVariant:
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Plugins/Harmony/net48/0Harmony.dll
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Harmony/net48/0Harmony.xml b/Assets/FastScriptReload/Plugins/Harmony/net48/0Harmony.xml
new file mode 100644
index 0000000..f1b9b4c
--- /dev/null
+++ b/Assets/FastScriptReload/Plugins/Harmony/net48/0Harmony.xml
@@ -0,0 +1,3693 @@
+
+
+
+ 0Harmony
+
+
+
+ A factory to create delegate types
+
+
+ Default constructor
+
+
+ Creates a delegate type for a method
+ The method
+ The new delegate type
+
+
+
+ A getter delegate type
+ Type that getter gets field/property value from
+ Type of the value that getter gets
+ The instance get getter uses
+ An delegate
+
+
+
+ A setter delegate type
+ Type that setter sets field/property value for
+ Type of the value that setter sets
+ The instance the setter uses
+ The value the setter uses
+ An delegate
+
+
+
+ A constructor delegate type
+ Type that constructor creates
+ An delegate
+
+
+
+ A helper class for fast access to getters and setters
+
+
+ Creates an instantiation delegate
+ Type that constructor creates
+ The new instantiation delegate
+
+
+
+ Creates an getter delegate for a property
+ Type that getter reads property from
+ Type of the property that gets accessed
+ The property
+ The new getter delegate
+
+
+
+ Creates an getter delegate for a field
+ Type that getter reads field from
+ Type of the field that gets accessed
+ The field
+ The new getter delegate
+
+
+
+ Creates an getter delegate for a field (with a list of possible field names)
+ Type that getter reads field/property from
+ Type of the field/property that gets accessed
+ A list of possible field names
+ The new getter delegate
+
+
+
+ Creates an setter delegate
+ Type that setter assigns property value to
+ Type of the property that gets assigned
+ The property
+ The new setter delegate
+
+
+
+ Creates an setter delegate for a field
+ Type that setter assigns field value to
+ Type of the field that gets assigned
+ The field
+ The new getter delegate
+
+
+
+ A delegate to invoke a method
+ The instance
+ The method parameters
+ The method result
+
+
+ A helper class to invoke method with delegates
+
+
+ Creates a fast invocation handler from a method
+ The method to invoke
+ Controls if boxed value object is accessed/updated directly
+ The
+
+
+ The directBoxValueAccess option controls how value types passed by reference (e.g. ref int, out my_struct) are handled in the arguments array
+ passed to the fast invocation handler.
+ Since the arguments array is an object array, any value types contained within it are actually references to a boxed value object.
+ Like any other object, there can be other references to such boxed value objects, other than the reference within the arguments array.
+ For example,
+
+ var val = 5;
+ var box = (object)val;
+ var arr = new object[] { box };
+ handler(arr); // for a method with parameter signature: ref/out/in int
+
+
+
+
+ If directBoxValueAccess is true, the boxed value object is accessed (and potentially updated) directly when the handler is called,
+ such that all references to the boxed object reflect the potentially updated value.
+ In the above example, if the method associated with the handler updates the passed (boxed) value to 10, both box and arr[0]
+ now reflect the value 10. Note that the original val is not updated, since boxing always copies the value into the new boxed value object.
+
+
+ If directBoxValueAccess is false (default), the boxed value object in the arguments array is replaced with a "reboxed" value object,
+ such that potential updates to the value are reflected only in the arguments array.
+ In the above example, if the method associated with the handler updates the passed (boxed) value to 10, only arr[0] now reflects the value 10.
+
+
+
+
+ A low level memory helper
+
+
+
+ Mark method for no inlining (currently only works on Mono)
+ The method/constructor to change
+
+
+
+ Detours a method
+ The original method/constructor
+ The replacement method/constructor
+ An error string
+
+
+
+ Writes a jump to memory
+ The memory address
+ Jump destination
+ An error string
+
+
+
+ Gets the start of a method in memory
+ The method/constructor
+ [out] Details of the exception
+ The method start address
+
+
+
+ special parameter names that can be used in prefix and postfix methods
+
+
+ Patch function helpers
+
+
+ Sorts patch methods by their priority rules
+ The original method
+ Patches to sort
+ Use debug mode
+ The sorted patch methods
+
+
+
+ Creates new replacement method with the latest patches and detours the original method
+ The original method
+ Information describing the patches
+ The newly created replacement method
+
+
+
+ Creates a patch sorter
+ Array of patches that will be sorted
+ Use debugging
+
+
+ Sorts internal PatchSortingWrapper collection and caches the results.
+ After first run the result is provided from the cache.
+ The original method
+ The sorted patch methods
+
+
+ Checks if the sorter was created with the same patch list and as a result can be reused to
+ get the sorted order of the patches.
+ List of patches to check against
+ true if equal
+
+
+ Removes one unresolved dependency from the least important patch.
+
+
+ Outputs all unblocked patches from the waiting list to results list
+
+
+ Adds patch to both results list and handled patches set
+ Patch to add
+
+
+ Wrapper used over the Patch object to allow faster dependency access and
+ dependency removal in case of cyclic dependencies
+
+
+ Create patch wrapper object used for sorting
+ Patch to wrap
+
+
+ Determines how patches sort
+ The other patch
+ integer to define sort order (-1, 0, 1)
+
+
+ Determines whether patches are equal
+ The other patch
+ true if equal
+
+
+ Hash function
+ A hash code
+
+
+ Bidirectionally registers Patches as after dependencies
+ List of dependencies to register
+
+
+ Bidirectionally registers Patches as before dependencies
+ List of dependencies to register
+
+
+ Bidirectionally removes Patch from after dependencies
+ Patch to remove
+
+
+ Bidirectionally removes Patch from before dependencies
+ Patch to remove
+
+
+ Specifies the type of method
+
+
+
+ This is a normal method
+
+
+ This is a getter
+
+
+ This is a setter
+
+
+ This is a constructor
+
+
+ This is a static constructor
+
+
+ This targets the MoveNext method of the enumerator result
+
+
+ Specifies the type of argument
+
+
+
+ This is a normal argument
+
+
+ This is a reference argument (ref)
+
+
+ This is an out argument (out)
+
+
+ This is a pointer argument (&)
+
+
+ Specifies the type of patch
+
+
+
+ Any patch
+
+
+ A prefix patch
+
+
+ A postfix patch
+
+
+ A transpiler
+
+
+ A finalizer
+
+
+ A reverse patch
+
+
+ Specifies the type of reverse patch
+
+
+
+ Use the unmodified original method (directly from IL)
+
+
+ Use the original as it is right now including previous patches but excluding future ones
+
+
+ Specifies the type of method call dispatching mechanics
+
+
+
+ Call the method using dynamic dispatching if method is virtual (including overriden)
+
+
+ This is the built-in form of late binding (a.k.a. dynamic binding) and is the default dispatching mechanic in C#.
+ This directly corresponds with the instruction.
+
+
+ For virtual (including overriden) methods, the instance type's most-derived/overriden implementation of the method is called.
+ For non-virtual (including static) methods, same behavior as : the exact specified method implementation is called.
+
+
+ Note: This is not a fully dynamic dispatch, since non-virtual (including static) methods are still called non-virtually.
+ A fully dynamic dispatch in C# involves using
+ the dynamic type
+ (actually a fully dynamic binding, since even the name and overload resolution happens at runtime), which does not support.
+
+
+
+
+ Call the method using static dispatching, regardless of whether method is virtual (including overriden) or non-virtual (including static)
+
+
+ a.k.a. non-virtual dispatching, early binding, or static binding.
+ This directly corresponds with the instruction.
+
+
+ For both virtual (including overriden) and non-virtual (including static) methods, the exact specified method implementation is called, without virtual/override mechanics.
+
+
+
+
+ The base class for all Harmony annotations (not meant to be used directly)
+
+
+
+ The common information for all attributes
+
+
+ Annotation to define your Harmony patch methods
+
+
+
+ An empty annotation can be used together with TargetMethod(s)
+
+
+
+ An annotation that specifies a class to patch
+ The declaring class/type
+
+
+
+ An annotation that specifies a method, property or constructor to patch
+ The declaring class/type
+ The argument types of the method or constructor to patch
+
+
+
+ An annotation that specifies a method, property or constructor to patch
+ The declaring class/type
+ The name of the method, property or constructor to patch
+
+
+
+ An annotation that specifies a method, property or constructor to patch
+ The declaring class/type
+ The name of the method, property or constructor to patch
+ An array of argument types to target overloads
+
+
+
+ An annotation that specifies a method, property or constructor to patch
+ The declaring class/type
+ The name of the method, property or constructor to patch
+ An array of argument types to target overloads
+ Array of
+
+
+
+ An annotation that specifies a method, property or constructor to patch
+ The declaring class/type
+ The
+
+
+
+ An annotation that specifies a method, property or constructor to patch
+ The declaring class/type
+ The
+ An array of argument types to target overloads
+
+
+
+ An annotation that specifies a method, property or constructor to patch
+ The declaring class/type
+ The
+ An array of argument types to target overloads
+ Array of
+
+
+
+ An annotation that specifies a method, property or constructor to patch
+ The declaring class/type
+ The name of the method, property or constructor to patch
+ The
+
+
+
+ An annotation that specifies a method, property or constructor to patch
+ The name of the method, property or constructor to patch
+
+
+
+ An annotation that specifies a method, property or constructor to patch
+ The name of the method, property or constructor to patch
+ An array of argument types to target overloads
+
+
+
+ An annotation that specifies a method, property or constructor to patch
+ The name of the method, property or constructor to patch
+ An array of argument types to target overloads
+ An array of
+
+
+
+ An annotation that specifies a method, property or constructor to patch
+ The name of the method, property or constructor to patch
+ The
+
+
+
+ An annotation that specifies a method, property or constructor to patch
+ The
+
+
+
+ An annotation that specifies a method, property or constructor to patch
+ The
+ An array of argument types to target overloads
+
+
+
+ An annotation that specifies a method, property or constructor to patch
+ The
+ An array of argument types to target overloads
+ An array of
+
+
+
+ An annotation that specifies a method, property or constructor to patch
+ An array of argument types to target overloads
+
+
+
+ An annotation that specifies a method, property or constructor to patch
+ An array of argument types to target overloads
+ An array of
+
+
+
+ An annotation that specifies a method, property or constructor to patch
+ The full name of the declaring class/type
+ The name of the method, property or constructor to patch
+ The
+
+
+
+ Annotation to define the original method for delegate injection
+
+
+
+ An annotation that specifies a class to patch
+ The declaring class/type
+
+
+
+ An annotation that specifies a method, property or constructor to patch
+ The declaring class/type
+ The argument types of the method or constructor to patch
+
+
+
+ An annotation that specifies a method, property or constructor to patch
+ The declaring class/type
+ The name of the method, property or constructor to patch
+
+
+
+ An annotation that specifies a method, property or constructor to patch
+ The declaring class/type
+ The name of the method, property or constructor to patch
+ An array of argument types to target overloads
+
+
+
+ An annotation that specifies a method, property or constructor to patch
+ The declaring class/type
+ The name of the method, property or constructor to patch
+ An array of argument types to target overloads
+ Array of
+
+
+
+ An annotation that specifies a method, property or constructor to patch
+ The declaring class/type
+ The
+
+
+
+ An annotation that specifies a method, property or constructor to patch
+ The declaring class/type
+ The
+ An array of argument types to target overloads
+
+
+
+ An annotation that specifies a method, property or constructor to patch
+ The declaring class/type
+ The
+ An array of argument types to target overloads
+ Array of
+
+
+
+ An annotation that specifies a method, property or constructor to patch
+ The declaring class/type
+ The name of the method, property or constructor to patch
+ The
+
+
+
+ An annotation that specifies a method, property or constructor to patch
+ The name of the method, property or constructor to patch
+
+
+
+ An annotation that specifies a method, property or constructor to patch
+ The name of the method, property or constructor to patch
+ An array of argument types to target overloads
+
+
+
+ An annotation that specifies a method, property or constructor to patch
+ The name of the method, property or constructor to patch
+ An array of argument types to target overloads
+ An array of
+
+
+
+ An annotation that specifies a method, property or constructor to patch
+ The name of the method, property or constructor to patch
+ The
+
+
+
+ An annotation that specifies call dispatching mechanics for the delegate
+ The
+
+
+
+ An annotation that specifies a method, property or constructor to patch
+ The
+ An array of argument types to target overloads
+
+
+
+ An annotation that specifies a method, property or constructor to patch
+ The
+ An array of argument types to target overloads
+ An array of
+
+
+
+ An annotation that specifies a method, property or constructor to patch
+ An array of argument types to target overloads
+
+
+
+ An annotation that specifies a method, property or constructor to patch
+ An array of argument types to target overloads
+ An array of
+
+
+
+ Annotation to define your standin methods for reverse patching
+
+
+
+ An annotation that specifies the type of reverse patching
+ The of the reverse patch
+
+
+
+ A Harmony annotation to define that all methods in a class are to be patched
+
+
+
+ A Harmony annotation
+
+
+
+ A Harmony annotation to define patch priority
+ The priority
+
+
+
+ A Harmony annotation
+
+
+
+ A Harmony annotation to define that a patch comes before another patch
+ The array of harmony IDs of the other patches
+
+
+
+ A Harmony annotation
+
+
+ A Harmony annotation to define that a patch comes after another patch
+ The array of harmony IDs of the other patches
+
+
+
+ A Harmony annotation
+
+
+ A Harmony annotation to debug a patch (output uses to log to your Desktop)
+
+
+
+ Specifies the Prepare function in a patch class
+
+
+
+ Specifies the Cleanup function in a patch class
+
+
+
+ Specifies the TargetMethod function in a patch class
+
+
+
+ Specifies the TargetMethods function in a patch class
+
+
+
+ Specifies the Prefix function in a patch class
+
+
+
+ Specifies the Postfix function in a patch class
+
+
+
+ Specifies the Transpiler function in a patch class
+
+
+
+ Specifies the Finalizer function in a patch class
+
+
+
+ A Harmony annotation
+
+
+
+ The name of the original argument
+
+
+
+ The index of the original argument
+
+
+
+ The new name of the original argument
+
+
+
+ An annotation to declare injected arguments by name
+
+
+
+ An annotation to declare injected arguments by index
+ Zero-based index
+
+
+
+ An annotation to declare injected arguments by renaming them
+ Name of the original argument
+ New name
+
+
+
+ An annotation to declare injected arguments by index and renaming them
+ Zero-based index
+ New name
+
+
+
+ An abstract wrapper around OpCode and their operands. Used by transpilers
+
+
+
+ The opcode
+
+
+
+ The operand
+
+
+
+ All labels defined on this instruction
+
+
+
+ All exception block boundaries defined on this instruction
+
+
+
+ Creates a new CodeInstruction with a given opcode and optional operand
+ The opcode
+ The operand
+
+
+
+ Create a full copy (including labels and exception blocks) of a CodeInstruction
+ The to copy
+
+
+
+ Clones a CodeInstruction and resets its labels and exception blocks
+ A lightweight copy of this code instruction
+
+
+
+ Clones a CodeInstruction, resets labels and exception blocks and sets its opcode
+ The opcode
+ A copy of this CodeInstruction with a new opcode
+
+
+
+ Clones a CodeInstruction, resets labels and exception blocks and sets its operand
+ The operand
+ A copy of this CodeInstruction with a new operand
+
+
+
+ Creates a CodeInstruction calling a method (CALL)
+ The class/type where the method is declared
+ The name of the method (case sensitive)
+ Optional parameters to target a specific overload of the method
+ Optional list of types that define the generic version of the method
+ A code instruction that calls the method matching the arguments
+
+
+
+ Creates a CodeInstruction calling a method (CALL)
+ The target method in the form TypeFullName:MethodName, where the type name matches a form recognized by Type.GetType like Some.Namespace.Type.
+ Optional parameters to target a specific overload of the method
+ Optional list of types that define the generic version of the method
+ A code instruction that calls the method matching the arguments
+
+
+
+ Creates a CodeInstruction calling a method (CALL)
+ The lambda expression using the method
+
+
+
+
+ Creates a CodeInstruction calling a method (CALL)
+ The lambda expression using the method
+
+
+
+
+ Creates a CodeInstruction calling a method (CALL)
+ The lambda expression using the method
+
+
+
+
+ Creates a CodeInstruction calling a method (CALL)
+ The lambda expression using the method
+
+
+
+
+ Returns an instruction to call the specified closure
+ The delegate type to emit
+ The closure that defines the method to call
+ A that calls the closure as a method
+
+
+
+ Creates a CodeInstruction loading a field (LD[S]FLD[A])
+ The class/type where the field is defined
+ The name of the field (case sensitive)
+ Use address of field
+
+
+
+ Creates a CodeInstruction storing to a field (ST[S]FLD)
+ The class/type where the field is defined
+ The name of the field (case sensitive)
+
+
+
+ Returns a string representation of the code instruction
+ A string representation of the code instruction
+
+
+
+ Exception block types
+
+
+
+ The beginning of an exception block
+
+
+
+ The beginning of a catch block
+
+
+
+ The beginning of an except filter block (currently not supported to use in a patch)
+
+
+
+ The beginning of a fault block
+
+
+
+ The beginning of a finally block
+
+
+
+ The end of an exception block
+
+
+
+ An exception block
+
+
+
+ Block type
+
+
+
+ Catch type
+
+
+
+ Creates an exception block
+ The
+ The catch type
+
+
+
+ The Harmony instance is the main entry to Harmony. After creating one with an unique identifier, it is used to patch and query the current application domain
+
+
+
+ The unique identifier
+
+
+
+ Set to true before instantiating Harmony to debug Harmony or use an environment variable to set HARMONY_DEBUG to '1' like this: cmd /C "set HARMONY_DEBUG=1 && game.exe"
+ This is for full debugging. To debug only specific patches, use the attribute
+
+
+
+ Creates a new Harmony instance
+ A unique identifier (you choose your own)
+ A Harmony instance
+
+
+
+ Searches the current assembly for Harmony annotations and uses them to create patches
+ This method can fail to use the correct assembly when being inlined. It calls StackTrace.GetFrame(1) which can point to the wrong method/assembly. If you are unsure or run into problems, use PatchAll(Assembly.GetExecutingAssembly()) instead.
+
+
+
+ Creates a empty patch processor for an original method
+ The original method/constructor
+ A new instance
+
+
+
+ Creates a patch class processor from an annotated class
+ The class/type
+ A new instance
+
+
+
+ Creates a reverse patcher for one of your stub methods
+ The original method/constructor
+ The stand-in stub method as
+ A new instance
+
+
+
+ Searches an assembly for Harmony annotations and uses them to create patches
+ The assembly
+
+
+
+ Creates patches by manually specifying the methods
+ The original method/constructor
+ An optional prefix method wrapped in a object
+ An optional postfix method wrapped in a object
+ An optional transpiler method wrapped in a object
+ An optional finalizer method wrapped in a object
+ The replacement method that was created to patch the original method
+
+
+
+ Patches a foreign method onto a stub method of yours and optionally applies transpilers during the process
+ The original method/constructor you want to duplicate
+ Your stub method as that will become the original. Needs to have the correct signature (either original or whatever your transpilers generates)
+ An optional transpiler as method that will be applied during the process
+ The replacement method that was created to patch the stub method
+
+
+
+ Unpatches methods by patching them with zero patches. Fully unpatching is not supported. Be careful, unpatching is global
+ The optional Harmony ID to restrict unpatching to a specific Harmony instance
+ This method could be static if it wasn't for the fact that unpatching creates a new replacement method that contains your harmony ID
+
+
+
+ Unpatches a method by patching it with zero patches. Fully unpatching is not supported. Be careful, unpatching is global
+ The original method/constructor
+ The
+ The optional Harmony ID to restrict unpatching to a specific Harmony instance
+
+
+
+ Unpatches a method by patching it with zero patches. Fully unpatching is not supported. Be careful, unpatching is global
+ The original method/constructor
+ The patch method as method to remove
+
+
+
+ Test for patches from a specific Harmony ID
+ The Harmony ID
+ True if patches for this ID exist
+
+
+
+ Gets patch information for a given original method
+ The original method/constructor
+ The patch information as
+
+
+
+ Gets the methods this instance has patched
+ An enumeration of original methods/constructors
+
+
+
+ Gets all patched original methods in the appdomain
+ An enumeration of patched original methods/constructors
+
+
+
+ Gets the original method from a given replacement method
+ A replacement method, for example from a stacktrace
+ The original method/constructor or null if not found
+
+
+
+ Tries to get the method from a stackframe including dynamic replacement methods
+ The
+ For normal frames, frame.GetMethod() is returned. For frames containing patched methods, the replacement method is returned or null if no method can be found
+
+
+
+ Gets the original method from the stackframe and uses original if method is a dynamic replacement
+ The
+ The original method from that stackframe
+
+
+ Gets Harmony version for all active Harmony instances
+ [out] The current Harmony version
+ A dictionary containing assembly versions keyed by Harmony IDs
+
+
+
+ Under Mono, HarmonyException wraps IL compile errors with detailed information about the failure
+
+
+
+ Default serialization constructor (not implemented)
+ The info
+ The context
+
+
+
+ Get a list of IL instructions in pairs of offset+code
+ A list of key/value pairs which represent an offset and the code at that offset
+
+
+
+ Get a list of IL instructions without offsets
+ A list of
+
+
+
+ Get the error offset of the errornous IL instruction
+ The offset
+
+
+
+ Get the index of the errornous IL instruction
+ The index into the list of instructions or -1 if not found
+
+
+
+ A wrapper around a method to use it as a patch (for example a Prefix)
+
+
+
+ The original method
+
+
+
+ Class/type declaring this patch
+
+
+
+ Patch method name
+
+
+
+ Optional patch
+
+
+
+ Array of argument types of the patch method
+
+
+
+ of the patch
+
+
+
+ Install this patch before patches with these Harmony IDs
+
+
+
+ Install this patch after patches with these Harmony IDs
+
+
+
+ Reverse patch type, see
+
+
+
+ Create debug output for this patch
+
+
+
+ Whether to use (true) or (false) mechanics
+ for -attributed delegate
+
+
+
+ Default constructor
+
+
+
+ Creates a patch from a given method
+ The original method
+
+
+
+ Creates a patch from a given method
+ The original method
+ The patch
+ A list of harmony IDs that should come after this patch
+ A list of harmony IDs that should come before this patch
+ Set to true to generate debug output
+
+
+
+ Creates a patch from a given method
+ The patch class/type
+ The patch method name
+ The optional argument types of the patch method (for overloaded methods)
+
+
+
+ Gets the names of all internal patch info fields
+ A list of field names
+
+
+
+ Merges annotations
+ The list of to merge
+ The merged
+
+
+
+ Returns a string that represents the annotation
+ A string representation
+
+
+
+ Annotation extensions
+
+
+
+ Copies annotation information
+ The source
+ The destination
+
+
+
+ Clones an annotation
+ The to clone
+ A copied
+
+
+
+ Merges annotations
+ The master
+ The detail
+ A new, merged
+
+
+
+ Gets all annotations on a class/type
+ The class/type
+ A list of all
+
+
+
+ Gets merged annotations on a class/type
+ The class/type
+ The merged
+
+
+
+ Gets all annotations on a method
+ The method/constructor
+ A list of
+
+
+
+ Gets merged annotations on a method
+ The method/constructor
+ The merged
+
+
+
+
+ A mutable representation of an inline signature, similar to Mono.Cecil's CallSite.
+ Used by the calli instruction, can be used by transpilers
+
+
+
+
+ See
+
+
+
+ See
+
+
+
+ See
+
+
+
+ The list of all parameter types or function pointer signatures received by the call site
+
+
+
+ The return type or function pointer signature returned by the call site
+
+
+
+ Returns a string representation of the inline signature
+ A string representation of the inline signature
+
+
+
+
+ A mutable representation of a parameter type with an attached type modifier,
+ similar to Mono.Cecil's OptionalModifierType / RequiredModifierType and C#'s modopt / modreq
+
+
+
+
+ Whether this is a modopt (optional modifier type) or a modreq (required modifier type)
+
+
+
+ The modifier type attached to the parameter type
+
+
+
+ The modified parameter type
+
+
+
+ Returns a string representation of the modifier type
+ A string representation of the modifier type
+
+
+
+ Patch serialization
+
+
+
+ Control the binding of a serialized object to a type
+ Specifies the assembly name of the serialized object
+ Specifies the type name of the serialized object
+ The type of the object the formatter creates a new instance of
+
+
+
+ Serializes a patch info
+ The
+ The serialized data
+
+
+
+ Deserialize a patch info
+ The serialized data
+ A
+
+
+
+ Compare function to sort patch priorities
+ The patch
+ Zero-based index
+ The priority
+ A standard sort integer (-1, 0, 1)
+
+
+
+ Serializable patch information
+
+
+
+ Prefixes as an array of
+
+
+
+ Postfixes as an array of
+
+
+
+ Transpilers as an array of
+
+
+
+ Finalizers as an array of
+
+
+
+ Returns if any of the patches wants debugging turned on
+
+
+
+ Adds prefixes
+ An owner (Harmony ID)
+ The patch methods
+
+
+
+ Adds a prefix
+
+
+ Removes prefixes
+ The owner of the prefixes, or * for all
+
+
+
+ Adds postfixes
+ An owner (Harmony ID)
+ The patch methods
+
+
+
+ Adds a postfix
+
+
+ Removes postfixes
+ The owner of the postfixes, or * for all
+
+
+
+ Adds transpilers
+ An owner (Harmony ID)
+ The patch methods
+
+
+
+ Adds a transpiler
+
+
+ Removes transpilers
+ The owner of the transpilers, or * for all
+
+
+
+ Adds finalizers
+ An owner (Harmony ID)
+ The patch methods
+
+
+
+ Adds a finalizer
+
+
+ Removes finalizers
+ The owner of the finalizers, or * for all
+
+
+
+ Removes a patch using its method
+ The method of the patch to remove
+
+
+
+ Gets a concatenated list of patches
+ The Harmony instance ID adding the new patches
+ The patches to add
+ The current patches
+
+
+
+ Gets a list of patches with any from the given owner removed
+ The owner of the methods, or * for all
+ The current patches
+
+
+
+ A serializable patch
+
+
+
+ Zero-based index
+
+
+
+ The owner (Harmony ID)
+
+
+
+ The priority, see
+
+
+
+ Keep this patch before the patches indicated in the list of Harmony IDs
+
+
+
+ Keep this patch after the patches indicated in the list of Harmony IDs
+
+
+
+ A flag that will log the replacement method via every time this patch is used to build the replacement, even in the future
+
+
+
+ The method of the static patch method
+
+
+
+ Creates a patch
+ The method of the patch
+ Zero-based index
+ An owner (Harmony ID)
+ The priority, see
+ A list of Harmony IDs for patches that should run after this patch
+ A list of Harmony IDs for patches that should run before this patch
+ A flag that will log the replacement method via every time this patch is used to build the replacement, even in the future
+
+
+
+ Creates a patch
+ The method of the patch
+ Zero-based index
+ An owner (Harmony ID)
+
+
+ Get the patch method or a DynamicMethod if original patch method is a patch factory
+ The original method/constructor
+ The method of the patch
+
+
+
+ Determines whether patches are equal
+ The other patch
+ true if equal
+
+
+
+ Determines how patches sort
+ The other patch
+ integer to define sort order (-1, 0, 1)
+
+
+
+ Hash function
+ A hash code
+
+
+
+ A PatchClassProcessor used to turn on a class/type into patches
+
+
+
+ Creates a patch class processor by pointing out a class. Similar to PatchAll() but without searching through all classes.
+ The Harmony instance
+ The class to process (need to have at least a [HarmonyPatch] attribute)
+
+
+
+ Applies the patches
+ A list of all created replacement methods or null if patch class is not annotated
+
+
+
+ A group of patches
+
+
+
+ A collection of prefix
+
+
+
+ A collection of postfix
+
+
+
+ A collection of transpiler
+
+
+
+ A collection of finalizer
+
+
+
+ Gets all owners (Harmony IDs) or all known patches
+ The patch owners
+
+
+
+ Creates a group of patches
+ An array of prefixes as
+ An array of postfixes as
+ An array of transpileres as
+ An array of finalizeres as
+
+
+
+ A PatchProcessor handles patches on a method/constructor
+
+
+
+ Creates an empty patch processor
+ The Harmony instance
+ The original method/constructor
+
+
+
+ Adds a prefix
+ The prefix as a
+ A for chaining calls
+
+
+
+ Adds a prefix
+ The prefix method
+ A for chaining calls
+
+
+
+ Adds a postfix
+ The postfix as a
+ A for chaining calls
+
+
+
+ Adds a postfix
+ The postfix method
+ A for chaining calls
+
+
+
+ Adds a transpiler
+ The transpiler as a
+ A for chaining calls
+
+
+
+ Adds a transpiler
+ The transpiler method
+ A for chaining calls
+
+
+
+ Adds a finalizer
+ The finalizer as a
+ A for chaining calls
+
+
+
+ Adds a finalizer
+ The finalizer method
+ A for chaining calls
+
+
+
+ Gets all patched original methods in the appdomain
+ An enumeration of patched method/constructor
+
+
+
+ Applies all registered patches
+ The generated replacement method
+
+
+
+ Unpatches patches of a given type and/or Harmony ID
+ The patch type
+ Harmony ID or * for any
+ A for chaining calls
+
+
+
+ Unpatches a specific patch
+ The method of the patch
+ A for chaining calls
+
+
+
+ Gets patch information on an original
+ The original method/constructor
+ The patch information as
+
+
+
+ Sort patch methods by their priority rules
+ The original method
+ Patches to sort
+ The sorted patch methods
+
+
+
+ Gets Harmony version for all active Harmony instances
+ [out] The current Harmony version
+ A dictionary containing assembly version keyed by Harmony ID
+
+
+
+ Creates a new empty generator to use when reading method bodies
+ A new
+
+
+
+ Creates a new generator matching the method/constructor to use when reading method bodies
+ The original method/constructor to copy method information from
+ A new
+
+
+
+ Returns the methods unmodified list of code instructions
+ The original method/constructor
+ Optionally an existing generator that will be used to create all local variables and labels contained in the result (if not specified, an internal generator is used)
+ A list containing all the original
+
+
+
+ Returns the methods unmodified list of code instructions
+ The original method/constructor
+ A new generator that now contains all local variables and labels contained in the result
+ A list containing all the original
+
+
+
+ Returns the methods current list of code instructions after all existing transpilers have been applied
+ The original method/constructor
+ Apply only the first count of transpilers
+ Optionally an existing generator that will be used to create all local variables and labels contained in the result (if not specified, an internal generator is used)
+ A list of
+
+
+
+ Returns the methods current list of code instructions after all existing transpilers have been applied
+ The original method/constructor
+ A new generator that now contains all local variables and labels contained in the result
+ Apply only the first count of transpilers
+ A list of
+
+
+
+ A low level way to read the body of a method. Used for quick searching in methods
+ The original method
+ All instructions as opcode/operand pairs
+
+
+
+ A low level way to read the body of a method. Used for quick searching in methods
+ The original method
+ An existing generator that will be used to create all local variables and labels contained in the result
+ All instructions as opcode/operand pairs
+
+
+
+ A patch priority
+
+
+
+ Patch last
+
+
+
+ Patch with very low priority
+
+
+
+ Patch with low priority
+
+
+
+ Patch with lower than normal priority
+
+
+
+ Patch with normal priority
+
+
+
+ Patch with higher than normal priority
+
+
+
+ Patch with high priority
+
+
+
+ Patch with very high priority
+
+
+
+ Patch first
+
+
+
+ A reverse patcher
+
+
+
+ Creates a reverse patcher
+ The Harmony instance
+ The original method/constructor
+ Your stand-in stub method as
+
+
+
+ Applies the patch
+ The type of patch, see
+ The generated replacement method
+
+
+
+ A collection of commonly used transpilers
+
+
+
+ A transpiler that replaces all occurrences of a given method with another one using the same signature
+ The enumeration of to act on
+ Method or constructor to search for
+ Method or constructor to replace with
+ Modified enumeration of
+
+
+
+ A transpiler that alters instructions that match a predicate by calling an action
+ The enumeration of to act on
+ A predicate selecting the instructions to change
+ An action to apply to matching instructions
+ Modified enumeration of
+
+
+
+ A transpiler that logs a text at the beginning of the method
+ The instructions to act on
+ The log text
+ Modified enumeration of
+
+
+
+ A helper class for reflection related functions
+
+
+
+ Shortcut for to simplify the use of reflections and make it work for any access level
+
+
+
+ Shortcut for to simplify the use of reflections and make it work for any access level but only within the current type
+
+
+
+ Enumerates all assemblies in the current app domain, excluding visual studio assemblies
+ An enumeration of
+
+
+ Gets a type by name. Prefers a full name with namespace but falls back to the first type matching the name otherwise
+ The name
+ A type or null if not found
+
+
+
+ Gets all successfully loaded types from a given assembly
+ The assembly
+ An array of types
+
+ This calls and returns , while catching any thrown .
+ If such an exception is thrown, returns the successfully loaded types (,
+ filtered for non-null values).
+
+
+
+
+ Enumerates all successfully loaded types in the current app domain, excluding visual studio assemblies
+ An enumeration of all in all assemblies, excluding visual studio assemblies
+
+
+ Applies a function going up the type hierarchy and stops at the first non-null result
+ Result type of func()
+ The class/type to start with
+ The evaluation function returning T
+ The first non-null result, or null if no match
+
+ The type hierarchy of a class or value type (including struct) does NOT include implemented interfaces,
+ and the type hierarchy of an interface is only itself (regardless of whether that interface implements other interfaces).
+ The top-most type in the type hierarchy of all non-interface types (including value types) is .
+
+
+
+
+ Applies a function going into inner types and stops at the first non-null result
+ Generic type parameter
+ The class/type to start with
+ The evaluation function returning T
+ The first non-null result, or null if no match
+
+
+
+ Gets the reflection information for a directly declared field
+ The class/type where the field is defined
+ The name of the field
+ A field or null when type/name is null or when the field cannot be found
+
+
+
+ Gets the reflection information for a directly declared field
+ The member in the form TypeFullName:MemberName, where TypeFullName matches the form recognized by Type.GetType like Some.Namespace.Type.
+ A field or null when the field cannot be found
+
+
+
+ Gets the reflection information for a field by searching the type and all its super types
+ The class/type where the field is defined
+ The name of the field (case sensitive)
+ A field or null when type/name is null or when the field cannot be found
+
+
+
+ Gets the reflection information for a field by searching the type and all its super types
+ The member in the form TypeFullName:MemberName, where TypeFullName matches the form recognized by Type.GetType like Some.Namespace.Type.
+ A field or null when the field cannot be found
+
+
+
+ Gets the reflection information for a field
+ The class/type where the field is declared
+ The zero-based index of the field inside the class definition
+ A field or null when type is null or when the field cannot be found
+
+
+
+ Gets the reflection information for a directly declared property
+ The class/type where the property is declared
+ The name of the property (case sensitive)
+ A property or null when type/name is null or when the property cannot be found
+
+
+
+ Gets the reflection information for a directly declared property
+ The member in the form TypeFullName:MemberName, where TypeFullName matches the form recognized by Type.GetType like Some.Namespace.Type.
+ A property or null when the property cannot be found
+
+
+
+ Gets the reflection information for the getter method of a directly declared property
+ The class/type where the property is declared
+ The name of the property (case sensitive)
+ A method or null when type/name is null or when the property cannot be found
+
+
+
+ Gets the reflection information for the getter method of a directly declared property
+ The member in the form TypeFullName:MemberName, where TypeFullName matches the form recognized by Type.GetType like Some.Namespace.Type.
+ A method or null when the property cannot be found
+
+
+
+ Gets the reflection information for the setter method of a directly declared property
+ The class/type where the property is declared
+ The name of the property (case sensitive)
+ A method or null when type/name is null or when the property cannot be found
+
+
+
+ Gets the reflection information for the Setter method of a directly declared property
+ The member in the form TypeFullName:MemberName, where TypeFullName matches the form recognized by Type.GetType like Some.Namespace.Type.
+ A method or null when the property cannot be found
+
+
+
+ Gets the reflection information for a property by searching the type and all its super types
+ The class/type
+ The name
+ A property or null when type/name is null or when the property cannot be found
+
+
+
+ Gets the reflection information for a property by searching the type and all its super types
+ The member in the form TypeFullName:MemberName, where TypeFullName matches the form recognized by Type.GetType like Some.Namespace.Type.
+ A property or null when the property cannot be found
+
+
+
+ Gets the reflection information for the getter method of a property by searching the type and all its super types
+ The class/type
+ The name
+ A method or null when type/name is null or when the property cannot be found
+
+
+
+ Gets the reflection information for the getter method of a property by searching the type and all its super types
+ The member in the form TypeFullName:MemberName, where TypeFullName matches the form recognized by Type.GetType like Some.Namespace.Type.
+ A method or null when type/name is null or when the property cannot be found
+
+
+
+ Gets the reflection information for the setter method of a property by searching the type and all its super types
+ The class/type
+ The name
+ A method or null when type/name is null or when the property cannot be found
+
+
+
+ Gets the reflection information for the setter method of a property by searching the type and all its super types
+ The member in the form TypeFullName:MemberName, where TypeFullName matches the form recognized by Type.GetType like Some.Namespace.Type.
+ A method or null when type/name is null or when the property cannot be found
+
+
+
+ Gets the reflection information for a directly declared method
+ The class/type where the method is declared
+ The name of the method (case sensitive)
+ Optional parameters to target a specific overload of the method
+ Optional list of types that define the generic version of the method
+ A method or null when type/name is null or when the method cannot be found
+
+
+
+ Gets the reflection information for a directly declared method
+ The member in the form TypeFullName:MemberName, where TypeFullName matches the form recognized by Type.GetType like Some.Namespace.Type.
+ Optional parameters to target a specific overload of the method
+ Optional list of types that define the generic version of the method
+ A method or null when the method cannot be found
+
+
+
+ Gets the reflection information for a method by searching the type and all its super types
+ The class/type where the method is declared
+ The name of the method (case sensitive)
+ Optional parameters to target a specific overload of the method
+ Optional list of types that define the generic version of the method
+ A method or null when type/name is null or when the method cannot be found
+
+
+
+ Gets the reflection information for a method by searching the type and all its super types
+ The member in the form TypeFullName:MemberName, where TypeFullName matches the form recognized by Type.GetType like Some.Namespace.Type.
+ Optional parameters to target a specific overload of the method
+ Optional list of types that define the generic version of the method
+ A method or null when the method cannot be found
+
+
+
+ Gets the method of an enumerator method
+ Enumerator method that creates the enumerator
+ The internal method of the enumerator or null if no valid enumerator is detected
+
+
+ Gets the names of all method that are declared in a type
+ The declaring class/type
+ A list of method names
+
+
+
+ Gets the names of all method that are declared in the type of the instance
+ An instance of the type to search in
+ A list of method names
+
+
+
+ Gets the names of all fields that are declared in a type
+ The declaring class/type
+ A list of field names
+
+
+
+ Gets the names of all fields that are declared in the type of the instance
+ An instance of the type to search in
+ A list of field names
+
+
+
+ Gets the names of all properties that are declared in a type
+ The declaring class/type
+ A list of property names
+
+
+
+ Gets the names of all properties that are declared in the type of the instance
+ An instance of the type to search in
+ A list of property names
+
+
+
+ Gets the type of any class member of
+ A member
+ The class/type of this member
+
+
+
+ Test if a class member is actually an concrete implementation
+ A member
+ True if the member is a declared
+
+
+
+ Gets the real implementation of a class member
+ A member
+ The member itself if its declared. Otherwise the member that is actually implemented in some base type
+
+
+
+ Gets the reflection information for a directly declared constructor
+ The class/type where the constructor is declared
+ Optional parameters to target a specific overload of the constructor
+ Optional parameters to only consider static constructors
+ A constructor info or null when type is null or when the constructor cannot be found
+
+
+
+ Gets the reflection information for a constructor by searching the type and all its super types
+ The class/type where the constructor is declared
+ Optional parameters to target a specific overload of the method
+ Optional parameters to only consider static constructors
+ A constructor info or null when type is null or when the method cannot be found
+
+
+
+ Gets reflection information for all declared constructors
+ The class/type where the constructors are declared
+ Optional parameters to only consider static constructors
+ A list of constructor infos
+
+
+
+ Gets reflection information for all declared methods
+ The class/type where the methods are declared
+ A list of methods
+
+
+
+ Gets reflection information for all declared properties
+ The class/type where the properties are declared
+ A list of properties
+
+
+
+ Gets reflection information for all declared fields
+ The class/type where the fields are declared
+ A list of fields
+
+
+
+ Gets the return type of a method or constructor
+ The method/constructor
+ The return type
+
+
+
+ Given a type, returns the first inner type matching a recursive search by name
+ The class/type to start searching at
+ The name of the inner type (case sensitive)
+ The inner type or null if type/name is null or if a type with that name cannot be found
+
+
+
+ Given a type, returns the first inner type matching a recursive search with a predicate
+ The class/type to start searching at
+ The predicate to search with
+ The inner type or null if type/predicate is null or if a type with that name cannot be found
+
+
+
+ Given a type, returns the first method matching a predicate
+ The class/type to start searching at
+ The predicate to search with
+ The method or null if type/predicate is null or if a type with that name cannot be found
+
+
+
+ Given a type, returns the first constructor matching a predicate
+ The class/type to start searching at
+ The predicate to search with
+ The constructor info or null if type/predicate is null or if a type with that name cannot be found
+
+
+
+ Given a type, returns the first property matching a predicate
+ The class/type to start searching at
+ The predicate to search with
+ The property or null if type/predicate is null or if a type with that name cannot be found
+
+
+
+ Returns an array containing the type of each object in the given array
+ An array of objects
+ An array of types or an empty array if parameters is null (if an object is null, the type for it will be object)
+
+
+
+ Creates an array of input parameters for a given method and a given set of potential inputs
+ The method/constructor you are planing to call
+ The possible input parameters in any order
+ An object array matching the method signature
+
+
+
+ A readable/assignable reference delegate to an instance field of a class or static field (NOT an instance field of a struct)
+
+ An arbitrary type if the field is static; otherwise the class that defines the field, or a parent class (including ),
+ implemented interface, or derived class of this type
+
+
+ The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
+ a type that is assignable from that type; or if the field's type is an enum type,
+ either that type or the underlying integral type of that enum type
+
+ The runtime instance to access the field (ignored and can be omitted for static fields)
+ A readable/assignable reference to the field
+ Null instance passed to a non-static field ref delegate
+
+ Instance of invalid type passed to a non-static field ref delegate
+ (this can happen if is a parent class or interface of the field's declaring type)
+
+
+
+ This delegate cannot be used for instance fields of structs, since a struct instance passed to the delegate would be passed by
+ value and thus would be a copy that only exists within the delegate's invocation. This is fine for a readonly reference,
+ but makes assignment futile. Use instead.
+
+
+ Note that is not required to be the field's declaring type. It can be a parent class (including ),
+ implemented interface, or a derived class of the field's declaring type ("instanceOfT is FieldDeclaringType" must be possible).
+ Specifically, must be assignable from OR to the field's declaring type.
+ Technically, this allows Nullable, although Nullable is only relevant for structs, and since only static fields of structs
+ are allowed for this delegate, and the instance passed to such a delegate is ignored, this hardly matters.
+
+
+ Similarly, is not required to be the field's field type, unless that type is a non-enum value type.
+ It can be a parent class (including object) or implemented interface of the field's field type. It cannot be a derived class.
+ This variance is not allowed for value types, since that would require boxing/unboxing, which is not allowed for ref values.
+ Special case for enum types: can also be the underlying integral type of the enum type.
+ Specifically, for reference types, must be assignable from
+ the field's field type; for non-enum value types, must be exactly the field's field type; for enum types,
+ must be either the field's field type or the underyling integral type of that field type.
+
+
+ This delegate supports static fields, even those defined in structs, for legacy reasons.
+ For such static fields, is effectively ignored.
+ Consider using (and StaticFieldRefAccess methods that return it) instead for static fields.
+
+
+
+
+
+ Creates a field reference delegate for an instance field of a class
+ The class that defines the instance field, or derived class of this type
+
+ The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
+ a type that is assignable from that type; or if the field's type is an enum type,
+ either that type or the underlying integral type of that enum type
+
+ The name of the field
+ A readable/assignable delegate
+
+
+ For backwards compatibility, there is no class constraint on .
+ Instead, the non-value-type check is done at runtime within the method.
+
+
+
+
+
+ Creates an instance field reference for a specific instance of a class
+ The class that defines the instance field, or derived class of this type
+
+ The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
+ a type that is assignable from that type; or if the field's type is an enum type,
+ either that type or the underlying integral type of that enum type
+
+ The instance
+ The name of the field
+ A readable/assignable reference to the field
+
+
+ This method is meant for one-off access to a field's value for a single instance.
+ If you need to access a field's value for potentially multiple instances, use instead.
+ FieldRefAccess<T, F>(instance, fieldName) is functionally equivalent to FieldRefAccess<T, F>(fieldName)(instance).
+
+
+ For backwards compatibility, there is no class constraint on .
+ Instead, the non-value-type check is done at runtime within the method.
+
+
+
+
+
+ Creates a field reference delegate for an instance field of a class or static field (NOT an instance field of a struct)
+
+ The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
+ a type that is assignable from that type; or if the field's type is an enum type,
+ either that type or the underlying integral type of that enum type
+
+
+ The type that defines the field, or derived class of this type; must not be a struct type unless the field is static
+
+ The name of the field
+
+ A readable/assignable delegate with T=object
+ (for static fields, the instance delegate parameter is ignored)
+
+
+
+ This method is meant for cases where the given type is only known at runtime and thus can't be used as a type parameter T
+ in e.g. .
+
+
+ This method supports static fields, even those defined in structs, for legacy reasons.
+ Consider using (and other overloads) instead for static fields.
+
+
+
+
+
+ Creates a field reference delegate for an instance field of a class or static field (NOT an instance field of a struct)
+ type of the field
+ The member in the form TypeFullName:MemberName, where TypeFullName matches the form recognized by Type.GetType like Some.Namespace.Type.
+ A readable/assignable delegate with T=object
+
+
+ Creates a field reference delegate for an instance field of a class or static field (NOT an instance field of a struct)
+
+ An arbitrary type if the field is static; otherwise the class that defines the field, or a parent class (including ),
+ implemented interface, or derived class of this type ("instanceOfT is FieldDeclaringType" must be possible)
+
+
+ The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
+ a type that is assignable from that type; or if the field's type is an enum type,
+ either that type or the underlying integral type of that enum type
+
+ The field
+ A readable/assignable delegate
+
+
+ This method is meant for cases where the field has already been obtained, avoiding the field searching cost in
+ e.g. .
+
+
+ This method supports static fields, even those defined in structs, for legacy reasons.
+ For such static fields, is effectively ignored.
+ Consider using (and other overloads) instead for static fields.
+
+
+ For backwards compatibility, there is no class constraint on .
+ Instead, the non-value-type check is done at runtime within the method.
+
+
+
+
+
+ Creates a field reference for an instance field of a class
+
+ The type that defines the field; or a parent class (including ), implemented interface, or derived class of this type
+ ("instanceOfT is FieldDeclaringType" must be possible)
+
+
+ The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
+ a type that is assignable from that type; or if the field's type is an enum type,
+ either that type or the underlying integral type of that enum type
+
+ The instance
+ The field
+ A readable/assignable reference to the field
+
+
+ This method is meant for one-off access to a field's value for a single instance and where the field has already been obtained.
+ If you need to access a field's value for potentially multiple instances, use instead.
+ FieldRefAccess<T, F>(instance, fieldInfo) is functionally equivalent to FieldRefAccess<T, F>(fieldInfo)(instance).
+
+
+ For backwards compatibility, there is no class constraint on .
+ Instead, the non-value-type check is done at runtime within the method.
+
+
+
+
+
+ A readable/assignable reference delegate to an instance field of a struct
+ The struct that defines the instance field
+
+ The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
+ a type that is assignable from that type; or if the field's type is an enum type,
+ either that type or the underlying integral type of that enum type
+
+ A reference to the runtime instance to access the field
+ A readable/assignable reference to the field
+
+
+
+ Creates a field reference delegate for an instance field of a struct
+ The struct that defines the instance field
+
+ The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
+ a type that is assignable from that type; or if the field's type is an enum type,
+ either that type or the underlying integral type of that enum type
+
+ The name of the field
+ A readable/assignable delegate
+
+
+
+ Creates an instance field reference for a specific instance of a struct
+ The struct that defines the instance field
+
+ The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
+ a type that is assignable from that type; or if the field's type is an enum type,
+ either that type or the underlying integral type of that enum type
+
+ The instance
+ The name of the field
+ A readable/assignable reference to the field
+
+
+ This method is meant for one-off access to a field's value for a single instance.
+ If you need to access a field's value for potentially multiple instances, use instead.
+ StructFieldRefAccess<T, F>(ref instance, fieldName) is functionally equivalent to StructFieldRefAccess<T, F>(fieldName)(ref instance).
+
+
+
+
+
+ Creates a field reference delegate for an instance field of a struct
+ The struct that defines the instance field
+
+ The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
+ a type that is assignable from that type; or if the field's type is an enum type,
+ either that type or the underlying integral type of that enum type
+
+ The field
+ A readable/assignable delegate
+
+
+ This method is meant for cases where the field has already been obtained, avoiding the field searching cost in
+ e.g. .
+
+
+
+
+
+ Creates a field reference for an instance field of a struct
+ The struct that defines the instance field
+
+ The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
+ a type that is assignable from that type; or if the field's type is an enum type,
+ either that type or the underlying integral type of that enum type
+
+ The instance
+ The field
+ A readable/assignable reference to the field
+
+
+ This method is meant for one-off access to a field's value for a single instance and where the field has already been obtained.
+ If you need to access a field's value for potentially multiple instances, use instead.
+ StructFieldRefAccess<T, F>(ref instance, fieldInfo) is functionally equivalent to StructFieldRefAccess<T, F>(fieldInfo)(ref instance).
+
+
+
+
+
+ A readable/assignable reference delegate to a static field
+
+ The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
+ a type that is assignable from that type; or if the field's type is an enum type,
+ either that type or the underlying integral type of that enum type
+
+ A readable/assignable reference to the field
+
+
+
+ Creates a static field reference
+ The type (can be class or struct) the field is defined in
+
+ The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
+ a type that is assignable from that type; or if the field's type is an enum type,
+ either that type or the underlying integral type of that enum type
+
+ The name of the field
+ A readable/assignable reference to the field
+
+
+
+ Creates a static field reference
+
+ The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
+ a type that is assignable from that type; or if the field's type is an enum type,
+ either that type or the underlying integral type of that enum type
+
+ The type (can be class or struct) the field is defined in
+ The name of the field
+ A readable/assignable reference to the field
+
+
+
+ Creates a static field reference
+ The type of the field
+ The member in the form TypeFullName:MemberName, where TypeFullName matches the form recognized by Type.GetType like Some.Namespace.Type.
+ A readable/assignable reference to the field
+
+
+
+ Creates a static field reference
+ An arbitrary type (by convention, the type the field is defined in)
+
+ The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
+ a type that is assignable from that type; or if the field's type is an enum type,
+ either that type or the underlying integral type of that enum type
+
+ The field
+ A readable/assignable reference to the field
+
+ The type parameter is only used in exception messaging and to distinguish between this method overload
+ and the overload (which returns a rather than a reference).
+
+
+
+
+ Creates a static field reference delegate
+
+ The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
+ a type that is assignable from that type; or if the field's type is an enum type,
+ either that type or the underlying integral type of that enum type
+
+ The field
+ A readable/assignable delegate
+
+
+
+ Creates a delegate to a given method
+ The delegate Type
+ The method to create a delegate from.
+
+ Only applies for instance methods. If null (default), returned delegate is an open (a.k.a. unbound) instance delegate
+ where an instance is supplied as the first argument to the delegate invocation; else, delegate is a closed (a.k.a. bound)
+ instance delegate where the delegate invocation always applies to the given .
+
+
+ Only applies for instance methods. If true (default) and is virtual, invocation of the delegate
+ calls the instance method virtually (the instance type's most-derived/overriden implementation of the method is called);
+ else, invocation of the delegate calls the exact specified (this is useful for calling base class methods)
+ Note: if false and is an interface method, an ArgumentException is thrown.
+
+ A delegate of given to given
+
+
+ Delegate invocation is more performant and more convenient to use than
+ at a one-time setup cost.
+
+
+ Works for both type of static and instance methods, both open and closed (a.k.a. unbound and bound) instance methods,
+ and both class and struct methods.
+
+
+
+
+
+ Creates a delegate to a given method
+ The delegate Type
+ The method in the form TypeFullName:MemberName, where TypeFullName matches the form recognized by Type.GetType like Some.Namespace.Type.
+
+ Only applies for instance methods. If null (default), returned delegate is an open (a.k.a. unbound) instance delegate
+ where an instance is supplied as the first argument to the delegate invocation; else, delegate is a closed (a.k.a. bound)
+ instance delegate where the delegate invocation always applies to the given .
+
+
+ Only applies for instance methods. If true (default) and is virtual, invocation of the delegate
+ calls the instance method virtually (the instance type's most-derived/overriden implementation of the method is called);
+ else, invocation of the delegate calls the exact specified (this is useful for calling base class methods)
+ Note: if false and is an interface method, an ArgumentException is thrown.
+
+ A delegate of given to given
+
+
+ Delegate invocation is more performant and more convenient to use than
+ at a one-time setup cost.
+
+
+ Works for both type of static and instance methods, both open and closed (a.k.a. unbound and bound) instance methods,
+ and both class and struct methods.
+
+
+
+
+
+ Creates a delegate for a given delegate definition, attributed with []
+ The delegate Type, attributed with []
+
+ Only applies for instance methods. If null (default), returned delegate is an open (a.k.a. unbound) instance delegate
+ where an instance is supplied as the first argument to the delegate invocation; else, delegate is a closed (a.k.a. bound)
+ instance delegate where the delegate invocation always applies to the given .
+
+ A delegate of given to the method specified via []
+ attributes on
+
+ This calls with the method and virtualCall arguments
+ determined from the [] attributes on ,
+ and the given (for closed instance delegates).
+
+
+
+
+ Returns who called the current method
+ The calling method/constructor (excluding the caller)
+
+
+
+ Rethrows an exception while preserving its stack trace (throw statement typically clobbers existing stack traces)
+ The exception to rethrow
+
+
+
+ True if the current runtime is based on Mono, false otherwise (.NET)
+
+
+
+ True if the current runtime is .NET Framework, false otherwise (.NET Core or Mono, although latter isn't guaranteed)
+
+
+
+ True if the current runtime is .NET Core, false otherwise (Mono or .NET Framework)
+
+
+
+ Throws a missing member runtime exception
+ The type that is involved
+ A list of names
+
+
+
+ Gets default value for a specific type
+ The class/type
+ The default value
+
+
+
+ Creates an (possibly uninitialized) instance of a given type
+ The class/type
+ The new instance
+
+
+
+ Creates an (possibly uninitialized) instance of a given type
+ The class/type
+ The new instance
+
+
+
+
+ A cache for the or similar Add methods for different types.
+
+
+
+ Makes a deep copy of any object
+ The type of the instance that should be created; for legacy reasons, this must be a class or interface
+ The original object
+ A copy of the original object but of type T
+
+
+
+ Makes a deep copy of any object
+ The type of the instance that should be created
+ The original object
+ [out] The copy of the original object
+ Optional value transformation function (taking a field name and src/dst instances)
+ The optional path root to start with
+
+
+
+ Makes a deep copy of any object
+ The original object
+ The type of the instance that should be created
+ Optional value transformation function (taking a field name and src/dst instances)
+ The optional path root to start with
+ The copy of the original object
+
+
+
+ Tests if a type is a struct
+ The type
+ True if the type is a struct
+
+
+
+ Tests if a type is a class
+ The type
+ True if the type is a class
+
+
+
+ Tests if a type is a value type
+ The type
+ True if the type is a value type
+
+
+
+ Tests if a type is an integer type
+ The type
+ True if the type represents some integer
+
+
+
+ Tests if a type is a floating point type
+ The type
+ True if the type represents some floating point
+
+
+
+ Tests if a type is a numerical type
+ The type
+ True if the type represents some number
+
+
+
+ Tests if a type is void
+ The type
+ True if the type is void
+
+
+
+ Test whether an instance is of a nullable type
+ Type of instance
+ An instance to test
+ True if instance is of nullable type, false if not
+
+
+
+ Tests whether a type or member is static, as defined in C#
+ The type or member
+ True if the type or member is static
+
+
+
+ Tests whether a type is static, as defined in C#
+ The type
+ True if the type is static
+
+
+
+ Tests whether a property is static, as defined in C#
+ The property
+ True if the property is static
+
+
+
+ Tests whether an event is static, as defined in C#
+ The event
+ True if the event is static
+
+
+
+ Calculates a combined hash code for an enumeration of objects
+ The objects
+ The hash code
+
+
+
+ A CodeInstruction match
+
+
+ The name of the match
+
+
+ The matched opcodes
+
+
+ The matched operands
+
+
+ The jumps from the match
+
+
+ The jumps to the match
+
+
+ The match predicate
+
+
+ Creates a code match
+ The optional opcode
+ The optional operand
+ The optional name
+
+
+
+ Creates a code match that calls a method
+ The lambda expression using the method
+ The optional name
+
+
+
+ Creates a code match that calls a method
+ The lambda expression using the method
+ The optional name
+
+
+
+ Creates a code match
+ The CodeInstruction
+ An optional name
+
+
+
+ Creates a code match
+ The predicate
+ An optional name
+
+
+
+ Returns a string that represents the match
+ A string representation
+
+
+
+ A CodeInstruction matcher
+
+
+ The current position
+ The index or -1 if out of bounds
+
+
+
+ Gets the number of code instructions in this matcher
+ The count
+
+
+
+ Checks whether the position of this CodeMatcher is within bounds
+ True if this CodeMatcher is valid
+
+
+
+ Checks whether the position of this CodeMatcher is outside its bounds
+ True if this CodeMatcher is invalid
+
+
+
+ Gets the remaining code instructions
+ The remaining count
+
+
+
+ Gets the opcode at the current position
+ The opcode
+
+
+
+ Gets the operand at the current position
+ The operand
+
+
+
+ Gets the labels at the current position
+ The labels
+
+
+
+ Gets the exception blocks at the current position
+ The blocks
+
+
+
+ Creates an empty code matcher
+
+
+ Creates a code matcher from an enumeration of instructions
+ The instructions (transpiler argument)
+ An optional IL generator
+
+
+
+ Makes a clone of this instruction matcher
+ A copy of this matcher
+
+
+
+ Gets instructions at the current position
+ The instruction
+
+
+
+ Gets instructions at the current position with offset
+ The offset
+ The instruction
+
+
+
+ Gets all instructions
+ A list of instructions
+
+
+
+ Gets all instructions as an enumeration
+ A list of instructions
+
+
+
+ Gets some instructions counting from current position
+ Number of instructions
+ A list of instructions
+
+
+
+ Gets all instructions within a range
+ The start index
+ The end index
+ A list of instructions
+
+
+
+ Gets all instructions within a range (relative to current position)
+ The start offset
+ The end offset
+ A list of instructions
+
+
+
+ Gets a list of all distinct labels
+ The instructions (transpiler argument)
+ A list of Labels
+
+
+
+ Reports a failure
+ The method involved
+ The logger
+ True if current position is invalid and error was logged
+
+
+
+ Throw an InvalidOperationException if current state is invalid (position out of bounds / last match failed)
+ Explanation of where/why the exception was thrown that will be added to the exception message
+ The same code matcher
+
+
+
+ Throw an InvalidOperationException if current state is invalid (position out of bounds / last match failed),
+ or if the matches do not match at current position
+ Explanation of where/why the exception was thrown that will be added to the exception message
+ Some code matches
+ The same code matcher
+
+
+
+ Throw an InvalidOperationException if current state is invalid (position out of bounds / last match failed),
+ or if the matches do not match at any point between current position and the end
+ Explanation of where/why the exception was thrown that will be added to the exception message
+ Some code matches
+ The same code matcher
+
+
+
+ Throw an InvalidOperationException if current state is invalid (position out of bounds / last match failed),
+ or if the matches do not match at any point between current position and the start
+ Explanation of where/why the exception was thrown that will be added to the exception message
+ Some code matches
+ The same code matcher
+
+
+
+ Throw an InvalidOperationException if current state is invalid (position out of bounds / last match failed),
+ or if the check function returns false
+ Explanation of where/why the exception was thrown that will be added to the exception message
+ Function that checks validity of current state. If it returns false, an exception is thrown
+ The same code matcher
+
+
+
+ Sets an instruction at current position
+ The instruction to set
+ The same code matcher
+
+
+
+ Sets instruction at current position and advances
+ The instruction
+ The same code matcher
+
+
+
+ Sets opcode and operand at current position
+ The opcode
+ The operand
+ The same code matcher
+
+
+
+ Sets opcode and operand at current position and advances
+ The opcode
+ The operand
+ The same code matcher
+
+
+
+ Sets opcode at current position and advances
+ The opcode
+ The same code matcher
+
+
+
+ Sets operand at current position and advances
+ The operand
+ The same code matcher
+
+
+
+ Creates a label at current position
+ [out] The label
+ The same code matcher
+
+
+
+ Creates a label at a position
+ The position
+ [out] The new label
+ The same code matcher
+
+
+
+ Creates a label at a position
+ The offset
+ [out] The new label
+ The same code matcher
+
+
+
+ Adds an enumeration of labels to current position
+ The labels
+ The same code matcher
+
+
+
+ Adds an enumeration of labels at a position
+ The position
+ The labels
+ The same code matcher
+
+
+
+ Sets jump to
+ Branch instruction
+ Destination for the jump
+ [out] The created label
+ The same code matcher
+
+
+
+ Inserts some instructions
+ The instructions
+ The same code matcher
+
+
+
+ Inserts an enumeration of instructions
+ The instructions
+ The same code matcher
+
+
+
+ Inserts a branch
+ The branch opcode
+ Branch destination
+ The same code matcher
+
+
+
+ Inserts some instructions and advances the position
+ The instructions
+ The same code matcher
+
+
+
+ Inserts an enumeration of instructions and advances the position
+ The instructions
+ The same code matcher
+
+
+
+ Inserts a branch and advances the position
+ The branch opcode
+ Branch destination
+ The same code matcher
+
+
+
+ Removes current instruction
+ The same code matcher
+
+
+
+ Removes some instruction from current position by count
+ Number of instructions
+ The same code matcher
+
+
+
+ Removes the instructions in a range
+ The start
+ The end
+ The same code matcher
+
+
+
+ Removes the instructions in a offset range
+ The start offset
+ The end offset
+ The same code matcher
+
+
+
+ Advances the current position
+ The offset
+ The same code matcher
+
+
+
+ Moves the current position to the start
+ The same code matcher
+
+
+
+ Moves the current position to the end
+ The same code matcher
+
+
+
+ Searches forward with a predicate and advances position
+ The predicate
+ The same code matcher
+
+
+
+ Searches backwards with a predicate and reverses position
+ The predicate
+ The same code matcher
+
+
+
+ Matches forward and advances position to beginning of matching sequence
+ Some code matches
+ The same code matcher
+
+
+
+ Matches forward and advances position to ending of matching sequence
+ Some code matches
+ The same code matcher
+
+
+
+ Matches backwards and reverses position to beginning of matching sequence
+ Some code matches
+ The same code matcher
+
+
+
+ Matches backwards and reverses position to ending of matching sequence
+ Some code matches
+ The same code matcher
+
+
+
+ Repeats a match action until boundaries are met
+ The match action
+ An optional action that is executed when no match is found
+ The same code matcher
+
+
+
+ Gets a match by its name
+ The match name
+ An instruction
+
+
+
+ General extensions for common cases
+
+
+
+ Joins an enumeration with a value converter and a delimiter to a string
+ The inner type of the enumeration
+ The enumeration
+ An optional value converter (from T to string)
+ An optional delimiter
+ The values joined into a string
+
+
+
+ Converts an array of types (for example methods arguments) into a human readable form
+ The array of types
+ A human readable description including brackets
+
+
+
+ A full description of a type
+ The type
+ A human readable description
+
+
+
+ A a full description of a method or a constructor without assembly details but with generics
+ The method/constructor
+ A human readable description
+
+
+
+ A helper converting parameter infos to types
+ The array of parameter infos
+ An array of types
+
+
+
+ A helper to access a value via key from a dictionary
+ The key type
+ The value type
+ The dictionary
+ The key
+ The value for the key or the default value (of T) if that key does not exist
+
+
+
+ A helper to access a value via key from a dictionary with extra casting
+ The value type
+ The dictionary
+ The key
+ The value for the key or the default value (of T) if that key does not exist or cannot be cast to T
+
+
+
+ Escapes Unicode and ASCII non printable characters
+ The string to convert
+ The string to convert
+ A string literal surrounded by
+
+
+
+ Extensions for
+
+
+
+ Returns if an is initialized and valid
+ The
+
+
+
+ Shortcut for testing whether the operand is equal to a non-null value
+ The
+ The value
+ True if the operand has the same type and is equal to the value
+
+
+
+ Shortcut for testing whether the operand is equal to a non-null value
+ The
+ The value
+ True if the operand is equal to the value
+ This is an optimized version of for
+
+
+
+ Shortcut for code.opcode == opcode && code.OperandIs(operand)
+ The
+ The
+ The operand value
+ True if the opcode is equal to the given opcode and the operand has the same type and is equal to the given operand
+
+
+
+ Shortcut for code.opcode == opcode && code.OperandIs(operand)
+ The
+ The
+ The operand value
+ True if the opcode is equal to the given opcode and the operand is equal to the given operand
+ This is an optimized version of for
+
+
+
+ Tests for any form of Ldarg*
+ The
+ The (optional) index
+ True if it matches one of the variations
+
+
+
+ Tests for Ldarga/Ldarga_S
+ The
+ The (optional) index
+ True if it matches one of the variations
+
+
+
+ Tests for Starg/Starg_S
+ The
+ The (optional) index
+ True if it matches one of the variations
+
+
+
+ Tests for any form of Ldloc*
+ The
+ The optional local variable
+ True if it matches one of the variations
+
+
+
+ Tests for any form of Stloc*
+ The
+ The optional local variable
+ True if it matches one of the variations
+
+
+
+ Tests if the code instruction branches
+ The
+ The label if the instruction is a branch operation or if not
+ True if the instruction branches
+
+
+
+ Tests if the code instruction calls the method/constructor
+ The
+ The method
+ True if the instruction calls the method or constructor
+
+
+
+ Tests if the code instruction loads a constant
+ The
+ True if the instruction loads a constant
+
+
+
+ Tests if the code instruction loads an integer constant
+ The
+ The integer constant
+ True if the instruction loads the constant
+
+
+
+ Tests if the code instruction loads a floating point constant
+ The
+ The floating point constant
+ True if the instruction loads the constant
+
+
+
+ Tests if the code instruction loads an enum constant
+ The
+ The enum
+ True if the instruction loads the constant
+
+
+
+ Tests if the code instruction loads a string constant
+ The
+ The string
+ True if the instruction loads the constant
+
+
+
+ Tests if the code instruction loads a field
+ The
+ The field
+ Set to true if the address of the field is loaded
+ True if the instruction loads the field
+
+
+
+ Tests if the code instruction stores a field
+ The
+ The field
+ True if the instruction stores this field
+
+
+
+ Adds labels to the code instruction and return it
+ The
+ One or several to add
+ The same code instruction
+
+
+ Adds labels to the code instruction and return it
+ The
+ An enumeration of
+ The same code instruction
+
+
+ Extracts all labels from the code instruction and returns them
+ The
+ A list of
+
+
+ Moves all labels from the code instruction to another one
+ The to move the labels from
+ The other to move the labels to
+ The code instruction labels were moved from (now empty)
+
+
+ Moves all labels from another code instruction to the current one
+ The to move the labels to
+ The other to move the labels from
+ The code instruction that received the labels
+
+
+ Adds ExceptionBlocks to the code instruction and return it
+ The
+ One or several to add
+ The same code instruction
+
+
+ Adds ExceptionBlocks to the code instruction and return it
+ The
+ An enumeration of
+ The same code instruction
+
+
+ Extracts all ExceptionBlocks from the code instruction and returns them
+ The
+ A list of
+
+
+ Moves all ExceptionBlocks from the code instruction to another one
+ The to move the ExceptionBlocks from
+ The other to move the ExceptionBlocks to
+ The code instruction blocks were moved from (now empty)
+
+
+ Moves all ExceptionBlocks from another code instruction to the current one
+ The to move the ExceptionBlocks to
+ The other to move the ExceptionBlocks from
+ The code instruction that received the blocks
+
+
+ General extensions for collections
+
+
+
+ A simple way to execute code for every element in a collection
+ The inner type of the collection
+ The collection
+ The action to execute
+
+
+
+ A simple way to execute code for elements in a collection matching a condition
+ The inner type of the collection
+ The collection
+ The predicate
+ The action to execute
+
+
+
+ A helper to add an item to a collection
+ The inner type of the collection
+ The collection
+ The item to add
+ The collection containing the item
+
+
+
+ A helper to add an item to an array
+ The inner type of the collection
+ The array
+ The item to add
+ The array containing the item
+
+
+
+ A helper to add items to an array
+ The inner type of the collection
+ The array
+ The items to add
+ The array containing the items
+
+
+
+ General extensions for collections
+
+
+
+ Tests a class member if it has an IL method body (external methods for example don't have a body)
+ The member to test
+ Returns true if the member has an IL body or false if not
+
+
+ A file log for debugging
+
+
+
+ Set this to make Harmony write its log content to this stream
+
+
+
+ Full pathname of the log file, defaults to a file called harmony.log.txt on your Desktop
+
+
+
+ The indent character. The default is tab
+
+
+
+ The current indent level
+
+
+
+ Changes the indentation level
+ The value to add to the indentation level
+
+
+
+ Log a string in a buffered way. Use this method only if you are sure that FlushBuffer will be called
+ or else logging information is incomplete in case of a crash
+ The string to log
+
+
+
+ Logs a list of string in a buffered way. Use this method only if you are sure that FlushBuffer will be called
+ or else logging information is incomplete in case of a crash
+ A list of strings to log (they will not be re-indented)
+
+
+
+ Returns the log buffer and optionally empties it
+ True to empty the buffer
+ The buffer.
+
+
+
+ Replaces the buffer with new lines
+ The lines to store
+
+
+
+ Flushes the log buffer to disk (use in combination with LogBuffered)
+
+
+
+ Log a string directly to disk. Slower method that prevents missing information in case of a crash
+ The string to log.
+
+
+
+ Log a string directly to disk if Harmony.DEBUG is true. Slower method that prevents missing information in case of a crash
+ The string to log.
+
+
+
+ Resets and deletes the log
+
+
+
+ Logs some bytes as hex values
+ The pointer to some memory
+ The length of bytes to log
+
+
+
+ A helper class to retrieve reflection info for non-private methods
+
+
+
+ Given a lambda expression that calls a method, returns the method info
+ The lambda expression using the method
+ The method in the lambda expression
+
+
+
+ Given a lambda expression that calls a method, returns the method info
+ The generic type
+ The lambda expression using the method
+ The method in the lambda expression
+
+
+
+ Given a lambda expression that calls a method, returns the method info
+ The generic type
+ The generic result type
+ The lambda expression using the method
+ The method in the lambda expression
+
+
+
+ Given a lambda expression that calls a method, returns the method info
+ The lambda expression using the method
+ The method in the lambda expression
+
+
+
+ A reflection helper to read and write private elements
+ The result type defined by GetValue()
+
+
+
+ Creates a traverse instance from an existing instance
+ The existing instance
+
+
+
+ Gets/Sets the current value
+ The value to read or write
+
+
+
+ A reflection helper to read and write private elements
+
+
+
+ Creates a new traverse instance from a class/type
+ The class/type
+ A instance
+
+
+
+ Creates a new traverse instance from a class T
+ The class
+ A instance
+
+
+
+ Creates a new traverse instance from an instance
+ The object
+ A instance
+
+
+
+ Creates a new traverse instance from a named type
+ The type name, for format see
+ A instance
+
+
+
+ Creates a new and empty traverse instance
+
+
+
+ Creates a new traverse instance from a class/type
+ The class/type
+
+
+
+ Creates a new traverse instance from an instance
+ The object
+
+
+
+ Gets the current value
+ The value
+
+
+
+ Gets the current value
+ The type of the value
+ The value
+
+
+
+ Invokes the current method with arguments and returns the result
+ The method arguments
+ The value returned by the method
+
+
+
+ Invokes the current method with arguments and returns the result
+ The type of the value
+ The method arguments
+ The value returned by the method
+
+
+
+ Sets a value of the current field or property
+ The value
+ The same traverse instance
+
+
+
+ Gets the type of the current field or property
+ The type
+
+
+
+ Moves the current traverse instance to a inner type
+ The type name
+ A traverse instance
+
+
+
+ Moves the current traverse instance to a field
+ The type name
+ A traverse instance
+
+
+
+ Moves the current traverse instance to a field
+ The type of the field
+ The type name
+ A traverse instance
+
+
+
+ Gets all fields of the current type
+ A list of field names
+
+
+
+ Moves the current traverse instance to a property
+ The type name
+ Optional property index
+ A traverse instance
+
+
+
+ Moves the current traverse instance to a field
+ The type of the property
+ The type name
+ Optional property index
+ A traverse instance
+
+
+
+ Gets all properties of the current type
+ A list of property names
+
+
+
+ Moves the current traverse instance to a method
+ The name of the method
+ The arguments defining the argument types of the method overload
+ A traverse instance
+
+
+
+ Moves the current traverse instance to a method
+ The name of the method
+ The argument types of the method
+ The arguments for the method
+ A traverse instance
+
+
+
+ Gets all methods of the current type
+ A list of method names
+
+
+
+ Checks if the current traverse instance is for a field
+ True if its a field
+
+
+
+ Checks if the current traverse instance is for a property
+ True if its a property
+
+
+
+ Checks if the current traverse instance is for a method
+ True if its a method
+
+
+
+ Checks if the current traverse instance is for a type
+ True if its a type
+
+
+
+ Iterates over all fields of the current type and executes a traverse action
+ Original object
+ The action receiving a instance for each field
+
+
+
+ Iterates over all fields of the current type and executes a traverse action
+ Original object
+ Target object
+ The action receiving a pair of instances for each field pair
+
+
+
+ Iterates over all fields of the current type and executes a traverse action
+ Original object
+ Target object
+ The action receiving a dot path representing the field pair and the instances
+
+
+
+ Iterates over all properties of the current type and executes a traverse action
+ Original object
+ The action receiving a instance for each property
+
+
+
+ Iterates over all properties of the current type and executes a traverse action
+ Original object
+ Target object
+ The action receiving a pair of instances for each property pair
+
+
+
+ Iterates over all properties of the current type and executes a traverse action
+ Original object
+ Target object
+ The action receiving a dot path representing the property pair and the instances
+
+
+
+ A default field action that copies fields to fields
+
+
+
+ Returns a string that represents the current traverse
+ A string representation
+
+
+
+
diff --git a/Assets/FastScriptReload/Plugins/Harmony/net48/0Harmony.xml.meta b/Assets/FastScriptReload/Plugins/Harmony/net48/0Harmony.xml.meta
new file mode 100644
index 0000000..fe484c3
--- /dev/null
+++ b/Assets/FastScriptReload/Plugins/Harmony/net48/0Harmony.xml.meta
@@ -0,0 +1,14 @@
+fileFormatVersion: 2
+guid: 59922c0cd2ffd71478db2dea7fb3fb7a
+TextScriptImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Plugins/Harmony/net48/0Harmony.xml
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon.meta b/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon.meta
new file mode 100644
index 0000000..bfa8e7b
--- /dev/null
+++ b/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: fec618116c7eb7f42a3cf42dd1e125ea
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRTools.Common.Editor.dll b/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRTools.Common.Editor.dll
new file mode 100644
index 0000000..a06903e
Binary files /dev/null and b/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRTools.Common.Editor.dll differ
diff --git a/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRTools.Common.Editor.dll.meta b/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRTools.Common.Editor.dll.meta
new file mode 100644
index 0000000..629157c
--- /dev/null
+++ b/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRTools.Common.Editor.dll.meta
@@ -0,0 +1,83 @@
+fileFormatVersion: 2
+guid: 1f20b53a7360a6f40957117be6217b96
+PluginImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ iconMap: {}
+ executionOrder: {}
+ defineConstraints: []
+ isPreloaded: 0
+ isOverridable: 0
+ isExplicitlyReferenced: 1
+ validateReferences: 1
+ platformData:
+ - first:
+ : Any
+ second:
+ enabled: 0
+ settings:
+ Exclude Android: 1
+ Exclude Editor: 0
+ Exclude Linux64: 1
+ Exclude OSXUniversal: 1
+ Exclude Win: 1
+ Exclude Win64: 1
+ - first:
+ Android: Android
+ second:
+ enabled: 0
+ settings:
+ CPU: ARMv7
+ - first:
+ Any:
+ second:
+ enabled: 0
+ settings: {}
+ - first:
+ Editor: Editor
+ second:
+ enabled: 1
+ settings:
+ CPU: AnyCPU
+ DefaultValueInitialized: true
+ OS: AnyOS
+ - first:
+ Standalone: Linux64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: OSXUniversal
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Windows Store Apps: WindowsStoreApps
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ userData:
+ assetBundleName:
+ assetBundleVariant:
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRTools.Common.Editor.dll
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRTools.Common.Runtime.dll b/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRTools.Common.Runtime.dll
new file mode 100644
index 0000000..158a5f3
Binary files /dev/null and b/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRTools.Common.Runtime.dll differ
diff --git a/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRTools.Common.Runtime.dll.meta b/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRTools.Common.Runtime.dll.meta
new file mode 100644
index 0000000..7f58e6e
--- /dev/null
+++ b/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRTools.Common.Runtime.dll.meta
@@ -0,0 +1,85 @@
+fileFormatVersion: 2
+guid: 42c3f40ad0520e442aa80842ab9748a9
+PluginImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ iconMap: {}
+ executionOrder:
+ ImmersiveVRTools.Runtime.Common.Debug.RuntimeDebugDraw: 9990
+ defineConstraints:
+ - UNITY_EDITOR || LiveScriptReload_IncludeInBuild_Enabled
+ isPreloaded: 0
+ isOverridable: 0
+ isExplicitlyReferenced: 1
+ validateReferences: 1
+ platformData:
+ - first:
+ : Any
+ second:
+ enabled: 0
+ settings:
+ Exclude Android: 0
+ Exclude Editor: 0
+ Exclude Linux64: 0
+ Exclude OSXUniversal: 0
+ Exclude Win: 0
+ Exclude Win64: 0
+ - first:
+ Android: Android
+ second:
+ enabled: 1
+ settings:
+ CPU: ARMv7
+ - first:
+ Any:
+ second:
+ enabled: 1
+ settings: {}
+ - first:
+ Editor: Editor
+ second:
+ enabled: 1
+ settings:
+ CPU: AnyCPU
+ DefaultValueInitialized: true
+ OS: AnyOS
+ - first:
+ Standalone: Linux64
+ second:
+ enabled: 1
+ settings:
+ CPU: AnyCPU
+ - first:
+ Standalone: OSXUniversal
+ second:
+ enabled: 1
+ settings:
+ CPU: None
+ - first:
+ Standalone: Win
+ second:
+ enabled: 1
+ settings:
+ CPU: x86
+ - first:
+ Standalone: Win64
+ second:
+ enabled: 1
+ settings:
+ CPU: x86_64
+ - first:
+ Windows Store Apps: WindowsStoreApps
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ userData:
+ assetBundleName:
+ assetBundleVariant:
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRTools.Common.Runtime.dll
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRToolsCommonLicense.txt b/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRToolsCommonLicense.txt
new file mode 100644
index 0000000..dd75623
--- /dev/null
+++ b/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRToolsCommonLicense.txt
@@ -0,0 +1,3 @@
+This code is part of the product and can be used with same licence as the one you got it with.
+
+Left in Plugins folder solely for convenience.
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRToolsCommonLicense.txt.meta b/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRToolsCommonLicense.txt.meta
new file mode 100644
index 0000000..29d1be5
--- /dev/null
+++ b/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRToolsCommonLicense.txt.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: 656785d4ce824de4ac3c58af77fec60d
+timeCreated: 1670158565
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRToolsCommonLicense.txt
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Roslyn.meta b/Assets/FastScriptReload/Plugins/Roslyn.meta
new file mode 100644
index 0000000..3e29032
--- /dev/null
+++ b/Assets/FastScriptReload/Plugins/Roslyn.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 99309b63b6416e44f8c19d3f300ee1c1
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2019+.meta b/Assets/FastScriptReload/Plugins/Roslyn/2019+.meta
new file mode 100644
index 0000000..6b4c33d
--- /dev/null
+++ b/Assets/FastScriptReload/Plugins/Roslyn/2019+.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 9bfedaf58be6fc243a48a4cc7e808d73
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2019+/Microsoft.CodeAnalysis.CSharp.dll b/Assets/FastScriptReload/Plugins/Roslyn/2019+/Microsoft.CodeAnalysis.CSharp.dll
new file mode 100644
index 0000000..c48d7ce
Binary files /dev/null and b/Assets/FastScriptReload/Plugins/Roslyn/2019+/Microsoft.CodeAnalysis.CSharp.dll differ
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2019+/Microsoft.CodeAnalysis.CSharp.dll.meta b/Assets/FastScriptReload/Plugins/Roslyn/2019+/Microsoft.CodeAnalysis.CSharp.dll.meta
new file mode 100644
index 0000000..be33d27
--- /dev/null
+++ b/Assets/FastScriptReload/Plugins/Roslyn/2019+/Microsoft.CodeAnalysis.CSharp.dll.meta
@@ -0,0 +1,84 @@
+fileFormatVersion: 2
+guid: aa900f3e8ecf37343bb158cd68e5718d
+PluginImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ iconMap: {}
+ executionOrder: {}
+ defineConstraints:
+ - UNITY_2019 || UNITY_2020
+ isPreloaded: 0
+ isOverridable: 0
+ isExplicitlyReferenced: 1
+ validateReferences: 1
+ platformData:
+ - first:
+ : Any
+ second:
+ enabled: 0
+ settings:
+ Exclude Android: 1
+ Exclude Editor: 0
+ Exclude Linux64: 1
+ Exclude OSXUniversal: 1
+ Exclude Win: 1
+ Exclude Win64: 1
+ - first:
+ Android: Android
+ second:
+ enabled: 0
+ settings:
+ CPU: ARMv7
+ - first:
+ Any:
+ second:
+ enabled: 0
+ settings: {}
+ - first:
+ Editor: Editor
+ second:
+ enabled: 1
+ settings:
+ CPU: AnyCPU
+ DefaultValueInitialized: true
+ OS: AnyOS
+ - first:
+ Standalone: Linux64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: OSXUniversal
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Windows Store Apps: WindowsStoreApps
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ userData:
+ assetBundleName:
+ assetBundleVariant:
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Plugins/Roslyn/2019+/Microsoft.CodeAnalysis.CSharp.dll
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2019+/Microsoft.CodeAnalysis.dll b/Assets/FastScriptReload/Plugins/Roslyn/2019+/Microsoft.CodeAnalysis.dll
new file mode 100644
index 0000000..6bde7b7
Binary files /dev/null and b/Assets/FastScriptReload/Plugins/Roslyn/2019+/Microsoft.CodeAnalysis.dll differ
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2019+/Microsoft.CodeAnalysis.dll.meta b/Assets/FastScriptReload/Plugins/Roslyn/2019+/Microsoft.CodeAnalysis.dll.meta
new file mode 100644
index 0000000..3456847
--- /dev/null
+++ b/Assets/FastScriptReload/Plugins/Roslyn/2019+/Microsoft.CodeAnalysis.dll.meta
@@ -0,0 +1,84 @@
+fileFormatVersion: 2
+guid: b6ebf747d582ac34fa013efea6bda29d
+PluginImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ iconMap: {}
+ executionOrder: {}
+ defineConstraints:
+ - UNITY_2019 || UNITY_2020
+ isPreloaded: 0
+ isOverridable: 0
+ isExplicitlyReferenced: 1
+ validateReferences: 1
+ platformData:
+ - first:
+ : Any
+ second:
+ enabled: 0
+ settings:
+ Exclude Android: 1
+ Exclude Editor: 0
+ Exclude Linux64: 1
+ Exclude OSXUniversal: 1
+ Exclude Win: 1
+ Exclude Win64: 1
+ - first:
+ Android: Android
+ second:
+ enabled: 0
+ settings:
+ CPU: ARMv7
+ - first:
+ Any:
+ second:
+ enabled: 0
+ settings: {}
+ - first:
+ Editor: Editor
+ second:
+ enabled: 1
+ settings:
+ CPU: AnyCPU
+ DefaultValueInitialized: true
+ OS: AnyOS
+ - first:
+ Standalone: Linux64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: OSXUniversal
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Windows Store Apps: WindowsStoreApps
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ userData:
+ assetBundleName:
+ assetBundleVariant:
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Plugins/Roslyn/2019+/Microsoft.CodeAnalysis.dll
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2019+/RoslynLicense.txt b/Assets/FastScriptReload/Plugins/Roslyn/2019+/RoslynLicense.txt
new file mode 100644
index 0000000..89d7c4f
--- /dev/null
+++ b/Assets/FastScriptReload/Plugins/Roslyn/2019+/RoslynLicense.txt
@@ -0,0 +1,23 @@
+The MIT License (MIT)
+
+Copyright (c) .NET Foundation and Contributors
+
+All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2019+/RoslynLicense.txt.meta b/Assets/FastScriptReload/Plugins/Roslyn/2019+/RoslynLicense.txt.meta
new file mode 100644
index 0000000..932c0aa
--- /dev/null
+++ b/Assets/FastScriptReload/Plugins/Roslyn/2019+/RoslynLicense.txt.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: 20fdb23994f768f4e89f8a9779e20213
+timeCreated: 1670158681
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Plugins/Roslyn/2019+/RoslynLicense.txt
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Collections.Immutable.dll b/Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Collections.Immutable.dll
new file mode 100644
index 0000000..7e8bbed
Binary files /dev/null and b/Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Collections.Immutable.dll differ
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Collections.Immutable.dll.meta b/Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Collections.Immutable.dll.meta
new file mode 100644
index 0000000..cfc6d4a
--- /dev/null
+++ b/Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Collections.Immutable.dll.meta
@@ -0,0 +1,84 @@
+fileFormatVersion: 2
+guid: ef253369b6dd9f4438722b050ca92f39
+PluginImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ iconMap: {}
+ executionOrder: {}
+ defineConstraints:
+ - UNITY_2019 || UNITY_2020
+ isPreloaded: 0
+ isOverridable: 0
+ isExplicitlyReferenced: 1
+ validateReferences: 1
+ platformData:
+ - first:
+ : Any
+ second:
+ enabled: 0
+ settings:
+ Exclude Android: 1
+ Exclude Editor: 0
+ Exclude Linux64: 1
+ Exclude OSXUniversal: 1
+ Exclude Win: 1
+ Exclude Win64: 1
+ - first:
+ Android: Android
+ second:
+ enabled: 0
+ settings:
+ CPU: ARMv7
+ - first:
+ Any:
+ second:
+ enabled: 0
+ settings: {}
+ - first:
+ Editor: Editor
+ second:
+ enabled: 1
+ settings:
+ CPU: AnyCPU
+ DefaultValueInitialized: true
+ OS: AnyOS
+ - first:
+ Standalone: Linux64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: OSXUniversal
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Windows Store Apps: WindowsStoreApps
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ userData:
+ assetBundleName:
+ assetBundleVariant:
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Collections.Immutable.dll
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Reflection.Metadata.dll b/Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Reflection.Metadata.dll
new file mode 100644
index 0000000..49b7997
Binary files /dev/null and b/Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Reflection.Metadata.dll differ
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Reflection.Metadata.dll.meta b/Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Reflection.Metadata.dll.meta
new file mode 100644
index 0000000..ed4d28c
--- /dev/null
+++ b/Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Reflection.Metadata.dll.meta
@@ -0,0 +1,84 @@
+fileFormatVersion: 2
+guid: f3873ad25446a8b469c55b876e3b4577
+PluginImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ iconMap: {}
+ executionOrder: {}
+ defineConstraints:
+ - UNITY_2019 || UNITY_2020
+ isPreloaded: 0
+ isOverridable: 0
+ isExplicitlyReferenced: 1
+ validateReferences: 1
+ platformData:
+ - first:
+ : Any
+ second:
+ enabled: 0
+ settings:
+ Exclude Android: 1
+ Exclude Editor: 0
+ Exclude Linux64: 1
+ Exclude OSXUniversal: 1
+ Exclude Win: 1
+ Exclude Win64: 1
+ - first:
+ Android: Android
+ second:
+ enabled: 0
+ settings:
+ CPU: ARMv7
+ - first:
+ Any:
+ second:
+ enabled: 0
+ settings: {}
+ - first:
+ Editor: Editor
+ second:
+ enabled: 1
+ settings:
+ CPU: AnyCPU
+ DefaultValueInitialized: true
+ OS: AnyOS
+ - first:
+ Standalone: Linux64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: OSXUniversal
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Windows Store Apps: WindowsStoreApps
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ userData:
+ assetBundleName:
+ assetBundleVariant:
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Reflection.Metadata.dll
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Threading.Tasks.Extensions.dll b/Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Threading.Tasks.Extensions.dll
new file mode 100644
index 0000000..a1234ce
Binary files /dev/null and b/Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Threading.Tasks.Extensions.dll differ
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Threading.Tasks.Extensions.dll.meta b/Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Threading.Tasks.Extensions.dll.meta
new file mode 100644
index 0000000..82a7738
--- /dev/null
+++ b/Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Threading.Tasks.Extensions.dll.meta
@@ -0,0 +1,84 @@
+fileFormatVersion: 2
+guid: c90f5e7176b3a054684c79065480027d
+PluginImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ iconMap: {}
+ executionOrder: {}
+ defineConstraints:
+ - UNITY_2019 || UNITY_2020
+ isPreloaded: 0
+ isOverridable: 0
+ isExplicitlyReferenced: 1
+ validateReferences: 1
+ platformData:
+ - first:
+ : Any
+ second:
+ enabled: 0
+ settings:
+ Exclude Android: 1
+ Exclude Editor: 0
+ Exclude Linux64: 1
+ Exclude OSXUniversal: 1
+ Exclude Win: 1
+ Exclude Win64: 1
+ - first:
+ Android: Android
+ second:
+ enabled: 0
+ settings:
+ CPU: ARMv7
+ - first:
+ Any:
+ second:
+ enabled: 0
+ settings: {}
+ - first:
+ Editor: Editor
+ second:
+ enabled: 1
+ settings:
+ CPU: AnyCPU
+ DefaultValueInitialized: true
+ OS: AnyOS
+ - first:
+ Standalone: Linux64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: OSXUniversal
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Windows Store Apps: WindowsStoreApps
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ userData:
+ assetBundleName:
+ assetBundleVariant:
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Threading.Tasks.Extensions.dll
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+.meta b/Assets/FastScriptReload/Plugins/Roslyn/2021+.meta
new file mode 100644
index 0000000..3730ddf
--- /dev/null
+++ b/Assets/FastScriptReload/Plugins/Roslyn/2021+.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 70d195e83e3a18d429e11445ca3df423
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/Microsoft.CodeAnalysis.CSharp.dll b/Assets/FastScriptReload/Plugins/Roslyn/2021+/Microsoft.CodeAnalysis.CSharp.dll
new file mode 100644
index 0000000..fbd43cb
Binary files /dev/null and b/Assets/FastScriptReload/Plugins/Roslyn/2021+/Microsoft.CodeAnalysis.CSharp.dll differ
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/Microsoft.CodeAnalysis.CSharp.dll.meta b/Assets/FastScriptReload/Plugins/Roslyn/2021+/Microsoft.CodeAnalysis.CSharp.dll.meta
new file mode 100644
index 0000000..0b1a0ff
--- /dev/null
+++ b/Assets/FastScriptReload/Plugins/Roslyn/2021+/Microsoft.CodeAnalysis.CSharp.dll.meta
@@ -0,0 +1,84 @@
+fileFormatVersion: 2
+guid: 139b14934c1c2ce4dac3f527ac5e78e9
+PluginImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ iconMap: {}
+ executionOrder: {}
+ defineConstraints:
+ - UNITY_2021_1_OR_NEWER
+ isPreloaded: 0
+ isOverridable: 0
+ isExplicitlyReferenced: 1
+ validateReferences: 1
+ platformData:
+ - first:
+ : Any
+ second:
+ enabled: 0
+ settings:
+ Exclude Android: 1
+ Exclude Editor: 0
+ Exclude Linux64: 1
+ Exclude OSXUniversal: 1
+ Exclude Win: 1
+ Exclude Win64: 1
+ - first:
+ Android: Android
+ second:
+ enabled: 0
+ settings:
+ CPU: ARMv7
+ - first:
+ Any:
+ second:
+ enabled: 0
+ settings: {}
+ - first:
+ Editor: Editor
+ second:
+ enabled: 1
+ settings:
+ CPU: AnyCPU
+ DefaultValueInitialized: true
+ OS: AnyOS
+ - first:
+ Standalone: Linux64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: OSXUniversal
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Windows Store Apps: WindowsStoreApps
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ userData:
+ assetBundleName:
+ assetBundleVariant:
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Plugins/Roslyn/2021+/Microsoft.CodeAnalysis.CSharp.dll
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/Microsoft.CodeAnalysis.dll b/Assets/FastScriptReload/Plugins/Roslyn/2021+/Microsoft.CodeAnalysis.dll
new file mode 100644
index 0000000..c710e0d
Binary files /dev/null and b/Assets/FastScriptReload/Plugins/Roslyn/2021+/Microsoft.CodeAnalysis.dll differ
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/Microsoft.CodeAnalysis.dll.meta b/Assets/FastScriptReload/Plugins/Roslyn/2021+/Microsoft.CodeAnalysis.dll.meta
new file mode 100644
index 0000000..2db563a
--- /dev/null
+++ b/Assets/FastScriptReload/Plugins/Roslyn/2021+/Microsoft.CodeAnalysis.dll.meta
@@ -0,0 +1,84 @@
+fileFormatVersion: 2
+guid: aab00a18aeb22e84882f5e659c0314da
+PluginImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ iconMap: {}
+ executionOrder: {}
+ defineConstraints:
+ - UNITY_2021_1_OR_NEWER
+ isPreloaded: 0
+ isOverridable: 0
+ isExplicitlyReferenced: 1
+ validateReferences: 1
+ platformData:
+ - first:
+ : Any
+ second:
+ enabled: 0
+ settings:
+ Exclude Android: 1
+ Exclude Editor: 0
+ Exclude Linux64: 1
+ Exclude OSXUniversal: 1
+ Exclude Win: 1
+ Exclude Win64: 1
+ - first:
+ Android: Android
+ second:
+ enabled: 0
+ settings:
+ CPU: ARMv7
+ - first:
+ Any:
+ second:
+ enabled: 0
+ settings: {}
+ - first:
+ Editor: Editor
+ second:
+ enabled: 1
+ settings:
+ CPU: AnyCPU
+ DefaultValueInitialized: true
+ OS: AnyOS
+ - first:
+ Standalone: Linux64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: OSXUniversal
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Windows Store Apps: WindowsStoreApps
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ userData:
+ assetBundleName:
+ assetBundleVariant:
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Plugins/Roslyn/2021+/Microsoft.CodeAnalysis.dll
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/RoslynLicense.txt b/Assets/FastScriptReload/Plugins/Roslyn/2021+/RoslynLicense.txt
new file mode 100644
index 0000000..89d7c4f
--- /dev/null
+++ b/Assets/FastScriptReload/Plugins/Roslyn/2021+/RoslynLicense.txt
@@ -0,0 +1,23 @@
+The MIT License (MIT)
+
+Copyright (c) .NET Foundation and Contributors
+
+All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/RoslynLicense.txt.meta b/Assets/FastScriptReload/Plugins/Roslyn/2021+/RoslynLicense.txt.meta
new file mode 100644
index 0000000..d426261
--- /dev/null
+++ b/Assets/FastScriptReload/Plugins/Roslyn/2021+/RoslynLicense.txt.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: d7099df6462159544838be814444129f
+timeCreated: 1670158681
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Plugins/Roslyn/2021+/RoslynLicense.txt
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Collections.Immutable.FSR.dll b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Collections.Immutable.FSR.dll
new file mode 100644
index 0000000..fd518a6
Binary files /dev/null and b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Collections.Immutable.FSR.dll differ
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Collections.Immutable.FSR.dll.meta b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Collections.Immutable.FSR.dll.meta
new file mode 100644
index 0000000..73e093b
--- /dev/null
+++ b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Collections.Immutable.FSR.dll.meta
@@ -0,0 +1,84 @@
+fileFormatVersion: 2
+guid: 9136761bcf6d7f54d94a6763da626ceb
+PluginImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ iconMap: {}
+ executionOrder: {}
+ defineConstraints:
+ - UNITY_2021_1_OR_NEWER
+ isPreloaded: 0
+ isOverridable: 0
+ isExplicitlyReferenced: 1
+ validateReferences: 1
+ platformData:
+ - first:
+ : Any
+ second:
+ enabled: 0
+ settings:
+ Exclude Android: 1
+ Exclude Editor: 0
+ Exclude Linux64: 1
+ Exclude OSXUniversal: 1
+ Exclude Win: 1
+ Exclude Win64: 1
+ - first:
+ Android: Android
+ second:
+ enabled: 0
+ settings:
+ CPU: ARMv7
+ - first:
+ Any:
+ second:
+ enabled: 0
+ settings: {}
+ - first:
+ Editor: Editor
+ second:
+ enabled: 1
+ settings:
+ CPU: AnyCPU
+ DefaultValueInitialized: true
+ OS: AnyOS
+ - first:
+ Standalone: Linux64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: OSXUniversal
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Windows Store Apps: WindowsStoreApps
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ userData:
+ assetBundleName:
+ assetBundleVariant:
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Collections.Immutable.FSR.dll
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Collections.Immutable.dll b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Collections.Immutable.dll
new file mode 100644
index 0000000..7e8bbed
Binary files /dev/null and b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Collections.Immutable.dll differ
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Collections.Immutable.dll.meta b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Collections.Immutable.dll.meta
new file mode 100644
index 0000000..d185019
--- /dev/null
+++ b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Collections.Immutable.dll.meta
@@ -0,0 +1,84 @@
+fileFormatVersion: 2
+guid: 8fe61eaaa3c4e714c8b9c78ce0303b3a
+PluginImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ iconMap: {}
+ executionOrder: {}
+ defineConstraints:
+ - UNITY_2021_1_OR_NEWER
+ isPreloaded: 0
+ isOverridable: 0
+ isExplicitlyReferenced: 1
+ validateReferences: 1
+ platformData:
+ - first:
+ : Any
+ second:
+ enabled: 0
+ settings:
+ Exclude Android: 1
+ Exclude Editor: 0
+ Exclude Linux64: 1
+ Exclude OSXUniversal: 1
+ Exclude Win: 1
+ Exclude Win64: 1
+ - first:
+ Android: Android
+ second:
+ enabled: 0
+ settings:
+ CPU: ARMv7
+ - first:
+ Any:
+ second:
+ enabled: 0
+ settings: {}
+ - first:
+ Editor: Editor
+ second:
+ enabled: 1
+ settings:
+ CPU: AnyCPU
+ DefaultValueInitialized: true
+ OS: AnyOS
+ - first:
+ Standalone: Linux64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: OSXUniversal
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Windows Store Apps: WindowsStoreApps
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ userData:
+ assetBundleName:
+ assetBundleVariant:
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Collections.Immutable.dll
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Reflection.Metadata.dll b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Reflection.Metadata.dll
new file mode 100644
index 0000000..29d38f9
Binary files /dev/null and b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Reflection.Metadata.dll differ
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Reflection.Metadata.dll.meta b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Reflection.Metadata.dll.meta
new file mode 100644
index 0000000..da25bee
--- /dev/null
+++ b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Reflection.Metadata.dll.meta
@@ -0,0 +1,84 @@
+fileFormatVersion: 2
+guid: 65b841640a4bf8d40b71eaa00a711049
+PluginImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ iconMap: {}
+ executionOrder: {}
+ defineConstraints:
+ - UNITY_2021_1_OR_NEWER
+ isPreloaded: 0
+ isOverridable: 0
+ isExplicitlyReferenced: 1
+ validateReferences: 1
+ platformData:
+ - first:
+ : Any
+ second:
+ enabled: 0
+ settings:
+ Exclude Android: 1
+ Exclude Editor: 0
+ Exclude Linux64: 1
+ Exclude OSXUniversal: 1
+ Exclude Win: 1
+ Exclude Win64: 1
+ - first:
+ Android: Android
+ second:
+ enabled: 0
+ settings:
+ CPU: ARMv7
+ - first:
+ Any:
+ second:
+ enabled: 0
+ settings: {}
+ - first:
+ Editor: Editor
+ second:
+ enabled: 1
+ settings:
+ CPU: AnyCPU
+ DefaultValueInitialized: true
+ OS: AnyOS
+ - first:
+ Standalone: Linux64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: OSXUniversal
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Windows Store Apps: WindowsStoreApps
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ userData:
+ assetBundleName:
+ assetBundleVariant:
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Reflection.Metadata.dll
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Reflection.Metadata.xml b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Reflection.Metadata.xml
new file mode 100644
index 0000000..62f2068
--- /dev/null
+++ b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Reflection.Metadata.xml
@@ -0,0 +1,8431 @@
+
+
+
+ System.Reflection.Metadata
+
+
+
+
+ Content type masked bits that correspond to values of .
+
+
+ Just-In-Time (JIT) compiler optimization is disabled for the assembly.
+
+
+ Just-In-Time (JIT) compiler tracking is enabled for the assembly.
+
+
+ The assembly reference holds the full (unhashed) public key. Not applicable on assembly definition.
+
+
+ The implementation of the referenced assembly used at runtime is not expected to match the version seen at compile time.
+
+
+ The assembly contains Windows Runtime code.
+
+
+ Specifies the hash algorithms used for hashing assembly files and for generating the strong name.
+
+
+
+ Retrieves the MD5 message-digest algorithm.
+ Due to collision problems with MD5, Microsoft recommends SHA256.
+ MD5 was developed by Rivest in 1991. It is basically MD4 with safety-belts and, while it is slightly slower than MD4, it helps provide more security. The algorithm consists of four distinct rounds, which has a slightly different design from that of MD4. Message-digest size, as well as padding requirements, remain the same.
+
+
+
+
+ A mask indicating that there is no hash algorithm.
+ If you specify for a multi-module assembly, the common language runtime defaults to the SHA1 algorithm, since multi-module assemblies need to generate a hash.
+
+
+
+
+ Retrieves a revision of the Secure Hash Algorithm that corrects an unpublished flaw in SHA.
+ Due to collision problems with SHA1, Microsoft recommends SHA256.
+
+
+
+ Retrieves a version of the Secure Hash Algorithm with a hash size of 256 bits.
+
+
+ Retrieves a version of the Secure Hash Algorithm with a hash size of 384 bits.
+
+
+ Retrieves a version of the Secure Hash Algorithm with a hash size of 512 bits.
+
+
+ Specifies the security actions that can be performed using declarative security.
+
+
+ The calling code can access the resource identified by the current permission object, even if callers higher in the stack have not been granted permission to access the resource.
+
+
+ Check that all callers in the call chain have been granted the specified permission.
+
+
+ Without further checks refuse Demand for the specified permission.
+
+
+ The derived class inheriting the class or overriding a method is required to have the specified permission.
+
+
+ Check that the immediate caller has been granted the specified permission.
+
+
+ No declarative security action.
+
+
+ Without further checks, refuse the demand for all permissions other than those specified.
+
+
+ Request the minimum permissions required for code to run. This action can only be used within the scope of the assembly.
+
+
+ Request additional permissions that are optional (not required to run). This request implicitly refuses all other permissions not specifically requested. This action can only be used within the scope of the assembly.
+
+
+ Request that permissions that might be misused not be granted to the calling code. This action can only be used within the scope of the assembly.
+
+
+
+ The resource is not exported from the assembly.
+
+
+ The resource is exported from the assembly.
+
+
+ Masks just the visibility-related attributes.
+
+
+ Represents the shape of an array type.
+
+
+ Initializes a new instance of the structure.
+ The number of dimensions in the array.
+ The size of each dimension.
+ The lower-bound of each dimension.
+
+
+ Gets the lower-bounds of all dimensions. Length may be smaller than rank, in which case the trailing dimensions have unspecified lower bounds.
+ An array of lower-bounds.
+
+
+ Gets the number of dimensions in the array.
+ The number of dimensions.
+
+
+ Gets the sizes of all dimensions.
+ An array of sizes.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets a value that indicates whether the file contains metadata.
+
+ if the file contains metadata, otherwise.
+
+
+ Gets the hash value of the file content calculated using .
+ A instance representing the hash value of the file content.
+
+
+ Gets the file name, including its extension.
+ A instance representing the file name with its extension.
+
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Represents a collection of .
+
+
+
+ Returns an enumerator that iterates through the collection.
+ An enumerator that can be used to iterate through the collection.
+
+
+ Returns an enumerator that iterates through a collection.
+ An object that can be used to iterate through the collection.
+
+
+ Gets the number of elements in the collection.
+ The number of elements in the collection.
+
+
+
+ Advances the enumerator to the next element of the collection.
+
+ if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
+
+
+ Sets the enumerator to its initial position, which is before the first element in the collection.
+
+
+ Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A collection of assembly references.
+
+
+
+ Returns an enumerator that iterates through the collection.
+ An enumerator that can be used to iterate through the collection.
+
+
+ Returns an enumerator that iterates through a collection.
+ An object that can be used to iterate through the collection.
+
+
+ Gets the number of elements in the collection.
+ The number of elements in the collection.
+
+
+
+ Advances the enumerator to the next element of the collection.
+
+ if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
+
+
+ Sets the enumerator to its initial position, which is before the first element in the collection.
+
+
+ Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+
+
+
+
+
+
+
+
+
+ The builder is not writable; it has been linked with another one.
+
+
+
+
+
+
+ Compares the current content of this writer with another one.
+ A instance to compare with this one.
+ Content is not available; the builder has been linked with another one.
+
+ if equal; otherwise, .
+
+
+
+
+ Returns a sequence of all blobs that represent the content of the builder.
+ Content is not available; the builder has been linked with another one.
+ A sequence of blobs.
+
+
+
+
+ is .
+ The builder is not writable; it has been linked with another one.
+
+
+
+
+ is .
+ The builder is not writable; it has been linked with another one.
+
+
+
+ The builder is not writable; it has been linked with another one.
+
+
+ Reserves a contiguous block of bytes.
+
+
+ is negative.
+ The builder is not writable; it has been linked with another one.
+
+
+ Content is not available; the builder has been linked with another one.
+
+
+
+
+ The range specified by and falls outside of the bounds of the buffer content.
+ Content is not available; the builder has been linked with another one.
+
+
+ Content is not available; the builder has been linked with another one.
+
+
+
+
+ The range specified by and falls outside of the bounds of the buffer content.
+ Content is not available; the builder has been linked with another one.
+
+
+ Attempts to write a sequence of bytes to the builder. A return value indicates the number of bytes successfully written.
+
+
+
+ is .
+
+ is negative.
+ The builder is not writable; it has been linked with another one.
+ The number of bytes successfully written from .
+
+
+ Writes a value to the builder.
+ The value to write.
+ The builder is not writable; it has been linked with another one.
+
+
+ Writes a value to the builder.
+ The value to write.
+ The builder is not writable; it has been linked with another one.
+
+
+ Writes a specified number of bytes from a buffer to the builder.
+
+ The number of bytes to write.
+
+ is .
+
+ is negative.
+ The builder is not writable, it has been linked with another one.
+
+
+ Writes a specified number of occurrences of a byte value to the builder.
+
+ The number of occurences of to write.
+
+ is negative.
+ The builder is not writable, it has been linked with another one.
+
+
+ Writes the contents of a byte array to the builder.
+ The byte array to write.
+
+ is .
+ The builder is not writable; it has been linked with another one.
+
+
+ Writes a specified number of bytes starting at a specified index in a byte array to the builder.
+
+
+ The number of bytes to write.
+
+ is .
+ The range specified by and falls outside of the bounds of .
+ The builder is not writable; it has been linked with another one.
+
+
+ Writes the contents of an immutable byte array to the builder.
+ The array to write.
+
+ is .
+ The builder is not writable; it has been linked with another one.
+
+
+ Writes a specified number of bytes starting at a specified index of an immutable array to the builder.
+
+
+ The number of bytes to write.
+
+ is .
+ The range specified by and falls outside of the bounds of the .
+ The builder is not writable; it has been linked with another one.
+
+
+ Implements compressed unsigned integer encoding as defined by ECMA-335-II chapter 23.2: Blobs and signatures.
+ The value to write.
+
+ can't be represented as a compressed unsigned integer.
+ The builder is not writable; it has been linked with another one.
+
+
+ Implements compressed signed integer encoding as defined by ECMA-335-II chapter 23.2: Blobs and signatures.
+ The value to write.
+
+ can't be represented as a compressed signed integer.
+ The builder is not writable; it has been linked with another one.
+
+
+ Writes a constant value (see ECMA-335 Partition II section 22.9) at the current position.
+ The constant value to write.
+
+ is not of a constant type.
+ The builder is not writable; it has been linked with another one.
+
+
+
+
+ is .
+ Content is not available, the builder has been linked with another one.
+
+
+
+
+ is .
+ Content is not available, the builder has been linked with another one.
+
+
+
+
+ is default ().
+ Content is not available, the builder has been linked with another one.
+
+
+
+ Builder is not writable, it has been linked with another one.
+
+
+
+ Builder is not writable, it has been linked with another one.
+
+
+
+ Builder is not writable, it has been linked with another one.
+
+
+
+ Builder is not writable, it has been linked with another one.
+
+
+
+ Builder is not writable, it has been linked with another one.
+
+
+
+ Builder is not writable, it has been linked with another one.
+
+
+
+ Builder is not writable, it has been linked with another one.
+
+
+
+ Builder is not writable, it has been linked with another one.
+
+
+
+ Builder is not writable, it has been linked with another one.
+
+
+ Writes a reference to a heap (heap offset) or a table (row number).
+ Heap offset or table row number.
+
+ to encode the reference as a 16-bit integer; to encode it as a 32-bit integer.
+ Builder is not writable, it has been linked with another one.
+
+
+
+ Builder is not writable, it has been linked with another one.
+
+
+ Writes a string in SerString format (see ECMA-335-II 23.3 Custom attributes).
+
+ Builder is not writable, it has been linked with another one.
+
+
+
+ Builder is not writable, it has been linked with another one.
+
+
+
+ Builder is not writable, it has been linked with another one.
+
+
+
+ Builder is not writable, it has been linked with another one.
+
+
+
+ Builder is not writable, it has been linked with another one.
+
+
+
+ Builder is not writable, it has been linked with another one.
+
+
+
+ Builder is not writable, it has been linked with another one.
+
+
+ Writes a string in User String (#US) heap format (see ECMA-335-II 24.2.4 #US and #Blob heaps).
+
+ Builder is not writable, it has been linked with another one.
+
+
+ Writes a UTF16 (little-endian) encoded character array at the current position.
+
+
+ is .
+ Builder is not writable, it has been linked with another one.
+
+
+ Writes UTF16 (little-endian) encoded string at the current position.
+
+
+ is .
+ Builder is not writable, it has been linked with another one.
+
+
+ Writes a UTF8 encoded string at the current position.
+ Constant value.
+
+ to encode unpaired surrogates as specified; to replace them with a U+FFFD character.
+
+ is .
+ Builder is not writable, it has been linked with another one.
+
+
+
+
+
+
+
+ Advances the enumerator to the next element of the collection.
+
+ if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
+
+
+ Sets the enumerator to its initial position, which is before the first element in the collection.
+
+
+ Returns an enumerator that iterates through the collection.
+ An enumerator that can be used to iterate through the collection.
+
+
+ Returns an enumerator that iterates through a collection.
+ An object that can be used to iterate through the collection.
+
+
+ Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Creates a reader of the specified memory block.
+ A pointer to the start of the memory block.
+ Length in bytes of the memory block.
+
+ is and is greater than zero.
+
+ is negative.
+ The current platform is not little-endian.
+
+
+ Repositions the reader forward by the number of bytes required to satisfy the given alignment.
+
+
+
+ Searches for a specified byte in the blob following the current position.
+ The byte value to find.
+ The index relative to the current position, or -1 if the byte is not found in the blob following the current position.
+
+
+ Reads a Blob heap handle encoded as a compressed integer.
+
+
+
+
+ Reads bytes starting at the current position.
+ The number of bytes to read.
+
+ bytes not available.
+ The byte array.
+
+
+ Reads bytes starting at the current position and writes them to the specified buffer starting at the specified offset.
+ The number of bytes to read.
+ The destination buffer the bytes read will be written to.
+ The offset in the destination buffer where the bytes read will be written.
+
+ bytes not available.
+
+
+
+ Reads an unsigned compressed integer value. See Metadata Specification section II.23.2: Blobs and signatures.
+ The data at the current position was not a valid compressed integer.
+ The value of the compressed integer that was read.
+
+
+ Reads a signed compressed integer value. See Metadata Specification section II.23.2: Blobs and signatures.
+ The data at the current position was not a valid compressed integer.
+ The value of the compressed integer that was read.
+
+
+ Reads a constant value (see ECMA-335 Partition II section 22.9) from the current position.
+
+ Error while reading from the blob.
+
+ is not a valid .
+ A boxed constant value. To avoid allocating the object use Read* methods directly.
+
+
+
+ Reads a number.
+ The data at the current position was not a valid number.
+
+
+
+
+
+
+
+
+ Reads a type code encoded in a serialized custom attribute value.
+
+ if the encoding is invalid.
+
+
+ Reads a string encoded as a compressed integer containing its length followed by its contents in UTF8. Null strings are encoded as a single 0xFF byte.
+ The encoding is invalid.
+ A string value, or .
+
+
+
+ Reads a type code encoded in a signature.
+ The type code encoded in the serialized custom attribute value if the encoding is valid, or if the encoding is invalid.
+
+
+
+ Reads a type handle encoded in a signature as TypeDefOrRefOrSpecEncoded (see ECMA-335 II.23.2.8).
+ The handle when the encoding is valid. Otherwise, a handle where the property is .
+
+
+
+
+
+ Reads a UTF16 (little-endian) encoded string starting at the current position.
+ The number of bytes to read.
+
+ bytes not available.
+ The string.
+
+
+ Reads a UTF8 encoded string starting at the current position.
+ The number of bytes to read.
+
+ bytes not available.
+ The string.
+
+
+ Repositions the reader to the start of the underlying memory block.
+
+
+ Reads an unsigned compressed integer value. See Metadata Specification section II.23.2: Blobs and signatures.
+ The value of the compressed integer that was read.
+
+ if the value was read successfully. if the data at the current position was not a valid compressed integer.
+
+
+ Reads a signed compressed integer value. See Metadata Specification section II.23.2: Blobs and signatures.
+ The value of the compressed integer that was read.
+
+ if the value was read successfully. if the data at the current position was not a valid compressed integer.
+
+
+ Gets a pointer to the byte at the current position of the reader.
+
+
+ Gets the total length of the underlying memory block.
+
+
+ Gets or sets the offset from the start of the blob to the current position.
+ The offset is set outside the bounds of the underlying reader.
+
+
+ Gets the number of bytes remaining from current position to the end of the underlying memory block.
+
+
+ Gets a pointer to the byte at the start of the underlying memory block.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Compares the current content of this writer with another one.
+
+
+
+
+
+
+
+
+
+ The range specified by and falls outside of the bounds of the buffer content.
+
+
+
+
+
+ Range specified by and falls outside of the bounds of the buffer content.
+
+
+
+
+
+
+
+
+
+
+
+ is .
+
+ is negative.
+
+
+
+
+
+ is negative.
+
+
+
+
+ is .
+
+
+
+
+
+
+ is .
+ Range specified by and falls outside of the bounds of the .
+
+
+
+
+ is .
+
+
+
+
+
+
+ is .
+ Range specified by and falls outside of the bounds of the .
+
+
+
+
+
+ is .
+
+ is negative.
+
+
+
+
+ is .
+
+
+ Implements compressed unsigned integer encoding as defined by ECMA-335-II chapter 23.2: Blobs and signatures.
+
+
+ can't be represented as a compressed unsigned integer.
+
+
+ Implements compressed signed integer encoding as defined by ECMA-335-II chapter 23.2: Blobs and signatures.
+
+
+ can't be represented as a compressed signed integer.
+
+
+ Writes a constant value (see ECMA-335 Partition II section 22.9) at the current position.
+
+
+ is not of a constant type.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Writes a reference to a heap (heap offset) or a table (row number).
+ Heap offset or table row number.
+
+ to encode the reference as 16-bit integer, to encode as 32-bit integer.
+
+
+
+
+
+ Writes a string in SerString format (see ECMA-335-II 23.3 Custom attributes).
+
+ The builder is not writable; it has been linked with another one.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Writes a string in User String (#US) heap format (see ECMA-335-II 24.2.4 #US and #Blob heaps).
+
+ Builder is not writable, it has been linked with another one.
+
+
+ Writes a UTF16 (little-endian) encoded string at the current position.
+
+
+ is .
+
+
+ Writes a UTF16 (little-endian) encoded string at the current position.
+
+
+ is .
+
+
+ Writes a UTF8 encoded string at the current position.
+
+
+
+ is .
+
+
+
+
+
+
+
+ Gets the parent handle (, , or ).
+
+
+ Gets a type code that identifies the type of the constant value.
+
+
+ Gets the constant value.
+
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Specifies values that represent types of metadata constants.
+
+
+ A Boolean type.
+
+
+ An unsigned 1-byte integer.
+
+
+ A character type.
+
+
+ An 8-byte floating point type.
+
+
+ A signed 2-byte integer type.
+
+
+ A signed 4-byte integer type.
+
+
+ A signed 8-byte integer type.
+
+
+ An invalid type.
+
+
+ A null reference.
+
+
+ A signed 1-byte integer type.
+
+
+ A 4-byte floating point type.
+
+
+ A type.
+
+
+ An unsigned 2-byte integer type.
+
+
+ An unsigned 4-byte integer type.
+
+
+ An unsigned 8-byte integer type.
+
+
+
+ Decodes the arguments encoded in the value blob.
+
+
+
+
+ Gets the constructor (the or ) of the custom attribute type.
+
+
+ Gets the handle of the metadata entity the attribute is applied to.
+
+
+ Gets the value of the attribute.
+
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns an enumerator that iterates through the collection.
+ An enumerator that can be used to iterate through the collection.
+
+
+ Returns an enumerator that iterates through a collection.
+ An object that can be used to iterate through the collection.
+
+
+ Gets the number of elements in the collection.
+ The number of elements in the collection.
+
+
+
+ Advances the enumerator to the next element of the collection.
+
+ if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
+
+
+ Sets the enumerator to its initial position, which is before the first element in the collection.
+
+
+ Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+ Represents a named argument decoded from a custom attribute signature.
+ The type used to represent types of values decoded from the custom attribute signature.
+
+
+ Initializes a new instance of the structure using the specified name, kind, type, and value.
+ The name of the argument.
+ The kind of the argument.
+ The type of the argument.
+ The value of the argument.
+
+
+ Gets the kind of argument.
+ The argument kind.
+
+
+ Gets the name of the argument.
+ The argument name.
+
+
+ Gets the type of the argument.
+ The argument type.
+
+
+ Gets the value of the argument.
+ An object containing the argument value.
+
+
+ Specifies constants that define the kinds of arguments in a custom attribute signature.
+
+
+ A field argument.
+
+
+ A property argument.
+
+
+ Represents a typed argument for a custom metadata attribute.
+ The type of the argument.
+
+
+ Initializes a new instance of the structure using the specified argument type and value.
+ The type of the argument.
+ The argument value.
+
+
+ Gets the type of the argument.
+ The argument type.
+
+
+ Gets the value of the argument.
+ The argument value.
+
+
+ Represents a custom attribute of the type specified by .
+ The attribute type.
+
+
+ Initializes a new instance of the structure using the specified fixed arguments and named arguments.
+ The fixed arguments.
+ The named arguments.
+
+
+ Gets the fixed arguments for the custom attribute.
+ An immutable array of arguments.
+
+
+ Gets the named arguments for the custom attribute value.
+ An immutable array of arguments.
+
+
+
+
+
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns an enumerator that iterates through the collection.
+ An enumerator that can be used to iterate through the collection.
+
+
+ Returns an enumerator that iterates through a collection.
+ An object that can be used to iterate through the collection.
+
+
+ Gets the number of elements in the collection.
+ The number of elements in the collection.
+
+
+
+ Advances the enumerator to the next element of the collection.
+
+ if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
+
+
+ Sets the enumerator to its initial position, which is before the first element in the collection.
+
+
+ Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+
+
+
+ Gets the offset (in bytes) from the start of the metadata blob to the start of the blob.
+
+
+
+
+
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns an enumerator that iterates through the collection.
+ An enumerator that can be used to iterate through the collection.
+
+
+ Returns an enumerator that iterates through a collection.
+ An object that can be used to iterate through the collection.
+
+
+ Gets the number of elements in the collection.
+ The number of elements in the collection.
+
+
+
+ Advances the enumerator to the next element of the collection.
+
+ if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
+
+
+ Sets the enumerator to its initial position, which is before the first element in the collection.
+
+
+ Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+ The source document in the debug metadata.
+
+
+ Gets the document content hash.
+
+
+ Gets the hash algorithm used to calculate the (SHA1, SHA256, etc.).
+
+
+ Gets the source code language (C#, VB, F#, etc.).
+
+
+ Gets the document name blob.
+
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns an enumerator that iterates through the collection.
+ An enumerator that can be used to iterate through the collection.
+
+
+ Returns an enumerator that iterates through a collection.
+ An object that can be used to iterate through the collection.
+
+
+ Gets the number of elements in the collection.
+ The number of elements in the collection.
+
+
+
+ Advances the enumerator to the next element of the collection.
+
+ if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
+
+
+ Sets the enumerator to its initial position, which is before the first element in the collection.
+
+
+ Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+ A representing a blob on #Blob heap in Portable PDB structured as Document Name.
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Encodes array shape.
+ The number of dimensions in the array (shall be 1 or more).
+ Dimension sizes. The array may be shorter than but not longer.
+ Dimension lower bounds, or default() to set all lower bounds to 0.
+ The array may be shorter than but not longer.
+
+ is outside of range [1, 0xffff], smaller than , or smaller than .
+
+ is .
+
+
+
+
+
+
+
+ Encodes custom attribute signature blob.
+ Called first, to encode fixed arguments.
+ Called second, to encode named arguments.
+
+ or is .
+
+
+ Encodes custom attribute signature blob.
+ Returns a pair of encoders that must be used in the order they appear in the parameter list.
+ Use first, to encode fixed arguments.
+ Use second, to encode named arguments.
+
+
+ Encodes Field Signature blob, with additional support for encoding ref fields, custom modifiers and typed references.
+ Encoder of the field type.
+
+
+ Encodes field signature blob.
+ Encoder of the field type.
+
+
+ Encodes local variable signature.
+ Number of local variables.
+
+ is not in range [0, 0x1fffffff].
+ Encoder of a sequence of local variables.
+
+
+ Encodes method signature blob.
+ Calling convention.
+ Number of generic parameters.
+
+ to encode an instance method signature, to encode a static method signature.
+
+ is not in range [0, 0xffff].
+ An encoder of the rest of the signature including return value and parameters.
+
+
+ Encodes method specification signature blob.
+ Number of generic arguments.
+
+ is not in range [0, 0xffff].
+ Encoder of generic arguments.
+
+
+ Encodes permission set arguments.
+ Number of arguments in the set.
+ Encoder of the arguments of the set.
+
+
+ Encodes a permission set blob.
+ Number of attributes in the set.
+
+ is not in range [0, 0x1fffffff].
+ Permission set encoder.
+
+
+ Encodes property signature blob.
+
+ to encode an instance property signature, to encode a static property signature.
+ An encoder of the rest of the signature including return value and parameters, which has the same structure as method signature.
+
+
+ Encodes type specification signature.
+ Type encoder of the structured type represented by the type specification (it shall not encode a primitive type).
+
+
+
+
+ Calculates a CustomAttributeType coded index for the specified handle.
+
+ or .
+ The handle type is unexpected.
+
+
+ Calculates a HasConstant coded index for the specified handle.
+
+ , , or .
+ The handle type is unexpected.
+
+
+ Calculates a HasCustomAttribute coded index for the specified handle.
+
+ , , , , , , , , , , , , , , , , , , , , or .
+ The handle type is unexpected.
+
+
+ Calculates a HasCustomDebugInformation coded index for the specified handle.
+
+ , , , , , , , , , , , , , , , , , , , , , , , , , or .
+ The handle type is unexpected.
+
+
+ Calculates a HasDeclSecurity coded index for the specified handle.
+
+ , , or .
+ The handle type is unexpected.
+
+
+ Calculates a HasFieldMarshal coded index for the specified handle.
+
+ or .
+ The handle type is unexpected.
+
+
+ Calculates a HasSemantics coded index for the specified handle.
+
+ or .
+ The handle type is unexpected.
+
+
+ Calculates an implementation coded index for the specified handle.
+
+ , or .
+ The handle type is unexpected.
+
+
+ Calculates a MemberForwarded coded index for the specified handle.
+
+ , .
+ The handle type is unexpected.
+
+
+ Calculates a MemberRefParent coded index for the specified handle.
+
+ , , , , or .
+ The handle type is unexpected.
+
+
+ Calculates a MethodDefOrRef coded index for the specified handle.
+
+ or .
+ The handle type is unexpected.
+
+
+ Calculates a ResolutionScope coded index for the specified handle.
+
+ , , or .
+ The handle type is unexpected.
+
+
+ Calculates a TypeDefOrRef coded index for the specified handle.
+
+ or .
+ The handle type is unexpected.
+
+
+ Calculates a TypeDefOrRefOrSpec coded index for the specified handle.
+
+ , or .
+ The handle type is unexpected.
+
+
+ Calculates a TypeOrMethodDef coded index for the specified handle.
+
+ or .
+ The handle type is unexpected.
+
+
+ Emits branches and exception blocks in a method body.
+
+
+
+ Adds catch region.
+ Label marking the first instruction of the try block.
+ Label marking the instruction immediately following the try block.
+ Label marking the first instruction of the handler.
+ Label marking the instruction immediately following the handler.
+ The type of exception to be caught: , or .
+ A label was not defined by an instruction encoder this builder is associated with.
+
+-or-
+
+ is not a valid type handle.
+ A label has default value.
+
+
+ Adds fault region.
+ Label marking the first instruction of the try block.
+ Label marking the instruction immediately following the try block.
+ Label marking the first instruction of the handler.
+ Label marking the instruction immediately following the handler.
+ A label was not defined by an instruction encoder this builder is associated with.
+ A label has default value.
+
+
+ Adds catch region.
+ Label marking the first instruction of the try block.
+ Label marking the instruction immediately following the try block.
+ Label marking the first instruction of the handler.
+ Label marking the instruction immediately following the handler.
+ Label marking the first instruction of the filter block.
+ A label was not defined by an instruction encoder this builder is associated with.
+ A label has default value.
+
+
+ Adds finally region.
+ Label marking the first instruction of the try block.
+ Label marking the instruction immediately following the try block.
+ Label marking the first instruction of the handler.
+ Label marking the instruction immediately following the handler.
+ A label was not defined by an instruction encoder this builder is associated with.
+ A label has default value.
+
+
+ Clears the object's internal state, allowing the same instance to be reused.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Encodes a custom modifier.
+
+ , or .
+ Is optional modifier.
+
+ is or of an unexpected kind.
+ Encoder of subsequent modifiers.
+
+
+
+
+
+
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Adds an exception clause.
+ Clause kind.
+ Try block start offset.
+ Try block length.
+ Handler start offset.
+ Handler length.
+
+ , or , or nil if is not .
+ Offset of the filter block, or 0 if the is not .
+
+ is invalid.
+
+ has an invalid value.
+
+-or-
+
+, , , or is out of range.
+ Method body was not declared to have exception regions.
+ Encoder for the next clause.
+
+
+ Adds a fault clause.
+ Try block start offset.
+ Try block length.
+ Handler start offset.
+ Handler length.
+
+ , or .
+
+ is invalid.
+
+ , , or is out of range.
+ Method body was not declared to have exception regions.
+ Encoder for the next clause.
+
+
+ Adds a fault clause.
+ Try block start offset.
+ Try block length.
+ Handler start offset.
+ Handler length.
+
+ , , or is out of range.
+ Method body was not declared to have exception regions.
+ Encoder for the next clause.
+
+
+ Adds a fault clause.
+ Try block start offset.
+ Try block length.
+ Handler start offset.
+ Handler length.
+ Offset of the filter block.
+
+ , , or is out of range.
+ Method body was not declared to have exception regions.
+ Encoder for the next clause.
+
+
+ Adds a finally clause.
+ Try block start offset.
+ Try block length.
+ Handler start offset.
+ Handler length.
+
+ , , or is out of range.
+ Method body was not declared to have exception regions.
+ Encoder for the next clause.
+
+
+ Returns if the region fits small format.
+ Start offset of the region.
+ Length of the region.
+
+
+ Returns if the number of exception regions first small format.
+ Number of exception regions.
+
+
+ The underlying builder.
+
+
+
+ if the encoder uses small format.
+
+
+ Provides an extension method to access the TypeDefinitionId column of the ExportedType table.
+
+
+ Gets a hint at the likely row number of the target type in the TypeDef table of its module.
+ If the namespaces and names do not match, resolution falls back to a full search of the target TypeDef table. Ignored and should be zero if is .
+
+
+
+ Provides encoder for field signature blob, with additional support for encoding ref fields, custom modifiers and typed references.
+
+
+ Initializes a new instance of the struct.
+ Builder to write encoded field signature to.
+
+
+ Gets the custom modifiers encoder to the field signature.
+ The encoder that specifies the custom modifiers to the field signature.
+
+
+ Encodes the field type signature.
+ Determines if the field is ByRef
+ Encoder of the field type.
+
+
+ Write .
+
+
+ Underlying builder where encoded field signature is written to.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Encodes Common Intermediate Language (CIL) instructions.
+
+
+ Creates an encoder backed by code and control-flow builders.
+ Builder to write encoded instructions to.
+ Builder tracking labels, branches and exception handlers.
+ Must be specified to be able to use some of the control-flow factory methods of , such as , , etc.
+
+
+ Encodes a branch instruction.
+ Branch instruction to encode.
+ Label of the target location in instruction stream.
+
+ is not a branch instruction.
+
+-or-
+
+ was not defined by this encoder.
+
+ is .
+
+ has default value.
+
+
+ Encodes call instruction and its operand.
+
+
+
+ Encodes call instruction and its operand.
+
+
+
+ Encodes call instruction and its operand.
+
+
+
+ Encodes call instruction and its operand.
+
+
+
+ Encodes calli instruction and its operand.
+
+
+
+ Defines a label that can later be used to mark and refer to a location in the instruction stream.
+
+ is .
+ Label handle.
+
+
+ Encodes argument load instruction.
+ Index of the argument.
+
+ is negative.
+
+
+ Encodes argument address load instruction.
+ Index of the argument.
+
+ is negative.
+
+
+ Encodes constant load instruction.
+
+
+
+ Encodes constant load instruction.
+
+
+
+ Encodes constant load instruction.
+
+
+
+ Encodes constant load instruction.
+
+
+
+ Encodes local variable load instruction.
+ Index of the local variable slot.
+
+ is negative.
+
+
+ Encodes local variable address load instruction.
+ Index of the local variable slot.
+
+ is negative.
+
+
+ Encodes ldstr instruction and its operand.
+
+
+
+ Associates specified label with the current IL offset.
+ Label to mark.
+
+ is .
+
+ was not defined by this encoder.
+
+ has default value.
+
+
+ Encodes specified op-code.
+
+
+
+ Encodes argument store instruction.
+ Index of the argument.
+
+ is negative.
+
+
+ Encodes local variable store instruction.
+ Index of the local variable slot.
+
+ is negative.
+
+
+ Encodes a token.
+
+
+
+ Encodes a token.
+
+
+
+ Underlying builder where encoded instructions are written to.
+
+
+ Builder tracking labels, branches and exception handlers.
+
+
+ Offset of the next encoded instruction.
+
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+ 1-based id identifying the label within the context of a .
+
+
+
+ Provides methods for encoding literals.
+
+
+ Creates a new instance of the class with the specified blob builder.
+
+
+ Returns the encoder used to encode the literal value.
+ The encoder of the literal value.
+
+
+ Encodes the type and the value of a literal using the specified delegates.
+ A delegate used to encode the type of the literal. Called first by this method.
+ A delegate used to encode the value of the literal. Called second by this method.
+
+ or is .
+
+
+ Returns a pair of encoders that must be used to encode the type and value of a literal in the order they appear in the parameter list.
+ When this method returns, a custom attribute element type encoder used to encode the type of the literal.
+ When this method returns, a scalar encoded used to encode the value of the literal.
+
+
+ Encodes the type and the items of a vector literal using the specified delegates.
+ A delegate used to encode the type of the vector. Called first by this method.
+ A delegate used to encode the items of the vector. Called second by this method.
+
+ or is .
+
+
+ Returns a pair of encoders that must be used to encode the type and the items of a vector literal in the order they appear in the parameter list.
+ When this method returns, a custom attribute array type encoder used to encode the type of the vector.
+ When this method returns, a vector encoder used to encode the items of the vector.
+
+
+ Gets a vector encoder used to encode the items of a vector.
+ A vector encoder used to encode the items of a vector.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Calculates the handle of the entity within the metadata generation it is defined in, given a handle of an entity in an aggregate metadata.
+ Handle of an entity in an aggregate metadata.
+ The generation the entity is defined in.
+ Handle of the entity within the metadata .
+
+
+ The MetadataBuilder class reads and writes metadata for an assembly in a highly performant manner. It is designed for use by compilers and other assembly generation tools.
+
+
+ Creates a builder for metadata tables and heaps.
+ The start offset of the User String heap. The cumulative size of User String heaps of all previous EnC generations should be 0 unless the metadata is EnC delta metadata.
+ The start offset of the String heap. The cumulative size of String heaps of all previous EnC generations should be 0 unless the metadata is EnC delta metadata.
+ The start offset of the Blob heap. The cumulative size of Blob heaps of all previous EnC generations should be 0 unless the metadata is EnC delta metadata.
+ The start offset of the Guid heap. The cumulative size of Guid heaps of all previous EnC generations should be 0 unless the metadata is EnC delta metadata.
+ Offset is too big.
+ Offset is negative.
+
+ is not a multiple of size of GUID.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Adds a default value for a parameter, field or property.
+ The parent entity handle, which can be one of the following: , , or .
+ The constant value.
+
+ doesn't have the expected handle kind.
+ A handle to the added constant.
+
+
+ Adds a custom attribute.
+ An entity to attach the custom attribute to: a , , , , , , , , , , , , , , , , , , , , , or a .
+ A custom attribute constructor: a or .
+ A custom attribute value blob.
+
+ doesn't have the expected handle kind.
+ A handle to the added custom attribute.
+
+
+ Adds custom debug information.
+ An entity to attach the debug information to: a , , , , , , , , , , , , , , , , , , , , , , , , , , or a .
+ The information kind. Determines the structure of the blob.
+ The custom debug information blob.
+
+ doesn't have the expected handle kind.
+ A handle to the added custom debug information.
+
+
+ Adds a declarative security attribute to a type, method, or assembly.
+ The parent entity handle, which can be one of the following: a , , or a .
+ A declarative security action.
+ The permission set blob.
+
+ doesn't have the expected handle kind.
+ A handle to the added declarative security attribute.
+
+
+ Adds document debug information.
+ The document name blob.
+ THe GUID of the hash algorithm used to calculate the value of .
+ The hash of the document content.
+ The GUID of the language.
+ A handle to the added document.
+
+
+
+
+
+
+
+
+
+ Adds an event definition.
+ The event attributes.
+ The event name.
+ The type of the event: a , , or .
+
+ doesn't have the expected handle kind.
+ A handle to the added event definition.
+
+
+
+
+
+
+ Adds an exported type.
+ The type attributes.
+ The type namespace.
+ The type name.
+ The implementation entity handle, which can be one of the following: an , , or .
+ The type definition ID.
+
+ doesn't have the expected handle kind.
+ A handle to the added exported type.
+
+
+ Adds a field definition.
+ The field attributes.
+ The field name.
+ The field signature. Use to construct the blob.
+ A handle to the added field definition.
+
+
+ Defines a field layout of a field definition.
+ The field definition handle.
+ The byte offset of the field within the declaring type instance.
+
+
+ Adds a mapping from a field to its initial value stored in the PE image.
+ The field definition handle.
+ The offset within the block in the PE image that stores initial values of mapped fields (usually in the .text section).
+
+ is negative.
+
+
+ Adds a generic parameter definition.
+ The parent entity handle, which can be either a or .
+ The generic parameter attributes.
+ The parameter name.
+ The zero-based parameter index.
+
+ doesn't have the expected handle kind.
+
+ is greater than UInt16.MaxValue.
+ A handle to the added generic parameter.
+
+
+ Adds a type constraint to a generic parameter.
+ The generic parameter to constrain.
+ The type constraint, which can be one of the following: a , or a .
+
+ doesn't have the expected handle kind.
+ A handle to the added generic parameter constraint.
+
+
+ Adds local scope debug information.
+ The parent scope handle.
+ The import scope handle.
+ A handle to the added import scope.
+
+
+ Adds an interface implementation to a type.
+ The type implementing the interface.
+ The interface being implemented, which can be one of the following: , , or .
+
+ doesn't have the expected handle kind.
+ A handle to the added interface implementation.
+
+
+ Adds local constant debug information.
+ The name of the variable.
+ The LocalConstantSig blob.
+ A handle to the added local constant.
+
+
+ Adds local scope debug information.
+ The containing method.
+ The handle of the associated import scope.
+ If the scope declares variables, set this to the handle of the first one. Otherwise, set this to the handle of the first variable declared by the next scope definition. If no scope defines any variables, .
+ If the scope declares constants, set this the handle of the first one. Otherwise, set this to the handle of the first constant declared by the next scope definition. If no scope defines any constants, .
+ The offset of the first instruction covered by the scope.
+ The length (in bytes) of the scope.
+ A handle to the added local scope.
+
+
+ Adds local variable debug information.
+ The local variable attributes.
+ The zero-base index of the local variable in the local signature.
+ The name of the variable.
+
+ is greater than UInt16.MaxValue.
+ A handle to the added local variable.
+
+
+ Adds a manifest resource.
+ The manifest resource attributes.
+ The name of the manifest resource.
+ The implementation entity handle, which can be one of the following: , , or .
+ Specifies the byte offset within the referenced file at which this resource record begins.
+
+ doesn't have the expected handle kind.
+ A handle to the added manifest resource.
+
+
+ Adds marshalling information to a field or a parameter.
+ The parent entity handle, which can be one of the following: or .
+ The descriptor blob.
+
+ doesn't have the expected handle kind.
+
+
+ Adds a MemberRef table row.
+ The containing entity, which can be one of the following: , , , , or .
+ The member name.
+ The member signature.
+
+ doesn't have the expected handle kind.
+ A handle to the added member reference.
+
+
+ Adds method debug information.
+ The handle of a single document containing all sequence points of the method, or if the method doesn't have sequence points or spans multiple documents.
+ The sequence Points blob, or if the method doesn't have sequence points.
+ A handle to the added method debug information.
+
+
+ Adds a method definition.
+ The method attributes.
+ The method implementation attributes.
+ The method name.
+ The method signature.
+ Offset within the block in the PE image that stores method bodies (the IL stream), or -1 if the method doesn't have a body.
+ If the method declares parameters in the Params table, set this to the handle of the first one. Otherwise, set this to the handle of the first parameter declared by the next method definition. If no parameters are declared in the module, .
+
+ is less than -1.
+ A handle to the added method definition.
+
+
+ Defines an implementation for a method declaration within a type.
+ The type definition.
+ The method body entity handle, which can be one of the following: or .
+ The method declaration entity handle, which can be one of the following: or .
+
+ or doesn't have the expected handle kind.
+ A handle to the added method implementation.
+
+
+ Adds import information to a method definition.
+ The method definition handle.
+ The method import attributes.
+ The unmanaged method name.
+ The module containing the unmanaged method.
+
+
+ Associates a method (a getter, a setter, an adder, etc.) with a property or an event.
+ The association entity handle, which can be one of the following: or .
+ The method semantics attributes.
+ The method definition.
+
+ doesn't have the expected handle kind.
+
+
+ Adds a method specification (an instantiation).
+ The generic method entity handle, which can be one of the following: or .
+ The instantiation blob encoding the generic arguments of the method.
+
+ doesn't have the expected handle kind.
+ A handle to the added method specification.
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines a nesting relationship to specified type definitions.
+ The nested type definition handle.
+ The enclosing type definition handle.
+
+
+ Adds a parameter definition.
+ The parameter attributes.
+ Optional. The parameter name.
+ The sequence number of the parameter. A value of 0 refers to the owner method's return type; its parameters are then numbered from 1 onward.
+
+ is greater than UInt16.MaxValue.
+ A handle to the added parameter.
+
+
+ Adds a property definition.
+ The property attributes.
+ The property name.
+ The signature of the property.
+ A handle to the added property definition.
+
+
+
+
+
+
+
+
+
+ Adds state machine method debug information.
+ The handle of the method of the state machine (the compiler-generated method).
+ The handle of the kickoff method (the user defined iterator/async method).
+
+
+ Adds a type definition.
+ The type attributes.
+ The type namespace.
+ The type name.
+ The base type entity handle, which can be one of the following: , , , or .
+ If the type declares fields, set this to the handle of the first one. Otherwise, set this to the handle of the first field declared by the next type definition. If no type defines any fields in the module, .
+ If the type declares methods, the handle of the first one. Otherwise, the handle of the first method declared by the next type definition. If no type defines any methods in the module, .
+
+ doesn't have the expected handle kind.
+ A handle to the added type definition.
+
+
+ Defines a type layout of a type definition.
+ The type definition.
+ Specifies that fields should be placed within the type instance at byte addresses which are a multiple of , or at natural alignment for that field type, whichever is smaller. Its value should be one of the following: 0, 1, 2, 4, 8, 16, 32, 64, or 128. A value of zero indicates that the packing size used should match the default for the current platform.
+ Indicates a minimum size of the type instance and is intended to allow for padding. The amount of memory allocated is the maximum of the size calculated from the layout and . Note that if this directive applies to a value type, then the size will be less than 1 MB.
+
+
+ Adds a type reference.
+ The entity declaring the target type, which can be one of the following: , , , , or .
+ The type reference namespace.
+ The type reference name.
+
+ doesn't have the expected handle kind.
+ A handle to the added type reference.
+
+
+
+
+
+ Adds the specified blob to the Blob heap, if it's not there already.
+ The array containing the blob.
+
+ is .
+ A handle to the added or existing blob.
+
+
+ Adds the specified blob from a byte array to the Blob heap, if it's not there already.
+ The array containing the blob.
+
+ is .
+ A handle to the added or existing blob.
+
+
+ Adds the specified blob from an immutable byte array to the Blob heap, if it's not there already.
+ The blob builder instance containing the blob.
+
+ is .
+ A handle to the added or existing blob.
+
+
+ Encodes a string using UTF16 encoding to a blob and adds it to the Blob heap, if it's not there already.
+ The string to add.
+
+ is .
+ A handle to the added or existing blob.
+
+
+ Encodes a string using UTF8 encoding to a blob and adds it to the Blob heap, if it's not there already.
+ The value to add.
+
+ to encode the unpaired surrogates as specified; to replace them with the U+FFFD character.
+
+ is .
+ A handle to the added or existing blob.
+
+
+ Encodes a constant value to a blob and adds it to the Blob heap, if it's not there already. Uses UTF16 to encode string constants.
+ The constant value to add.
+ A handle to the added or existing blob.
+
+
+ Encodes a debug document name and adds it to the Blob heap, if it's not there already.
+ The document name to add.
+
+ is .
+ A handle to the added or existing document name blob.
+
+
+ Adds the specified Guid to the Guid heap, if it's not there already.
+ The Guid to add.
+ A handle to the added or existing Guid.
+
+
+ Adds the specified string to the string heap, if it's not there already.
+ The string to add.
+
+ is .
+ A handle to the added or existing string.
+
+
+ Adds the specified string to the user string heap, if it's not there already.
+ The string to add.
+ The remaining space on the heap is too small to fit the string.
+
+ is .
+ A handle to the added or existing string. This value may be used in .
+
+
+ Returns the current number of items in the specified table.
+ The table index.
+
+ is not a valid table index.
+ The number of items in the table.
+
+
+ Returns the current number of items in each table.
+ An array of size , with each item filled with the current row count of the corresponding table.
+
+
+ Reserves space on the Guid heap for a GUID.
+ The remaining space on the heap is too small to fit the string.
+ A handle to the reserved Guid and a representing the GUID blob as stored on the heap.
+
+
+ Reserves space on the user string heap for a string of the specified length.
+ The number of characters to reserve.
+ The remaining space on the heap is too small to fit the string.
+
+ is negative.
+ A handle to the reserved user string and a representing the entire User String blob (including its length and terminal character). The handle may be used in .
+ Use to fill in the blob content.
+
+
+ Sets the capacity of the specified heap.
+ The heap index.
+ The number of bytes.
+
+ is not a valid heap index.
+
+-or-
+
+ is negative.
+
+
+ Sets the capacity of the specified table.
+ The table index.
+ The number of rows in the table.
+
+ is not a valid table index.
+
+-or-
+
+ is negative.
+
+
+ Provides extension methods for working with certain raw elements of the ECMA-335 metadata tables and heaps.
+
+
+ Enumerates entries of EnC log.
+
+
+ is .
+
+
+ Enumerates entries of EnC map.
+
+
+ is .
+
+
+ Returns the offset from the start of metadata to the specified heap.
+
+
+
+ is .
+
+ is not a valid heap index.
+
+
+ Returns the size of the specified heap.
+
+
+
+ is .
+
+ is not a valid heap index.
+
+
+ Returns the handle to the that follows the given one in the heap or a nil handle if it is the last one.
+
+
+
+ is .
+
+
+ Returns the a handle to the string that follows the given one in the string heap, or a nil handle if it is the last one.
+
+
+
+ is .
+
+
+ Returns the a handle to the UserString that follows the given one in the UserString heap or a nil handle if it is the last one.
+
+
+
+ is .
+
+
+ Returns the offset from the start of metadata to the specified table.
+
+
+
+ is .
+
+ is not a valid table index.
+
+
+ Returns the number of rows in the specified table.
+
+
+
+ is .
+
+ is not a valid table index.
+
+
+ Returns the size of a row in the specified table.
+
+
+
+ is .
+
+ is not a valid table index.
+
+
+ Enumerate types that define one or more events.
+
+ The resulting sequence corresponds exactly to entries in EventMap table, i.e. n-th returned is stored in n-th row of EventMap.
+
+
+ Enumerate types that define one or more properties.
+
+ The resulting sequence corresponds exactly to entries in the property map table, that is, the n-th returned is stored in n-th row of the property map.
+
+
+ Given a type handle and a raw type kind found in a signature blob determines whether the target type is a value type or a reference type.
+
+
+
+
+
+ Builder of a Metadata Root to be embedded in a Portable Executable image.
+
+
+ Creates a builder of a metadata root.
+ Builder populated with metadata entities stored in tables and values stored in heaps. The entities and values will be enumerated when serializing the metadata root.
+ The version string written to the metadata header. The default value is "v4.0.30319".
+
+ to suppress basic validation of metadata tables during serialization; otherwise, .
+
+ is .
+
+ is too long (the number of bytes when UTF8-encoded must be less than 255).
+
+
+ Serializes metadata root content into the given .
+ Builder to write to.
+ The relative virtual address of the start of the method body stream. Used to calculate the final value of RVA fields of MethodDef table.
+ The relative virtual address of the start of the field init data stream. Used to calculate the final value of RVA fields of FieldRVA table.
+
+ is .
+
+ or is negative.
+ A metadata table is not ordered as required by the specification and is .
+
+
+ The metadata version.
+ A string that represents the metadata version.
+
+
+ Returns sizes of various metadata structures.
+
+
+ Determines if basic validation of metadata tables should be suppressed. The validation verifies that entries in the tables were added in order required by the ECMA specification. It does not enforce all specification requirements on metadata tables.
+
+ to suppress basic validation of metadata tables; otherwise, .
+
+
+ Provides information on sizes of various metadata structures.
+
+
+ Returns aligned size of the specified heap.
+
+
+
+ External table row count.
+
+
+ Exact (unaligned) heap sizes.
+
+
+ Table row counts.
+
+
+
+ Maximum number of tables that can be present in Ecma335 metadata.
+
+
+ Maximum number of tables that can be present in Ecma335 metadata.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Creates an entity handle from a token value.
+
+
+ is not a valid metadata entity token.
+
+
+ Creates an from a token value.
+
+
+
+ is not a valid table index.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets the offset of metadata heap data that corresponds to the specified .
+
+ Zero based offset, or -1 if can only be interpreted in a context of a specific or .
+
+
+ Gets the offset of metadata heap data that corresponds to the specified .
+
+ 1-based index into the #Guid heap. Unlike other heaps, which are essentially byte arrays, the #Guid heap is an array of 16-byte GUIDs.
+
+
+ Gets the offset of metadata heap data that corresponds to the specified .
+
+ An offset in the corresponding heap, or -1 if can only be interpreted in a context of a specific or .
+
+
+ Gets the offset of metadata heap data that corresponds to the specified in the context of .
+
+
+ The operation is not supported for the specified .
+ The is invalid.
+ Zero based offset, or -1 if isn't a metadata heap handle.
+
+
+ Gets the offset of metadata heap data that corresponds to the specified .
+
+ Zero-based offset, or -1 if can only be interpreted in a context of a specific or .
+
+
+ Gets the offset of metadata heap data that corresponds to the specified .
+
+ Zero-based offset.
+
+
+ Gets the row number of a metadata table entry that corresponds to the specified .
+
+ One based row number, or -1 if can only be interpreted in a context of a specific .
+ See .
+
+
+ Gets the row number of a metadata table entry that corresponds to the specified in the context of .
+
+
+ The is not a valid metadata table handle.
+ One based row number.
+
+
+ Gets the metadata token of the specified .
+
+ Metadata token, or 0 if can only be interpreted in a context of a specific .
+
+
+ Gets the metadata token of the specified .
+
+ Handle represents a metadata entity that doesn't have a token.
+ A token can only be retrieved for a metadata table handle or a heap handle of type .
+ Metadata token, or 0 if can only be interpreted in a context of a specific .
+
+
+ Gets the metadata token of the specified in the context of .
+
+
+ The operation is not supported for the specified .
+ Metadata token.
+
+
+ Gets the metadata token of the specified in the context of .
+
+
+ Handle represents a metadata entity that doesn't have a token.
+ A token can only be retrieved for a metadata table handle or a heap handle of type .
+ The operation is not supported for the specified .
+ Metadata token.
+
+
+
+
+
+ Creates a handle from a token value.
+
+
+ is not a valid metadata token.
+ It must encode a metadata table entity or an offset in the heap.
+
+
+ Creates an from a token value.
+
+
+
+ is not a valid table index.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets the of the heap corresponding to the specified .
+ Handle type.
+ Heap index.
+
+ if the handle type corresponds to an Ecma335 heap; otherwise.
+
+
+ Gets the of the table corresponding to the specified .
+ Handle type.
+ Table index.
+
+ if the handle type corresponds to an Ecma335 or Portable PDB table; otherwise.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines method body attributes.
+
+
+ Initializes any locals the method defines to zero and dynamically allocates local memory.
+
+
+ Performs no local memory initialization.
+
+
+ Provides an encoder for a method body stream.
+
+
+
+
+
+ Encodes a method body and adds it to the method body stream, using the provided code size, maximum stack size, number of exception regions, local variables' signature handle, method body attributes and allowing to indicate whether the exception regions should be encoded in small format or not.
+ The number of bytes to be reserved for instructions.
+ The maximum stack size.
+ The number of exception regions.
+
+ if the exception regions should be encoded in small format; otherwise.
+ The local variables' signature handle.
+ The method body attributes.
+
+ , , or is out of the allowed range.
+ The offset of the encoded body within the method body stream.
+
+
+ Encodes a method body and adds it to the method body stream, using the provided code size, maximum stack size, number of exception regions, local variables' signature handle, method body attributes, allowing to indicate whether the exception regions should be encoded in small format or not, and allowing to indicate whether the method should allocate from the dynamic local memory pool or not.
+ The number of bytes to be reserved for instructions.
+ The maximum stack size.
+ The number of exception regions.
+
+ if the exception regions should be encoded in small format; otherwise.
+ The local variables' signature handle.
+ The method body attributes.
+
+ if the method allocates from the dynamic local memory pool (the instruction); otherwise.
+
+ , , or is out of the allowed range.
+ The offset of the encoded body within the method body stream.
+
+
+ Encodes a method body and adds it to the method body stream.
+ The instruction encoder.
+ The maximum stack size.
+ The local variables' signature handle.
+ The method body attributes.
+
+ has default value.
+
+ is out of range [0, UInt16.MaxValue].
+ A label targeted by a branch in the instruction stream has not been marked, or the distance between a branch instruction and the target label doesn't fit the size of the instruction operand.
+ The offset of the encoded body within the method body stream.
+
+
+ Encodes a method body and adds it to the method body stream, using the provided instruction encoder, maximum stack size, local variables' signature handle, method body attributes, and allowing to indicate whether the method should allocate from the dynamic local memory pool or not.
+ The instruction encoder.
+ The maximum stack size.
+ The local variables' signature handle.
+ The method body attributes.
+
+ if the method allocates from the dynamic local memory pool (the IL contains the instruction); otherwise.
+
+ has default value.
+
+ is out of range [0, UInt16.MaxValue].
+ A label targeted by a branch in the instruction stream has not been marked, or the distance between a branch instruction and the target label doesn't fit the size of the instruction operand.
+ The offset of the encoded body within the method body stream.
+
+
+
+ Describes a method body. This class is meant to used along with the class.
+
+
+ Gets an encoder object that can be used to encode exception regions to the method body.
+ An exception region encoder instance.
+
+
+ Gets a blob reserved for instructions.
+ A blob reserved for instructions.
+
+
+ Gets the offset of the encoded method body in the method body stream.
+ The offset of the encoded method body in the method body stream.
+
+
+ Provides an encoder for method signatures.
+
+
+
+
+
+
+ Encodes the provided return type and parameters.
+ The number of parameters.
+ The method that is called first to encode the return type.
+ The method that is called second to encode the parameters.
+
+ or is .
+
+
+ Encodes the provided return type and parameters, which must be used in the order they appear in the parameter list.
+ The number of parameters.
+ The method that is called first to encode the return types.
+ The method that is called second to encode the parameters.
+
+
+
+
+
+ Initializes a new instance of the structure.
+ A builder for encoding the named argument.
+
+
+ Encodes a named argument (a field or property).
+
+ to encode a field, to encode a property.
+ The method to call first to encode the type of the argument.
+ The method to call second to encode the name of the field or property.
+ The method to call third to encode the literal value of the argument.
+
+ , or is .
+
+
+ Encodes a named argument (a field or property) and returns three encoders that must be used in the order they appear in the parameter list.
+
+ to encode a field, to encode a property.
+ The method to call first to encode the type of the argument.
+ The method to call second to encode the name of the field or property.
+ The method to call third to encode the literal value of the argument.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Represents the builder of a Portable PDB image.
+
+
+ Creates a builder of a Portable PDB image.
+ A builder populated with debug metadata entities stored in tables and values stored in heaps. The entities and values are enumerated when serializing the Portable PDB image.
+ The row counts of all tables that the associated type system metadata contain. Each slot in the array corresponds to a table (). The length of the array must be equal .
+ An entry point method definition handle.
+ A function that calculates the ID of content represented as a sequence of blobs. If not specified, a default function that ignores the content and returns a content ID based on the current time is used (). You must specify a deterministic function to produce a deterministic Portable PDB image.
+
+ or is .
+
+
+ Serializes portable PDB content into the given .
+ The builder to write to.
+
+ is .
+ The ID of the serialized content.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Encodes a constant literal.
+ A constant of type , , , , , , , , , , , (encoded as a two-byte Unicode character), (encoded as SerString), or (encoded as the underlying integer value).
+ Unexpected constant type.
+
+
+ Encodes a literal of type .
+
+
+ Encodes a literal of type (which can possibly be ).
+ The name of the type, or .
+
+ is empty.
+
+
+
+ Decodes signature blobs.
+
+
+
+
+ Creates a new .
+ The provider used to obtain type symbols as the signature is decoded.
+ The metadata reader from which the signature was obtained. It may be if the given provider allows it.
+ Additional context needed to resolve generic parameters.
+
+
+ Decodes a field signature blob and advances the reader past the signature.
+ The blob reader positioned at a field signature.
+ The decoded field type.
+
+
+ Decodes a local variable signature blob and advances the reader past the signature.
+ The blob reader positioned at a local variable signature.
+ The local variable signature is invalid.
+ The local variable types.
+
+
+ Decodes a method (definition, reference, or standalone) or a property signature blob.
+ A blob reader positioned at a method signature.
+ The method signature is invalid.
+ The decoded method signature.
+
+
+ Decodes a method specification signature blob and advances the reader past the signature.
+ A blob reader positioned at a valid method specification signature.
+ The types used to instantiate a generic method via the method specification.
+
+
+ Decodes a type embedded in a signature and advances the reader past the type.
+ The blob reader positioned at the leading .
+
+ to allow a to follow a (CLASS | VALUETYPE) in the signature; otherwise.
+ The reader was not positioned at a valid signature type.
+ The decoded type.
+
+
+
+
+
+
+ Encodes an array type.
+ Called first, to encode the type of the element.
+ Called second, to encode the shape of the array.
+
+ or is .
+
+
+ Encodes an array type. Returns a pair of encoders that must be used in the order they appear in the parameter list.
+ Use first, to encode the type of the element.
+ Use second, to encode the shape of the array.
+
+
+
+
+
+ Starts a signature of a type with custom modifiers.
+
+
+
+ Starts a function pointer signature.
+ Calling convention.
+ Function pointer attributes.
+ Generic parameter count.
+
+ is invalid.
+
+ is not in range [0, 0xffff].
+
+
+ Starts a generic instantiation signature.
+
+ or .
+ Generic argument count.
+
+ to mark the type as value type, to mark it as a reference type in the signature.
+
+ doesn't have the expected handle kind.
+
+ is not in range [1, 0xffff].
+
+
+ Encodes a reference to type parameter of a containing generic method.
+ Parameter index.
+
+ is not in range [0, 0xffff].
+
+
+ Encodes a reference to type parameter of a containing generic type.
+ Parameter index.
+
+ is not in range [0, 0xffff].
+
+
+
+
+
+
+
+ Starts pointer signature.
+
+
+ Writes primitive type code.
+ Any primitive type code except for and .
+
+ is not valid in this context.
+
+
+
+
+
+ Starts SZ array (vector) signature.
+
+
+ Encodes a reference to a type.
+
+ or .
+
+ to mark the type as value type, to mark it as a reference type in the signature.
+
+ doesn't have the expected handle kind.
+
+
+
+
+
+
+ Encodes a void pointer (void*).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Represents a metadata entity (such as a type reference, type definition, type specification, method definition, or custom attribute).
+
+
+
+
+ Returns a value that indicates whether the current instance and the specified object are equal.
+ The object to compare with the current instance.
+
+ if is an and is equal to the current instance; otherwise, .
+
+
+ Returns a value that indicates whether the current instance and the specified are equal.
+ The value to compare with the current instance.
+
+ if the current instance and are equal; otherwise, .
+
+
+ Returns the hash code for this instance.
+ The hash code for this instance.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns an enumerator that iterates through the collection.
+ An enumerator that can be used to iterate through the collection.
+
+
+ Returns an enumerator that iterates through a collection.
+ An object that can be used to iterate through the collection.
+
+
+ Gets the number of elements in the collection.
+ The number of elements in the collection.
+
+
+
+ Advances the enumerator to the next element of the collection.
+
+ if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
+
+
+ Sets the enumerator to its initial position, which is before the first element in the collection.
+
+
+ Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+
+ Gets a TypeRef, TypeDef, or TypeSpec handle if the region represents a catch, or a nil token otherwise (()).
+
+
+ Gets the IL offset of the start of the filter block, or -1 if the region is not a filter.
+
+
+ Gets the length in bytes of the exception handler.
+
+
+ Gets the starting IL offset of the exception handler.
+
+
+
+ Gets the length in bytes of the try block.
+
+
+ Gets the starting IL offset of the try block.
+
+
+
+
+
+
+
+
+
+
+ Gets a handle to resolve the implementation of the target type.
+
+
+
+
+ representing another module in the assembly.
+
+
+
+ representing another assembly if is .
+
+
+
+ representing the declaring exported type in which this was is nested.
+
+
+
+
+
+
+ Gets the name of the target type, or if the type is nested or defined in a root namespace.
+ A struct instance.
+
+
+ Gets the full name of the namespace that contains the target type, or if the type is nested or defined in a root namespace.
+
+
+ Gets the definition handle of the namespace where the target type is defined, or if the type is nested or defined in a root namespace.
+
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Represents a collection of instances.
+
+
+
+ Returns an enumerator that iterates through the collection.
+ An enumerator that can be used to iterate through the collection.
+
+
+ Returns an enumerator that iterates through a collection.
+ An object that can be used to iterate through the collection.
+
+
+ Gets the number of elements in the collection.
+ The number of elements in the collection.
+
+
+
+ Advances the enumerator to the next element of the collection.
+
+ if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
+
+
+ Sets the enumerator to its initial position, which is before the first element in the collection.
+
+
+ Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns the field layout offset, or -1 if it is not available.
+ The field definition offset, or -1 if it is not available.
+
+
+
+
+
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns an enumerator that iterates through the collection.
+ An enumerator that can be used to iterate through the collection.
+
+
+ Returns an enumerator that iterates through a collection.
+ An object that can be used to iterate through the collection.
+
+
+ Gets the number of elements in the collection.
+ The number of elements in the collection.
+
+
+
+ Advances the enumerator to the next element of the collection.
+
+ if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
+
+
+ Sets the enumerator to its initial position, which is before the first element in the collection.
+
+
+ Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+
+
+
+ Gets the attributes specifying variance and constraints.
+
+
+ Gets the zero-based index of the parameter within the declaring generic type or method declaration.
+
+
+ Gets the name of the generic parameter.
+
+
+ Gets a or that represents the parent of this generic parameter.
+
+
+
+
+ Gets the constrained .
+
+
+ Gets a handle (, , or )
+ specifying from which type this generic parameter is constrained to derive,
+ or which interface this generic parameter is constrained to implement.
+ An instance.
+
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Represents a collection of constraints of a generic type parameter.
+
+
+
+ Returns an enumerator that iterates through the collection.
+ An enumerator that can be used to iterate through the collection.
+
+
+ Returns an enumerator that iterates through a collection.
+ An object that can be used to iterate through the collection.
+
+
+ Gets the number of elements in the collection.
+ The number of elements in the collection.
+
+
+ Gets the element at the specified index in the read-only list.
+ The zero-based index of the element to get.
+ The element at the specified index in the read-only list.
+
+
+
+ Advances the enumerator to the next element of the collection.
+
+ if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
+
+
+ Sets the enumerator to its initial position, which is before the first element in the collection.
+
+
+ Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Represents a collection of generic type parameters of a method or type.
+
+
+
+ Returns an enumerator that iterates through the collection.
+ An enumerator that can be used to iterate through the collection.
+
+
+ Returns an enumerator that iterates through a collection.
+ An object that can be used to iterate through the collection.
+
+
+ Gets the number of elements in the collection.
+ The number of elements in the collection.
+
+
+ Gets the element at the specified index in the read-only list.
+ The zero-based index of the element to get.
+ The element at the specified index in the read-only list.
+
+
+
+ Advances the enumerator to the next element of the collection.
+
+ if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
+
+
+ Sets the enumerator to its initial position, which is before the first element in the collection.
+
+
+ Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Represents any metadata entity (such as a type reference, a type definition, a type specification, a method definition, or a custom attribute) or value (a string, blob, guid, or user string).
+
+
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Compares two entity handles.
+ The first entity handle to compare.
+ The second entity handle to compare.
+ Zero if the two entity handles are equal, and a non-zero value of they are not.
+
+
+ Compares two handles.
+ The first handle to compare.
+ The second handle to compare.
+ Zero if the two handles are equal, and a non-zero value if they are not.
+
+
+ Determines whether the specified objects are equal.
+ The first object of type to compare.
+ The second object of type to compare.
+
+ if the specified objects are equal; otherwise, .
+
+
+ Determines whether the specified objects are equal.
+ The first object of type to compare.
+ The second object of type to compare.
+
+ if the specified objects are equal; otherwise, .
+
+
+ Returns a hash code for the specified object.
+ The for which a hash code is to be returned.
+ A hash code for the specified object.
+
+
+ Returns a hash code for the specified object.
+ The for which a hash code is to be returned.
+ A hash code for the specified object.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets the type symbol for a generalized array of the given element type and shape.
+ The type of the elements in the array.
+ The shape (rank, sizes, and lower bounds) of the array.
+
+
+ Gets the type symbol for a managed pointer to the given element type.
+
+
+
+ Gets the type symbol for a generic instantiation of the given generic type with the given type arguments.
+
+
+
+
+ Gets the type symbol for an unmanaged pointer to the given element type.
+
+
+
+
+
+
+ Gets the representation for .
+
+
+ Gets the type symbol for the given serialized type name.
+ The serialized type name in so-called "reflection notation" format (as understood by the method.)
+ The name is malformed.
+ A instance.
+
+
+ Gets the underlying type of the given enum type symbol.
+ An enum type.
+ The given type symbol does not represent an enum.
+ A type code that indicates the underlying type of the enumeration.
+
+
+ Verifies if the given type represents .
+ The type to verify.
+
+ if the given type is a , otherwise.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Calculates the size of the specified branch instruction operand.
+ The branch op-code.
+ The specified is not a branch op-code.
+ 1 if is a short branch, or 4 if it is a long branch.
+
+
+ Gets a long form of the specified branch op-code.
+ The branch op-code.
+ The specified is not a branch op-code.
+ The long form of the branch op-code.
+
+
+ Gets a short form of the specified branch op-code.
+ The branch op-code.
+ The specified is not a branch op-code.
+ The short form of the branch op-code.
+
+
+ Verifies if the specified op-code is a branch to a label.
+
+
+ if the specified op-code is a branch to a label, otherwise.
+
+
+ The exception that is thrown when an attempt to write metadata exceeds a limit given by the format specification. For example, when the heap size limit is exceeded.
+
+
+ Initializes a new instance of the class.
+
+
+ Initializes a new instance of the class with serialized data.
+ The object that holds the serialized object data.
+ The contextual information about the source or destination.
+
+
+ Initializes a new instance of the class with a specified error message.
+ The error message that explains the reason for this exception.
+
+
+ Initializes a new instance of the class with a specified error message and the exception that is the cause of this exception.
+ The error message that explains the reason for this exception.
+ The exception that is the cause of the current exception, or if no inner exception is specified.
+
+
+
+
+
+
+
+
+
+
+ Returns an enumerator that iterates through the collection.
+ An enumerator that can be used to iterate through the collection.
+
+
+ Returns an enumerator that iterates through a collection.
+ An object that can be used to iterate through the collection.
+
+
+
+ Advances the enumerator to the next element of the collection.
+ Invalid blob format.
+
+ if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
+
+
+ Sets the enumerator to its initial position, which is before the first element in the collection.
+
+
+ Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+
+
+
+
+
+
+
+
+
+
+ Provides information about the lexical scope within which a group of imports are available. This information is stored in debug metadata.
+
+
+
+
+
+
+
+ Returns an enumerator that iterates through the collection.
+ An enumerator that can be used to iterate through the collection.
+
+
+ Returns an enumerator that iterates through a collection.
+ An object that can be used to iterate through the collection.
+
+
+ Gets the number of elements in the collection.
+ The number of elements in the collection.
+
+
+
+ Advances the enumerator to the next element of the collection.
+
+ if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
+
+
+ Sets the enumerator to its initial position, which is before the first element in the collection.
+
+
+ Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets the interface that is implemented (, , or ).
+
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns an enumerator that iterates through the collection.
+ An enumerator that can be used to iterate through the collection.
+
+
+ Returns an enumerator that iterates through a collection.
+ An object that can be used to iterate through the collection.
+
+
+ Gets the number of elements in the collection.
+ The number of elements in the collection.
+
+
+
+ Advances the enumerator to the next element of the collection.
+
+ if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
+
+
+ Sets the enumerator to its initial position, which is before the first element in the collection.
+
+
+ Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+
+
+
+
+ Gets the type symbol for the function pointer type of the given method .
+
+ The type symbol for the function pointer type.
+
+
+ Gets the type symbol for the generic method parameter at the given zero-based .
+
+
+ The type symbol for the generic method parameter at .
+
+
+ Gets the type symbol for the generic type parameter at the given zero-based .
+
+
+ The type symbol for the generic type parameter at the given zero-based .
+
+
+ Gets the type symbol for a type with a custom modifier applied.
+ The modifier type applied.
+ The type symbol of the underlying type without modifiers applied.
+
+ if the modifier is required, if it's optional.
+ The type symbol.
+
+
+ Gets the type symbol for a local variable type that is marked as pinned.
+
+ The type symbol for the local variable type.
+
+
+ Gets the type symbol for a type specification.
+ The metadata reader that was passed to the signature decoder. It may be .
+ The context that was passed to the signature decoder.
+ The type specification handle.
+ The kind of the type, as specified in the signature. To interpret this value, use .
+ The type symbol for the type specification.
+
+
+
+
+
+ Gets the type symbol for a primitive type.
+
+ The type symbol for .
+
+
+ Gets the type symbol for a type definition.
+ The metadata reader that was passed to the signature decoder. It may be .
+ The type definition handle.
+ The kind of the type, as specified in the signature. To interpret this value use .
+ The type symbol.
+
+
+ Gets the type symbol for a type reference.
+ The metadata reader that was passed to the signature decoder. It may be .
+ The type definition handle.
+ The kind of the type as specified in the signature. To interpret this value, use .
+ The type symbol.
+
+
+
+
+
+ Gets the type symbol for a single-dimensional array of the given element type with a lower bounds of zero.
+
+ A instance.
+
+
+ Provides information about local constants. This information is stored in debug metadata.
+
+
+
+ Gets the constant signature.
+ The constant signature.
+
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns an enumerator that iterates through the collection.
+ An enumerator that can be used to iterate through the collection.
+
+
+ Returns an enumerator that iterates through a collection.
+ An object that can be used to iterate through the collection.
+
+
+ Gets the number of elements in the collection.
+ The number of elements in the collection.
+
+
+
+ Advances the enumerator to the next element of the collection.
+
+ if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
+
+
+ Sets the enumerator to its initial position, which is before the first element in the collection.
+
+
+ Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+ Provides information about the scope of local variables and constants. This information is stored in debug metadata.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns an enumerator that iterates through the collection.
+ An enumerator that can be used to iterate through the collection.
+
+
+ Returns an enumerator that iterates through a collection.
+ An object that can be used to iterate through the collection.
+
+
+ Gets the number of elements in the collection.
+ The number of elements in the collection.
+
+
+
+ Advances the enumerator to the next element of the collection.
+
+ if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
+
+
+ Sets the enumerator to its initial position, which is before the first element in the collection.
+
+
+ Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+
+ Advances the enumerator to the next element of the collection.
+
+ if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
+
+
+ Sets the enumerator to its initial position, which is before the first element in the collection.
+
+
+ Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+ Provides information about local variables. This information is stored in debug metadata.
+
+
+
+
+
+
+
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns an enumerator that iterates through the collection.
+ An enumerator that can be used to iterate through the collection.
+
+
+ Returns an enumerator that iterates through a collection.
+ An object that can be used to iterate through the collection.
+
+
+ Gets the number of elements in the collection.
+ The number of elements in the collection.
+
+
+
+ Advances the enumerator to the next element of the collection.
+
+ if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
+
+
+ Sets the enumerator to its initial position, which is before the first element in the collection.
+
+
+ Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+
+
+ Gets the manifest resource attributes.
+ A bitwise combination of the enumeration values that specify the manifest resource attributes.
+
+
+ Gets the implementation entity handle.
+ An EntityHandle instance. If the property is , the returned handle will have default values.
+
+
+ Gets the resource name.
+ The resource name.
+
+
+ Gets the byte offset within the referenced file at which this resource record begins.
+ The byte offset within the referenced file at which this resource record begins.
+
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Represents a collection of instances.
+
+
+
+ Returns an enumerator that iterates through the collection.
+ An enumerator that can be used to iterate through the collection.
+
+
+ Returns an enumerator that iterates through a collection.
+ An object that can be used to iterate through the collection.
+
+
+ Gets the number of elements in the collection.
+ The number of elements in the collection.
+
+
+
+ Advances the enumerator to the next element of the collection.
+
+ if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
+
+
+ Sets the enumerator to its initial position, which is before the first element in the collection.
+
+
+ Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Determines if the member reference is to a method or field.
+ The member reference signature is invalid.
+ One of the enumeration values that indicates the kind of member reference.
+
+
+
+ Gets the parent entity handle.
+ An entity handle instance. If the property is , the returned handle will have default values.
+
+
+ Gets a handle to the signature blob.
+ A handle to the signature blob.
+
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Represents a collection of instances.
+
+
+
+ Returns an enumerator that iterates through the collection.
+ An enumerator that can be used to iterate through the collection.
+
+
+ Returns an enumerator that iterates through a collection.
+ An object that can be used to iterate through the collection.
+
+
+ Gets the number of elements in the collection.
+ The number of elements in the collection.
+
+
+
+ Advances the enumerator to the next element of the collection.
+
+ if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
+
+
+ Sets the enumerator to its initial position, which is before the first element in the collection.
+
+
+ Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+ Specifies constants that indicate whether a references a method or field.
+
+
+ The references a field.
+
+
+ The references a method.
+
+
+
+ CLI metadata.
+
+
+ Windows metadata generated by managed compilers.
+
+
+ Windows metadata.
+
+
+ Reads metadata as defined by the ECMA 335 CLI specification.
+
+
+ Initializes a new instance of the class from the metadata stored at the given memory location.
+ A pointer to the first byte in a block of metadata.
+ The number of bytes in the block.
+
+
+ Initializes a new instance of the class from the metadata stored at the given memory location.
+
+
+
+
+
+ Initializes a new instance of the class from the metadata stored at the given memory location.
+
+
+
+
+
+ is not positive.
+
+ is .
+ The encoding of is not .
+ The current platform is big-endian.
+ Bad metadata header.
+
+
+
+
+
+
+ Gets the for a given file.
+ The path to the assembly for which is to be returned.
+
+ is .
+
+ is invalid.
+
+ is not found.
+
+ is not a valid assembly.
+ An that represents the given .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets the information decoded from #Pdb stream, or if the stream is not present.
+ The information decoded from #Pdb stream, or if the stream is not present.
+
+
+
+
+
+
+
+
+ Gets a value that indicates whether the metadata represents an assembly.
+
+ if the metadata represents an assembly; otherwise, .
+
+
+
+
+
+
+
+ Gets the metadata kind.
+ One of the enumeration values that specifies the metadata kind.
+
+
+ Gets the length of the underlying data.
+ The length of the underlying data.
+
+
+ Gets the pointer to the underlying data.
+ The pointer to the underlying data.
+
+
+ Gets the version string read from metadata header.
+ The version string read from metadata header.
+
+
+
+
+ Gets the passed to the constructor.
+ A bitwise combination of the enumeration values that describes the enum value.
+
+
+
+ Gets the comparer used to compare strings stored in metadata.
+ The comparer used to compare strings stored in metadata.
+
+
+
+
+ Gets the decoder used by the reader to produce string instances from UTF8-encoded byte sequences.
+ The decoder used by the reader to produce string instances from UTF8-encoded byte sequences.
+
+
+
+ Windows Runtime projections are enabled (on by default).
+
+
+ The options that are used when a is obtained via an overload that does not take a argument.
+
+
+ All options are disabled.
+
+
+ Provides a for metadata stored in an array of bytes, a memory block, or a stream.
+
+
+ Disposes all memory allocated by the reader.
+
+
+ Creates a metadata provider over an image stored in memory.
+ Pointer to the start of the metadata blob.
+ The size of the metadata blob.
+
+ is .
+
+ is negative.
+ The new metadata provider.
+
+
+ Creates a provider over a byte array.
+ Metadata image.
+
+ is .
+ The new provider.
+
+
+ Creates a provider for a stream of the specified size beginning at its current position.
+ A instance.
+ Options specifying how sections of the image are read from the stream.
+ Size of the metadata blob in the stream. If not specified, the metadata blob is assumed to span to the end of the stream.
+
+ is .
+
+ doesn't support read and seek operations.
+ Size is negative or extends past the end of the stream.
+ Error reading from the stream (only when is specified).
+ The new provider.
+
+
+ Creates a portable PDB metadata provider over a blob stored in memory.
+ Pointer to the start of the portable PDB blob.
+ The size of the portable PDB blob.
+
+ is .
+
+ is negative.
+ The new portable PDB metadata provider.
+
+
+ Creates a portable PDB metadata provider over a byte array.
+ A portable PDB image.
+
+ is .
+ The new portable PDB metadata provider .
+
+
+ Creates a provider for a stream of the specified size beginning at its current position.
+ The stream.
+ Options specifying how sections of the image are read from the stream.
+ Size of the metadata blob in the stream. If not specified, the metadata blob is assumed to span to the end of the stream.
+
+ is .
+
+ doesn't support read and seek operations.
+ Size is negative or extends past the end of the stream.
+ A instance.
+
+
+ Gets a from a .
+ A bitwise combination of the enumeration values that represent the configuration when reading the metadata.
+ The encoding to use.
+ The encoding of is not .
+ The current platform is big-endian.
+ IO error while reading from the underlying stream.
+ Provider has been disposed.
+ A instance.
+
+
+
+ By default, the stream is disposed when is disposed and sections of the PE image are read lazily.
+
+
+ Keeps the stream open when the is disposed.
+
+
+
+ Reads PDB metadata into memory right away.
+ The underlying file may be closed and even deleted after the is constructed. closes the stream automatically by the time the constructor returns unless is specified.
+
+
+
+ Provides string comparison helpers to query strings in metadata while avoiding allocation if possible.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Provides the with a custom mechanism for decoding byte sequences in metadata that represent text.
+
+
+ Initializes a new instance of the class using the given encoding.
+ The encoding to use.
+
+
+ Obtains strings for byte sequences in metadata. Override this to cache strings if required. Otherwise, it is implemented by forwarding straight to and every call will allocate a new string.
+ Pointer to bytes to decode.
+ Number of bytes to decode.
+ The decoded string.
+
+
+ Gets the default decoder used by to decode UTF-8 when no decoder is provided to the constructor.
+ The default decoder used by to decode UTF-8.
+
+
+ Gets the encoding used by this instance.
+ The encoding used by this instance.
+
+
+ Represents the method body in ECMA 335 assembly.
+
+
+ Creates a new instance of the class using the specified blob reader.
+ The blob reader to read the method body.
+
+ The method body data in the specified blob reader is invalid.
+ A new instance of the class.
+
+
+ Gets the IL bytecode of this method body as a byte array.
+ A byte array with the IL bytecode of this method body.
+
+
+ Gets the IL bytecode of this method body as an immutable array.
+ An immutable byte array with the IL bytecode of this method body.
+
+
+ Gets a blob reader that reads the IL bytecode of this method body.
+ A blob reader that reads the IL bytecode of this method body.
+
+
+ Gets the array of exception regions in this method body.
+ The array of exception regions.
+
+
+ Gets the handle to the local variables signature.
+ The handle to the local variables signature.
+
+
+ Gets a value that indicates whether local variables in this method are initialized to default values of their types.
+
+ if local variables are initialized; otherwise, .
+
+
+ Gets the maximum number of items on the evaluation stack for this method.
+ The maximum number of items on the evaluation stack.
+
+
+ Gets the size of the method body, including the header, IL, and exception regions.
+ The size of the method body.
+
+
+ Provides debug information associated with a method definition. This information is stored in debug metadata.
+
+
+ Returns a collection of sequence points decoded from .
+ A collection of sequence points.
+
+
+ Returns the kickoff method of the state machine.
+ The kickoff method of the state machine, if the method is a MoveNext method of a state machine. Otherwise, it returns a handle whose property is .
+
+
+ Gets the handle of the single document containing all sequence points of the method.
+ The handle of the single document containing all sequence points of the method, or a handle whose property is if the method doesn't have sequence points or spans multiple documents.
+
+
+ Returns a local signature handle.
+ A local signature handle, or a handle whose property is if the method doesn't define any local variables.
+
+
+ Returns a blob encoding sequence points.
+ A blob encoding sequence points, or a handle whose property is if the method doesn't have sequence points.
+
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns a handle to a that corresponds to this handle.
+ A method definition handle that corresponds to this handle.
+
+
+
+
+
+ Returns an enumerator that iterates through the collection.
+ An enumerator that can be used to iterate through the collection.
+
+
+ Returns an enumerator that iterates through a collection.
+ An object that can be used to iterate through the collection.
+
+
+ Gets the number of elements in the collection.
+ The number of elements in the collection.
+
+
+
+ Advances the enumerator to the next element of the collection.
+
+ if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
+
+
+ Sets the enumerator to its initial position, which is before the first element in the collection.
+
+
+ Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns a handle to a that corresponds to this handle.
+ A method debug information handle that corresponds to this handle.
+
+
+
+
+
+ Returns an enumerator that iterates through the collection.
+ An enumerator that can be used to iterate through the collection.
+
+
+ Returns an enumerator that iterates through a collection.
+ An object that can be used to iterate through the collection.
+
+
+ Gets the number of elements in the collection.
+ The number of elements in the collection.
+
+
+
+ Advances the enumerator to the next element of the collection.
+
+ if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
+
+
+ Sets the enumerator to its initial position, which is before the first element in the collection.
+
+
+ Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+
+
+
+
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns an enumerator that iterates through the collection.
+ An enumerator that can be used to iterate through the collection.
+
+
+ Returns an enumerator that iterates through a collection.
+ An object that can be used to iterate through the collection.
+
+
+ Gets the number of elements in the collection.
+ The number of elements in the collection.
+
+
+
+ Advances the enumerator to the next element of the collection.
+
+ if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
+
+
+ Sets the enumerator to its initial position, which is before the first element in the collection.
+
+
+ Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+
+
+
+
+ Represents a method (definition, reference, or standalone) or property signature. In the case of properties, the signature matches that of a getter with a distinguishing .
+ The method type.
+
+
+ Initializes a new instance of the structure using the specified header, return type, and parameter information.
+ The information in the leading byte of the signature (kind, calling convention, flags).
+ The return type of the method.
+ The number of required parameters.
+ The number of generic type parameters.
+ The parameter types.
+
+
+ Gets the number of generic type parameters for the method.
+ The number of generic type parameters, or 0 for non-generic methods.
+
+
+ Gets the information in the leading byte of the signature (kind, calling convention, flags).
+ The header signature.
+
+
+ Gets the method's parameter types.
+ An immutable collection of parameter types.
+
+
+ Gets the number of parameters that are required for the method.
+ The number of required parameters.
+
+
+ Gets the return type of the method.
+ The return type.
+
+
+
+
+
+
+
+
+
+
+ Gets a or handle specifying which generic method this instance refers to (that is, which generic method it is an instantiation of).
+ A or handle specifying which generic method this instance refers to.
+
+
+ Gets a handle to the signature blob.
+ A handle to the signature blob.
+
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets all exported types that reside directly in a namespace.
+ An immutable array of exported type handles.
+
+
+ Gets the unqualified name of the namespace definition.
+ The unqualified name of the namespace definition.
+
+
+ Gets the namespace definitions that are direct children of the current namespace definition.
+ An immutable array of namespace definitions that are direct children of the current namespace definition.
+
+
+ Gets the parent namespace.
+ The parent namespace.
+
+
+ Gets all type definitions that reside directly in a namespace.
+ An immutable array of type definition handles.
+
+
+ Provides a handle to a namespace definition.
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Contains a collection of parameters of a specified method.
+
+
+
+ Returns an enumerator that iterates through the collection.
+ An enumerator that can be used to iterate through the collection.
+
+
+ Returns an enumerator that iterates through a collection.
+ An object that can be used to iterate through the collection.
+
+
+ Gets the number of elements in the collection.
+ The number of elements in the collection.
+
+
+
+ Advances the enumerator to the next element of the collection.
+
+ if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
+
+
+ Sets the enumerator to its initial position, which is before the first element in the collection.
+
+
+ Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+
+ Gets a from a .
+ The current instance.
+
+ is .
+ The current platform is big-endian.
+ IO error while reading from the underlying stream.
+ A metadata reader.
+
+
+ Gets a metadata reader with the specified metadata reading configuration from a .
+ The current instance.
+ An enumeration value indicating the metadata reading configuration.
+
+ is .
+ The current platform is big-endian.
+ IO error while reading from the underlying stream.
+ A metadata reader with the specified metadata reading configuration.
+
+
+ Gets a metadata reader with the specified metadata reading configuration and encoding configuration from a .
+ The current instance.
+ An enumeration value indicating the metadata reading configuration.
+ A metadata string decoder with the encoding configuration.
+
+ is .
+ The encoding of is not .
+ The current platform is big-endian.
+ IO error while reading from the underlying stream.
+ >A metadata reader with the specified metadata reading configuration and encoding configuration.
+
+
+ Returns a body block of a method with the specified Relative Virtual Address (RVA).
+ The current instance.
+ The Relative Virtual Address (RVA).
+
+ is .
+ The body is not found in the metadata or is invalid.
+ The section where the method is stored is not available.
+ IO error occurred while reading from the underlying stream.
+ A method block body instance.
+
+
+ Specifies constants that define the type codes used to encode types of primitive values in a value blob.
+
+
+ A type.
+
+
+ An unsigned 1-byte integer type.
+
+
+ A type.
+
+
+ An 8-byte floating point type.
+
+
+ A signed 2-byte integer type.
+
+
+ A signed 4-byte integer type.
+
+
+ A signed 8-byte integer type.
+
+
+ A signed 1-byte integer type.
+
+
+ A 4-byte floating point type.
+
+
+ A type.
+
+
+ An unsigned 2-byte integer type.
+
+
+ An unsigned 4-byte integer type.
+
+
+ An unsigned 8-byte integer type.
+
+
+ Specifies constants that define primitive types found in metadata signatures.
+
+
+ A type.
+
+
+ A type.
+
+
+ A type.
+
+
+ A type.
+
+
+ An type.
+
+
+ An type.
+
+
+ An type.
+
+
+ An type.
+
+
+ An type.
+
+
+ An type.
+
+
+ A type.
+
+
+ A type.
+
+
+ A typed reference.
+
+
+ A type.
+
+
+ A type.
+
+
+ A type.
+
+
+ A type.
+
+
+ A type.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns an enumerator that iterates through the collection.
+ An enumerator that can be used to iterate through the collection.
+
+
+ Returns an enumerator that iterates through a collection.
+ An object that can be used to iterate through the collection.
+
+
+ Gets the number of elements in the collection.
+ The number of elements in the collection.
+
+
+
+ Advances the enumerator to the next element of the collection.
+
+ if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
+
+
+ Sets the enumerator to its initial position, which is before the first element in the collection.
+
+
+ Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+ Represents a handle and a corresponding blob on a metadata heap that was reserved for future content update.
+
+
+
+ Returns a to be used to update the content.
+ A blob writer to be used to update the content.
+
+
+
+ Gets the reserved blob handle.
+ The reserved bloc handle.
+
+
+ Represents a Portable PDB sequence point.
+
+
+ Specifies a line number value for a hidden sequence point.
+
+
+ Indicates whether the current sequence point is equal to the specified object.
+ The object to compare with the current object.
+
+ if the current sequence point is equal to the parameter; otherwise, .
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+ Gets the hash code of this sequence point.
+ The hash code of this sequence point.
+
+
+ Gets the source document that contains this sequence point.
+ The source document that contains this sequence point.
+
+
+ Gets the column number of the last character in this sequence point.
+ The column number of the last character in this sequence point.
+
+
+ Gets the line number of the last character in this sequence point.
+ The line number of the last character in this sequence point.
+
+
+ Gets a value that indicates whether this sequence point is hidden.
+
+ if this sequence point is hidden; otherwise, .
+
+
+ Gets the IL offset of this sequence point from the start of the method body, in bytes.
+ The IL offset of this sequence point from the start of the method body, in bytes.
+
+
+ Gets the column number of the first character in this sequence point.
+ The column number of the first character in this sequence point.
+
+
+ Gets the line number of the first character in this sequence point.
+ The line number of the first character in this sequence point.
+
+
+
+
+ Returns an enumerator that iterates through the collection.
+ An enumerator that can be used to iterate through the collection.
+
+
+ Returns an enumerator that iterates through a collection.
+ An object that can be used to iterate through the collection.
+
+
+
+ Advances the enumerator to the next element of the collection.
+
+ if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
+
+
+ Sets the enumerator to its initial position, which is before the first element in the collection.
+
+
+ Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+ Specifies type codes used to encode the types of values in a blob.
+
+
+ A value equivalent to .
+
+
+ A value equivalent to .
+
+
+ A value equivalent to .
+
+
+ A value equivalent to .
+
+
+ The attribute argument is an Enum instance.
+
+
+ A value equivalent to .
+
+
+ A value equivalent to .
+
+
+ A value equivalent to .
+
+
+ A value equivalent to .
+
+
+ A value equivalent to .
+
+
+ A value equivalent to .
+
+
+ A value equivalent to .
+
+
+ A value equivalent to .
+
+
+ The attribute argument is "boxed" (passed to a parameter, field, or property of type object) and carries type information in the attribute blob.
+
+
+ The attribute argument is a instance.
+
+
+ A value equivalent to .
+
+
+ A value equivalent to .
+
+
+ A value equivalent to .
+
+
+ Specifies additional flags that can be applied to method signatures. The underlying values of the fields in this type correspond to the representation in the leading signature byte represented by a structure.
+
+
+ Indicates the first explicitly declared parameter that represents the instance pointer.
+
+
+ A generic method.
+
+
+
+ An instance method.
+ The Ecma 335 CLI Specification refers to this flag as .
+
+
+
+ No flags.
+
+
+ Specifies how arguments in a given signature are passed from the caller to the callee. The underlying values of the fields in this type correspond to the representation in the leading signature byte represented by a structure.
+
+
+ An unmanaged C/C++ style calling convention where the call stack is cleaned by the caller.
+
+
+ A managed calling convention with a fixed-length argument list.
+
+
+ An unmanaged calling convention where arguments are passed in registers when possible.
+
+
+ An unmanaged calling convention where the call stack is cleaned up by the callee.
+
+
+ An unmanaged C++ style calling convention for calling instance member functions with a fixed argument list.
+
+
+ Indicates that the specifics of the unmanaged calling convention are encoded as modopts.
+
+
+ A managed calling convention for passing extra arguments.
+
+
+ Represents the signature characteristics specified by the leading byte of signature blobs.
+
+
+ Gets the mask value for the calling convention or signature kind. The default value is 15 (0x0F).
+
+
+ Initializes a new instance of the structure using the specified byte value.
+ The byte.
+
+
+ Initializes a new instance of the structure using the specified signature kind, calling convention and signature attributes.
+ The signature kind.
+ The calling convention.
+ The signature attributes.
+
+
+ Compares the specified object with this for equality.
+ The object to compare.
+
+ if the objects are equal; otherwise, .
+
+
+ Compares two values for equality.
+ The value to compare.
+
+ if the values are equal; otherwise, .
+
+
+ Gets a hash code for the current object.
+ A hash code for the current object.
+
+
+ Compares two values for equality.
+ The first value to compare.
+ The second value to compare.
+
+ if the values are equal; otherwise, .
+
+
+ Determines whether two values are unequal.
+ The first value to compare.
+ The second value to compare.
+
+ if the values are unequal; otherwise, .
+
+
+ Returns a string that represents the current object.
+ A string that represents the current object.
+
+
+ Gets the signature attributes.
+ The attributes.
+
+
+ Gets the calling convention.
+ The calling convention.
+
+
+ Gets a value that indicates whether this structure has the signature attribute.
+
+ if the attribute is present; otherwise, .
+
+
+ Gets a value that indicates whether this structure has the signature attribute.
+
+ if the attribute is present; otherwise, .
+
+
+ Gets a value that indicates whether this structure has the signature attribute.
+
+ if the attribute is present; otherwise, .
+
+
+ Gets the signature kind.
+ The signature kind.
+
+
+ Gets the raw value of the header byte.
+ The raw value of the header byte.
+
+
+ Specifies the signature kind. The underlying values of the fields in this type correspond to the representation in the leading signature byte represented by a structure.
+
+
+ A field signature.
+
+
+ A local variables signature.
+
+
+ A method reference, method definition, or standalone method signature.
+
+
+ A method specification signature.
+
+
+ A property signature.
+
+
+ Specifies constants that define type codes used in signature encoding.
+
+
+ Represents a generalized in signatures.
+
+
+ Represents a in signatures.
+
+
+ Represents managed pointers (byref return values and parameters) in signatures. It is followed in the blob by the signature encoding of the underlying type.
+
+
+ Represents a in signatures.
+
+
+ Represents a in signatures.
+
+
+ Represents a in signatures.
+
+
+ Represents function pointer types in signatures.
+
+
+ Represents a generic method parameter used within a signature.
+
+
+ Represents the instantiation of a generic type in signatures.
+
+
+ Represents a generic type parameter used within a signature.
+
+
+ Represents an in signatures.
+
+
+ Represents an in signatures.
+
+
+ Represents an in signatures.
+
+
+ Represents an in signatures.
+
+
+ Represents an invalid or uninitialized type code. It will not appear in valid signatures.
+
+
+ Represents an in signatures.
+
+
+ Represents a custom modifier applied to a type within a signature that the caller can ignore.
+
+
+ Represents a local variable that is pinned by garbage collector.
+
+
+ Represents an unmanaged pointer in signatures. It is followed in the blob by the signature encoding of the underlying type.
+
+
+ Represents a custom modifier applied to a type within a signature that the caller must understand.
+
+
+ Represents an in signatures.
+
+
+ Represents a marker to indicate the end of fixed arguments and the beginning of variable arguments.
+
+
+ Represents a in signatures.
+
+
+ Represents a in signatures.
+
+
+ Represents a single dimensional with a lower bound of 0.
+
+
+ Represents a typed reference in signatures.
+
+
+ Precedes a type in signatures. In raw metadata, this is encoded as either ELEMENT_TYPE_CLASS (0x12) for reference types or ELEMENT_TYPE_VALUETYPE (0x11) for value types. This is collapsed to a single code because Windows Runtime projections can project from class to value type or vice-versa, and the raw code is misleading in those cases.
+
+
+ Represents a in signatures.
+
+
+ Represents a in signatures.
+
+
+ Represents a in signatures.
+
+
+ Represents a in signatures.
+
+
+ Represents in signatures.
+
+
+ Indicates the type definition of the signature.
+
+
+ The type definition or reference refers to a class.
+
+
+ It isn't known in the current context if the type reference or definition is a class or value type.
+
+
+ The type definition or reference refers to a value type.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Determines the kind of signature, which can be or .
+ The signature is invalid.
+ An enumeration value that indicates the signature kind.
+
+
+ Gets a handle to the signature blob.
+ A handle to the signature blob.
+
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Indicates whether a represents a standalone method or local variable signature.
+
+
+ The references a local variable signature.
+
+
+ The represents a standalone method signature.
+
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns the enclosing type of a specified nested type.
+ The enclosing type of the specified nested type, or a handle a handle whose property is if the type is not nested.
+
+
+
+
+
+
+
+
+
+ Returns an array of types nested in the specified type.
+ An immutable array of type definition handles that represent types nested in the specified type.
+
+
+
+
+ Gets the base type of the type definition: either , or .
+ The base type of the type definition.
+
+
+ Gets a value that indicates whether this is a nested type.
+
+ if it is a nested type, otherwise.
+
+
+ Gets the name of the type.
+ The name of the type.
+
+
+ Gets the full name of the namespace where the type is defined.
+ The full name of the namespace where the type is defined, or a handle whose property is if the type is nested or defined in a root namespace.
+
+
+ Gets the definition handle of the namespace where the type is defined.
+ The definition handle of the namespace where the type is defined, or a handle whose property is if the type is nested or defined in a root namespace.
+
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Contains a collection of instances.
+
+
+
+ Returns an enumerator that iterates through the collection.
+ An enumerator that can be used to iterate through the collection.
+
+
+ Returns an enumerator that iterates through a collection.
+ An object that can be used to iterate through the collection.
+
+
+ Gets the number of elements in the collection.
+ The number of elements in the collection.
+
+
+
+ Advances the enumerator to the next element of the collection.
+
+ if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
+
+
+ Sets the enumerator to its initial position, which is before the first element in the collection.
+
+
+ Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+
+
+
+
+
+
+
+
+
+ Gets the name of the target type.
+ The name of the target type.
+
+
+ Gets the full name of the namespace where the target type is defined.
+ The full name of the namespace where the target type is defined, or a handle whose the property is if the type is nested or defined in a root namespace.
+
+
+ Gets the resolution scope in which the target type is defined and is uniquely identified by the specified and .
+ The resolution scope in which the target type is uniquely defined.
+
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Contains a collection of instances.
+
+
+
+ Returns an enumerator that iterates through the collection.
+ An enumerator that can be used to iterate through the collection.
+
+
+ Returns an enumerator that iterates through a collection.
+ An object that can be used to iterate through the collection.
+
+
+ Gets the number of elements in the collection.
+ The number of elements in the collection.
+
+
+
+ Advances the enumerator to the next element of the collection.
+
+ if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
+
+
+ Sets the enumerator to its initial position, which is before the first element in the collection.
+
+
+ Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+ Gets the element in the collection at the current position of the enumerator.
+ The element in the collection at the current position of the enumerator.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Represents a handle to the user string heap.
+
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+ An object to compare with this object.
+
+ if the current object is equal to the parameter; otherwise, .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Specifies flags for the unmanaged method import attributes.
+
+
+ Specifies that the best-fit mapping behavior when converting Unicode characters to ANSI characters is disabled.
+
+
+ Specifies that the best-fit mapping behavior when converting Unicode characters to ANSI characters is enabled.
+
+
+ Specifies whether the best-fit mapping behavior when converting Unicode characters to ANSI characters is enabled or disabled.
+
+
+ Specifies that the calling convention is CDecl.
+
+
+ Specifies that the calling convention is FastCall.
+
+
+ Specifies the calling convention.
+
+
+ Specifies that the calling convention is StdCall.
+
+
+ Specifies that the calling convention is ThisCall.
+
+
+ Specifies that the default platform calling convention is used (StdCall on Windows x86, CDecl on Linux x86).
+
+
+ Specifies that strings are marshalled as multiple-byte character strings: the system default Windows (ANSI) code page on Windows, and UTF-8 on Unix.
+
+
+ Specifies that the character set is chosen automatically. See Charsets and marshaling for details.
+
+
+ Specifies the character set used for string marshalling.
+
+
+ Specifies that strings are marshalled as Unicode 2-byte character strings.
+
+
+ Specifies that the Common Language Runtime should not try an entry-point names with charset-specific suffixes when searching for the imported method.
+
+
+ Specifies default method import attributes.
+
+
+ Specifies that the imported method calls the SetLastError Windows API function before returning.
+
+
+ Specifies that an exception should not be thrown when an unmappable Unicode character is converted to an ANSI character.
+
+
+ Specifies that an exception should be thrown when an unmappable Unicode character is converted to an ANSI character.
+
+
+ Specifies whether an exception should be thrown when an unmappable Unicode character is converted to an ANSI character.
+
+
+
+
+ Used to add a handler for an event. Corresponds to the flag in the Ecma 335 CLI specification.
+ CLS-compliant adders are named the with prefix.
+
+
+
+
+ Reads the value of the property.
+ CLS-compliant getters are named with get_ prefix.
+
+
+
+ Other method for a property (not a getter or setter) or an event (not an adder, remover, or raiser).
+
+
+
+ Used to indicate that an event has occurred. Corresponds to the flag in the Ecma 335 CLI specification.
+ CLS-compliant raisers are named with the prefix.
+
+
+
+
+ Used to remove a handler for an event. Corresponds to the flag in the Ecma 335 CLI specification.
+ CLS-compliant removers are named with the prefix.
+
+
+
+
+ Used to modify the value of the property.
+ CLS-compliant setters are named with the prefix.
+
+
+
+ Represents the Common Object File Format (COFF) file characteristics.
+
+
+ Indicates that the operating system should aggressively trim the working set for this file. This flag is deprecated and should be zero.
+
+
+ Indicates that this file is for a 32-bit machine.
+
+
+ Indicates that this file uses a big endian byte order. This flag is deprecated and should be zero.
+
+
+ Indicates that this file uses a little endian byte order. This flag is deprecated and should be zero.
+
+
+ Indicates that debugging information is removed from the image file.
+
+
+ Indicates that the image file is a dynamic-link library (DLL).
+
+
+ Indicates that the image file is valid and can be run.
+
+
+ Indicates that this executable file can handle memory addresses greater than 2 GB.
+
+
+ Indicates that COFF line numbers have been removed from the file. This flag is deprecated and should be zero.
+
+
+ Indicates that COFF symbol table entries for local symbols have been removed from the file. This flag is deprecated and should be zero.
+
+
+ Indicates that the image should be fully loaded and copied into the swap file if it's located on a network media.
+
+
+ Indicates that the image doesn't contain base relocations and must therefore be loaded at its preferred base address.
+
+
+ Indicates that the image should be fully loaded and copied into the swap file if it's located on a removable media.
+
+
+ Indicates that the image file is a system file, not a user program.
+
+
+ Indicates that the file should be run only on a uniprocessor machine.
+
+
+ Provides information about a Program Debug Database (PDB) file.
+
+
+ The iteration of the PDB. The first iteration is 1. The iteration is incremented each time the PDB content is augmented.
+
+
+ The Globally Unique Identifier (GUID) of the associated PDB.
+
+
+ The path to the .pdb file that contains debug information for the PE/COFF file.
+
+
+ Represents the header of a COFF file.
+
+
+ Gets the flags that indicate the attributes of the file.
+ The flags that indicate the attributes of the file.
+
+
+ Gets the type of the target machine.
+ The type of the target machine.
+
+
+ Gets the number of sections. This indicates the size of the section table, which immediately follows the headers.
+ The number of sections.
+
+
+ Gets the number of entries in the symbol table. This data can be used to locate the string table, which immediately follows the symbol table. This value should be zero for a PE image.
+
+
+ Gets the file pointer to the COFF symbol table.
+ The file pointer to the COFF symbol table, or zero if no COFF symbol table is present. This value should be zero for a PE image.
+
+
+ Gets the size of the optional header, which is required for executable files but not for object files. This value should be zero for an object file.
+ The size of the optional header.
+
+
+ Gets a value that indicates when the file was created.
+ The low 32 bits of the number of seconds since 00:00 January 1, 1970, which indicates when the file was created.
+
+
+ Represents the runtime flags for a .NET executable image.
+
+
+ Indicates that this image is a library that only contains IL code.
+
+
+ Indicates that this image only contains IL code.
+
+
+ Reserved, shall be 0.
+
+
+ Indicates that this image should be run as a 32-bit process on a 64-bit operating system.
+
+
+ Indicates that this image can only be loaded into a 32-bit process.
+
+
+ Indicates that this image has a strong name signature.
+
+
+ Reserved, shall be 0.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Adds a CodeView entry.
+ The path to the PDB. It should not be empty.
+ The unique id of the PDB content.
+ The version of Portable PDB format (e.g. 0x0100 for 1.0), or 0 if the PDB is not portable.
+
+ is .
+
+ contains a NUL character.
+
+ is smaller than 0x0100.
+
+
+ Adds a CodeView entry.
+ The path to the PDB. It should not be empty.
+ The unique id of the PDB content.
+ The version of Portable PDB format (e.g. 0x0100 for 1.0), or 0 if the PDB is not portable.
+ Age (iteration) of the PDB. Shall be 1 for Portable PDBs.
+
+ is .
+
+ contains a NUL character.
+
+ Either is smaller than 0x0100 or is less than 1.
+
+
+ Adds an Embedded Portable PDB entry.
+ A Portable PDB metadata builder.
+ The version of Portable PDB format (e.g. 0x0100 for 1.0).
+
+ is .
+
+ is smaller than 0x0100.
+
+
+ Adds an entry of the specified type.
+ The entry type.
+ The entry version.
+ The entry stamp.
+
+
+ Adds an entry of the specified type and serializes its data.
+ The entry type.
+ The entry version.
+ The entry stamp.
+ The data to pass to .
+ A serializer for serializing data to a .
+ The type of the data passed to .
+
+
+ Adds PDB checksum entry.
+ The hash algorithm name (for example, "SHA256").
+ The checksum.
+
+ or is .
+
+ or is empty.
+
+
+ Adds a reproducible entry.
+
+
+ Identifies the location, size and format of a block of debug information.
+
+
+ Initializes a new instance of the structure.
+
+
+
+
+
+
+
+
+
+ Gets the file pointer to the debug data.
+ The file pointer to the debug data.
+
+
+ Gets the address of the debug data when loaded, relative to the image base.
+ The address of the debug data relative to the image base.
+
+
+ Gets the size of the debug data (not including the debug directory itself).
+ the size of the debug data (excluding the debug directory).
+
+
+ Gets a value that indicates if the entry is a entry that points to a Portable PDB.
+
+ if the entry is a entry pointing to a Portable PDB; otherwise, .
+
+
+ Gets the major version number of the debug data format.
+ The major version number of the debug data format.
+
+
+ Gets the minor version number of the debug data format.
+ The minor version number of the debug data format.
+
+
+ Get the time and date that the debug data was created if the PE/COFF file is not deterministic; otherwise, gets a value based on the hash of the content.
+ for a non-deterministic PE/COFF file, the time and date that the debug data was created; otherwise, a value based on the hash of the content.
+
+
+ Gets the format of the debugging information.
+ The format of the debugging information.
+
+
+ An enumeration that describes the format of the debugging information of a .
+
+
+ Associated PDB file description. For more information, see the specification.
+
+
+ The COFF debug information (line numbers, symbol table, and string table). This type of debug information is also pointed to by fields in the file headers.
+
+
+
+ The entry points to a blob containing Embedded Portable PDB. The Embedded Portable PDB blob has the following format:
+ - blob ::= uncompressed-size data
+ - Data spans the remainder of the blob and contains a Deflate-compressed Portable PDB.
+ For more information, see the specification.
+
+
+
+ The entry stores a crypto hash of the content of the symbol file the PE/COFF file was built with. The hash can be used to validate that a given PDB file was built with the PE/COFF file and not altered in any way. More than one entry can be present if multiple PDBs were produced during the build of the PE/COFF file (for example, private and public symbols). For more information, see the specification.
+
+
+
+ The presence of this entry indicates a deterministic PE/COFF file. See the Remarks section for more information.
+ The tool that produced the deterministic PE/COFF file guarantees that the entire content of the file is based solely on documented inputs given to the tool (such as source files, resource files, and compiler options) rather than ambient environment variables (such as the current time, the operating system, and the bitness of the process running the tool).
+ The value of field TimeDateStamp in COFF File Header of a deterministic PE/COFF file does not indicate the date and time when the file was produced and should not be interpreted that way. Instead, the value of the field is derived from a hash of the file content. The algorithm to calculate this value is an implementation detail of the tool that produced the file.
+ The debug directory entry of type must have all fields, except for Type zeroed.
+ For more information, see the specification.
+
+
+
+ An unknown value that should be ignored by all tools.
+
+
+
+
+
+
+
+
+
+ Describes the characteristics of a dynamic link library.
+
+
+ The image must run inside an AppContainer.
+
+
+ The DLL can be relocated.
+
+
+ The image can handle a high entropy 64-bit virtual address space.
+
+
+ Do not bind this image.
+
+
+ The image understands isolation and doesn't want it.
+
+
+ The image does not use SEH. No SE handler may reside in this image.
+
+
+ The image is NX compatible.
+
+
+ Reserved.
+
+
+ Reserved.
+
+
+ The image is Terminal Server aware.
+
+
+ Reserved.
+
+
+ Reserved.
+
+
+ The driver uses the WDM model.
+
+
+ Specifies the target machine's CPU architecture.
+
+
+ Alpha.
+
+
+ ALPHA64.
+
+
+ Matsushita AM33.
+
+
+ AMD64 (K8).
+
+
+ ARM little endian.
+
+
+ ARM64.
+
+
+ ARM Thumb-2 little endian.
+
+
+ EFI Byte Code.
+
+
+ Intel 386.
+
+
+ Intel 64.
+
+
+ LOONGARCH32
+
+
+ LOONGARCH64
+
+
+ M32R little-endian.
+
+
+ MIPS.
+
+
+ MIPS with FPU.
+
+
+ MIPS16 with FPU.
+
+
+ IBM PowerPC little endian.
+
+
+ PowerPCFP.
+
+
+ Hitachi SH3 little endian.
+
+
+ Hitachi SH3 DSP.
+
+
+ Hitachi SH3 little endian.
+
+
+ Hitachi SH4 little endian.
+
+
+ Hitachi SH5.
+
+
+ Thumb.
+
+
+ Infineon.
+
+
+ The target CPU is unknown or not specified.
+
+
+ MIPS little-endian WCE v2.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Represents a PDB Checksum debug directory entry.
+
+
+ The name of the crypto hash algorithm used to calculate the checksum.
+ A string representing the name of the crypto hash algorithm used to calculate the checksum.
+
+
+ The checksum of the PDB content.
+ An immutable array of bytes representing the checksum of the PDB content.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Builds PE directories.
+
+
+ Initializes an instance of the class.
+
+
+ The address of the entry point relative to the image base when the PE file is loaded into memory.
+ For program images, this is the starting address. For device drivers, this is the address of the initialization function. An entry point is optional for DLLs. When no entry point is present, this field must be zero.
+
+
+ The base relocation table image directory entry.
+ A directory entry instance.
+
+
+ The bound import image directory entry.
+ A directory entry instance.
+
+
+ The copyright/architecture image directory entry.
+ A directory entry instance.
+
+
+ The COM descriptortable image directory entry.
+ A directory entry instance.
+
+
+ The debug table image directory entry.
+ A directory entry instance.
+
+
+ The delay import table image directory entry.
+ A directory entry instance.
+
+
+ The exception table image directory entry.
+ A directory entry instance.
+
+
+ The export table image directory entry.
+ A directory entry instance.
+
+
+ The global pointer table image directory entry.
+ A directory entry instance.
+
+
+ The import address table (IAT) image directory entry.
+ A directory entry instance.
+
+
+ The import table image directory entry.
+ A directory entry instance.
+
+
+ The load configuration table image directory entry.
+ A directory entry instance.
+
+
+ The resource table image directory entry.
+ A directory entry instance.
+
+
+ The thread local storage (TLS) table image directory entry.
+ A directory entry instance.
+
+
+
+ Gets the address of the entry point relative to the image base when the PE file is loaded into memory.
+ The address of the entry point relative to the image base.
+
+
+ Gets the address of the beginning-of-code section relative to the image base when the image is loaded into memory.
+ The address of the beginning-of-code section relative to the image base.
+
+
+ Gets the address of the beginning-of-data section relative to the image base when the image is loaded into memory.
+ The address of the beginning-of-data section relative to the image base.
+
+
+
+
+ Gets the Certificate Table entry, which points to a table of attribute certificates.
+
+
+ Gets the image file checksum.
+ The image file checksum.
+
+
+
+
+
+
+
+
+
+ Gets the alignment factor (in bytes) that is used to align the raw data of sections in the image file.
+ A power of 2 between 512 and 64K, inclusive. The default is 512.
+
+
+
+ Gets the preferred address of the first byte of the image when it is loaded into memory.
+ The preferred address, which is a multiple of 64K.
+
+
+
+
+
+ Gets a value that identifies the format of the image file.
+ The format of the image file.
+
+
+ Gets the major version number of the image.
+ The major version number of the image.
+
+
+ Gets the linker major version number.
+ The linker major version number.
+
+
+ Gets the major version number of the required operating system.
+ The major version number of the required operating system.
+
+
+ Gets the major version number of the subsystem.
+ The major version number of the subsystem.
+
+
+ Gets the minor version number of the image.
+ The minor version number of the image.
+
+
+ Gets the linker minor version number.
+ The linker minor version number.
+
+
+ Gets the minor version number of the required operating system.
+ The minor version number of the required operating system.
+
+
+ Gets the minor version number of the subsystem.
+ The minor version number of the subsystem.
+
+
+ Gets the number of data-directory entries in the remainder of the . Each describes a location and size.
+ The number of data-directory entries in the remainder of the .
+
+
+
+ Gets the alignment (in bytes) of sections when they are loaded into memory.
+ A number greater than or equal to . The default is the page size for the architecture.
+
+
+ Gets the size of the code (text) section, or the sum of all code sections if there are multiple sections.
+ the size of the code (text) section, or the sum of all code sections if there are multiple sections.
+
+
+ Gets the combined size of an MS DOS stub, PE header, and section headers rounded up to a multiple of FileAlignment.
+ The combined size of an MS DOS stub, PE header, and section headers rounded up to a multiple of FileAlignment.
+
+
+ Gets the size of the local heap space to commit.
+ the size of the local heap space to commit.
+
+
+ Gets the size of the local heap space to reserve. Only is committed; the rest is made available one page at a time until the reserve size is reached.
+ The size of the local heap space to reserve.
+
+
+ Gets the size (in bytes) of the image, including all headers, as the image is loaded in memory.
+ The size (in bytes) of the image, which is a multiple of .
+
+
+ Gets the size of the initialized data section, or the sum of all such sections if there are multiple data sections.
+
+
+ Gets the size of the stack to commit.
+ The size of the stack to commit.
+
+
+ Gets the size of the stack to reserve. Only is committed; the rest is made available one page at a time until the reserve size is reached.
+ The size of the stack to reserve.
+
+
+ Gets the size of the uninitialized data section (BSS), or the sum of all such sections if there are multiple BSS sections.
+ The size of the uninitialized data section (BSS) or the sum of all such sections.
+
+
+ Gets the name of the subsystem that is required to run this image.
+ the name of the subsystem that is required to run this image.
+
+
+
+ Defines the header for a portable executable (PE) file.
+
+
+ Initializes a new instance of the class.
+ The target machine's CPU architecture.
+ The alignment (in bytes) of sections when they are loaded into memory. It must be greater than or equal to . The default is the page size for the architecture.
+ The alignment factor (in bytes) that is used to align the raw data of sections in the image file. The value should be a power of 2 between 512 and 64K, inclusive. The default is 512. If the is less than the architecture's page size, then must match .
+ The preferred address of the first byte of image when loaded into memory; must be a multiple of 64K.
+ The linker major version number.
+ The linker minor version number.
+ The major version number of the required operating system.
+ The minor version number of the required operating system.
+ The major version number of the image.
+ The minor version number of the image.
+ The major version number of the subsystem.
+ The minor version number of the subsystem.
+ The subsystem required to run the image.
+ An object describing the characteristics of the dynamic link library.
+ An object describing the characteristics of the image.
+ The size of the stack to reserve. Only is committed; the rest is made available one page at a time until the reserve size is reached.
+ The size of the stack to commit.
+ The size of the local heap space to reserve. Only is committed; the rest is made available one page at a time until the reserve size is reached.
+ The size of the local heap space to commit.
+
+ is not power of 2 between 512 and 64K.
+-or-
+
+ not power of 2.
+
+-or-
+
+ is less than .
+
+
+ Creates an executable header.
+ A instance representing the executable header.
+
+
+ Creates a library header.
+ A instance representing the library header.
+
+
+ Returns the dynamic linker library characteristics.
+ An object that describes the dynamic linker library characteristics.
+
+
+ The alignment factor (in bytes) that is used to align the raw data of sections in the image file. The value should be a power of 2 between 512 and 64K, inclusive. The default is 512. If the section alignment is less than the architecture's page size, then file alignment must match the section alignment.
+
+
+ The preferred address of the first byte of image when loaded into memory; must be a multiple of 64K.
+ A number representing the preferred address of the first byte of image when loaded into memory.
+
+
+ Returns the image characteristics.
+ An object representing the image characteristics.
+
+
+ The target machine's CPU architecture.
+ One of the enumeration values representing the different CPU architectures.
+
+
+ The major version number of the image.
+ A number the size of a representing the major version number of the image.
+
+
+ The linker major version number.
+ A number the size of a representing the linker major version number.
+
+
+ The major version number of the required operating system.
+ A number the size of a representing the major version number of the required operating system.
+
+
+ The major version number of the subsystem.
+ A number the size of a representing the major version number of the subsystem.
+
+
+ The minor version number of the image.
+ A number the size of a representing the minor version number of the image.
+
+
+ The linker minor version number.
+ A number the size of a representing the linker minor version number.
+
+
+ The minor version number of the required operating system.
+ A number the size of a representing the minor version number of the required operating system.
+
+
+ The minor version number of the subsystem.
+ A number the size of a representing the minor version number of the subsystem.
+
+
+ The alignment (in bytes) of sections when they are loaded into memory.
+ A number representing the alignment (in bytes) of sections when they are loaded into memory. It must be greater than or equal to the file alignment. The default is the page size for the architecture.
+
+
+ The size of the local heap space to commit.
+ A number representing the size of the local heap space to commit.
+
+
+ The size of the local heap space to reserve. Only is committed; the rest is made available one page at a time until the reserve size is reached.
+ A number representing the size of the local heap space to reserve.
+
+
+ The size of the stack to commit.
+ A number representing the size of the stack to commit.
+
+
+ The size of the stack to reserve. Only is committed; the rest is made available one page at a time until the reserve size is reached.
+ A number representing the size of the stack to reserve.
+
+
+ The subsystem that is required to run this image.
+ A instance.
+
+
+ Defines a type that reads PE (Portable Executable) and COFF (Common Object File Format) headers from a stream.
+
+
+ Instantiates a new instance of the class that reads the PE headers from the current location in the specified stream.
+ A stream containing the PE image starting at the stream's current position and ending at the end of the stream.
+ The data read from the stream has an invalid format.
+ Error reading from the stream.
+ The stream does not support seek operations.
+
+ is .
+
+
+ Instantiates a new instance of the class that reads the PE headers from a stream that represents a PE image of a specified size.
+ A stream containing PE image of the given size starting at its current position.
+ The size of the PE image.
+ The data read from the stream has an invalid format.
+ Error reading from the stream.
+ The stream does not support seek operations.
+
+ is .
+
+ is negative or extends past the end of the stream.
+
+
+ Instantiates a new instance of the class that reads the PE headers from a stream that represents a PE image of a specified size and indicates whether the PE image has been loaded into memory.
+ The stream containing PE image of the given size starting at its current position.
+ The size of the PE image.
+
+ if the PE image has been loaded into memory by the OS loader; otherwise, .
+ The data read from the stream has invalid format.
+ Error reading from the stream.
+ The stream does not support seek operations.
+
+ is .
+
+ is negative or extends past the end of the stream.
+
+
+ Searches sections of the PE image for the section that contains the specified Relative Virtual Address.
+ The relative virtual address to search for.
+ The index of the section that contains , or -1 if there the search is unsuccessful.
+
+
+ Gets the offset (in bytes) from the start of the image to the given directory data.
+ The PE directory entry.
+ When the method returns, contains the offset from the start of the image to the given directory data.
+
+ if the directory data is found; otherwise.
+
+
+ Gets the COFF header of the image.
+ The COFF header of the image.
+
+
+ Gets the byte offset from the start of the PE image to the start of the COFF header.
+ The byte offset from the start of the PE image to the start of the COFF header.
+
+
+ Gets the COR header.
+ The COR header, or if the image does not have one.
+
+
+ Gets the byte offset from the start of the image to the COR header.
+ The byte offset from the start of the image to the COR header, or -1 if the image does not have a COR header.
+
+
+ Gets a value that indicates whether the image is Coff only.
+
+ if the image is Coff only; otherwise, .
+
+
+ Gets a value that indicates whether the image represents a Windows console application.
+
+ if the image is a Windows console applications; otherwise, .
+
+
+ Gets a value that indicates whether the image represents a dynamic link library.
+
+ if the image is a DLL; otherwise, .
+
+
+ Gets a value that indicates whether the image represents an executable.
+
+ if the image is an executable; otherwise, .
+
+
+ Gets the size of the CLI metadata.
+ the size of the CLI metadata, or 0 if the image does not contain metadata.
+
+
+ Gets the offset (in bytes) from the start of the PE image to the start of the CLI metadata.
+ The offset (in bytes) from the start of the PE image to the start of the CLI metadata, or -1 if the image does not contain metadata.
+
+
+ Gets the image's PE header.
+ The image's PE header, or if the image is COFF only.
+
+
+ Gets the byte offset of the header from the start of the image.
+ The byte offset of the header from the start of the image.
+
+
+ Gets the PE section headers.
+ An array containing the PE section headers.
+
+
+
+
+
+
+ Reads the contents of the entire block into an array.
+ An immutable byte array.
+
+
+ Reads the contents of a part of the block into an array.
+ The starting position in the block.
+ The number of bytes to read.
+ The specified range is not contained within the block.
+ An immutable array of bytes.
+
+
+ Creates a for a blob spanning the entire block.
+ A reader for a blob spanning the entire block.
+
+
+ Creates a for a blob spanning a part of the block.
+ The starting position in the block.
+ The number of bytes in the portion of the block.
+ The specified range is not contained within the block.
+ A reader for a blob spanning a portion of the block.
+
+
+ Gets the length of the block.
+ The length of the block.
+
+
+ Gets a pointer to the first byte of the block.
+ A pointer to the first byte of the block.
+
+
+ Provides a reader for Portable Executable format (PE) files.
+
+
+ Creates a Portable Executable reader over a PE image stored in memory.
+ A pointer to the start of the PE image.
+ The size of the PE image.
+
+ is .
+
+ is negative.
+
+
+ Creates a Portable Executable reader over a PE image stored in memory. A flag indicates whether the image has already been loaded into memory.
+ A pointer to the start of the PE image.
+ The size of the PE image.
+
+ if the PE image has been loaded into memory by the OS loader; otherwise, .
+
+ is .
+
+ is negative.
+
+
+ Creates a Portable Executable reader over a PE image stored in a byte array.
+ An immutable array of bytes representing the PE image.
+
+ is .
+
+
+ Creates a Portable Executable reader over a PE image stored in a stream.
+ PE image stream.
+
+ is .
+
+
+ Creates a Portable Executable reader over a PE image stored in a stream beginning at its current position and ending at the end of the stream.
+ A PE image stream.
+ Options specifying how sections of the PE image are read from the stream.
+
+ is .
+
+ has an invalid value.
+ Error reading from the stream (only when prefetching data).
+
+ is specified, and the PE headers of the image are invalid.
+
+
+ Creates a Portable Executable reader over a PE image of the given size beginning at the stream's current position.
+ A PE image stream.
+ Options specifying how sections of the PE image are read from the stream.
+ The PE image size.
+
+ is negative or extends past the end of the stream.
+ Error reading from the stream (only when prefetching data).
+
+ is specified, and the PE headers of the image are invalid.
+
+
+ Disposes all memory allocated by the reader.
+
+
+ Gets a object containing the entire PE image.
+ The entire PE image is not available.
+ A memory block that contains the entire PE image.
+
+
+ Loads a PE section that contains CLI metadata.
+ The PE image doesn't contain metadata ( returns ).
+ The PE headers contain invalid data.
+ IO error while reading from the underlying stream.
+ A memory block that contains the CLI metadata.
+
+
+ Loads the PE section that contains the specified relative virtual address into memory and returns a memory block that starts at that address and ends at the end of the containing section.
+ The Relative Virtual Address of the data to read.
+ The PE headers contain invalid data.
+ An IO error occurred while reading from the underlying stream.
+ The PE image is not available.
+
+ is negative.
+ A memory block that starts at and ends at the end of the containing section, or an empty block if doesn't represent a location in any of the PE sections of this PE image.
+
+
+ Loads the PE section with the specified name into memory and returns a memory block that spans the section.
+ The name of the section.
+
+ is .
+ The PE image is not available.
+ A memory block that spans the section, or an empty block if no section of the given exists in this PE image.
+
+
+ Reads the data pointed to by the specified Debug Directory entry and interprets it as CodeView.
+ A Debug Directory entry instance.
+
+ is not a CodeView entry.
+ Bad format of the data.
+ IO error while reading from the underlying stream.
+ The PE image is not available.
+ A code view debug directory data instance.
+
+
+ Reads all Debug Directory table entries.
+ Bad format of the entry.
+ IO error while reading from the underlying stream.
+ The PE image is not available.
+ An array of Debug Directory table entries.
+
+
+ Reads the data pointed to by the specified Debug Directory entry and interprets it as an Embedded Portable PDB blob.
+ The Debug Directory entry whose data is to be read.
+
+ is not a entry.
+ Bad format of the data.
+ PE image not available.
+ The provider of a metadata reader for reading a Portable PDB image.
+
+
+ Reads the data pointed to by the specified Debug Directory entry and interprets it as a PDB Checksum entry.
+ The Debug Directory entry whose data is to be read.
+
+ is not a PDB Checksum entry.
+ Bad format of the data.
+ IO error while reading from the underlying stream.
+ The PE image is not available.
+ The PDB Checksum entry.
+
+
+ Opens a Portable PDB associated with this PE image.
+ The path to the PE image. The path is used to locate the PDB file located in the directory containing the PE file.
+ If specified, called to open a for a given file path. The provider is expected to either return a readable and seekable , or if the target file doesn't exist or should be ignored for some reason. The provider should throw if it fails to open the file due to an unexpected IO error.
+ If successful, a new instance of to be used to read the Portable PDB.
+ If successful and the PDB is found in a file, the path to the file, or if the PDB is embedded in the PE image itself.
+
+ or is .
+ The stream returned from doesn't support read and seek operations.
+ No matching PDB file was found due to an error: The PE image or the PDB is invalid.
+ No matching PDB file was found due to an error: An IO error occurred while reading the PE image or the PDB.
+
+ if the PE image has a PDB associated with it and the PDB has been successfully opened; otherwise, .
+
+
+ Gets a value that indicates if the PE image contains CLI metadata.
+ The PE headers contain invalid data.
+ Error reading from the underlying stream.
+
+ if the PE image contains CLI metadata; otherwise, .
+
+
+ Gets a value that indicates if the reader can access the entire PE image.
+
+ if the reader can access the entire PE image; otherwise, .
+
+
+ Gets a value that indicates if the PE image has been loaded into memory by the OS loader.
+
+ if the PE image has been loaded into memory by the OS loader; otherwise, .
+
+
+ Gets the PE headers.
+ The headers contain invalid data.
+ Error reading from the stream.
+ The PE headers for this PE image.
+
+
+ Provides options that specify how sections of a PE image are read from a stream.
+
+
+ By default, the stream is disposed when the is disposed, and sections of the PE image are read lazily.
+
+
+ Indicates that the underlying PE image has been loaded into memory by the OS loader.
+
+
+ Keeps the stream open when the is disposed.
+
+
+ Reads the entire image into memory right away. closes the stream automatically by the time the constructor returns unless is specified.
+
+
+
+ Reads the metadata section into memory right away.
+ Reading from other sections of the file is not allowed ( is thrown by the ).
+
+ closes the stream automatically by the time the constructor returns unless is specified. The underlying file may be closed and even deleted after is constructed.
+
+
+
+ Defines the base class for a PE resource section builder. Derive from to provide serialization logic for native resources.
+
+
+ Initializes a new instance of the class.
+
+
+ Serializes the specified resource.
+ A blob that contains the data to serialize.
+ The location to which to serialize .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Provides information about the section header of a PE/COFF file.
+
+
+ Gets the name of the section.
+ The name of the section.
+
+
+ Gets the number of line-number entries for the section.
+ The number of line-number entries for the section.
+
+
+ Gets the number of relocation entries for the section.
+ The number of relocation entries for the section. Its value is zero for PE images.
+
+
+ Gets the file pointer to the beginning of line-number entries for the section.
+ The file pointer to the beginning of line-number entries for the section, or zero if there are no COFF line numbers.
+
+
+ Gets the file pointer to the first page of the section within the COFF file.
+ The file pointer to the first page of the section within the COFF file.
+
+
+ Gets the file pointer to the beginning of relocation entries for the section.
+ The file pointer to the beginning of relocation entries for the section. It is set to zero for PE images or if there are no relocations.
+
+
+ Gets the flags that describe the characteristics of the section.
+ The flags that describe the characteristics of the section.
+
+
+ Gets the size of the section (for object files) or the size of the initialized data on disk (for image files).
+ The size of the section (for object files) or the size of the initialized data on disk (for image files).
+
+
+ Gets the virtual addess of the section.
+ The virtual address of the section.
+
+
+ Gets the total size of the section when loaded into memory.
+ The total size of the section when loaded into memory.
+
+
+
+
+
+
+
+
+
+ Describes the subsystem requirement for the image.
+
+
+ Extensible Firmware Interface (EFI) application.
+
+
+ EFI driver with boot services.
+
+
+ EFI ROM image.
+
+
+ EFI driver with run-time services.
+
+
+ The image doesn't require a subsystem.
+
+
+ The image is a native Win9x driver.
+
+
+ The image runs in the OS/2 character subsystem.
+
+
+ The image runs in the Posix character subsystem.
+
+
+ Unknown subsystem.
+
+
+ Boot application.
+
+
+ The image runs in the Windows CE subsystem.
+
+
+ The image runs in the Windows character subsystem.
+
+
+ The image runs in the Windows GUI subsystem.
+
+
+ Xbox system.
+
+
+
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Reflection.Metadata.xml.meta b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Reflection.Metadata.xml.meta
new file mode 100644
index 0000000..50bd06b
--- /dev/null
+++ b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Reflection.Metadata.xml.meta
@@ -0,0 +1,14 @@
+fileFormatVersion: 2
+guid: 2995ab795c7c4854d991cb7b672c14aa
+TextScriptImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Reflection.Metadata.xml
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Runtime.CompilerServices.Unsafe.dll b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Runtime.CompilerServices.Unsafe.dll
new file mode 100644
index 0000000..103462b
Binary files /dev/null and b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Runtime.CompilerServices.Unsafe.dll differ
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Runtime.CompilerServices.Unsafe.dll.meta b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Runtime.CompilerServices.Unsafe.dll.meta
new file mode 100644
index 0000000..f483676
--- /dev/null
+++ b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Runtime.CompilerServices.Unsafe.dll.meta
@@ -0,0 +1,50 @@
+fileFormatVersion: 2
+guid: 8e60dc682ecdf2a4c8d1f481f807496b
+PluginImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ iconMap: {}
+ executionOrder: {}
+ defineConstraints:
+ - UNITY_2021_1_OR_NEWER
+ isPreloaded: 0
+ isOverridable: 0
+ isExplicitlyReferenced: 0
+ validateReferences: 1
+ platformData:
+ - first:
+ : Any
+ second:
+ enabled: 0
+ settings:
+ Exclude Linux64: 1
+ Exclude OSXUniversal: 1
+ Exclude Win: 1
+ Exclude Win64: 1
+ - first:
+ Any:
+ second:
+ enabled: 1
+ settings: {}
+ - first:
+ Editor: Editor
+ second:
+ enabled: 0
+ settings:
+ DefaultValueInitialized: true
+ - first:
+ Windows Store Apps: WindowsStoreApps
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ userData:
+ assetBundleName:
+ assetBundleVariant:
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Runtime.CompilerServices.Unsafe.dll
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Runtime.CompilerServices.Unsafe.xml b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Runtime.CompilerServices.Unsafe.xml
new file mode 100644
index 0000000..9d79492
--- /dev/null
+++ b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Runtime.CompilerServices.Unsafe.xml
@@ -0,0 +1,291 @@
+
+
+
+ System.Runtime.CompilerServices.Unsafe
+
+
+
+ Contains generic, low-level functionality for manipulating pointers.
+
+
+ Adds an element offset to the given reference.
+ The reference to add the offset to.
+ The offset to add.
+ The type of reference.
+ A new reference that reflects the addition of offset to pointer.
+
+
+ Adds an element offset to the given reference.
+ The reference to add the offset to.
+ The offset to add.
+ The type of reference.
+ A new reference that reflects the addition of offset to pointer.
+
+
+ Adds an element offset to the given reference.
+ The reference to add the offset to.
+ The offset to add.
+ The type of reference.
+ A new reference that reflects the addition of offset to pointer.
+
+
+ Adds an element offset to the given void pointer.
+ The void pointer to add the offset to.
+ The offset to add.
+ The type of void pointer.
+ A new void pointer that reflects the addition of offset to the specified pointer.
+
+
+ Adds a byte offset to the given reference.
+ The reference to add the offset to.
+ The offset to add.
+ The type of reference.
+ A new reference that reflects the addition of byte offset to pointer.
+
+
+ Adds a byte offset to the given reference.
+ The reference to add the offset to.
+ The offset to add.
+ The type of reference.
+ A new reference that reflects the addition of byte offset to pointer.
+
+
+ Determines whether the specified references point to the same location.
+ The first reference to compare.
+ The second reference to compare.
+ The type of reference.
+
+ if and point to the same location; otherwise, .
+
+
+ Casts the given object to the specified type.
+ The object to cast.
+ The type which the object will be cast to.
+ The original object, casted to the given type.
+
+
+ Reinterprets the given reference as a reference to a value of type .
+ The reference to reinterpret.
+ The type of reference to reinterpret.
+ The desired type of the reference.
+ A reference to a value of type .
+
+
+ Returns a pointer to the given by-ref parameter.
+ The object whose pointer is obtained.
+ The type of object.
+ A pointer to the given value.
+
+
+ Reinterprets the given read-only reference as a reference.
+ The read-only reference to reinterpret.
+ The type of reference.
+ A reference to a value of type .
+
+
+ Reinterprets the given location as a reference to a value of type .
+ The location of the value to reference.
+ The type of the interpreted location.
+ A reference to a value of type .
+
+
+ Determines the byte offset from origin to target from the given references.
+ The reference to origin.
+ The reference to target.
+ The type of reference.
+ Byte offset from origin to target i.e. - .
+
+
+ Copies a value of type to the given location.
+ The location to copy to.
+ A pointer to the value to copy.
+ The type of value to copy.
+
+
+ Copies a value of type to the given location.
+ The location to copy to.
+ A reference to the value to copy.
+ The type of value to copy.
+
+
+ Copies bytes from the source address to the destination address.
+ The destination address to copy to.
+ The source address to copy from.
+ The number of bytes to copy.
+
+
+ Copies bytes from the source address to the destination address.
+ The destination address to copy to.
+ The source address to copy from.
+ The number of bytes to copy.
+
+
+ Copies bytes from the source address to the destination address without assuming architecture dependent alignment of the addresses.
+ The destination address to copy to.
+ The source address to copy from.
+ The number of bytes to copy.
+
+
+ Copies bytes from the source address to the destination address without assuming architecture dependent alignment of the addresses.
+ The destination address to copy to.
+ The source address to copy from.
+ The number of bytes to copy.
+
+
+ Initializes a block of memory at the given location with a given initial value.
+ The address of the start of the memory block to initialize.
+ The value to initialize the block to.
+ The number of bytes to initialize.
+
+
+ Initializes a block of memory at the given location with a given initial value.
+ The address of the start of the memory block to initialize.
+ The value to initialize the block to.
+ The number of bytes to initialize.
+
+
+ Initializes a block of memory at the given location with a given initial value without assuming architecture dependent alignment of the address.
+ The address of the start of the memory block to initialize.
+ The value to initialize the block to.
+ The number of bytes to initialize.
+
+
+ Initializes a block of memory at the given location with a given initial value without assuming architecture dependent alignment of the address.
+ The address of the start of the memory block to initialize.
+ The value to initialize the block to.
+ The number of bytes to initialize.
+
+
+ Returns a value that indicates whether a specified reference is greater than another specified reference.
+ The first value to compare.
+ The second value to compare.
+ The type of the reference.
+
+ if is greater than ; otherwise, .
+
+
+ Returns a value that indicates whether a specified reference is less than another specified reference.
+ The first value to compare.
+ The second value to compare.
+ The type of the reference.
+
+ if is less than ; otherwise, .
+
+
+ Determines if a given reference to a value of type is a null reference.
+ The reference to check.
+ The type of the reference.
+
+ if is a null reference; otherwise, .
+
+
+ Returns a reference to a value of type that is a null reference.
+ The type of the reference.
+ A reference to a value of type that is a null reference.
+
+
+ Reads a value of type from the given location.
+ The location to read from.
+ The type to read.
+ An object of type read from the given location.
+
+
+ Reads a value of type from the given location without assuming architecture dependent alignment of the addresses.
+ The location to read from.
+ The type to read.
+ An object of type read from the given location.
+
+
+ Reads a value of type from the given location without assuming architecture dependent alignment of the addresses.
+ The location to read from.
+ The type to read.
+ An object of type read from the given location.
+
+
+ Returns the size of an object of the given type parameter.
+ The type of object whose size is retrieved.
+ The size of an object of type .
+
+
+ Bypasses definite assignment rules for a given value.
+ The uninitialized object.
+ The type of the uninitialized object.
+
+
+ Subtracts an element offset from the given reference.
+ The reference to subtract the offset from.
+ The offset to subtract.
+ The type of reference.
+ A new reference that reflects the subtraction of offset from pointer.
+
+
+ Subtracts an element offset from the given reference.
+ The reference to subtract the offset from.
+ The offset to subtract.
+ The type of reference.
+ A new reference that reflects the subtraction of offset from pointer.
+
+
+ Subtracts an element offset from the given reference.
+ The reference to subtract the offset from.
+ The offset to subtract.
+ The type of reference.
+ A new reference that reflects the subraction of offset from pointer.
+
+
+ Subtracts an element offset from the given void pointer.
+ The void pointer to subtract the offset from.
+ The offset to subtract.
+ The type of the void pointer.
+ A new void pointer that reflects the subtraction of offset from the specified pointer.
+
+
+ Subtracts a byte offset from the given reference.
+ The reference to subtract the offset from.
+ The offset to subtract.
+ The type of reference.
+ A new reference that reflects the subtraction of byte offset from pointer.
+
+
+ Subtracts a byte offset from the given reference.
+ The reference to subtract the offset from.
+ The offset to subtract.
+ The type of reference.
+ A new reference that reflects the subraction of byte offset from pointer.
+
+
+ Returns a to a boxed value.
+ The value to unbox.
+ The type to be unboxed.
+
+ is , and is a non-nullable value type.
+
+ is not a boxed value type.
+
+-or-
+
+ is not a boxed .
+
+ cannot be found.
+ A to the boxed value .
+
+
+ Writes a value of type to the given location.
+ The location to write to.
+ The value to write.
+ The type of value to write.
+
+
+ Writes a value of type to the given location without assuming architecture dependent alignment of the addresses.
+ The location to write to.
+ The value to write.
+ The type of value to write.
+
+
+ Writes a value of type to the given location without assuming architecture dependent alignment of the addresses.
+ The location to write to.
+ The value to write.
+ The type of value to write.
+
+
+
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Runtime.CompilerServices.Unsafe.xml.meta b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Runtime.CompilerServices.Unsafe.xml.meta
new file mode 100644
index 0000000..bfc0431
--- /dev/null
+++ b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Runtime.CompilerServices.Unsafe.xml.meta
@@ -0,0 +1,14 @@
+fileFormatVersion: 2
+guid: 37aa3a1626690b44da6b8799b8f26450
+TextScriptImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Runtime.CompilerServices.Unsafe.xml
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Threading.Tasks.Extensions.dll b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Threading.Tasks.Extensions.dll
new file mode 100644
index 0000000..a1234ce
Binary files /dev/null and b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Threading.Tasks.Extensions.dll differ
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Threading.Tasks.Extensions.dll.meta b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Threading.Tasks.Extensions.dll.meta
new file mode 100644
index 0000000..85e57a4
--- /dev/null
+++ b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Threading.Tasks.Extensions.dll.meta
@@ -0,0 +1,84 @@
+fileFormatVersion: 2
+guid: 337544ddb4628f340bd86d16c5d58caa
+PluginImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ iconMap: {}
+ executionOrder: {}
+ defineConstraints:
+ - UNITY_2021_1_OR_NEWER
+ isPreloaded: 0
+ isOverridable: 0
+ isExplicitlyReferenced: 1
+ validateReferences: 1
+ platformData:
+ - first:
+ : Any
+ second:
+ enabled: 0
+ settings:
+ Exclude Android: 1
+ Exclude Editor: 0
+ Exclude Linux64: 1
+ Exclude OSXUniversal: 1
+ Exclude Win: 1
+ Exclude Win64: 1
+ - first:
+ Android: Android
+ second:
+ enabled: 0
+ settings:
+ CPU: ARMv7
+ - first:
+ Any:
+ second:
+ enabled: 0
+ settings: {}
+ - first:
+ Editor: Editor
+ second:
+ enabled: 1
+ settings:
+ CPU: AnyCPU
+ DefaultValueInitialized: true
+ OS: AnyOS
+ - first:
+ Standalone: Linux64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: OSXUniversal
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Windows Store Apps: WindowsStoreApps
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ userData:
+ assetBundleName:
+ assetBundleVariant:
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Threading.Tasks.Extensions.dll
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/Microsoft.CSharp.dll b/Assets/FastScriptReload/Plugins/Roslyn/Microsoft.CSharp.dll
new file mode 100644
index 0000000..22c92fc
Binary files /dev/null and b/Assets/FastScriptReload/Plugins/Roslyn/Microsoft.CSharp.dll differ
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/Microsoft.CSharp.dll.IMPORTANT.txt.txt b/Assets/FastScriptReload/Plugins/Roslyn/Microsoft.CSharp.dll.IMPORTANT.txt.txt
new file mode 100644
index 0000000..f9c9bdb
--- /dev/null
+++ b/Assets/FastScriptReload/Plugins/Roslyn/Microsoft.CSharp.dll.IMPORTANT.txt.txt
@@ -0,0 +1 @@
+library is excluded from any compilation by default. It's only purpose is to serve as a reference for dynamic keyword when targetting NET Standard 2.1 - as this is required by ThisRewriters to function properly
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/Microsoft.CSharp.dll.IMPORTANT.txt.txt.meta b/Assets/FastScriptReload/Plugins/Roslyn/Microsoft.CSharp.dll.IMPORTANT.txt.txt.meta
new file mode 100644
index 0000000..7fac619
--- /dev/null
+++ b/Assets/FastScriptReload/Plugins/Roslyn/Microsoft.CSharp.dll.IMPORTANT.txt.txt.meta
@@ -0,0 +1,14 @@
+fileFormatVersion: 2
+guid: 26f2f034c23688d46b7284ad72c08f91
+TextScriptImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Plugins/Roslyn/Microsoft.CSharp.dll.IMPORTANT.txt.txt
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/Microsoft.CSharp.dll.meta b/Assets/FastScriptReload/Plugins/Roslyn/Microsoft.CSharp.dll.meta
new file mode 100644
index 0000000..0a87e89
--- /dev/null
+++ b/Assets/FastScriptReload/Plugins/Roslyn/Microsoft.CSharp.dll.meta
@@ -0,0 +1,84 @@
+fileFormatVersion: 2
+guid: 8f60cb703cea2fe4ebc2f2cf1a68714b
+PluginImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ iconMap: {}
+ executionOrder: {}
+ defineConstraints:
+ - UNITY_2019 || UNITY_2020
+ isPreloaded: 0
+ isOverridable: 0
+ isExplicitlyReferenced: 1
+ validateReferences: 0
+ platformData:
+ - first:
+ : Any
+ second:
+ enabled: 0
+ settings:
+ Exclude Android: 1
+ Exclude Editor: 1
+ Exclude Linux64: 1
+ Exclude OSXUniversal: 1
+ Exclude Win: 1
+ Exclude Win64: 1
+ - first:
+ Android: Android
+ second:
+ enabled: 0
+ settings:
+ CPU: ARMv7
+ - first:
+ Any:
+ second:
+ enabled: 0
+ settings: {}
+ - first:
+ Editor: Editor
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ DefaultValueInitialized: true
+ OS: AnyOS
+ - first:
+ Standalone: Linux64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: OSXUniversal
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Windows Store Apps: WindowsStoreApps
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ userData:
+ assetBundleName:
+ assetBundleVariant:
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Plugins/Roslyn/Microsoft.CSharp.dll
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts.meta b/Assets/FastScriptReload/Scripts.meta
new file mode 100644
index 0000000..e61eba7
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 3e2456f51a2408f43a5b76ab3daef351
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/FastScriptReload/Scripts/Editor.meta b/Assets/FastScriptReload/Scripts/Editor.meta
new file mode 100644
index 0000000..969f4be
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 018258c906e44916b88d291450c30b69
+timeCreated: 1668616782
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/AssemblyPostProcess.meta b/Assets/FastScriptReload/Scripts/Editor/AssemblyPostProcess.meta
new file mode 100644
index 0000000..895a3bd
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/AssemblyPostProcess.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 15c1071797bb4a818f85a6f8187f4289
+timeCreated: 1678785269
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/AssemblyPostProcess/AddInternalsVisibleToForAllUserAssembliesPostProcess.cs b/Assets/FastScriptReload/Scripts/Editor/AssemblyPostProcess/AddInternalsVisibleToForAllUserAssembliesPostProcess.cs
new file mode 100644
index 0000000..9496b34
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/AssemblyPostProcess/AddInternalsVisibleToForAllUserAssembliesPostProcess.cs
@@ -0,0 +1,46 @@
+using System.IO;
+using System.Reflection;
+using Mono.Cecil;
+using UnityEditor;
+using UnityEngine;
+
+namespace FastScriptReload.Editor.AssemblyPostProcess
+{
+ [InitializeOnLoad]
+ public static class AddInternalsVisibleToForAllUserAssembliesPostProcess
+ {
+ public static readonly DirectoryInfo AdjustedAssemblyRoot;
+
+ static AddInternalsVisibleToForAllUserAssembliesPostProcess()
+ {
+ AdjustedAssemblyRoot = new DirectoryInfo(Path.Combine(Application.dataPath, "..", "Temp", "Fast Script Reload", "AdjustedDlls"));
+ }
+
+ public static string CreateAssemblyWithInternalsContentsVisibleTo(Assembly changedAssembly, string visibleToAssemblyName)
+ {
+ if(!AdjustedAssemblyRoot.Exists)
+ AdjustedAssemblyRoot.Create();
+
+ using (var assembly = AssemblyDefinition.ReadAssembly(changedAssembly.Location, new ReaderParameters { ReadWrite = false }))
+ {
+ var mainModule = assembly.MainModule;
+
+ var attributeCtor = mainModule.ImportReference(
+ typeof(System.Runtime.CompilerServices.InternalsVisibleToAttribute).GetConstructor(new[] { typeof(string) })
+ );
+
+ var attribute = new CustomAttribute(attributeCtor);
+ attribute.ConstructorArguments.Add(
+ new CustomAttributeArgument(mainModule.TypeSystem.String, visibleToAssemblyName)
+ );
+
+ assembly.CustomAttributes.Add(attribute);
+
+ var newAssemblyPath = new FileInfo(Path.Combine(AdjustedAssemblyRoot.FullName, assembly.Name.Name) + ".dll").FullName;
+ assembly.Write(newAssemblyPath);
+
+ return newAssemblyPath;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/AssemblyPostProcess/AddInternalsVisibleToForAllUserAssembliesPostProcess.cs.meta b/Assets/FastScriptReload/Scripts/Editor/AssemblyPostProcess/AddInternalsVisibleToForAllUserAssembliesPostProcess.cs.meta
new file mode 100644
index 0000000..6419854
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/AssemblyPostProcess/AddInternalsVisibleToForAllUserAssembliesPostProcess.cs.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: b2f64e1d1e2642f9ab712970582c0b45
+timeCreated: 1678785285
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Scripts/Editor/AssemblyPostProcess/AddInternalsVisibleToForAllUserAssembliesPostProcess.cs
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation.meta
new file mode 100644
index 0000000..e47810b
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 5d518c1ca9c2d974a886d5856abadb4d
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting.meta
new file mode 100644
index 0000000..d578aac
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: bdecd2714d8a463fa3bdae705d942796
+timeCreated: 1672992950
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/BuilderPatternFunctionsRewriter.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/BuilderPatternFunctionsRewriter.cs
new file mode 100644
index 0000000..a65524d
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/BuilderPatternFunctionsRewriter.cs
@@ -0,0 +1,36 @@
+using System.Linq;
+using ImmersiveVrToolsCommon.Runtime.Logging;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+
+namespace FastScriptReload.Editor.Compilation.CodeRewriting
+{
+ class BuilderPatternFunctionsRewriter : FastScriptReloadCodeRewriterBase
+ {
+ public BuilderPatternFunctionsRewriter(bool writeRewriteReasonAsComment, bool visitIntoStructuredTrivia = false)
+ : base(writeRewriteReasonAsComment, visitIntoStructuredTrivia)
+ {
+ }
+
+ public override SyntaxNode VisitMethodDeclaration(MethodDeclarationSyntax node)
+ {
+ var ancestorName = node.Ancestors().OfType().FirstOrDefault()?.Identifier.ValueText;
+ if (string.IsNullOrEmpty(ancestorName)) //TODO: that happens too often for some methods, odd. Why? At very least don't spam user
+ {
+ LoggerScoped.LogWarning($"Unable to find ancestor for node '{node.ToFullString()}'");
+ }
+ else
+ {
+ var ancestorNameWithoutPatchedPostfix = ancestorName.Replace(FastScriptReload.Runtime.AssemblyChangesLoader.ClassnamePatchedPostfix, "");
+
+ if (node.ReturnType is IdentifierNameSyntax name && name.Identifier.ValueText == ancestorNameWithoutPatchedPostfix)
+ {
+ return node.WithReturnType(SyntaxFactory.IdentifierName(ancestorName + " "));
+ }
+ }
+
+ return base.VisitMethodDeclaration(node);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/BuilderPatternFunctionsRewriter.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/BuilderPatternFunctionsRewriter.cs.meta
new file mode 100644
index 0000000..2922c1c
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/BuilderPatternFunctionsRewriter.cs.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: ad3d5960a86c431cbea11b8962fa361e
+timeCreated: 1678960928
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/BuilderPatternFunctionsRewriter.cs
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ConstructorRewriter.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ConstructorRewriter.cs
new file mode 100644
index 0000000..3048539
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ConstructorRewriter.cs
@@ -0,0 +1,84 @@
+using System.Linq;
+using FastScriptReload.Runtime;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+
+namespace FastScriptReload.Editor.Compilation.CodeRewriting
+{
+ class ConstructorRewriter : FastScriptReloadCodeRewriterBase
+ {
+ private readonly bool _adjustCtorOnlyForNonNestedTypes;
+
+ public ConstructorRewriter(bool adjustCtorOnlyForNonNestedTypes, bool writeRewriteReasonAsComment)
+ : base(writeRewriteReasonAsComment)
+ {
+ _adjustCtorOnlyForNonNestedTypes = adjustCtorOnlyForNonNestedTypes;
+ }
+
+ public override SyntaxNode VisitConstructorDeclaration(ConstructorDeclarationSyntax node)
+ {
+ if (_adjustCtorOnlyForNonNestedTypes)
+ {
+ var typeNestedLevel = node.Ancestors().Count(a => a is TypeDeclarationSyntax);
+ if (typeNestedLevel == 1)
+ {
+ return AdjustCtorOrDestructorNameForTypeAdjustment(node, node.Identifier);
+ }
+ }
+ else
+ {
+ return AdjustCtorOrDestructorNameForTypeAdjustment(node, node.Identifier);
+ }
+
+ return base.VisitConstructorDeclaration(node);
+ }
+
+ public override SyntaxNode VisitDestructorDeclaration(DestructorDeclarationSyntax node)
+ {
+ if (_adjustCtorOnlyForNonNestedTypes)
+ {
+ var typeNestedLevel = node.Ancestors().Count(a => a is TypeDeclarationSyntax);
+ if (typeNestedLevel == 1)
+ {
+ return AdjustCtorOrDestructorNameForTypeAdjustment(node, node.Identifier);
+ }
+ }
+ else
+ {
+ return AdjustCtorOrDestructorNameForTypeAdjustment(node, node.Identifier);
+ }
+
+ return base.VisitDestructorDeclaration(node);
+ }
+
+ private SyntaxNode AdjustCtorOrDestructorNameForTypeAdjustment(BaseMethodDeclarationSyntax node, SyntaxToken nodeIdentifier)
+ {
+ var typeName = (node.Ancestors().First(n => n is TypeDeclarationSyntax) as TypeDeclarationSyntax).Identifier.ToString();
+ if (!nodeIdentifier.ToFullString().Contains(typeName))
+ {
+ //Used Roslyn version bug, some static methods are also interpreted as ctors, eg
+ // public static void Method()
+ // {
+ // Bar(); //treated as Ctor declaration...
+ // }
+ //
+ // private static void Bar()
+ // {
+ //
+ // }
+ return node;
+ }
+
+ if (!typeName.EndsWith(AssemblyChangesLoader.ClassnamePatchedPostfix))
+ {
+ typeName += AssemblyChangesLoader.ClassnamePatchedPostfix;
+ }
+
+ return AddRewriteCommentIfNeeded(
+ node.ReplaceToken(nodeIdentifier, SyntaxFactory.Identifier(typeName)),
+ $"{nameof(ConstructorRewriter)}:{nameof(AdjustCtorOrDestructorNameForTypeAdjustment)}"
+ );
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ConstructorRewriter.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ConstructorRewriter.cs.meta
new file mode 100644
index 0000000..3a03834
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ConstructorRewriter.cs.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: 1d2a76467ecd40529f59bc68be8d7289
+timeCreated: 1672992987
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ConstructorRewriter.cs
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/CreateNewFieldInitMethodRewriter.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/CreateNewFieldInitMethodRewriter.cs
new file mode 100644
index 0000000..cc010b0
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/CreateNewFieldInitMethodRewriter.cs
@@ -0,0 +1,153 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using ImmersiveVrToolsCommon.Runtime.Logging;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+
+namespace FastScriptReload.Editor.Compilation.CodeRewriting
+{
+ class CreateNewFieldInitMethodRewriter: FastScriptReloadCodeRewriterBase {
+ private readonly Dictionary> _typeToNewFieldDeclarations;
+ private static readonly string NewFieldsToCreateValueFnDictionaryFieldName = "__Patched_NewFieldNameToInitialValueFn";
+ private static readonly string NewFieldsToGetTypeFnDictionaryFieldName = "__Patched_NewFieldsToGetTypeFnDictionaryFieldName";
+ private static readonly string DictionaryFullNamespaceTypeName = "global::System.Collections.Generic.Dictionary";
+
+ public static Dictionary> ResolveNewFieldsToCreateValueFn(Type forType)
+ {
+ return (Dictionary>) forType.GetField(NewFieldsToCreateValueFnDictionaryFieldName, BindingFlags.NonPublic | BindingFlags.Static).GetValue(null);
+ }
+
+ public static Dictionary> ResolveNewFieldsToTypeFn(Type forType)
+ {
+ return (Dictionary>) forType.GetField(NewFieldsToGetTypeFnDictionaryFieldName, BindingFlags.NonPublic | BindingFlags.Static).GetValue(null);
+ }
+
+ public CreateNewFieldInitMethodRewriter(Dictionary> typeToNewFieldDeclarations, bool writeRewriteReasonAsComment)
+ :base(writeRewriteReasonAsComment)
+ {
+ _typeToNewFieldDeclarations = typeToNewFieldDeclarations;
+ }
+
+ public override SyntaxNode VisitClassDeclaration(ClassDeclarationSyntax node)
+ {
+ var fullClassName = RoslynUtils.GetMemberFQDN(node, node.Identifier.ToString());
+ if (!_typeToNewFieldDeclarations.TryGetValue(fullClassName, out var newClassFields))
+ {
+ LoggerScoped.LogWarning($"Unable to find new-fields for type: {fullClassName}, this is not an issue if there are no new fields for that type.");
+ }
+
+ Func getObjectFnSyntax = fieldDeclarationNode => fieldDeclarationNode.Declaration.Variables[0].Initializer?.Value //value captured from initializer
+ ?? SyntaxFactory.DefaultExpression(SyntaxFactory.IdentifierName(fieldDeclarationNode.Declaration.Type.ToString()));
+ var withDictionaryFieldNameToInitFieldValue = CreateNewFieldNameToGetObjectFnDictionary(node, newClassFields, getObjectFnSyntax, NewFieldsToCreateValueFnDictionaryFieldName);
+
+ //TODO: slightly odd scenario 'When explicit #nullable enable is used, reference types should be rewritten to typeof(type) for initialization and value types should remain typeof(type?)'
+ // Func getObjectTypeFnSyntax = fieldDeclarationNode => SyntaxFactory.TypeOfExpression(
+ // SyntaxFactory.ParseTypeName(fieldDeclarationNode.Declaration.Type.ToFullString().Replace("?", ""))
+ // );
+ Func getObjectTypeFnSyntax = fieldDeclarationNode => SyntaxFactory.TypeOfExpression(fieldDeclarationNode.Declaration.Type);
+ return CreateNewFieldNameToGetObjectFnDictionary(withDictionaryFieldNameToInitFieldValue, newClassFields, getObjectTypeFnSyntax, NewFieldsToGetTypeFnDictionaryFieldName);
+ }
+
+ private ClassDeclarationSyntax CreateNewFieldNameToGetObjectFnDictionary(ClassDeclarationSyntax node,
+ List newClassFields, Func getObjectFnSyntax, string dictionaryFieldName)
+ {
+ var dictionaryKeyToInitValueNodes = newClassFields.SelectMany(fieldName =>
+ {
+ var fieldDeclarationNode = node.ChildNodes().OfType()
+ .Single(f => f.Declaration.Variables.First().Identifier.ToString() == fieldName);
+
+ return new[]
+ {
+ (SyntaxNodeOrToken)SyntaxFactory.AssignmentExpression(
+ SyntaxKind.SimpleAssignmentExpression,
+ SyntaxFactory.ImplicitElementAccess()
+ .WithArgumentList(
+ SyntaxFactory.BracketedArgumentList(
+ SyntaxFactory.SingletonSeparatedList(
+ SyntaxFactory.Argument(
+ SyntaxFactory.LiteralExpression(
+ SyntaxKind.StringLiteralExpression,
+ SyntaxFactory.Literal(fieldDeclarationNode.Declaration.Variables.First()
+ .Identifier.ToString())))))), //variable name
+ SyntaxFactory.ParenthesizedLambdaExpression(getObjectFnSyntax(fieldDeclarationNode))),
+ SyntaxFactory.Token(SyntaxKind.CommaToken) //comma, add for all
+ };
+ }).ToArray();
+
+
+ var dictionaryInitializer =
+ SyntaxFactory.InitializerExpression(
+ SyntaxKind.ObjectInitializerExpression,
+ SyntaxFactory.SeparatedList(
+ dictionaryKeyToInitValueNodes.ToArray()
+ ));
+
+ var withDictionaryFieldNameToInitFieldValue = node.AddMembers(
+ SyntaxFactory.FieldDeclaration(
+ SyntaxFactory.VariableDeclaration(
+ SyntaxFactory.GenericName(
+ SyntaxFactory.Identifier(DictionaryFullNamespaceTypeName))
+ .WithTypeArgumentList(
+ SyntaxFactory.TypeArgumentList(
+ SyntaxFactory.SeparatedList(
+ new SyntaxNodeOrToken[]
+ {
+ SyntaxFactory.PredefinedType(
+ SyntaxFactory.Token(SyntaxKind.StringKeyword)),
+ SyntaxFactory.Token(SyntaxKind.CommaToken),
+ SyntaxFactory.GenericName(
+ SyntaxFactory.Identifier("global::System.Func"))
+ .WithTypeArgumentList(
+ SyntaxFactory.TypeArgumentList(
+ SyntaxFactory.SingletonSeparatedList(
+ SyntaxFactory.PredefinedType(
+ SyntaxFactory.Token(SyntaxKind.ObjectKeyword)))))
+ }))))
+ .WithVariables(
+ SyntaxFactory.SingletonSeparatedList(
+ SyntaxFactory.VariableDeclarator(
+ SyntaxFactory.Identifier(dictionaryFieldName))
+ .WithInitializer(
+ SyntaxFactory.EqualsValueClause(
+ SyntaxFactory.ObjectCreationExpression(
+ SyntaxFactory.GenericName(
+ SyntaxFactory.Identifier(DictionaryFullNamespaceTypeName))
+ .WithTypeArgumentList(
+ SyntaxFactory.TypeArgumentList(
+ SyntaxFactory.SeparatedList(
+ new SyntaxNodeOrToken[]
+ {
+ SyntaxFactory.PredefinedType(
+ SyntaxFactory.Token(SyntaxKind.StringKeyword)),
+ SyntaxFactory.Token(SyntaxKind.CommaToken),
+ SyntaxFactory.QualifiedName(
+ SyntaxFactory.IdentifierName("global::System"),
+ SyntaxFactory.GenericName(
+ SyntaxFactory.Identifier("Func"))
+ .WithTypeArgumentList(
+ SyntaxFactory.TypeArgumentList(
+ SyntaxFactory
+ .SingletonSeparatedList<
+ TypeSyntax>(
+ SyntaxFactory
+ .PredefinedType(
+ SyntaxFactory.Token(
+ SyntaxKind
+ .ObjectKeyword))))))
+ }))))
+ .WithInitializer(dictionaryInitializer))))))
+ .WithModifiers(
+ SyntaxFactory.TokenList(
+ SyntaxFactory.Token(SyntaxKind.PrivateKeyword),
+ SyntaxFactory.Token(SyntaxKind.StaticKeyword)))
+ .NormalizeWhitespace()
+ .WithLeadingTrivia(SyntaxFactory.TriviaList(SyntaxFactory.ElasticCarriageReturnLineFeed))
+ .WithTrailingTrivia(SyntaxFactory.TriviaList(SyntaxFactory.ElasticCarriageReturnLineFeed, SyntaxFactory.ElasticCarriageReturnLineFeed))
+ );
+ return AddRewriteCommentIfNeeded(withDictionaryFieldNameToInitFieldValue, $"{nameof(CreateNewFieldInitMethodRewriter)}", true);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/CreateNewFieldInitMethodRewriter.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/CreateNewFieldInitMethodRewriter.cs.meta
new file mode 100644
index 0000000..1bda7b4
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/CreateNewFieldInitMethodRewriter.cs.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: 6bbeaafe1bf54bda9b46e237bec3ccc0
+timeCreated: 1674215064
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/CreateNewFieldInitMethodRewriter.cs
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ExtensionMethodsCallingOtherExtensionMethodsInSameFileRewriter.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ExtensionMethodsCallingOtherExtensionMethodsInSameFileRewriter.cs
new file mode 100644
index 0000000..21b7d2b
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ExtensionMethodsCallingOtherExtensionMethodsInSameFileRewriter.cs
@@ -0,0 +1,74 @@
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+
+namespace FastScriptReload.Editor.Compilation.CodeRewriting
+{
+ // When calling other extension methods from same file compilation would fail with 'The call is ambiguous between the following methods or properties'
+ class ExtensionMethodsCallingOtherExtensionMethodsInSameFileRewriter : FastScriptReloadCodeRewriterBase
+ {
+ private Dictionary> _typeNameToDeclaredMethodNameToThisArgName = new Dictionary>();
+
+ public ExtensionMethodsCallingOtherExtensionMethodsInSameFileRewriter(bool writeRewriteReasonAsComment)
+ : base(writeRewriteReasonAsComment)
+ {
+
+ }
+
+ public override SyntaxNode VisitClassDeclaration(ClassDeclarationSyntax node)
+ {
+ var classDeclaredMethodNameToThisArgName = new Dictionary();
+ _typeNameToDeclaredMethodNameToThisArgName[node.Identifier.Text] = classDeclaredMethodNameToThisArgName;
+
+ foreach (var methodDeclaration in node.Members
+ .Where(n => n.Kind() == SyntaxKind.MethodDeclaration)
+ .Select(n => (MethodDeclarationSyntax)n))
+ {
+ var parameters = methodDeclaration.ParameterList.Parameters;
+ if (parameters.Count > 0 && parameters[0].Modifiers.Any(SyntaxKind.ThisKeyword))
+ {
+ var thisArgumentName = parameters[0].Identifier.Text;
+ classDeclaredMethodNameToThisArgName.TryAdd(methodDeclaration.Identifier.Text, thisArgumentName);
+ }
+ }
+
+ return base.VisitClassDeclaration(node);
+ }
+
+ public override SyntaxNode VisitInvocationExpression(InvocationExpressionSyntax node)
+ {
+ // Check if the invocation is an instance method with a member access (e.g., selfName.CallingOtherTest())
+ if (node.Expression is MemberAccessExpressionSyntax memberAccess)
+ {
+ var methodName = memberAccess.Name.Identifier.Text;
+ var instanceArgName = memberAccess.Expression;
+ var className = node.Ancestors().OfType().First().Identifier.Text;
+ if (_typeNameToDeclaredMethodNameToThisArgName.TryGetValue(className, out var declaredMethodNameToThisArgName)
+ && declaredMethodNameToThisArgName.TryGetValue(methodName, out var definedInstanceArgName))
+ {
+ if (instanceArgName.ToString() == definedInstanceArgName)
+ {
+ // Rewrite the invocation to a static method call
+ var newInvocation = SyntaxFactory.InvocationExpression(SyntaxFactory.IdentifierName(methodName))
+ .WithArgumentList(
+ SyntaxFactory.ArgumentList(
+ SyntaxFactory.SeparatedList(
+ node.ArgumentList.Arguments.Insert(0, SyntaxFactory.Argument(instanceArgName)) // Add instance as first argument
+ )
+ )
+ ).NormalizeWhitespace();
+
+ return AddRewriteCommentIfNeeded(
+ newInvocation,
+ $"{nameof(ExtensionMethodsCallingOtherExtensionMethodsInSameFileRewriter)}:Replaced extension method call with static call"
+ );
+ }
+ }
+ }
+
+ return base.VisitInvocationExpression(node);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ExtensionMethodsCallingOtherExtensionMethodsInSameFileRewriter.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ExtensionMethodsCallingOtherExtensionMethodsInSameFileRewriter.cs.meta
new file mode 100644
index 0000000..7b2efaa
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ExtensionMethodsCallingOtherExtensionMethodsInSameFileRewriter.cs.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: 9f739c197f9040efabf7f64461882d7b
+timeCreated: 1727194643
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ExtensionMethodsCallingOtherExtensionMethodsInSameFileRewriter.cs
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/FastScriptReloadCodeRewriterBase.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/FastScriptReloadCodeRewriterBase.cs
new file mode 100644
index 0000000..afa01a7
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/FastScriptReloadCodeRewriterBase.cs
@@ -0,0 +1,64 @@
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace FastScriptReload.Editor.Compilation.CodeRewriting
+{
+ public abstract class FastScriptReloadCodeRewriterBase : CSharpSyntaxRewriter
+ {
+ protected readonly bool _writeRewriteReasonAsComment;
+
+ protected FastScriptReloadCodeRewriterBase(bool writeRewriteReasonAsComment, bool visitIntoStructuredTrivia = false) : base(visitIntoStructuredTrivia)
+ {
+ _writeRewriteReasonAsComment = writeRewriteReasonAsComment;
+ }
+
+ protected SyntaxToken AddRewriteCommentIfNeeded(SyntaxToken syntaxToken, string commentText, bool append = false)
+ {
+ return AddRewriteCommentIfNeeded(syntaxToken, commentText, _writeRewriteReasonAsComment, append);
+ }
+
+ public static SyntaxToken AddRewriteCommentIfNeeded(SyntaxToken syntaxToken, string commentText, bool writeRewriteReasonAsComment, bool append)
+ {
+ if (writeRewriteReasonAsComment)
+ {
+ if (append)
+ {
+ return syntaxToken.WithLeadingTrivia(
+ syntaxToken.LeadingTrivia.Add(SyntaxFactory.Comment($"/*FSR:{commentText}*/")));
+ }
+ else
+ {
+ return syntaxToken.WithTrailingTrivia(
+ syntaxToken.TrailingTrivia.Add(SyntaxFactory.Comment($"/*FSR:{commentText}*/")));
+ }
+ }
+
+ return syntaxToken;
+ }
+
+ protected T AddRewriteCommentIfNeeded(T syntaxNode, string commentText, bool append = false)
+ where T : SyntaxNode
+ {
+ return AddRewriteCommentIfNeeded(syntaxNode, commentText, _writeRewriteReasonAsComment, append);
+ }
+
+ public static T AddRewriteCommentIfNeeded(T syntaxNode, string commentText, bool writeRewriteReasonAsComment, bool append) where T : SyntaxNode
+ {
+ if (writeRewriteReasonAsComment)
+ {
+ if (append)
+ {
+ return syntaxNode.WithLeadingTrivia(syntaxNode.GetLeadingTrivia()
+ .Add(SyntaxFactory.Comment($"/*FSR:{commentText}*/")));
+ }
+ else
+ {
+ return syntaxNode.WithTrailingTrivia(syntaxNode.GetTrailingTrivia()
+ .Add(SyntaxFactory.Comment($"/*FSR:{commentText}*/")));
+ }
+ }
+
+ return syntaxNode;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/FastScriptReloadCodeRewriterBase.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/FastScriptReloadCodeRewriterBase.cs.meta
new file mode 100644
index 0000000..6288f64
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/FastScriptReloadCodeRewriterBase.cs.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: bcc848f0140d41cdbf1003b0f594694e
+timeCreated: 1677233811
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/FastScriptReloadCodeRewriterBase.cs
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/FieldsWalker.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/FieldsWalker.cs
new file mode 100644
index 0000000..282ca79
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/FieldsWalker.cs
@@ -0,0 +1,43 @@
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+
+namespace FastScriptReload.Editor.Compilation.CodeRewriting
+{
+ class FieldsWalker : CSharpSyntaxWalker {
+ private readonly Dictionary> _typeNameToFieldDeclarations = new Dictionary>();
+
+ public override void VisitClassDeclaration(ClassDeclarationSyntax node)
+ {
+ var className = node.Identifier;
+ var fullClassName = RoslynUtils.GetMemberFQDN(node, className.ToString());
+ if(!_typeNameToFieldDeclarations.ContainsKey(fullClassName)) {
+ _typeNameToFieldDeclarations[fullClassName] = new List();
+ }
+
+ base.VisitClassDeclaration(node);
+ }
+
+ public override void VisitFieldDeclaration(FieldDeclarationSyntax node)
+ {
+ var fieldName = node.Declaration.Variables.First().Identifier.ToString();
+ var fullClassName = RoslynUtils.GetMemberFQDNWithoutMemberName(node);
+ if(!_typeNameToFieldDeclarations.ContainsKey(fullClassName)) {
+ _typeNameToFieldDeclarations[fullClassName] = new List();
+ }
+
+ _typeNameToFieldDeclarations[fullClassName].Add(new NewFieldDeclaration(fieldName, node.Declaration.Type.ToString(), node));
+
+ base.VisitFieldDeclaration(node);
+ }
+
+ public Dictionary> GetTypeToFieldDeclarations() {
+ return _typeNameToFieldDeclarations;
+ }
+
+ public List GetTypeNames() {
+ return _typeNameToFieldDeclarations.Select(kv => kv.Key).ToList();
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/FieldsWalker.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/FieldsWalker.cs.meta
new file mode 100644
index 0000000..51dd9dc
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/FieldsWalker.cs.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: e4a18d5133af410bab07d9c1a973fe7a
+timeCreated: 1672993042
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/FieldsWalker.cs
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/HotReloadCompliantRewriter.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/HotReloadCompliantRewriter.cs
new file mode 100644
index 0000000..df628a3
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/HotReloadCompliantRewriter.cs
@@ -0,0 +1,71 @@
+using System.Collections.Generic;
+using FastScriptReload.Runtime;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+
+namespace FastScriptReload.Editor.Compilation.CodeRewriting
+{
+ class HotReloadCompliantRewriter : FastScriptReloadCodeRewriterBase
+ {
+ public List StrippedUsingDirectives = new List();
+ public List OriginalIdentifiersRenamedToContainPatchedPostfix = new List();
+
+ public HotReloadCompliantRewriter(bool writeRewriteReasonAsComment, bool visitIntoStructuredTrivia = false)
+ : base(writeRewriteReasonAsComment, visitIntoStructuredTrivia)
+ {
+ }
+
+ public override SyntaxNode VisitClassDeclaration(ClassDeclarationSyntax node)
+ {
+ return AddPatchedPostfixToTopLevelDeclarations(node, node.Identifier);
+ //if subclasses need to be adjusted, it's done via recursion.
+ // foreach (var childNode in node.ChildNodes().OfType())
+ // {
+ // var changed = Visit(childNode);
+ // node = node.ReplaceNode(childNode, changed);
+ // }
+ }
+
+ public override SyntaxNode VisitStructDeclaration(StructDeclarationSyntax node)
+ {
+ return AddPatchedPostfixToTopLevelDeclarations(node, node.Identifier);
+ }
+
+ public override SyntaxNode VisitEnumDeclaration(EnumDeclarationSyntax node)
+ {
+ return AddPatchedPostfixToTopLevelDeclarations(node, node.Identifier);
+ }
+
+ public override SyntaxNode VisitDelegateDeclaration(DelegateDeclarationSyntax node)
+ {
+ return AddPatchedPostfixToTopLevelDeclarations(node, node.Identifier);
+ }
+
+ public override SyntaxNode VisitInterfaceDeclaration(InterfaceDeclarationSyntax node)
+ {
+ return AddPatchedPostfixToTopLevelDeclarations(node, node.Identifier);
+ }
+
+ public override SyntaxNode VisitUsingDirective(UsingDirectiveSyntax node)
+ {
+ if (node.Parent is CompilationUnitSyntax)
+ {
+ StrippedUsingDirectives.Add(node.ToFullString());
+ return null;
+ }
+
+ return base.VisitUsingDirective(node);
+ }
+
+ private SyntaxNode AddPatchedPostfixToTopLevelDeclarations(CSharpSyntaxNode node, SyntaxToken identifier)
+ {
+ OriginalIdentifiersRenamedToContainPatchedPostfix.Add(identifier.ValueText);
+
+ var newIdentifier = SyntaxFactory.Identifier(identifier + AssemblyChangesLoader.ClassnamePatchedPostfix);
+ newIdentifier = AddRewriteCommentIfNeeded(newIdentifier, $"{nameof(HotReloadCompliantRewriter)}:{nameof(AddPatchedPostfixToTopLevelDeclarations)}");
+ node = node.ReplaceToken(identifier, newIdentifier);
+ return node;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/HotReloadCompliantRewriter.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/HotReloadCompliantRewriter.cs.meta
new file mode 100644
index 0000000..20c4aff
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/HotReloadCompliantRewriter.cs.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: f75e3e02acfa4397a558a923f7fa4f8e
+timeCreated: 1672993042
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/HotReloadCompliantRewriter.cs
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ManualUserDefinedScriptOverridesRewriter.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ManualUserDefinedScriptOverridesRewriter.cs
new file mode 100644
index 0000000..a08ef94
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ManualUserDefinedScriptOverridesRewriter.cs
@@ -0,0 +1,127 @@
+using System;
+using System.Linq;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+
+namespace FastScriptReload.Editor.Compilation.CodeRewriting
+{
+ public class ManualUserDefinedScriptOverridesRewriter : FastScriptReloadCodeRewriterBase
+ {
+ private readonly SyntaxNode _userDefinedOverridesRoot;
+
+ public ManualUserDefinedScriptOverridesRewriter(SyntaxNode userDefinedOverridesRoot, bool writeRewriteReasonAsComment, bool visitIntoStructuredTrivia = false)
+ : base(writeRewriteReasonAsComment, visitIntoStructuredTrivia)
+ {
+ _userDefinedOverridesRoot = userDefinedOverridesRoot;
+ }
+
+ //TODO: refactor to use OverrideDeclarationWithMatchingUserDefinedIfExists
+ public override SyntaxNode VisitConversionOperatorDeclaration(ConversionOperatorDeclarationSyntax node)
+ {
+ var methodFQDN = RoslynUtils.GetMemberFQDN(node, "operator");
+ var matchingInOverride = _userDefinedOverridesRoot.DescendantNodes()
+ //implicit conversion operators do not have name, just parameter list
+ .OfType()
+ .FirstOrDefault(m => m.ParameterList.ToString() == node.ParameterList.ToString() //parameter lists is type / order / names, all good for targetting if there's a proper match
+ && methodFQDN == RoslynUtils.GetMemberFQDN(m, "operator") //make sure same FQDN, even though there's no name there could be more implicit operators in file
+ );
+
+ if (matchingInOverride != null)
+ {
+ return AddRewriteCommentIfNeeded(matchingInOverride.WithTriviaFrom(node), $"User defined custom conversion override", true);
+ }
+ else {
+ return base.VisitConversionOperatorDeclaration(node);
+ }
+ }
+
+ //TODO: refactor to use OverrideDeclarationWithMatchingUserDefinedIfExists
+ public override SyntaxNode VisitMethodDeclaration(MethodDeclarationSyntax node)
+ {
+ var methodName = node.Identifier.ValueText;
+ var methodFQDN = RoslynUtils.GetMemberFQDN(node, node.Identifier.ToString());
+ var matchingInOverride = _userDefinedOverridesRoot.DescendantNodes()
+ .OfType()
+ .FirstOrDefault(m => m.Identifier.ValueText == methodName
+ && m.ParameterList.Parameters.Count == node.ParameterList.Parameters.Count
+ && m.ParameterList.ToString() == node.ParameterList.ToString() //parameter lists is type / order / names, all good for targetting if there's a proper match
+ && m.TypeParameterList?.ToString() == node.TypeParameterList?.ToString() //typed paratemets are for generics, also check
+ && methodFQDN == RoslynUtils.GetMemberFQDN(m, m.Identifier.ToString()) //last check for mathod FQDN (potentially slower than others)
+ );
+
+ if (matchingInOverride != null)
+ {
+ return AddRewriteCommentIfNeeded(matchingInOverride.WithTriviaFrom(node), $"User defined custom method override", true);
+ }
+ else {
+ return base.VisitMethodDeclaration(node);
+ }
+ }
+
+
+ public override SyntaxNode VisitConstructorDeclaration(ConstructorDeclarationSyntax node)
+ {
+ return OverrideDeclarationWithMatchingUserDefinedIfExists(
+ node,
+ (d) => d.Identifier.ValueText,
+ (d) => HasSameParametersPredicate(node.ParameterList)(d.ParameterList),
+ (d) => base.VisitConstructorDeclaration(d)
+ );
+ }
+
+ public override SyntaxNode VisitDestructorDeclaration(DestructorDeclarationSyntax node)
+ {
+ return OverrideDeclarationWithMatchingUserDefinedIfExists(
+ node,
+ (d) => d.Identifier.ValueText,
+ (d) => HasSameParametersPredicate(node.ParameterList)(d.ParameterList),
+ (d) => base.VisitDestructorDeclaration(d)
+ );
+ }
+
+ public override SyntaxNode VisitPropertyDeclaration(PropertyDeclarationSyntax node)
+ {
+ return OverrideDeclarationWithMatchingUserDefinedIfExists(
+ node,
+ (d) => d.Identifier.ValueText,
+ (d) => true,
+ (d) => base.VisitPropertyDeclaration(d)
+ );
+ }
+
+ private SyntaxNode OverrideDeclarationWithMatchingUserDefinedIfExists(T node, Func getName,
+ Func customFindMatchInOverridePredicate, Func visitDefault)
+ where T: MemberDeclarationSyntax
+ {
+ var name = getName(node);
+ var fqdn = RoslynUtils.GetMemberFQDN(node, name);
+ var matchingInOverride = _userDefinedOverridesRoot.DescendantNodes()
+ .OfType()
+ .FirstOrDefault(d =>
+ {
+ var declarationName = getName(d);
+ return declarationName == name
+ && customFindMatchInOverridePredicate(d)
+ && fqdn == RoslynUtils.GetMemberFQDN(d, declarationName); //last check for mathod FQDN (potentially slower than others)
+ }
+
+ );
+
+ if (matchingInOverride != null)
+ {
+ return AddRewriteCommentIfNeeded(matchingInOverride.WithTriviaFrom(node),
+ $"User defined custom {typeof(T)} override", true);
+ }
+ else
+ {
+ return visitDefault(node);
+ }
+ }
+
+ private Func HasSameParametersPredicate(ParameterListSyntax parameters)
+ {
+ return (resolvedParams) => resolvedParams.Parameters.Count == parameters.Parameters.Count
+ && resolvedParams.ToString() == parameters.ToString();
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ManualUserDefinedScriptOverridesRewriter.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ManualUserDefinedScriptOverridesRewriter.cs.meta
new file mode 100644
index 0000000..79d0611
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ManualUserDefinedScriptOverridesRewriter.cs.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: 7d61f64c891c45b68a7db1ea67854127
+timeCreated: 1678101034
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ManualUserDefinedScriptOverridesRewriter.cs
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/NewFieldDeclaration.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/NewFieldDeclaration.cs
new file mode 100644
index 0000000..b97ecad
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/NewFieldDeclaration.cs
@@ -0,0 +1,18 @@
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+
+namespace FastScriptReload.Editor.Compilation.CodeRewriting
+{
+ public class NewFieldDeclaration
+ {
+ public string FieldName { get; }
+ public string TypeName { get; }
+ public FieldDeclarationSyntax FieldDeclarationSyntax { get; } //TODO: PERF: will that block whole tree from being garbage collected
+
+ public NewFieldDeclaration(string fieldName, string typeName, FieldDeclarationSyntax fieldDeclarationSyntax)
+ {
+ FieldName = fieldName;
+ TypeName = typeName;
+ FieldDeclarationSyntax = fieldDeclarationSyntax;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/NewFieldDeclaration.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/NewFieldDeclaration.cs.meta
new file mode 100644
index 0000000..82e7fe9
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/NewFieldDeclaration.cs.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: ad6e49db99ff4065b14a3fc416af560b
+timeCreated: 1673019285
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/NewFieldDeclaration.cs
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/NewFieldsRewriter.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/NewFieldsRewriter.cs
new file mode 100644
index 0000000..0a7a319
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/NewFieldsRewriter.cs
@@ -0,0 +1,144 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using FastScriptReload.Runtime;
+using FastScriptReload.Scripts.Runtime;
+using ImmersiveVrToolsCommon.Runtime.Logging;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+
+namespace FastScriptReload.Editor.Compilation.CodeRewriting
+{
+ class NewFieldsRewriter : FastScriptReloadCodeRewriterBase
+ {
+ private readonly Dictionary> _typeToNewFieldDeclarations;
+
+ public NewFieldsRewriter(Dictionary> typeToNewFieldDeclarations, bool writeRewriteReasonAsComment)
+ :base(writeRewriteReasonAsComment)
+ {
+ _typeToNewFieldDeclarations = typeToNewFieldDeclarations;
+ }
+
+ public static List GetReplaceableMembers(Type type)
+ { //TODO: later other might need to be included? props?
+ return type.GetFields(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic).Cast().ToList();
+ }
+
+
+ public override SyntaxNode VisitInvocationExpression(InvocationExpressionSyntax node)
+ {
+ if (node.Expression.ToString() == "nameof")
+ {
+ var classNode = node.Ancestors().OfType().FirstOrDefault();
+ if (classNode != null)
+ {
+ var fullClassName = RoslynUtils.GetMemberFQDN(classNode, classNode.Identifier.ToString());
+ if (!string.IsNullOrEmpty(fullClassName))
+ {
+ var nameofExpressionParts = node.ArgumentList.Arguments.First().ToFullString().Split('.'); //nameof could have multiple . like NewFieldCustomClass.FieldInThatClass
+ var fieldName = nameofExpressionParts.First(); // should take first part only to determine if new field eg. 'NewFieldCustomClass'
+ if (_typeToNewFieldDeclarations.TryGetValue(fullClassName, out var allNewFieldNamesForClass))
+ {
+ if (allNewFieldNamesForClass.Contains(fieldName))
+ {
+ return AddRewriteCommentIfNeeded(
+ SyntaxFactory.LiteralExpression(SyntaxKind.StringLiteralExpression, SyntaxFactory.Literal(nameofExpressionParts.Last())), // should take last part only to for actual string eg. 'FieldInThatClass'
+ $"{nameof(NewFieldsRewriter)}:{nameof(VisitInvocationExpression)}");
+ }
+
+ }
+ }
+ }
+ }
+
+ return base.VisitInvocationExpression(node);
+ }
+
+ public override SyntaxNode VisitIdentifierName(IdentifierNameSyntax node)
+ {
+ var classNode = node.Ancestors().OfType().FirstOrDefault();
+ if (classNode != null)
+ {
+ var fullClassName = RoslynUtils.GetMemberFQDN(classNode, classNode.Identifier.ToString());
+ if (!string.IsNullOrEmpty(fullClassName))
+ {
+ var fieldName = node.Identifier.ToString();
+ if (_typeToNewFieldDeclarations.TryGetValue(fullClassName, out var allNewFieldNamesForClass))
+ {
+ if (allNewFieldNamesForClass.Contains(fieldName))
+ {
+ if(node.Parent is MemberAccessExpressionSyntax memberAccessExpressionSyntax)
+ {
+ //for member access expressions only rewrite if used with .this, eg this.NewField, that prevents rewriting of static class fields with same name
+ if (!memberAccessExpressionSyntax.ToString().StartsWith("this."))
+ {
+ return base.VisitIdentifierName(node);
+ }
+ }
+
+ var isNameOfExpression = node.Ancestors().OfType().Any(e => e.Expression.ToString() == "nameof");
+ if (!isNameOfExpression) //nameof expression will be rewritten via VisitInvocationExpression
+ {
+ return
+ AddRewriteCommentIfNeeded(
+ SyntaxFactory.MemberAccessExpression(
+ SyntaxKind.SimpleMemberAccessExpression,
+ SyntaxFactory.InvocationExpression(
+ SyntaxFactory.MemberAccessExpression(
+ SyntaxKind.SimpleMemberAccessExpression,
+ SyntaxFactory.IdentifierName(typeof(TemporaryNewFieldValues).FullName),
+ SyntaxFactory.GenericName(
+ SyntaxFactory.Identifier(nameof(TemporaryNewFieldValues.ResolvePatchedObject)))
+ .WithTypeArgumentList(
+ SyntaxFactory.TypeArgumentList(
+ SyntaxFactory.SingletonSeparatedList(
+ SyntaxFactory.IdentifierName(fullClassName + AssemblyChangesLoader.ClassnamePatchedPostfix))))))
+ .WithArgumentList(
+ SyntaxFactory.ArgumentList(
+ SyntaxFactory.SingletonSeparatedList(
+ SyntaxFactory.Argument(
+ SyntaxFactory.ThisExpression())))),
+ SyntaxFactory.IdentifierName(fieldName))
+ .WithTriviaFrom(node),
+ $"{nameof(NewFieldsRewriter)}:{nameof(VisitIdentifierName)}"
+ );
+ }
+ }
+ }
+ else
+ {
+ LoggerScoped.LogWarning($"Unable to find type: {fullClassName}");
+ }
+ }
+ }
+
+ return base.VisitIdentifierName(node);
+ }
+
+ public override SyntaxNode VisitFieldDeclaration(FieldDeclarationSyntax node)
+ {
+ var fieldName = node.Declaration.Variables.First().Identifier.ToString();
+ var fullClassName = RoslynUtils.GetMemberFQDNWithoutMemberName(node);
+
+ if (_typeToNewFieldDeclarations.TryGetValue(fullClassName, out var newFields))
+ {
+ if (newFields.Contains(fieldName))
+ {
+ var existingLeading = node.GetLeadingTrivia();
+ var existingTrailing = node.GetTrailingTrivia();
+
+ return AddRewriteCommentIfNeeded(
+ node
+ .WithLeadingTrivia(existingLeading.Add(SyntaxFactory.Comment("/* ")))
+ .WithTrailingTrivia(existingTrailing.Insert(0, SyntaxFactory.Comment(" */ //Auto-excluded to prevent exceptions - see docs"))),
+ $"{nameof(NewFieldsRewriter)}:{nameof(VisitFieldDeclaration)}"
+ );
+ }
+ }
+
+ return base.VisitFieldDeclaration(node);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/NewFieldsRewriter.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/NewFieldsRewriter.cs.meta
new file mode 100644
index 0000000..30a4f03
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/NewFieldsRewriter.cs.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: 0e9e687bdfc0444395deab1e7c68ed3f
+timeCreated: 1672993042
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/NewFieldsRewriter.cs
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials.meta
new file mode 100644
index 0000000..87b3fb4
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 919d4ff85d4d4156bddf5c48bcc99da1
+timeCreated: 1719699288
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialClassFinder.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialClassFinder.cs
new file mode 100644
index 0000000..ec56282
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialClassFinder.cs
@@ -0,0 +1,87 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using UnityEngine;
+
+public static class PartialClassFinder
+{
+ //TODO: optimize lookup, currently this loads all files in directory and checks if they have 'partial' string in them. For directories with many files this will not be sufficient
+ public static IEnumerable FindPartialClassFilesInDirectory(string filePath, int maxDepth = int.MaxValue)
+ {
+ if (string.IsNullOrEmpty(filePath) || !File.Exists(filePath))
+ return Enumerable.Empty();
+
+ string directory = Path.GetDirectoryName(filePath);
+ string fileContent = File.ReadAllText(filePath);
+
+ string partialClassName = ExtractPartialClassName(fileContent);
+ if (string.IsNullOrEmpty(partialClassName))
+ {
+ Debug.LogWarning($"No partial class/struct found in file: {filePath}");
+ return Enumerable.Empty();
+ }
+
+ return FindPartialClassFilesRecursively(directory, partialClassName, maxDepth, currentDepth: 0);
+ }
+
+ private static IEnumerable FindPartialClassFilesRecursively(string directory, string partialClassName, int maxDepth, int currentDepth)
+ {
+ var files = new List();
+
+ try
+ {
+ // Search in current directory
+ files.AddRange(Directory.GetFiles(directory, "*.cs")
+ .Where(file => IsPartialClassFile(file, partialClassName)));
+
+ // If we haven't reached max depth, search in subdirectories
+ if (currentDepth < maxDepth)
+ {
+ foreach (var subDir in Directory.GetDirectories(directory))
+ {
+ files.AddRange(FindPartialClassFilesRecursively(subDir, partialClassName, maxDepth, currentDepth + 1));
+ }
+ }
+ }
+ catch (UnauthorizedAccessException ex)
+ {
+ Debug.LogWarning($"Access denied to directory: {directory}. Error: {ex.Message}");
+ }
+ catch (Exception ex)
+ {
+ Debug.LogError($"Error searching directory: {directory}. Error: {ex.Message}");
+ }
+
+ return files;
+ }
+
+ private static bool IsPartialClassFile(string filePath, string className)
+ {
+ try
+ {
+ string content = File.ReadAllText(filePath);
+ return content.Contains($"partial class {className}")
+ || content.Contains($"partial struct {className}");
+ }
+ catch (Exception ex)
+ {
+ Debug.LogError($"Error reading file: {filePath}. Error: {ex.Message}");
+ return false;
+ }
+ }
+
+ private static string ExtractPartialClassName(string fileContent)
+ {
+ // This is a simple implementation and might need to be more robust
+ // depending on your specific needs
+ var partialClassDeclaration = fileContent.Split(new[] { "partial class", "partial struct" }, StringSplitOptions.RemoveEmptyEntries)
+ .Skip(1)
+ .FirstOrDefault();
+
+ if (partialClassDeclaration == null)
+ return string.Empty;
+
+ return partialClassDeclaration.TrimStart().Split(new[] { ' ', '{', ':' }, StringSplitOptions.RemoveEmptyEntries).FirstOrDefault().Trim();
+ }
+}
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialClassFinder.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialClassFinder.cs.meta
new file mode 100644
index 0000000..b2d7926
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialClassFinder.cs.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: 6f182f9db524441e80f367f8f99d8a5f
+timeCreated: 1719778688
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialClassFinder.cs
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialTreeProcessor.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialTreeProcessor.cs
new file mode 100644
index 0000000..021864f
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialTreeProcessor.cs
@@ -0,0 +1,92 @@
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+
+namespace FastScriptReload.Editor.Compilation.CodeRewriting
+{
+ internal static class PartialTreeProcessor
+ {
+ ///
+ /// Processes a syntax tree containing partial type definitions, merging it with other partial definitions found in the same directory.
+ ///
+ /// The original syntax tree to process.
+ /// A collection of defined preprocessor symbols.
+ /// A new SyntaxTree with merged partial types and added InternalsVisibleTo attribute.
+ ///
+ /// This method performs the following steps:
+ /// 1. Checks if the tree contains partial types.
+ /// 2. If it does, processes the current tree and other partial files in the same directory.
+ /// 3. Combines all partial type declarations.
+ /// 4. Creates a new compilation unit with merged types and using directives.
+ /// 5. Adds the InternalsVisibleTo attribute to the resulting tree.
+ ///
+ internal static SyntaxTree ProcessPartialTree(SyntaxTree tree, IEnumerable definedPreprocessorSymbols)
+ {
+ if (!HasPartialTypes(tree))
+ {
+ return tree;
+ }
+
+ var combinedTypes = new Dictionary>();
+ var combinedUsingDirectives = new HashSet();
+ var combinedTypesDefined = new HashSet();
+
+ ProcessTree(tree, combinedTypes, combinedUsingDirectives, combinedTypesDefined);
+
+ const int fileSearchMaxDepth = 5;
+ var otherPartialFiles = PartialClassFinder.FindPartialClassFilesInDirectory(tree.FilePath, fileSearchMaxDepth)
+ .Where(file => file != tree.FilePath);
+
+ foreach (var file in otherPartialFiles)
+ {
+ var partialTree = CSharpSyntaxTree.ParseText(File.ReadAllText(file), path: file);
+ ProcessTree(partialTree, combinedTypes, combinedUsingDirectives, combinedTypesDefined);
+ }
+
+ var combinedTypeDeclarations = combinedTypes
+ .Select(kvp => PartialTypeCombiner.CombinePartialType(kvp.Value))
+ .ToList();
+
+ var newRoot = SyntaxFactory.CompilationUnit()
+ .WithUsings(SyntaxFactory.List(combinedUsingDirectives))
+ .WithMembers(SyntaxFactory.List(combinedTypeDeclarations))
+ .WithAdditionalAnnotations(new SyntaxAnnotation("PreprocessorSymbols", string.Join(",", definedPreprocessorSymbols)));
+
+ return CSharpSyntaxTree.Create(newRoot, null, tree.FilePath)
+ .AddInternalsVisibleToAttribute();
+ }
+
+ private static bool HasPartialTypes(SyntaxTree tree)
+ {
+ var root = tree.GetCompilationUnitRoot();
+ return root.DescendantNodes().OfType().Any(type => type.Modifiers.Any(SyntaxKind.PartialKeyword));
+ }
+
+ private static void ProcessTree(
+ SyntaxTree tree,
+ Dictionary> combinedTypes,
+ HashSet combinedUsingDirectives,
+ HashSet combinedTypesDefined)
+ {
+ var root = tree.GetCompilationUnitRoot();
+
+ combinedUsingDirectives.UnionWith(root.Usings);
+
+ foreach (var typeDecl in root.DescendantNodes().OfType())
+ {
+ var fullName = NamespaceHelper.GetFullyQualifiedName(typeDecl);
+ combinedTypesDefined.Add(fullName);
+
+ if (!combinedTypes.TryGetValue(fullName, out var declarations))
+ {
+ declarations = new List();
+ combinedTypes[fullName] = declarations;
+ }
+ declarations.Add(typeDecl);
+ }
+ }
+ }
+}
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialTreeProcessor.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialTreeProcessor.cs.meta
new file mode 100644
index 0000000..507d71e
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialTreeProcessor.cs.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: 4aafad9b85b44ebe902ba3cee7bda205
+timeCreated: 1719954990
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialTreeProcessor.cs
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialTypeCombiner.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialTypeCombiner.cs
new file mode 100644
index 0000000..634d909
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialTypeCombiner.cs
@@ -0,0 +1,45 @@
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+
+namespace FastScriptReload.Editor.Compilation.CodeRewriting
+{
+ internal static class PartialTypeCombiner
+ {
+ internal static TypeDeclarationSyntax CombinePartialType(List declarations)
+ {
+ if (declarations.Count == 1)
+ return declarations[0];
+
+ var firstDeclaration = declarations[0];
+ var combinedMembers = declarations.SelectMany(d => d.Members).ToList();
+
+ var combinedModifiers = declarations
+ .SelectMany(d => d.Modifiers)
+ .Where(m => !m.IsKind(SyntaxKind.PartialKeyword))
+ .GroupBy(m => m.ValueText)
+ .Select(g => g.First().WithTrailingTrivia(SyntaxFactory.Space))
+ .ToList();
+
+ if (!combinedModifiers.Any(m => m.IsKind(SyntaxKind.PartialKeyword)))
+ combinedModifiers.Add(SyntaxFactory.Token(SyntaxKind.PartialKeyword).WithTrailingTrivia(SyntaxFactory.Space));
+
+ var combinedBaseList = declarations
+ .Where(d => d.BaseList != null)
+ .SelectMany(d => d.BaseList.Types)
+ .GroupBy(t => t.ToString())
+ .Select(g => g.First())
+ .ToList();
+
+ return firstDeclaration
+ .WithMembers(SyntaxFactory.List(combinedMembers))
+ .WithModifiers(SyntaxFactory.TokenList(combinedModifiers))
+ .WithKeyword(firstDeclaration.Keyword.WithLeadingTrivia(SyntaxFactory.Space))
+ .WithBaseList(combinedBaseList.Any()
+ ? SyntaxFactory.BaseList(SyntaxFactory.SeparatedList(combinedBaseList))
+ : null);
+ }
+ }
+}
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialTypeCombiner.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialTypeCombiner.cs.meta
new file mode 100644
index 0000000..eb0d9d3
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialTypeCombiner.cs.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: cc8170320f3a463590d434f7e0570ea0
+timeCreated: 1719955225
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialTypeCombiner.cs
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/SyntaxTreeHelpers.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/SyntaxTreeHelpers.cs
new file mode 100644
index 0000000..586d79a
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/SyntaxTreeHelpers.cs
@@ -0,0 +1,52 @@
+using System.Collections.Generic;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+
+namespace FastScriptReload.Editor.Compilation.CodeRewriting
+{
+ internal static class NamespaceHelper
+ {
+ internal static string GetFullyQualifiedName(TypeDeclarationSyntax typeDeclaration)
+ {
+ var namespaces = new List();
+ var currentNode = typeDeclaration.Parent;
+ while (currentNode != null)
+ {
+ if (currentNode is NamespaceDeclarationSyntax namespaceDeclaration)
+ {
+ namespaces.Add(namespaceDeclaration.Name.ToString());
+ }
+ currentNode = currentNode.Parent;
+ }
+ namespaces.Reverse();
+ var namespaceName = string.Join(".", namespaces);
+ return string.IsNullOrEmpty(namespaceName)
+ ? typeDeclaration.Identifier.Text
+ : $"{namespaceName}.{typeDeclaration.Identifier.Text}";
+ }
+ }
+
+ internal static class SyntaxTreeExtensions
+ {
+ internal static SyntaxTree AddInternalsVisibleToAttribute(this SyntaxTree tree)
+ {
+ var root = tree.GetCompilationUnitRoot();
+
+ var attributeArgument = SyntaxFactory.AttributeArgument(
+ SyntaxFactory.LiteralExpression(SyntaxKind.StringLiteralExpression, SyntaxFactory.Literal("Assembly-CSharp"))
+ );
+ var attribute = SyntaxFactory.Attribute(
+ SyntaxFactory.ParseName("System.Runtime.CompilerServices.InternalsVisibleTo"),
+ SyntaxFactory.AttributeArgumentList(SyntaxFactory.SeparatedList(new[] { attributeArgument }))
+ );
+
+ var attributeList = SyntaxFactory.AttributeList(SyntaxFactory.SingletonSeparatedList(attribute))
+ .WithTarget(SyntaxFactory.AttributeTargetSpecifier(SyntaxFactory.Token(SyntaxKind.AssemblyKeyword)));
+
+ var newRoot = root.AddAttributeLists(attributeList);
+
+ return tree.WithRootAndOptions(newRoot, tree.Options);
+ }
+ }
+}
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/SyntaxTreeHelpers.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/SyntaxTreeHelpers.cs.meta
new file mode 100644
index 0000000..84215af
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/SyntaxTreeHelpers.cs.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: 1c2f0e22f1a24fcda6d0c0516b428420
+timeCreated: 1719954970
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/SyntaxTreeHelpers.cs
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/SyntaxTreeMergePartialsExtensions.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/SyntaxTreeMergePartialsExtensions.cs
new file mode 100644
index 0000000..4782654
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/SyntaxTreeMergePartialsExtensions.cs
@@ -0,0 +1,18 @@
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.CodeAnalysis;
+
+namespace FastScriptReload.Editor.Compilation.CodeRewriting
+{
+ public static class SyntaxTreeMergePartialsExtensions
+ {
+ public static IEnumerable MergePartials(
+ this IEnumerable trees,
+ IEnumerable definedPreprocessorSymbols)
+ {
+ return trees
+ .Select(tree => PartialTreeProcessor.ProcessPartialTree(tree, definedPreprocessorSymbols))
+ .ToList();
+ }
+ }
+}
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/SyntaxTreeMergePartialsExtensions.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/SyntaxTreeMergePartialsExtensions.cs.meta
new file mode 100644
index 0000000..16f5b2f
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/SyntaxTreeMergePartialsExtensions.cs.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: 550c942c025f4fd5a1062891f3623c60
+timeCreated: 1719174342
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/SyntaxTreeMergePartialsExtensions.cs
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RecordRewriter.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RecordRewriter.cs
new file mode 100644
index 0000000..0c51827
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RecordRewriter.cs
@@ -0,0 +1,36 @@
+using FastScriptReload.Runtime;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+
+namespace FastScriptReload.Editor.Compilation.CodeRewriting
+{
+ class RecordeRewriter : FastScriptReloadCodeRewriterBase
+ {
+ public RecordeRewriter(bool writeRewriteReasonAsComment)
+ : base(writeRewriteReasonAsComment)
+ {
+
+ }
+
+ public override SyntaxNode VisitRecordDeclaration(RecordDeclarationSyntax node)
+ {
+ return AdjustRecordName(node, node.Identifier);
+ }
+
+ private SyntaxNode AdjustRecordName(RecordDeclarationSyntax node, SyntaxToken nodeIdentifier)
+ {
+ var typeName = nodeIdentifier.ToString(); //Not ToFullString() as it may include spaces and break.
+
+ if (!typeName.EndsWith(AssemblyChangesLoader.ClassnamePatchedPostfix))
+ {
+ typeName += AssemblyChangesLoader.ClassnamePatchedPostfix;
+ }
+
+ return AddRewriteCommentIfNeeded(
+ node.ReplaceToken(nodeIdentifier, SyntaxFactory.Identifier(typeName)),
+ $"{nameof(RecordeRewriter)}:{nameof(AdjustRecordName)}"
+ );
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RecordRewriter.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RecordRewriter.cs.meta
new file mode 100644
index 0000000..c0ae074
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RecordRewriter.cs.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: bb801c55172044ed9294ef722937f12f
+timeCreated: 1705523787
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RecordRewriter.cs
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RedundantTypeNameQualifierRewriter.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RedundantTypeNameQualifierRewriter.cs
new file mode 100644
index 0000000..c43ec05
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RedundantTypeNameQualifierRewriter.cs
@@ -0,0 +1,41 @@
+using System.Linq;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+
+namespace FastScriptReload.Editor.Compilation.CodeRewriting
+{
+ //ideally we'd use Simplifier but FSR doesn't have access to semantic model on which simplifier works
+
+ //Removes redundant type name qualifiers, eg: RootClass.NestedEnum.Value -> NestedEnum.Value, root class component is rewritten to have
+ //__Patched_ postfix and if original remains it'll cause type mismatch
+ class RedundantTypeNameQualifierRewriter : FastScriptReloadCodeRewriterBase
+ {
+ public RedundantTypeNameQualifierRewriter(bool writeRewriteReasonAsComment, bool visitIntoStructuredTrivia = false)
+ : base(writeRewriteReasonAsComment, visitIntoStructuredTrivia)
+ {
+ }
+
+ public override SyntaxNode VisitMemberAccessExpression(MemberAccessExpressionSyntax node)
+ {
+ if(node.Parent is MemberAccessExpressionSyntax)
+ return base.VisitMemberAccessExpression(node); //only target outermost member access for full rewrite
+
+ var firstNode = node.DescendantNodes().OfType().FirstOrDefault();
+ if(firstNode is IdentifierNameSyntax idNode && node.DescendantNodes().Count() > 1)
+ {
+ //enclosing type name same as first id node
+ if((idNode.Ancestors().First(n => n is TypeDeclarationSyntax) as TypeDeclarationSyntax)?.Identifier.ToString() == idNode.Identifier.ToString())
+ {
+ return AddRewriteCommentIfNeeded(
+ SyntaxFactory.ParseExpression(node.ToString().Replace($"{firstNode.Identifier.ToString()}.", string.Empty)),
+ $"{nameof(RedundantTypeNameQualifierRewriter)}"
+ );
+ }
+ }
+
+
+ return base.VisitMemberAccessExpression(node);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RedundantTypeNameQualifierRewriter.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RedundantTypeNameQualifierRewriter.cs.meta
new file mode 100644
index 0000000..d0e23be
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RedundantTypeNameQualifierRewriter.cs.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: 80a540048e524157a41df1241bd5c168
+timeCreated: 1679325667
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RedundantTypeNameQualifierRewriter.cs
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RoslynUtils.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RoslynUtils.cs
new file mode 100644
index 0000000..154a3e1
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RoslynUtils.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Linq;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+
+namespace FastScriptReload.Editor.Compilation.CodeRewriting
+{
+ public class RoslynUtils
+ {
+ public static string GetMemberFQDN(MemberDeclarationSyntax memberNode, string memberName) //TODO: try get rid of member name (needs to cast to whatever member it could be to get identifier)
+ {
+ var outer = GetMemberFQDNWithoutMemberName(memberNode);
+ return !string.IsNullOrEmpty(outer)
+ ? $"{outer}.{memberName}"
+ : memberName;
+ }
+
+ public static string GetMemberFQDNWithoutMemberName(MemberDeclarationSyntax memberNode) //TODO: move out to helper class
+ {
+ var fullTypeContibutingAncestorNames = memberNode.Ancestors().OfType().Select(da =>
+ {
+ if (da is TypeDeclarationSyntax t) return t.Identifier.ToString();
+ else if (da is NamespaceDeclarationSyntax n) return n.Name.ToString();
+ else throw new Exception("Unable to resolve full field name");
+ }).Reverse().ToList();
+
+ return string.Join(".", fullTypeContibutingAncestorNames);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RoslynUtils.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RoslynUtils.cs.meta
new file mode 100644
index 0000000..b502de7
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RoslynUtils.cs.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: 29bd7fad38034046a8dd4c7eea68907c
+timeCreated: 1673017013
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RoslynUtils.cs
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisAssignmentRewriter.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisAssignmentRewriter.cs
new file mode 100644
index 0000000..fd55ff2
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisAssignmentRewriter.cs
@@ -0,0 +1,21 @@
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+
+namespace FastScriptReload.Editor.Compilation.CodeRewriting
+{
+ class ThisAssignmentRewriter: ThisRewriterBase {
+ public ThisAssignmentRewriter(bool writeRewriteReasonAsComment, bool visitIntoStructuredTrivia = false)
+ : base(writeRewriteReasonAsComment, visitIntoStructuredTrivia)
+ {
+ }
+
+ public override SyntaxNode VisitThisExpression(ThisExpressionSyntax node)
+ {
+ if (node.Parent is AssignmentExpressionSyntax) {
+ return CreateCastedThisExpression(node);
+ }
+
+ return base.VisitThisExpression(node);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisAssignmentRewriter.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisAssignmentRewriter.cs.meta
new file mode 100644
index 0000000..18f8b07
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisAssignmentRewriter.cs.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: c5a960528b2b44edbf644e0ac0950d35
+timeCreated: 1672993042
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisAssignmentRewriter.cs
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisCallRewriter.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisCallRewriter.cs
new file mode 100644
index 0000000..59dd926
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisCallRewriter.cs
@@ -0,0 +1,22 @@
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+
+namespace FastScriptReload.Editor.Compilation.CodeRewriting
+{
+ class ThisCallRewriter : ThisRewriterBase
+ {
+ public ThisCallRewriter(bool writeRewriteReasonAsComment, bool visitIntoStructuredTrivia = false)
+ : base(writeRewriteReasonAsComment, visitIntoStructuredTrivia)
+ {
+ }
+
+ public override SyntaxNode VisitThisExpression(ThisExpressionSyntax node)
+ {
+ if (node.Parent is ArgumentSyntax)
+ {
+ return CreateCastedThisExpression(node);
+ }
+ return base.VisitThisExpression(node);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisCallRewriter.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisCallRewriter.cs.meta
new file mode 100644
index 0000000..74a91ae
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisCallRewriter.cs.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: f7e7aad39cec445db504fe5a117beae5
+timeCreated: 1672993042
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisCallRewriter.cs
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisRewriterBase.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisRewriterBase.cs
new file mode 100644
index 0000000..994cd40
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisRewriterBase.cs
@@ -0,0 +1,51 @@
+using System.Linq;
+using ImmersiveVrToolsCommon.Runtime.Logging;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+
+namespace FastScriptReload.Editor.Compilation.CodeRewriting
+{
+ abstract class ThisRewriterBase : FastScriptReloadCodeRewriterBase
+ {
+ protected ThisRewriterBase(bool writeRewriteReasonAsComment, bool visitIntoStructuredTrivia = false)
+ : base(writeRewriteReasonAsComment, visitIntoStructuredTrivia)
+ {
+ }
+
+ protected SyntaxNode CreateCastedThisExpression(ThisExpressionSyntax node)
+ {
+ var ancestors = node.Ancestors().Where(n => n is TypeDeclarationSyntax).Cast().ToList();
+ if (ancestors.Count() > 1)
+ {
+ LoggerScoped.LogWarning($"ThisRewriter: for class: '{ancestors.First().Identifier}' - 'this' call/assignment in nested class / struct. Dynamic cast will be used but this could cause issues in some cases:" +
+ $"\r\n\r\n1) - If called method has multiple overrides, using dynamic will cause compiler issue as it'll no longer be able to pick correct one" +
+ $"\r\n\r\n If you see any issues with that message, please look at 'Limitation' section in documentation as this outlines how to deal with it.");
+
+ //TODO: casting to dynamic seems to be best option (and one that doesn't fail for nested classes), what's the performance overhead?
+ return SyntaxFactory.CastExpression(
+ SyntaxFactory.ParseTypeName("dynamic"),
+ node
+ );
+ }
+
+ var firstAncestor = ancestors.FirstOrDefault();
+ if (firstAncestor == null)
+ {
+ LoggerScoped.LogWarning($"Unable to find first ancestor for node: {node.ToFullString()}, this rewrite will not be applied");
+ return node;
+ }
+
+ var methodInType = firstAncestor.Identifier.ToString();
+ var resultNode = SyntaxFactory.CastExpression(
+ SyntaxFactory.ParseTypeName(methodInType),
+ SyntaxFactory.CastExpression(
+ SyntaxFactory.ParseTypeName(typeof(object).FullName),
+ node
+ )
+ );
+
+ return AddRewriteCommentIfNeeded(resultNode, $"{nameof(ThisRewriterBase)}:{nameof(CreateCastedThisExpression)}");
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisRewriterBase.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisRewriterBase.cs.meta
new file mode 100644
index 0000000..4ea1ece
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisRewriterBase.cs.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: 0fd0b779590247168b3873c939c42d71
+timeCreated: 1672993042
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisRewriterBase.cs
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/DotnetExeCompilator.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/DotnetExeCompilator.cs
new file mode 100644
index 0000000..17105d9
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/DotnetExeCompilator.cs
@@ -0,0 +1,349 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Text;
+using System.Threading;
+using FastScriptReload.Editor.AssemblyPostProcess;
+using HarmonyLib;
+using ImmersiveVRTools.Editor.Common.Cache;
+using ImmersiveVRTools.Editor.Common.Utilities;
+using ImmersiveVRTools.Runtime.Common;
+using ImmersiveVrToolsCommon.Runtime.Logging;
+using UnityEditor;
+
+namespace FastScriptReload.Editor.Compilation
+{
+ [InitializeOnLoad]
+ public class DotnetExeDynamicCompilation: DynamicCompilationBase
+ {
+ private static string _dotnetExePath;
+ private static string _cscDll;
+ private static string _tempFolder;
+
+ private static string ApplicationContentsPath = EditorApplication.applicationContentsPath;
+ private static readonly List _createdFilesToCleanUp = new List();
+ private static readonly Dictionary _typeNameAssemblyCache = new Dictionary(16);
+
+ static DotnetExeDynamicCompilation()
+ {
+#if UNITY_EDITOR_WIN
+ const string dotnetExecutablePath = "dotnet.exe";
+#else
+ const string dotnetExecutablePath = "dotnet"; //mac and linux, no extension
+#endif
+
+ _dotnetExePath = FindFileOrThrow(dotnetExecutablePath);
+ _cscDll = FindFileOrThrow("csc.dll"); //even on mac/linux need to find dll and use, not no extension one
+ _tempFolder = Path.GetTempPath();
+
+ EditorApplication.playModeStateChanged += obj =>
+ {
+ if (obj == PlayModeStateChange.ExitingPlayMode && _createdFilesToCleanUp.Any())
+ {
+ LoggerScoped.LogDebug($"Removing temporary files: [{string.Join(",", _createdFilesToCleanUp)}]");
+
+ foreach (var fileToCleanup in _createdFilesToCleanUp)
+ {
+ new FileInfo(fileToCleanup).IsReadOnly = false;
+ File.Delete(fileToCleanup);
+ }
+ _createdFilesToCleanUp.Clear();
+ }
+ };
+ }
+
+ private static string FindFileOrThrow(string fileName)
+ {
+ return SessionStateCache.GetOrCreateString($"FSR:FilePath_{fileName}", () =>
+ {
+ var foundFile = Directory
+ .GetFiles(ApplicationContentsPath, fileName, SearchOption.AllDirectories)
+ .FirstOrDefault();
+ if (foundFile == null)
+ {
+ throw new Exception($"Unable to find '{fileName}', make sure Editor version supports it. You can also add preprocessor directive 'FastScriptReload_CompileViaMCS' which will use Mono compiler instead");
+ }
+
+ return foundFile;
+ });
+ }
+
+ public static CompileResult Compile(List filePathsWithSourceCode, UnityMainThreadDispatcher unityMainThreadDispatcher)
+ {
+ var sourceCodeCombinedFilePath = string.Empty;
+ try
+ {
+ var asmName = Guid.NewGuid().ToString().Replace("-", "");
+ var rspFile = _tempFolder + $"{asmName}.rsp";
+ var assemblyAttributeFilePath = _tempFolder + $"{asmName}.DynamicallyCreatedAssemblyAttribute.cs";
+ sourceCodeCombinedFilePath = _tempFolder + $"{asmName}.SourceCodeCombined.cs";
+ var outLibraryPath = $"{_tempFolder}{asmName}.dll";
+
+ var createSourceCodeCombinedResult = CreateSourceCodeCombinedContents(filePathsWithSourceCode, ActiveScriptCompilationDefines.ToList());
+ CreateFileAndTrackAsCleanup(sourceCodeCombinedFilePath, createSourceCodeCombinedResult.SourceCode, _createdFilesToCleanUp);
+#if UNITY_EDITOR
+ unityMainThreadDispatcher.Enqueue(() =>
+ {
+ if ((bool)FastScriptReloadPreference.IsAutoOpenGeneratedSourceFileOnChangeEnabled.GetEditorPersistedValueOrDefault())
+ {
+ UnityEditorInternal.InternalEditorUtility.OpenFileAtLineExternal(sourceCodeCombinedFilePath, 0);
+ }
+ });
+#endif
+
+ var originalAssemblyPathToAsmWithInternalsVisibleToCompiled = PerfMeasure.Elapsed(
+ () => CreateAssemblyCopiesWithInternalsVisibleTo(createSourceCodeCombinedResult, asmName),
+ out var createInternalVisibleToAsmElapsedMilliseconds);
+
+ var shouldAddUnsafeFlag = createSourceCodeCombinedResult.SourceCode.Contains("unsafe"); //TODO: not ideal as 'unsafe' can be part of comment, not code. But compiling with that flag in more cases shouldn't cause issues
+ var rspFileContent = GenerateCompilerArgsRspFileContents(outLibraryPath, sourceCodeCombinedFilePath, assemblyAttributeFilePath,
+ originalAssemblyPathToAsmWithInternalsVisibleToCompiled, shouldAddUnsafeFlag);
+ CreateFileAndTrackAsCleanup(rspFile, rspFileContent, _createdFilesToCleanUp);
+ CreateFileAndTrackAsCleanup(assemblyAttributeFilePath, DynamicallyCreatedAssemblyAttributeSourceCode, _createdFilesToCleanUp);
+
+ var exitCode = ExecuteDotnetExeCompilation(_dotnetExePath, _cscDll, rspFile, outLibraryPath, out var outputMessages);
+
+ var compiledAssembly = Assembly.LoadFrom(outLibraryPath);
+ return new CompileResult(outLibraryPath, outputMessages, exitCode, compiledAssembly, createSourceCodeCombinedResult.SourceCode,
+ sourceCodeCombinedFilePath, createInternalVisibleToAsmElapsedMilliseconds);
+ }
+ catch (SourceCodeHasErrorsException e)
+ {
+ // FastScriptReloadManager has a special case for reporting SourceCodeHasErrorsException.
+ // Just pass it through.
+ throw e;
+ }
+ catch (Exception e)
+ {
+ LoggerScoped.LogError($"Compilation error: temporary files were not removed so they can be inspected: "
+ + string.Join(", ", _createdFilesToCleanUp
+ .Select(f => $"{f}")));
+ if (LogHowToFixMessageOnCompilationError)
+ {
+ LoggerScoped.LogWarning($@"HOW TO FIX - INSTRUCTIONS:
+
+1) Open file that caused issue by looking at error log starting with: 'FSR: Compilation error: temporary files were not removed so they can be inspected: '. And click on file path to open.
+2) Look up other error in the console, which will be like 'Error When updating files:' - this one contains exact line that failed to compile (in XXX_SourceCodeGenerated.cs file). Those are same compilation errors as you see in Unity/IDE when developing.
+3) Read compiler error message as it'll help understand the issue
+
+Error could be caused by a normal compilation issue that you created in source file (eg typo), in that case please fix and it'll recompile.
+
+It's possible compilation fails due to existing limitation, in that case:
+
+You can quickly specify custom script rewrite override for part of code that's failing.
+
+Please use project panel to:
+1) Right-click on the original file that has compilation issue
+2) Click Fast Script Reload -> Add / Open User Script Rewrite Override
+3) Read top comment in opened file and it'll explain how to create overrides
+
+I'm continuously working on mitigating limitations.
+
+If you could please get in touch with me via 'support@immersivevrtools.com' and include error you see in the console as well as created files (from paths in previous error). This way I can get it fixed for you.
+
+You can also:
+1) Look at 'limitation' section in the docs - which will explain bit more around limitations and workarounds
+2) Move some of the code that you want to work on to different file - compilation happens on whole file, if you have multiple types there it could increase the chance of issues
+3) Have a look at compilation error, it shows error line (in the '*.SourceCodeCombined.cs' file, it's going to be something that compiler does not accept, likely easy to spot. To workaround you can change that part of code in original file. It's specific patterns that'll break it.
+
+*If you want to prevent that message from reappearing please go to Window -> Fast Script Reload -> Start Screen -> Logging -> tick off 'Log how to fix message on compilation error'*");
+
+ }
+
+ throw new HotReloadCompilationException(e.Message, e, sourceCodeCombinedFilePath);
+ }
+ }
+
+ private static Dictionary CreateAssemblyCopiesWithInternalsVisibleTo(CreateSourceCodeCombinedContentsResult createSourceCodeCombinedResult, string asmName)
+ {
+ var originalAssemblyPathToAsmWithInternalsVisibleToCompiled = new Dictionary();
+ try
+ {
+ var assembliesForTypesInCombinedFile = createSourceCodeCombinedResult.TypeNamesDefinitions
+ .Select(GetAssemblyByTypeName)
+ .Where(t => t != null)
+ .Distinct();
+
+ foreach (var assemblyForTypesInCombinedFile in assembliesForTypesInCombinedFile)
+ {
+ var createdAssemblyWithInternalsVisibleToNewlyCompiled = AddInternalsVisibleToForAllUserAssembliesPostProcess.CreateAssemblyWithInternalsContentsVisibleTo(
+ assemblyForTypesInCombinedFile, asmName
+ );
+ originalAssemblyPathToAsmWithInternalsVisibleToCompiled.Add(assemblyForTypesInCombinedFile.Location, createdAssemblyWithInternalsVisibleToNewlyCompiled);
+ }
+ }
+ catch (Exception e)
+ {
+ LoggerScoped.LogWarning($"Unable to create assembly with '{nameof(InternalsVisibleToAttribute)}' for dynamically recompiled code. {e}");
+ }
+
+ return originalAssemblyPathToAsmWithInternalsVisibleToCompiled;
+ }
+
+ private static void CreateFileAndTrackAsCleanup(string filePath, string contents, List createdFilesToCleanUp)
+ {
+ File.WriteAllText(filePath, contents);
+ new FileInfo(filePath).IsReadOnly = true;
+ createdFilesToCleanUp.Add(filePath);
+ }
+
+ private static Assembly GetAssemblyByTypeName(string typeName)
+ {
+ // This cache is barely worth it on my machine - it's ~1ms without, ~0ms with.
+ // However, the number of assemblies to search is technically unbounded
+ // - so this might be more important for somebody else.
+ if (_typeNameAssemblyCache.TryGetValue(typeName, out var assembly)) return assembly;
+
+ // FSR (via Harmony) originally did this search by enumerating assembly.GetTypes().
+ // I can't see anything in the documentation suggesting the assembly.GetType(typeName) version misses any cases.
+ // It's much faster.
+ assembly = AppDomain.CurrentDomain.GetAssemblies().SingleOrDefault(asm => asm.GetType(typeName, false) != null);
+
+ if (assembly != null) _typeNameAssemblyCache.Add(typeName, assembly);
+ return assembly;
+ }
+
+ private static string GenerateCompilerArgsRspFileContents(string outLibraryPath, string sourceCodeCombinedFilePath, string assemblyAttributeFilePath,
+ Dictionary originalAssemblyPathToAsmWithInternalsVisibleToCompiled, bool addUnsafeFlag)
+ {
+ var rspContents = new StringBuilder();
+ rspContents.AppendLine("-target:library");
+ rspContents.AppendLine($"-out:\"{outLibraryPath}\"");
+ // rspContents.AppendLine($"-refout:\"{tempFolder}{asmName}.ref.dll\""); //reference assembly for linking, not needed
+ foreach (var symbol in ActiveScriptCompilationDefines)
+ {
+ rspContents.AppendLine($"-define:{symbol}");
+ }
+
+ foreach (var referenceToAdd in ResolveReferencesToAdd(new List()))
+ {
+ if (originalAssemblyPathToAsmWithInternalsVisibleToCompiled.TryGetValue(referenceToAdd, out var asmWithInternalsVisibleTo))
+ {
+ //Changed assembly have InternalsVisibleTo added to it to avoid any issues where types are defined internal
+ rspContents.AppendLine($"-r:\"{asmWithInternalsVisibleTo}\"");
+ }
+ else
+ {
+ rspContents.AppendLine($"-r:\"{referenceToAdd}\"");
+ }
+ }
+
+ rspContents.AppendLine($"\"{sourceCodeCombinedFilePath}\"");
+ rspContents.AppendLine($"\"{assemblyAttributeFilePath}\"");
+
+ rspContents.AppendLine($"-langversion:latest");
+
+ rspContents.AppendLine("/deterministic");
+ rspContents.AppendLine("/optimize-");
+ rspContents.AppendLine("/debug:portable");
+ rspContents.AppendLine("/nologo");
+ rspContents.AppendLine("/RuntimeMetadataVersion:v4.0.30319");
+
+ if (addUnsafeFlag)
+ {
+ rspContents.AppendLine("/unsafe");
+ }
+
+ rspContents.AppendLine("/nowarn:0169");
+ rspContents.AppendLine("/nowarn:0649");
+ rspContents.AppendLine("/nowarn:1701");
+ rspContents.AppendLine("/nowarn:1702");
+ rspContents.AppendLine("/utf8output");
+ rspContents.AppendLine("/preferreduilang:en-US");
+
+ var rspContentsString = rspContents.ToString();
+ return rspContentsString;
+ }
+
+ private static int ExecuteDotnetExeCompilation(string dotnetExePath, string cscDll, string rspFile,
+ string outLibraryPath, out List outputMessages)
+ {
+ var process = new Process();
+ process.StartInfo.FileName = dotnetExePath;
+ process.StartInfo.Arguments = $"exec \"{cscDll}\" /nostdlib /noconfig /shared \"@{rspFile}\"";
+
+ var outMessages = new List();
+
+ var stderr_completed = new ManualResetEvent(false);
+ var stdout_completed = new ManualResetEvent(false);
+
+ process.StartInfo.CreateNoWindow = true;
+ process.StartInfo.UseShellExecute = false;
+ process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
+ process.StartInfo.RedirectStandardOutput = true;
+ process.StartInfo.RedirectStandardError = true;
+ process.ErrorDataReceived += (sender, args) =>
+ {
+ if (args.Data != null)
+ outMessages.Add(args.Data);
+ else
+ stderr_completed.Set();
+ };
+ process.OutputDataReceived += (sender, args) =>
+ {
+ if (args.Data != null)
+ {
+ outMessages.Add(args.Data);
+ return;
+ }
+
+ stdout_completed.Set();
+ };
+ process.StartInfo.StandardOutputEncoding = process.StartInfo.StandardErrorEncoding = Encoding.UTF8;
+
+ try
+ {
+ process.Start();
+ }
+ catch (Exception ex)
+ {
+ if (ex is Win32Exception win32Exception)
+ throw new SystemException(string.Format("Error running {0}: {1}", process.StartInfo.FileName,
+ typeof(Win32Exception)
+ .GetMethod("GetErrorMessage", BindingFlags.Static | BindingFlags.NonPublic)?
+ .Invoke(null, new object[] { win32Exception.NativeErrorCode }) ??
+ $", NativeErrorCode: {win32Exception.NativeErrorCode}"));
+ throw;
+ }
+
+ int exitCode = -1;
+ try
+ {
+ process.BeginOutputReadLine();
+ process.BeginErrorReadLine();
+ process.WaitForExit();
+
+ exitCode = process.ExitCode;
+ }
+ finally
+ {
+ stderr_completed.WaitOne(TimeSpan.FromSeconds(30.0));
+ stdout_completed.WaitOne(TimeSpan.FromSeconds(30.0));
+ process.Close();
+ }
+
+ if (!File.Exists(outLibraryPath))
+ throw new Exception("Compiler failed to produce the assembly. Output: '" +
+ string.Join(Environment.NewLine + Environment.NewLine, outMessages) + "'");
+
+ outputMessages = new List();
+ outputMessages.AddRange(outMessages);
+ return exitCode;
+ }
+ }
+
+ public class HotReloadCompilationException : Exception
+ {
+ public string SourceCodeCombinedFileCreated { get; }
+
+ public HotReloadCompilationException(string message, Exception innerException, string sourceCodeCombinedFileCreated) : base(message, innerException)
+ {
+ SourceCodeCombinedFileCreated = sourceCodeCombinedFileCreated;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/DotnetExeCompilator.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/DotnetExeCompilator.cs.meta
new file mode 100644
index 0000000..db5d6c7
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/DotnetExeCompilator.cs.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: 334fb2fc5cff4e98bf0f1ced9058cfc2
+timeCreated: 1669637513
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/DotnetExeCompilator.cs
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/DynamicAssemblyCompiler.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/DynamicAssemblyCompiler.cs
new file mode 100644
index 0000000..cfdf57c
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/DynamicAssemblyCompiler.cs
@@ -0,0 +1,64 @@
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using FastScriptReload.Runtime;
+using ImmersiveVRTools.Runtime.Common;
+using ImmersiveVrToolsCommon.Runtime.Logging;
+using Debug = UnityEngine.Debug;
+
+namespace FastScriptReload.Editor.Compilation
+{
+ public class DynamicAssemblyCompiler
+ {
+ public static CompileResult Compile(List filePathsWithSourceCode, UnityMainThreadDispatcher unityMainThreadDispatcher)
+ {
+ var sw = new Stopwatch();
+ sw.Start();
+
+#if FastScriptReload_CompileViaMCS
+ var result = McsExeDynamicCompilation.Compile(filePathsWithSourceCode);
+#else
+ var compileResult = DotnetExeDynamicCompilation.Compile(filePathsWithSourceCode, unityMainThreadDispatcher);
+#endif
+
+ LoggerScoped.Log($"Files: {string.Join(",", filePathsWithSourceCode.Select(fn => new FileInfo(fn).Name))} changed " +
+#if UNITY_2021_1_OR_NEWER
+ $"(click here to debug [in bottom details pane])" +
+#else
+ "(to debug go to Fast Script Reload -> Start Screen -> Debugging -> Auto-open generated source file for debugging)" +
+#endif
+ $" - compilation (took {sw.ElapsedMilliseconds}ms)"
+#if ImmersiveVrTools_DebugEnabled
+ + $" (of which creating internal visible to assemblies {compileResult.CreatingAssemblyWithInternalsVisibleToTook})ms"
+#endif
+);
+
+ return compileResult;
+ }
+ }
+
+ public class CompileResult
+ {
+ public Assembly CompiledAssembly { get; }
+ public string CompiledAssemblyPath { get; }
+ public List MessagesFromCompilerProcess { get; }
+ public bool IsError => string.IsNullOrEmpty(CompiledAssemblyPath);
+ public int NativeCompilerReturnValue { get; }
+ public string SourceCodeCombined { get; }
+ public string SourceCodeCombinedFileLocation { get; }
+ public float CreatingAssemblyWithInternalsVisibleToTook { get; }
+
+ public CompileResult(string compiledAssemblyPath, List messagesFromCompilerProcess, int nativeCompilerReturnValue, Assembly compiledAssembly, string sourceCodeCombined, string sourceCodeCombinedFileLocation, float creatingAssemblyWithInternalsVisibleToTook)
+ {
+ CompiledAssemblyPath = compiledAssemblyPath;
+ MessagesFromCompilerProcess = messagesFromCompilerProcess;
+ NativeCompilerReturnValue = nativeCompilerReturnValue;
+ CompiledAssembly = compiledAssembly;
+ SourceCodeCombined = sourceCodeCombined;
+ SourceCodeCombinedFileLocation = sourceCodeCombinedFileLocation;
+ CreatingAssemblyWithInternalsVisibleToTook = creatingAssemblyWithInternalsVisibleToTook;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/DynamicAssemblyCompiler.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/DynamicAssemblyCompiler.cs.meta
new file mode 100644
index 0000000..f5abcd3
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/DynamicAssemblyCompiler.cs.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: 616fd2855e784e728009a00bc1f09255
+timeCreated: 1669110323
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/DynamicAssemblyCompiler.cs
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/DynamicCompilationBase.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/DynamicCompilationBase.cs
new file mode 100644
index 0000000..3511491
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/DynamicCompilationBase.cs
@@ -0,0 +1,387 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using FastScriptReload.Editor.Compilation.CodeRewriting;
+using FastScriptReload.Editor.Compilation.ScriptGenerationOverrides;
+using FastScriptReload.Runtime;
+using FastScriptReload.Scripts.Runtime;
+using ImmersiveVRTools.Editor.Common.Cache;
+using ImmersiveVRTools.Runtime.Common.Utilities;
+using ImmersiveVrToolsCommon.Runtime.Logging;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using UnityEditor;
+using UnityEngine;
+using UnityEngine.Rendering;
+
+namespace FastScriptReload.Editor.Compilation
+{
+ [InitializeOnLoad]
+ public class DynamicCompilationBase
+ {
+ public static bool DebugWriteRewriteReasonAsComment;
+ public static bool LogHowToFixMessageOnCompilationError;
+ public static bool EnableExperimentalThisCallLimitationFix;
+ public static List ReferencesExcludedFromHotReload = new List();
+
+ public const string DebuggingInformationComment =
+ @"// DEBUGGING READ-ME: DO NOT EDIT THIS AUTO-GENERATED FILE AS IT'LL BE DELETED " +
+#if !UNITY_2021_1_OR_NEWER
+"WARN: on Unity versions prior to 2021, opening files in that manner can cause static values to be reinitialized"
+#else
+ ""
+#endif
+ +
+ @"//
+// To debug simply add a breakpoint in this file.
+//
+// With every code change - new file is generated, currently you'll need to re-set breakpoints after each change.
+// You can also:
+// - step into the function that was changed (and that will get you to correct source file)
+// - add a function breakpoint in your IDE (this way you won't have to re-add it every time)
+//
+// Tool can automatically open dynamically-compiled code file every time to make setting breakpoints easier.
+// You can adjust that behaviour via 'Window -> FastScriptReload -> Start Screen -> Debugging -> Do not auto-open generated cs file'.
+//
+// You can always open generated file when needed by clicking link in console, eg.
+// 'FSR: Files: FunctionLibrary.cs changed (click here to debug [in bottom details pane]) - compilation (took 240ms)'
+
+
+";
+
+ public static readonly string[] ActiveScriptCompilationDefines;
+ protected static readonly string DynamicallyCreatedAssemblyAttributeSourceCode = $"[assembly: {typeof(DynamicallyCreatedAssemblyAttribute).FullName}()]";
+ private static readonly string AssemblyCsharpFullPath;
+
+ static DynamicCompilationBase()
+ {
+ //needs to be set from main thread
+ ActiveScriptCompilationDefines = EditorUserBuildSettings.activeScriptCompilationDefines;
+ AssemblyCsharpFullPath = SessionStateCache.GetOrCreateString(
+ $"FSR:AssemblyCsharpFullPath",
+ () => AssetDatabase.FindAssets("Microsoft.CSharp")
+ .Select(g => new System.IO.FileInfo(UnityEngine.Application.dataPath + "/../" + AssetDatabase.GUIDToAssetPath(g)))
+ .First(fi => fi.Name.ToLower() == "Microsoft.CSharp.dll".ToLower()).FullName
+ );
+
+ }
+
+ protected static CreateSourceCodeCombinedContentsResult CreateSourceCodeCombinedContents(List sourceCodeFiles, List definedPreprocessorSymbols)
+ {
+ var combinedUsingStatements = new List();
+ var typesDefined = new List();
+
+ var trees = sourceCodeFiles
+ .Select(sourceCodeFile =>
+ {
+ var fileCode = File.ReadAllText(sourceCodeFile);
+ var tree = CSharpSyntaxTree.ParseText(fileCode, new CSharpParseOptions(preprocessorSymbols: definedPreprocessorSymbols));
+ return tree.WithFilePath(sourceCodeFile);
+ })
+ .ToList();
+
+ if (FastScriptReloadManager.Instance.IsPartialClassSupportEnabled)
+ {
+ trees = trees.MergePartials(definedPreprocessorSymbols).ToList();
+ }
+
+ // It's important to check whether the compiler was able to correctly interpret the original code.
+ // When the compiler encounters errors, it actually continues and still produces a tree.
+ // This tree even still roundtrips to the original source code.
+ // However, because the code didn't parse correctly, the tree's structure may be wrong.
+ // If we don't detect this here, FSR continues on obliviously, applying transformations to the broken tree.
+ // This sometimes leads to correctly generated code, because the parts of the tree that FSR cared to look at happened to be correct.
+ // However, this should not be relied upon.
+ // Transformations applied to broken trees lead to weird bugs, e.g. things at wrong nesting levels.
+ // The safest thing is to bail on the whole process.
+ //
+ // Note that this can happen with valid user code!!!
+ // This can trigger if FSR's compiler version is behind the one needed for language features in the code.
+ // The user may think their code is correct, but the compiler may disagree.
+ // In this scenario, it's particularly important to let the user know that something went wrong.
+ // Otherwise, they may expect valid output, and get nearly valid output from a broken tree.
+ // Trust me, these bugs are quite confusing when first encountered!
+ var errorDiagnostics = trees.SelectMany(tree => tree.GetDiagnostics()).Where(d => d.Severity == DiagnosticSeverity.Error);
+ if (errorDiagnostics.Any()) throw new SourceCodeHasErrorsException(errorDiagnostics);
+
+ var sourceCodeWithAdjustments = trees.Select(tree =>
+ {
+ //skip if tree.FilePath null or empty
+ if (string.IsNullOrEmpty(tree.FilePath))
+ {
+ LoggerScoped.LogError($"Skipping file as it has no path: {tree.FilePath}");
+ return tree.GetRoot().ToFullString();
+ }
+
+ var root = tree.GetRoot();
+
+ //WARN: needs to walk before root class name changes, otherwise it'll resolve wrong name
+ var fieldsWalker = new FieldsWalker();
+ fieldsWalker.Visit(root);
+ typesDefined.AddRange(fieldsWalker.GetTypeNames());
+
+ var typeToNewFieldDeclarations = new Dictionary>();
+ if (FastScriptReloadManager.Instance.AssemblyChangesLoaderEditorOptionsNeededInBuild.EnableExperimentalAddedFieldsSupport)
+ {
+ var typeToFieldDeclarations = fieldsWalker.GetTypeToFieldDeclarations();
+ typeToNewFieldDeclarations = typeToFieldDeclarations.ToDictionary(
+ t => t.Key,
+ t =>
+ {
+ if (!ProjectTypeCache.AllTypesInNonDynamicGeneratedAssemblies.TryGetValue(t.Key, out var existingType))
+ {
+ LoggerScoped.LogDebug($"Unable to find type: {t.Key} in loaded assemblies. If that's the class you've added field to then it may not be properly working. It's possible the class was not yet loaded / used and you can ignore that warning. If it's causing any issues please contact support");
+ return new List();
+ }
+
+ var existingTypeMembersToReplace = NewFieldsRewriter.GetReplaceableMembers(existingType).Select(m => m.Name).ToList();
+
+ var newFields = t.Value.Where(fD => !existingTypeMembersToReplace.Contains(fD.FieldName)).ToList();
+
+ //TODO: ideally that registration would happen outside of this class
+ //TODO: to work for LSR it needs to be handled in runtime
+ TemporaryNewFieldValues.RegisterNewFields(
+ existingType,
+ newFields.ToDictionary(
+ fD => fD.FieldName,
+ fD => new TemporaryNewFieldValues.GetNewFieldInitialValue((Type forNewlyGeneratedType) =>
+ {
+ //TODO: PERF: could cache those - they run to init every new value (for every instance when accessed)
+ return CreateNewFieldInitMethodRewriter.ResolveNewFieldsToCreateValueFn(forNewlyGeneratedType)[fD.FieldName]();
+ })
+ ),
+ newFields.ToDictionary(
+ fD => fD.FieldName,
+ fD => new TemporaryNewFieldValues.GetNewFieldType((Type forNewlyGeneratedType) =>
+ {
+ //TODO: PERF: could cache those - they run to init every new value (for every instance when accessed)
+ return (Type)CreateNewFieldInitMethodRewriter.ResolveNewFieldsToTypeFn(forNewlyGeneratedType)[fD.FieldName]();
+ })
+ )
+ );
+
+ return newFields.Select(fD => fD.FieldName).ToList();
+ }
+ );
+
+#if LiveScriptReload_Enabled
+ if (typeToNewFieldDeclarations.Any(kv => kv.Value.Any()))
+ {
+ LoggerScoped.LogWarning($"{nameof(FastScriptReloadManager.Instance.AssemblyChangesLoaderEditorOptionsNeededInBuild.EnableExperimentalAddedFieldsSupport)} is enabled. This is not supported in running build. Quite likely it'll crash remote client.");
+ }
+#endif
+ }
+
+ //WARN: application order is important, eg ctors need to happen before class names as otherwise ctors will not be recognised as ctors
+ if (FastScriptReloadManager.Instance.EnableExperimentalThisCallLimitationFix)
+ {
+ root = new ThisCallRewriter(DebugWriteRewriteReasonAsComment).Visit(root);
+ root = new ThisAssignmentRewriter(DebugWriteRewriteReasonAsComment).Visit(root);
+ }
+
+ if (FastScriptReloadManager.Instance.AssemblyChangesLoaderEditorOptionsNeededInBuild.EnableExperimentalAddedFieldsSupport)
+ {
+ root = new NewFieldsRewriter(typeToNewFieldDeclarations, DebugWriteRewriteReasonAsComment).Visit(root);
+ root = new CreateNewFieldInitMethodRewriter(typeToNewFieldDeclarations, DebugWriteRewriteReasonAsComment).Visit(root);
+ }
+
+ root = new RedundantTypeNameQualifierRewriter(DebugWriteRewriteReasonAsComment).Visit(root);
+
+ root = new ConstructorRewriter(adjustCtorOnlyForNonNestedTypes: true, DebugWriteRewriteReasonAsComment).Visit(root);
+
+ var hotReloadCompliantRewriter = new HotReloadCompliantRewriter(DebugWriteRewriteReasonAsComment);
+ root = hotReloadCompliantRewriter.Visit(root);
+ combinedUsingStatements.AddRange(hotReloadCompliantRewriter.StrippedUsingDirectives);
+
+ root = new BuilderPatternFunctionsRewriter(DebugWriteRewriteReasonAsComment).Visit(root);
+ root = new RecordeRewriter(DebugWriteRewriteReasonAsComment).Visit(root);
+ root = new ExtensionMethodsCallingOtherExtensionMethodsInSameFileRewriter(DebugWriteRewriteReasonAsComment).Visit(root);
+
+ //processed as last step to simply rewrite all changes made before
+ if (TryResolveUserDefinedOverridesRoot(tree.FilePath, definedPreprocessorSymbols, out var userDefinedOverridesRoot))
+ {
+ root = ProcessUserDefinedOverridesReplacements(tree.FilePath, root, userDefinedOverridesRoot);
+ root = AddUserDefinedOverridenTypes(userDefinedOverridesRoot, root);
+ }
+
+ return root.ToFullString();
+ }).ToList();
+
+ var sourceCodeCombinedSb = new StringBuilder();
+ sourceCodeCombinedSb.Append(DebuggingInformationComment);
+
+ foreach (var usingStatement in combinedUsingStatements.Distinct())
+ {
+ sourceCodeCombinedSb.Append(usingStatement);
+ }
+
+ foreach (var sourceCodeWithAdjustment in sourceCodeWithAdjustments)
+ {
+ sourceCodeCombinedSb.AppendLine(sourceCodeWithAdjustment);
+ }
+
+ LoggerScoped.LogDebug("Source Code Created:\r\n\r\n" + sourceCodeCombinedSb);
+ return new CreateSourceCodeCombinedContentsResult(sourceCodeCombinedSb.ToString(), typesDefined);
+ }
+
+ private static SyntaxNode AddUserDefinedOverridenTypes(SyntaxNode userDefinedOverridesRoot, SyntaxNode root)
+ {
+ try
+ {
+ var userDefinedOverrideTypes = userDefinedOverridesRoot.DescendantNodes().OfType()
+ .ToDictionary(n => RoslynUtils.GetMemberFQDN(n, n.Identifier.ToString()));
+ var allDefinedTypesInRecompiledFile = root.DescendantNodes().OfType()
+ .ToDictionary(n => RoslynUtils.GetMemberFQDN(n, n.Identifier.ToString())); //what about nested types?
+
+ var userDefinedOverrideTypesWithoutMatchnigInRecompiledFile = userDefinedOverrideTypes.Select(overridenType =>
+ {
+ if (!allDefinedTypesInRecompiledFile.ContainsKey(overridenType.Key))
+ {
+ return overridenType;
+ }
+
+ return default(KeyValuePair);
+ })
+ .Where(kv => kv.Key != default(string))
+ .ToList();
+
+ //types should be added either to root namespace or root of document
+ var rootNamespace = root.DescendantNodes().OfType().FirstOrDefault();
+ foreach (var overridenTypeToAdd in userDefinedOverrideTypesWithoutMatchnigInRecompiledFile)
+ {
+ var newMember = FastScriptReloadCodeRewriterBase.AddRewriteCommentIfNeeded(overridenTypeToAdd.Value,
+ "New type defined in override file",
+ true, //always write reason so it's not easy to miss in generated file
+ true);
+ if (rootNamespace != null)
+ {
+ rootNamespace =
+ root.DescendantNodes().OfType()
+ .FirstOrDefault(); //need to search again to make sure it didn't change
+ var newRootNamespace = rootNamespace.AddMembers(newMember);
+ root = root.ReplaceNode(rootNamespace, newRootNamespace);
+ }
+ else
+ {
+ root = ((CompilationUnitSyntax)root).AddMembers(newMember);
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ Debug.LogError($"Unable to add user defined override types. {e}");
+ }
+
+ return root;
+ }
+
+ private static bool TryResolveUserDefinedOverridesRoot(string sourceCodeFile, List definedPreprocessorSymbols, out SyntaxNode userDefinedOverridesRoot)
+ {
+ if (ScriptGenerationOverridesManager.TryGetScriptOverride(new FileInfo(sourceCodeFile), out var userDefinedOverridesFile))
+ {
+ try
+ {
+ userDefinedOverridesRoot = CSharpSyntaxTree.ParseText(File.ReadAllText(userDefinedOverridesFile.FullName), new CSharpParseOptions(preprocessorSymbols: definedPreprocessorSymbols)).GetRoot();
+ return true;
+ }
+ catch (Exception ex)
+ {
+ Debug.LogError($"Unable to resolve user defined overrides for file: '{userDefinedOverridesFile.FullName}' - please make sure it's compilable. Error: '{ex}'");
+ }
+ }
+
+ userDefinedOverridesRoot = null;
+ return false;
+ }
+
+ private static SyntaxNode ProcessUserDefinedOverridesReplacements(string sourceCodeFile, SyntaxNode root, SyntaxNode userDefinedOverridesRoot)
+ {
+ if (ScriptGenerationOverridesManager.TryGetScriptOverride(new FileInfo(sourceCodeFile), out var userDefinedOverridesFile))
+ {
+ try
+ {
+ var userDefinedScriptOverridesRewriter = new ManualUserDefinedScriptOverridesRewriter(userDefinedOverridesRoot,
+ true); //always write rewrite reason so it's not easy to miss
+ root = userDefinedScriptOverridesRewriter.Visit(root);
+ }
+ catch (Exception ex)
+ {
+ Debug.LogError($"Unable to resolve user defined overrides for file: '{userDefinedOverridesFile.FullName}' - please make sure it's compilable. Error: '{ex}'");
+ }
+ }
+
+ return root;
+ }
+
+ protected static List ResolveReferencesToAdd(List excludeAssyNames)
+ {
+ var referencesToAdd = new List();
+ foreach (var assembly in AppDomain.CurrentDomain
+ .GetAssemblies() //TODO: PERF: just need to load once and cache? or get assembly based on changed file only?
+ .Where(a => excludeAssyNames.All(assyName => !a.FullName.StartsWith(assyName))
+ && CustomAttributeExtensions.GetCustomAttribute((Assembly)a) == null))
+ {
+ try
+ {
+ if (string.IsNullOrEmpty(assembly.Location))
+ {
+ LoggerScoped.LogDebug($"FastScriptReload: Assembly location is null, usually dynamic assembly, harmless.");
+ continue;
+ }
+
+ referencesToAdd.Add(assembly.Location);
+ }
+ catch (Exception)
+ {
+ LoggerScoped.LogDebug($"Unable to add a reference to assembly as unable to get location or null: {assembly.FullName} when hot-reloading, this is likely dynamic assembly and won't cause issues");
+ }
+ }
+
+ referencesToAdd = referencesToAdd.Where(r => !ReferencesExcludedFromHotReload.Any(rTe => r.EndsWith(rTe))).ToList();
+
+ if (EnableExperimentalThisCallLimitationFix || FastScriptReloadManager.Instance.AssemblyChangesLoaderEditorOptionsNeededInBuild.EnableExperimentalAddedFieldsSupport)
+ {
+ IncludeMicrosoftCsharpReferenceToSupportDynamicKeyword(referencesToAdd);
+ }
+
+ return referencesToAdd;
+ }
+
+ private static void IncludeMicrosoftCsharpReferenceToSupportDynamicKeyword(List referencesToAdd)
+ {
+ //TODO: check .net4.5 backend not breaking?
+ //ThisRewriters will cast to dynamic - if using .NET Standard 2.1 - reference is required
+ referencesToAdd.Add(AssemblyCsharpFullPath);
+ // referencesToAdd.Add(@"C:\Program Files\Unity\Hub\Editor\2021.3.12f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Microsoft.CSharp.dll");
+ }
+ }
+
+ public class CreateSourceCodeCombinedContentsResult
+ {
+ public string SourceCode { get; }
+ public List TypeNamesDefinitions { get; }
+
+ public CreateSourceCodeCombinedContentsResult(string sourceCode, List typeNamesDefinitions)
+ {
+ SourceCode = sourceCode;
+ TypeNamesDefinitions = typeNamesDefinitions;
+ }
+ }
+
+ public class SourceCodeHasErrorsException : Exception
+ {
+ public SourceCodeHasErrorsException(IEnumerable errorDiagnostics) : base(MakeMessage(errorDiagnostics))
+ {
+ }
+
+ private static string MakeMessage(IEnumerable errorDiagnostics)
+ => "Failed to compile the original source code. The compiler found the following errors:"
+ + Environment.NewLine
+ + Environment.NewLine
+ + string.Join(Environment.NewLine, errorDiagnostics.Select(d => d.ToString()));
+ }
+}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/DynamicCompilationBase.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/DynamicCompilationBase.cs.meta
new file mode 100644
index 0000000..348fa36
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/DynamicCompilationBase.cs.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: 4301ea2066a04de58f95c515e910ae3e
+timeCreated: 1669637741
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/DynamicCompilationBase.cs
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/McsExeDynamicCompilation.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/McsExeDynamicCompilation.cs
new file mode 100644
index 0000000..1bd0c70
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/McsExeDynamicCompilation.cs
@@ -0,0 +1,64 @@
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using UnityEngine;
+
+#if FastScriptReload_CompileViaMCS
+public class McsExeDynamicCompilation : DynamicCompilationBase
+{
+ private const int ReferenceLenghtCountWarningThreshold = 32767 - 2000; //windows can accept up to 32767 chars as args, then it starts thorowing exceptions. MCS.exe is adding references via command /r:
+
+ private static CompileResult Compile(List filePathsWithSourceCode)
+ {
+ var fileSourceCode = filePathsWithSourceCode.Select(File.ReadAllText);
+
+ var providerOptions = new Dictionary();
+ var provider = new Microsoft.CSharp.CSharpCodeProvider(providerOptions);
+ var param = new System.CodeDom.Compiler.CompilerParameters();
+
+ var excludeAssyNames = new List
+ {
+ "mscorlib"
+ };
+ var referencesToAdd = ResolveReferencesToAdd(excludeAssyNames);
+
+ var referencePathCharLenght = referencesToAdd.Sum(r => r.Length);
+ if (referencePathCharLenght > ReferenceLenghtCountWarningThreshold)
+ {
+ LoggerScoped.LogWarning(
+ "Windows can accept up to 32767 chars as args, then it starts throwing exceptions. Dynamic compilation will use MCS.exe and will add references via command /r:, " +
+ $"currently your assembly have {referencesToAdd.Count} references which full paths amount to: {referencePathCharLenght} chars." +
+ $"\r\nIf you see this warning likely compilation will fail, you can:" +
+ $"\r\n1) Move your project to be more top-level, as references take full paths, eg 'c:\\my-source\\stuff\\unity\\my-project\\' - this then gets repeated for many references, moving it close to top level will help" +
+ $"\r\n2) Remove some of the assemblies if you don't need them" +
+ "\r\n Please let me know via support email if that's causing you issues, there may be a fix if it's affecting many users, sorry about that!");
+
+ //TODO: the process is started from Microsoft.CSharp.CSharpCodeGenerator.FromFileBatch, potentially all it'd be possible to patch that class to maybe copy all
+ //assemblies to some top-level location and change parameters to run from this folder, with a working directory set, this would drastically reduce char count used by full refs
+ //also mcs.exe allows to compile with -pkg:package1[,packageN], which somewhat bundles multiple references, maybe all unity engine refs could go in there, or all refs in general
+ }
+
+ param.ReferencedAssemblies.AddRange(referencesToAdd.ToArray());
+ param.GenerateExecutable = false;
+ param.GenerateInMemory = false;
+ providerOptions.Add(PatchMcsArgsGeneration.PreprocessorDirectivesProviderOptionsKey,
+ string.Join(";", ActiveScriptCompilationDefines));
+
+ var sourceCodeCombined = CreateSourceCodeCombinedContents(fileSourceCode);
+ var result = provider.CompileAssemblyFromSource(param, sourceCodeCombined, DynamicallyCreatedAssemblyAttributeSourceCode);
+ var errors = new List();
+ foreach (var error in result.Errors)
+ {
+ errors.Add(error.ToString());
+ }
+ return new CompileResult(
+ result.CompiledAssembly.FullName,
+ errors,
+ result.NativeCompilerReturnValue,
+ result.CompiledAssembly,
+ sourceCodeCombined,
+ string.Empty
+ );
+ }
+}
+#endif
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/McsExeDynamicCompilation.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/McsExeDynamicCompilation.cs.meta
new file mode 100644
index 0000000..0f2ffce
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/McsExeDynamicCompilation.cs.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: 5a359917ce85466389622feaf196d024
+timeCreated: 1669637866
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/McsExeDynamicCompilation.cs
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/PatchMcsArgsGeneration.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/PatchMcsArgsGeneration.cs
new file mode 100644
index 0000000..8a371b4
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/PatchMcsArgsGeneration.cs
@@ -0,0 +1,110 @@
+#if FastScriptReload_CompileViaMCS
+using System;
+using System.CodeDom.Compiler;
+using System.Collections.Generic;
+using System.Text;
+using FastScriptReload.Runtime;
+using HarmonyLib;
+using UnityEditor;
+
+[InitializeOnLoad]
+[PreventHotReload]
+public class PatchMcsArgsGeneration
+{
+ public const string PreprocessorDirectivesProviderOptionsKey = "PreprocessorDirectives";
+
+ static PatchMcsArgsGeneration()
+ {
+ var harmony = new Harmony(nameof(PatchMcsArgsGeneration));
+
+ var original = AccessTools.Method("Microsoft.CSharp.CSharpCodeGenerator:BuildArgs");
+ var postfix = AccessTools.Method(typeof(PatchMcsArgsGeneration), nameof(BuildArgsPostfix));
+
+ harmony.Patch(original, postfix: new HarmonyMethod(postfix));
+ }
+
+ //Copied from Microsoft.CSharp.CSharpCodeGenerator.BuildArgs
+ private static void BuildArgsPostfix(
+ CompilerParameters options,
+ string[] fileNames,
+ IDictionary providerOptions,
+ ref string __result)
+ {
+ StringBuilder stringBuilder = new StringBuilder();
+ if (options.GenerateExecutable)
+ stringBuilder.Append("/target:exe ");
+ else
+ stringBuilder.Append("/target:library ");
+ string privateBinPath = AppDomain.CurrentDomain.SetupInformation.PrivateBinPath;
+ if (privateBinPath != null && privateBinPath.Length > 0)
+ stringBuilder.AppendFormat("/lib:\"{0}\" ", (object) privateBinPath);
+ if (options.Win32Resource != null)
+ stringBuilder.AppendFormat("/win32res:\"{0}\" ", (object) options.Win32Resource);
+ if (options.IncludeDebugInformation)
+ stringBuilder.Append("/debug+ /optimize- ");
+ else
+ stringBuilder.Append("/debug- /optimize+ ");
+ if (options.TreatWarningsAsErrors)
+ stringBuilder.Append("/warnaserror ");
+ if (options.WarningLevel >= 0)
+ stringBuilder.AppendFormat("/warn:{0} ", (object) options.WarningLevel);
+ if (options.OutputAssembly == null || options.OutputAssembly.Length == 0)
+ {
+ string extension = options.GenerateExecutable ? "exe" : "dll"; //TODO:readd
+ // options.OutputAssembly = CSharpCodeGenerator.GetTempFileNameWithExtension(options.TempFiles, extension, !options.GenerateInMemory);
+ }
+ stringBuilder.AppendFormat("/out:\"{0}\" ", (object) options.OutputAssembly);
+ foreach (string referencedAssembly in options.ReferencedAssemblies)
+ {
+ if (referencedAssembly != null && referencedAssembly.Length != 0)
+ stringBuilder.AppendFormat("/r:\"{0}\" ", (object) referencedAssembly);
+ }
+ if (options.CompilerOptions != null)
+ {
+ stringBuilder.Append(options.CompilerOptions);
+ stringBuilder.Append(" ");
+ }
+ foreach (string embeddedResource in options.EmbeddedResources)
+ stringBuilder.AppendFormat("/resource:\"{0}\" ", (object) embeddedResource);
+ foreach (string linkedResource in options.LinkedResources)
+ stringBuilder.AppendFormat("/linkresource:\"{0}\" ", (object) linkedResource);
+
+ //WARN: that's how it's in source, quite odd, doesn't do much if compiler version specified?
+ // if (providerOptions != null && providerOptions.Count > 0)
+ // {
+ // string str;
+ // if (!providerOptions.TryGetValue("CompilerVersion", out str))
+ // str = "3.5";
+ // if (str.Length >= 1 && str[0] == 'v')
+ // str = str.Substring(1);
+ // if (str != "2.0")
+ // {
+ // }
+ // else
+ // stringBuilder.Append("/langversion:ISO-2 ");
+ // }
+
+ stringBuilder.Append("/langversion:experimental ");
+
+ CustomPatchAdditionAddPreprocessorDirectives(providerOptions, stringBuilder);
+
+ stringBuilder.Append("/noconfig ");
+ stringBuilder.Append(" -- ");
+ foreach (string fileName in fileNames)
+ stringBuilder.AppendFormat("\"{0}\" ", (object) fileName);
+
+ __result = stringBuilder.ToString();
+ }
+
+ private static void CustomPatchAdditionAddPreprocessorDirectives(IDictionary providerOptions, StringBuilder stringBuilder)
+ {
+ if (providerOptions != null && providerOptions.Count > 0)
+ {
+ if (providerOptions.TryGetValue(PreprocessorDirectivesProviderOptionsKey, out var preprocessorDirectives))
+ {
+ stringBuilder.Append($"/d:\"{preprocessorDirectives}\" ");
+ }
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/PatchMcsArgsGeneration.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/PatchMcsArgsGeneration.cs.meta
new file mode 100644
index 0000000..3abf63a
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/PatchMcsArgsGeneration.cs.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: 26428224dc3f4d069690c15cbfb3a070
+timeCreated: 1669209480
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/PatchMcsArgsGeneration.cs
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/ScriptGenerationOverrides.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/ScriptGenerationOverrides.meta
new file mode 100644
index 0000000..825b5d7
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/ScriptGenerationOverrides.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: a9e1198b8d42486bae230272101c0951
+timeCreated: 1678099546
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/ScriptGenerationOverrides/ScriptGenerationOverridesManager.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/ScriptGenerationOverrides/ScriptGenerationOverridesManager.cs
new file mode 100644
index 0000000..cf38f63
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/ScriptGenerationOverrides/ScriptGenerationOverridesManager.cs
@@ -0,0 +1,207 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using FastScriptReload.Runtime;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using UnityEditor;
+using UnityEditorInternal;
+using UnityEngine;
+
+namespace FastScriptReload.Editor.Compilation.ScriptGenerationOverrides
+{
+ [InitializeOnLoad]
+ public static class ScriptGenerationOverridesManager
+ {
+ private static float LoadOverridesFolderFilesEveryNSeconds = 5;
+
+ private static readonly string TemplateInterfaceDeclaration = @"
+
+//New interface declaration, this is very useful in cases where code depends on some internal interfaces that re-compiled code can no longer access. Simply define them here and code will compile.
+//You can add any type in that manner
+public interface ITestNewInterface {
+ bool Test { get; set; }
+}";
+
+ private static readonly string TemplateTopComment = @"// You can use this file to specify custom code overrides. Those will be applied to resulting code.
+// This approach is very useful if your code is failing to compile due to one of the existing limitations.
+//
+// While I work on reducing limitations you can simply specify override with proper code to make sure you can continue working.
+//
+// 1) Simply define code with same structure as your original class, make sure to include any namespace.
+// 2) Rename classes and types to have '' postfix.
+//
+// eg. 'MyClassName' needs to be changed to MyClassName otherwise it won't be properly connected.
+//
+// 3) Add any methods that you want to override, using same method signature. Whole method body will be replaced and no code adjustments will be run on it.
+// 4) You can add any additional types - this is quite useful when you hit limitation with internal interfaces - where compiler can not access them due to protection modifiers.
+// You can simply redefine those here, while not ideal it'll allow you to continue using Hot-Reload without modifying your code.
+//
+// Tool will now attempt to create a template file for you with first found class and first method as override, please adjust as necessary.
+// It'll also create an example redefined interface.
+// If you can't see anything please refer to the above and create overrides file manually.
+//
+// You can also refer to documentation section 'User defined script rewrite overrides'
+";
+
+ public static DirectoryInfo UserDefinedScriptRewriteOverridesFolder { get; }
+ private static double _lastTimeOverridesFolderFilesRead;
+
+ public static List UserDefinedScriptOverrides { get; } = new List();
+
+ static ScriptGenerationOverridesManager()
+ {
+ //TODO: allow to customize later from code, eg for user that'd like to include in source control
+ UserDefinedScriptRewriteOverridesFolder = new DirectoryInfo(Application.persistentDataPath + @"\FastScriptReload\ScriptOverrides");
+ UpdateUserDefinedScriptOverridesFileCache();
+ EditorApplication.update += Update;
+ }
+
+ private static void Update()
+ {
+ var timeSinceStartup = EditorApplication.timeSinceStartup;
+ if (_lastTimeOverridesFolderFilesRead + LoadOverridesFolderFilesEveryNSeconds < timeSinceStartup)
+ {
+ _lastTimeOverridesFolderFilesRead = timeSinceStartup;
+
+ UpdateUserDefinedScriptOverridesFileCache();
+ }
+ }
+
+ private static void UpdateUserDefinedScriptOverridesFileCache()
+ {
+ UserDefinedScriptOverrides.Clear();
+ if (UserDefinedScriptRewriteOverridesFolder.Exists)
+ {
+ UserDefinedScriptOverrides.AddRange(UserDefinedScriptRewriteOverridesFolder.GetFiles().Select(f => new UserDefinedScriptOverride(f)));
+ }
+ }
+
+ public static void AddScriptOverride(MonoScript script)
+ {
+ AddScriptOverride(new FileInfo(Path.Combine(Path.Combine(Application.dataPath + "//..", AssetDatabase.GetAssetPath(script)))));
+ }
+
+ public static void AddScriptOverride(FileInfo originalFile)
+ {
+ EnsureOverrideFolderExists();
+
+ var overridenFile = new FileInfo(Path.Combine(UserDefinedScriptRewriteOverridesFolder.FullName, originalFile.Name));
+ if (!overridenFile.Exists)
+ {
+ var templateString = string.Empty;
+ try
+ {
+ var fileCode = File.ReadAllText(originalFile.FullName);
+ var tree = CSharpSyntaxTree.ParseText(fileCode, new CSharpParseOptions(preprocessorSymbols: DynamicCompilationBase.ActiveScriptCompilationDefines));
+ var root = tree.GetRoot();
+
+ var firstType = root.DescendantNodes().OfType().FirstOrDefault();
+ if (firstType != null)
+ {
+ var members = new SyntaxList();
+ var firstMethod = firstType.DescendantNodes().OfType().FirstOrDefault(m => m.Body != null);
+ if (firstMethod != null)
+ {
+ var block = SyntaxFactory.Block();
+ block = block.AddStatements(SyntaxFactory.EmptyStatement().WithLeadingTrivia(
+ SyntaxFactory.Comment(@"/* Any code will be replaced with original method of same signature in same type*/"))
+ );
+ firstMethod = firstMethod
+ .WithBody(block)
+ .WithTriviaFrom(firstMethod);
+ members = members.Add(firstMethod);
+ }
+
+ root = root.ReplaceNode(firstType, firstType
+ .ReplaceToken(
+ firstType.Identifier,
+ SyntaxFactory.Identifier(firstType.Identifier.ValueText + AssemblyChangesLoader.ClassnamePatchedPostfix)
+ )
+ .WithMembers(members)).NormalizeWhitespace();
+
+ var interfaceDeclaration = CSharpSyntaxTree.ParseText(TemplateInterfaceDeclaration);
+
+ root = ((CompilationUnitSyntax)root).AddMembers(
+ interfaceDeclaration.GetRoot().DescendantNodes().OfType().First()
+ );
+ }
+
+ templateString = root.ToFullString();
+ }
+ catch (Exception e)
+ {
+ Debug.LogError($"Unable to generate user defined script override template from your file, please refer to note at the start of the file. {e}");
+ }
+
+ if (!overridenFile.Exists)
+ {
+ File.WriteAllText(overridenFile.FullName,
+ TemplateTopComment.Replace("", AssemblyChangesLoader.ClassnamePatchedPostfix) + templateString
+ );
+ UpdateUserDefinedScriptOverridesFileCache();
+ }
+ }
+
+ InternalEditorUtility.OpenFileAtLineExternal(overridenFile.FullName, 0);
+ }
+
+ public static bool TryRemoveScriptOverride(MonoScript originalScript)
+ {
+ EnsureOverrideFolderExists();
+
+ var overridenFile = new FileInfo(Path.Combine(UserDefinedScriptRewriteOverridesFolder.FullName, originalScript.name + ".cs"));
+ if (overridenFile.Exists)
+ {
+ return TryRemoveScriptOverride(overridenFile);
+ }
+
+ return false;
+ }
+
+ private static bool TryRemoveScriptOverride(FileInfo overridenFile)
+ {
+ try
+ {
+ overridenFile.Delete();
+ UpdateUserDefinedScriptOverridesFileCache();
+ }
+ catch (Exception)
+ {
+ Debug.Log($"Unable to remove: '{overridenFile.Name}' - make sure it's not locked / open in editor");
+ throw;
+ }
+
+ return true;
+ }
+
+ public static bool TryRemoveScriptOverride(UserDefinedScriptOverride scriptOverride)
+ {
+ return TryRemoveScriptOverride(scriptOverride.File);
+ }
+
+ public static bool TryGetScriptOverride(FileInfo changedFile, out FileInfo overridesFile)
+ {
+ overridesFile = UserDefinedScriptOverrides.FirstOrDefault(f => f.File.Name == changedFile.Name && f.File.Exists)?.File;
+ return overridesFile?.Exists ?? false;
+ }
+
+ private static void EnsureOverrideFolderExists()
+ {
+ if (!UserDefinedScriptRewriteOverridesFolder.Exists)
+ UserDefinedScriptRewriteOverridesFolder.Create();
+ }
+ }
+
+ public class UserDefinedScriptOverride
+ {
+ public FileInfo File { get; }
+
+ public UserDefinedScriptOverride(FileInfo file)
+ {
+ File = file;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/ScriptGenerationOverrides/ScriptGenerationOverridesManager.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/ScriptGenerationOverrides/ScriptGenerationOverridesManager.cs.meta
new file mode 100644
index 0000000..4928891
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/Compilation/ScriptGenerationOverrides/ScriptGenerationOverridesManager.cs.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: f699ee76d75a40b290cad5dd79619842
+timeCreated: 1678099566
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/ScriptGenerationOverrides/ScriptGenerationOverridesManager.cs
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/CustomFileWatcher.cs b/Assets/FastScriptReload/Scripts/Editor/CustomFileWatcher.cs
new file mode 100644
index 0000000..7b454e7
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/CustomFileWatcher.cs
@@ -0,0 +1,223 @@
+using UnityEngine;
+using UnityEditor;
+using System.Collections.Generic;
+using System.IO;
+using System.Security.Cryptography;
+using System.Text;
+using FastScriptReload.Editor;
+using System;
+using System.Threading;
+
+[InitializeOnLoad]
+public class CustomFileWatcher : EditorWindow
+{
+ public class HashEntry
+ {
+ private Dictionary _hashes = new Dictionary();
+ // Some metadata for the update function to use
+ // WARN: Note this data isn't exactly synced up or anything. It just reads it in when the filewatcher is initialized.
+ private string _searchPattern;
+ private bool _includeSubdirectories;
+
+ public Dictionary Hashes => _hashes;
+ public string SearchPattern => _searchPattern;
+ public bool IncludeSubdirectories => _includeSubdirectories;
+
+ public HashEntry(Dictionary hashes, string searchPattern, bool includeSubdirectories)
+ {
+ _hashes = hashes;
+ _searchPattern = searchPattern;
+ _includeSubdirectories = includeSubdirectories;
+ }
+ }
+
+ private static Dictionary FileHashes;
+ private static object StateLock = new object();
+
+ private static object ListLock; // Shared lock object
+ private static Thread LivewatcherThread;
+
+ public static bool InitSignaled = false;
+ private static readonly int WatcherThreadRunEveryNSeconds = 500; //TODO: expose in settings
+
+ static CustomFileWatcher()
+ {
+ FileHashes = new Dictionary();
+ ListLock = new object();
+ LivewatcherThread = null;
+ }
+
+ private static void UpdateFileWatcher()
+ {
+ if (FileHashes.Count > 0)
+ {
+ foreach (var kvp in FileHashes)
+ {
+ CheckForChanges(kvp.Key, kvp.Value.SearchPattern, kvp.Value.IncludeSubdirectories);
+ }
+ }
+ else
+ {
+ Debug.LogError("File watcher has not been initialized yet. Please initialize first.");
+ }
+ }
+
+ public static void TryEnableLivewatching()
+ {
+ if (LivewatcherThread != null)
+ {
+ Debug.LogWarning("Livewatcher is already running.");
+ return;
+ }
+
+ // Run on a separate thread every 1 second
+ LivewatcherThread = new Thread(() =>
+ {
+ var timer = new Timer((state) =>
+ {
+ // Go at it if we've initialized
+ if (FileHashes.Count > 0)
+ UpdateFileWatcher();
+ }, null, 0, WatcherThreadRunEveryNSeconds);
+ });
+
+ LivewatcherThread.Start();
+ }
+
+ public static void InitializeSingularFilewatcher(string directoryPath, string searchPattern, bool includeSubdirectories)
+ {
+#if ImmersiveVrTools_DebugEnabled
+ Debug.Log("Initializing hashes for directory: " + directoryPath);
+#endif
+
+ var thread = new Thread(() =>
+ {
+ lock (StateLock)
+ {
+ var hashes = new Dictionary();
+ var files = Directory.GetFiles(directoryPath, searchPattern, includeSubdirectories ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly);
+
+ foreach (var filePath in files)
+ {
+ var hash = GetFileHash(filePath);
+ hashes[filePath] = hash;
+ }
+
+ FileHashes[directoryPath] = new HashEntry(hashes, searchPattern, includeSubdirectories);
+ }
+ });
+ thread.Start();
+ }
+
+ private static void CheckForChanges(string directoryPath, string searchPattern, bool includeSubdirectories)
+ {
+ // Not really sure if this nuclear locking is needed
+ lock (StateLock)
+ {
+ var hashes = FileHashes[directoryPath].Hashes;
+
+ // Time profiling: Start the stopwatch for Directory.GetFiles
+#if ImmersiveVrTools_DebugEnabled
+
+ System.Diagnostics.Stopwatch getFilesStopwatch = new System.Diagnostics.Stopwatch();
+ getFilesStopwatch.Start();
+#endif
+
+ string[] files = Directory.GetFiles(directoryPath, searchPattern, includeSubdirectories ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly);
+
+#if ImmersiveVrTools_DebugEnabled
+
+ // Time profiling: Stop the stopwatch for Directory.GetFiles and log the elapsed time
+ getFilesStopwatch.Stop();
+ Debug.Log("Directory.GetFiles elapsed time: " + getFilesStopwatch.ElapsedMilliseconds + " ms");
+#endif
+
+ // Check if files were created or modified
+ // Time profiling: Start the stopwatch for file creation/modification
+ var fileChangeStopwatch = new System.Diagnostics.Stopwatch();
+ fileChangeStopwatch.Start();
+
+ foreach (var file in files)
+ {
+ if (!hashes.ContainsKey(file))
+ {
+ // New file
+#if ImmersiveVrTools_DebugEnabled
+ Debug.Log("New file: " + file);
+#endif
+ continue;
+ }
+
+ else if (hashes[file] != GetFileHash(file))
+ {
+ // File changed
+#if ImmersiveVrTools_DebugEnabled
+ Debug.Log("File changed: " + file);
+#endif
+ RecordChange(file);
+ }
+ }
+
+#if ImmersiveVrTools_DebugEnabled
+ // Time profiling: Stop the stopwatch for file creation/modification and log the elapsed time
+ fileChangeStopwatch.Stop();
+ Debug.Log("File creation/modification elapsed time: " + fileChangeStopwatch.ElapsedMilliseconds + " ms");
+#endif
+
+ // Check if any files were deleted
+ // Time profiling: Start the stopwatch for file deletion
+ var fileDeletionStopwatch = new System.Diagnostics.Stopwatch();
+ fileDeletionStopwatch.Start();
+
+ foreach (var kvp in hashes)
+ {
+ if (!File.Exists(kvp.Key))
+ {
+#if ImmersiveVrTools_DebugEnabled
+ Debug.Log("File deleted: " + kvp.Key);
+#endif
+ }
+ }
+
+ // Time profiling: Stop the stopwatch for file deletion and log the elapsed time
+#if ImmersiveVrTools_DebugEnabled
+ fileDeletionStopwatch.Stop();
+ Debug.Log("File deletion elapsed time: " + fileDeletionStopwatch.ElapsedMilliseconds + " ms");
+#endif
+
+ // Update hashes
+ hashes.Clear();
+ foreach (var file in files)
+ {
+ var hash = GetFileHash(file);
+ hashes[file] = hash;
+ }
+ }
+ }
+
+
+ private static string GetFileHash(string filePath)
+ {
+ using (var md5 = MD5.Create())
+ using (var stream = File.OpenRead(filePath))
+ {
+ var hashBytes = md5.ComputeHash(stream);
+ var sb = new StringBuilder();
+ for (var i = 0; i < hashBytes.Length; i++)
+ {
+ sb.Append(hashBytes[i].ToString("x2"));
+ }
+ return sb.ToString();
+ }
+ }
+
+ private static void RecordChange(string path)
+ {
+ if (FastScriptReloadManager.Instance.ShouldIgnoreFileChange()) return;
+
+ lock (ListLock)
+ {
+ FastScriptReloadManager.Instance.AddFileChangeToProcess(path);
+ }
+ }
+}
diff --git a/Assets/FastScriptReload/Scripts/Editor/CustomFileWatcher.cs.meta b/Assets/FastScriptReload/Scripts/Editor/CustomFileWatcher.cs.meta
new file mode 100644
index 0000000..24dde56
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/CustomFileWatcher.cs.meta
@@ -0,0 +1,18 @@
+fileFormatVersion: 2
+guid: 550c0c3f77d436e4fb133b8d029eb6a6
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Scripts/Editor/CustomFileWatcher.cs
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/FastScriptReload.Editor.asmdef b/Assets/FastScriptReload/Scripts/Editor/FastScriptReload.Editor.asmdef
new file mode 100644
index 0000000..c71d557
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/FastScriptReload.Editor.asmdef
@@ -0,0 +1,25 @@
+{
+ "name": "FastScriptReload.Editor",
+ "rootNamespace": "",
+ "references": [
+ "GUID:b75b497805046c443a21f90e84a5ff4f"
+ ],
+ "includePlatforms": [
+ "Editor"
+ ],
+ "excludePlatforms": [],
+ "allowUnsafeCode": true,
+ "overrideReferences": true,
+ "precompiledReferences": [
+ "0Harmony.dll",
+ "Microsoft.CodeAnalysis.dll",
+ "Microsoft.CodeAnalysis.CSharp.dll",
+ "ImmersiveVRTools.Common.Editor.dll",
+ "ImmersiveVRTools.Common.Runtime.dll",
+ "System.Collections.Immutable.FSR.dll"
+ ],
+ "autoReferenced": false,
+ "defineConstraints": [],
+ "versionDefines": [],
+ "noEngineReferences": false
+}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/FastScriptReload.Editor.asmdef.meta b/Assets/FastScriptReload/Scripts/Editor/FastScriptReload.Editor.asmdef.meta
new file mode 100644
index 0000000..00ef5c8
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/FastScriptReload.Editor.asmdef.meta
@@ -0,0 +1,14 @@
+fileFormatVersion: 2
+guid: 97dcf6b63da809f4aa9573d9e792e540
+AssemblyDefinitionImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
+AssetOrigin:
+ serializedVersion: 1
+ productId: 239351
+ packageName: Fast Script Reload
+ packageVersion: 1.6.1
+ assetPath: Assets/FastScriptReload/Scripts/Editor/FastScriptReload.Editor.asmdef
+ uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/FastScriptReloadManager.cs b/Assets/FastScriptReload/Scripts/Editor/FastScriptReloadManager.cs
new file mode 100644
index 0000000..9b774c3
--- /dev/null
+++ b/Assets/FastScriptReload/Scripts/Editor/FastScriptReloadManager.cs
@@ -0,0 +1,863 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using FastScriptReload.Editor.Compilation;
+using FastScriptReload.Editor.Compilation.ScriptGenerationOverrides;
+using FastScriptReload.Runtime;
+using ImmersiveVRTools.Editor.Common.Utilities;
+using ImmersiveVRTools.Runtime.Common;
+using ImmersiveVrToolsCommon.Runtime.Logging;
+using UnityEditor;
+using UnityEditor.Compilation;
+using UnityEngine;
+
+namespace FastScriptReload.Editor
+{
+ [InitializeOnLoad]
+ [PreventHotReload]
+ public class FastScriptReloadManager
+ {
+ private static FastScriptReloadManager _instance;
+ public static FastScriptReloadManager Instance
+ {
+ get {
+ if (_instance == null)
+ {
+ _instance = new FastScriptReloadManager();
+ LoggerScoped.LogDebug("Created Manager");
+ }
+
+ return _instance;
+ }
+ }
+
+ private static string DataPath = Application.dataPath;
+
+
+ public const string FileWatcherReplacementTokenForApplicationDataPath = "";
+ private const int BaseMenuItemPriority_ManualScriptOverride = 100;
+ private const int BaseMenuItemPriority_Exclusions = 200;
+ private const int BaseMenuItemPriority_FileWatcher = 300;
+
+ public Dictionary> FileWatcherTokensToResolvePathFn = new Dictionary>
+ {
+ [FileWatcherReplacementTokenForApplicationDataPath] = () => DataPath
+ };
+
+ private Dictionary _lastProcessedDynamicFileHotReloadStatesInSession = new Dictionary();
+ public IReadOnlyDictionary