diff --git a/proj/unity/Assets/AddressableAssetsData/Windows/addressables_content_state.bin b/proj/unity/Assets/AddressableAssetsData/Windows/addressables_content_state.bin index 7aad7f1..0e3e21f 100644 Binary files a/proj/unity/Assets/AddressableAssetsData/Windows/addressables_content_state.bin and b/proj/unity/Assets/AddressableAssetsData/Windows/addressables_content_state.bin differ diff --git a/proj/unity/Assets/AddressableAssetsData/link.xml b/proj/unity/Assets/AddressableAssetsData/link.xml deleted file mode 100644 index 2df1e15..0000000 --- a/proj/unity/Assets/AddressableAssetsData/link.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/proj/unity/Assets/Config/EnemyWaves/EasyWave.asset b/proj/unity/Assets/Config/EnemyWaves/EasyWave.asset index 00fb5de..08f48ff 100644 Binary files a/proj/unity/Assets/Config/EnemyWaves/EasyWave.asset and b/proj/unity/Assets/Config/EnemyWaves/EasyWave.asset differ diff --git a/proj/unity/Assets/Config/PHome/PHomeGameConfig.asset b/proj/unity/Assets/Config/PHome/PHomeGameConfig.asset index 512210f..b9172e7 100644 Binary files a/proj/unity/Assets/Config/PHome/PHomeGameConfig.asset and b/proj/unity/Assets/Config/PHome/PHomeGameConfig.asset differ diff --git a/proj/unity/Assets/Editor/StateTrack.meta b/proj/unity/Assets/Editor/StateTrack.meta new file mode 100644 index 0000000..4b871c4 --- /dev/null +++ b/proj/unity/Assets/Editor/StateTrack.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a1f91d91ae015534181f76d058dba686 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Fonts/MSYH SDF.asset b/proj/unity/Assets/Fonts/MSYH SDF.asset index 47cc99a..b956250 100644 Binary files a/proj/unity/Assets/Fonts/MSYH SDF.asset and b/proj/unity/Assets/Fonts/MSYH SDF.asset differ diff --git a/proj/unity/Assets/Fonts/SIMLI SDF.asset b/proj/unity/Assets/Fonts/SIMLI SDF.asset index 2661166..ebd67d5 100644 Binary files a/proj/unity/Assets/Fonts/SIMLI SDF.asset and b/proj/unity/Assets/Fonts/SIMLI SDF.asset differ diff --git a/proj/unity/Assets/Packages/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Fallback.asset b/proj/unity/Assets/Packages/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Fallback.asset index 0ca127f..e907cc7 100644 Binary files a/proj/unity/Assets/Packages/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Fallback.asset and b/proj/unity/Assets/Packages/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Fallback.asset differ diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Serialization.dll b/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Serialization.dll index a831399..a159213 100644 Binary files a/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Serialization.dll and b/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Serialization.dll differ diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Serialization.dll.meta b/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Serialization.dll.meta index 344354c..1a97dca 100644 --- a/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Serialization.dll.meta +++ b/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Serialization.dll.meta @@ -1,49 +1,14 @@ fileFormatVersion: 2 guid: 5651992cdad94894a3af7dc3f1da9170 +timeCreated: 1488828285 PluginImporter: - externalObjects: {} - serializedVersion: 2 + serializedVersion: 1 iconMap: {} executionOrder: {} - defineConstraints: [] isPreloaded: 0 isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 platformData: - - first: - : N3DS - second: - enabled: 1 - settings: {} - - first: - : PSM - second: - enabled: 1 - settings: {} - - first: - : PSP2 - second: - enabled: 1 - settings: {} - - first: - : SamsungTV - second: - enabled: 1 - settings: {} - - first: - : Tizen - second: - enabled: 1 - settings: {} - - first: - : WiiU - second: - enabled: 1 - settings: {} - - first: - Any: - second: + Any: enabled: 0 settings: Exclude Android: 1 @@ -68,41 +33,45 @@ PluginImporter: Exclude XboxOne: 0 Exclude iOS: 0 Exclude tvOS: 0 - - first: - Editor: Editor - second: + Editor: enabled: 0 settings: DefaultValueInitialized: true - - first: - PS4: PS4 - second: + N3DS: enabled: 1 settings: {} - - first: - WebGL: WebGL - second: + PS4: enabled: 1 settings: {} - - first: - Windows Store Apps: WindowsStoreApps - second: + PSM: + enabled: 1 + settings: {} + PSP2: + enabled: 1 + settings: {} + SamsungTV: + enabled: 1 + settings: {} + Tizen: + enabled: 1 + settings: {} + WebGL: + enabled: 1 + settings: {} + WiiU: + enabled: 1 + settings: {} + WindowsStoreApps: enabled: 1 settings: CPU: AnyCPU - - first: - XboxOne: XboxOne - second: + XboxOne: enabled: 1 settings: {} - - first: - iPhone: iOS - second: - enabled: 0 + iOS: + enabled: 1 settings: {} - - first: - tvOS: tvOS - second: + tvOS: enabled: 1 settings: {} userData: diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Serialization.pdb b/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Serialization.pdb new file mode 100644 index 0000000..aa5a55d Binary files /dev/null and b/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Serialization.pdb differ diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Serialization.pdb.meta b/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Serialization.pdb.meta new file mode 100644 index 0000000..ca8680d --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Serialization.pdb.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5651992cdad94894a3af7dc3f1da0a6f +timeCreated: 1488828285 +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Utilities.dll b/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Utilities.dll index e4206fe..a996815 100644 Binary files a/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Utilities.dll and b/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Utilities.dll differ diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Utilities.dll.meta b/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Utilities.dll.meta index a287af3..21e88ae 100644 --- a/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Utilities.dll.meta +++ b/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Utilities.dll.meta @@ -1,49 +1,14 @@ fileFormatVersion: 2 guid: 5978f8f3dd274e848fbb7a123bde1fb9 +timeCreated: 1488828285 PluginImporter: - externalObjects: {} - serializedVersion: 2 + serializedVersion: 1 iconMap: {} executionOrder: {} - defineConstraints: [] isPreloaded: 0 isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 platformData: - - first: - : N3DS - second: - enabled: 1 - settings: {} - - first: - : PSM - second: - enabled: 1 - settings: {} - - first: - : PSP2 - second: - enabled: 1 - settings: {} - - first: - : SamsungTV - second: - enabled: 1 - settings: {} - - first: - : Tizen - second: - enabled: 1 - settings: {} - - first: - : WiiU - second: - enabled: 1 - settings: {} - - first: - Any: - second: + Any: enabled: 0 settings: Exclude Android: 1 @@ -68,41 +33,45 @@ PluginImporter: Exclude XboxOne: 0 Exclude iOS: 0 Exclude tvOS: 0 - - first: - Editor: Editor - second: + Editor: enabled: 0 settings: DefaultValueInitialized: true - - first: - PS4: PS4 - second: + N3DS: enabled: 1 settings: {} - - first: - WebGL: WebGL - second: + PS4: enabled: 1 settings: {} - - first: - Windows Store Apps: WindowsStoreApps - second: + PSM: + enabled: 1 + settings: {} + PSP2: + enabled: 1 + settings: {} + SamsungTV: + enabled: 1 + settings: {} + Tizen: + enabled: 1 + settings: {} + WebGL: + enabled: 1 + settings: {} + WiiU: + enabled: 1 + settings: {} + WindowsStoreApps: enabled: 1 settings: CPU: AnyCPU - - first: - XboxOne: XboxOne - second: + XboxOne: enabled: 1 settings: {} - - first: - iPhone: iOS - second: - enabled: 0 + iOS: + enabled: 1 settings: {} - - first: - tvOS: tvOS - second: + tvOS: enabled: 1 settings: {} userData: diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Utilities.pdb b/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Utilities.pdb new file mode 100644 index 0000000..60ac47f Binary files /dev/null and b/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Utilities.pdb differ diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Utilities.pdb.meta b/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Utilities.pdb.meta new file mode 100644 index 0000000..d840ef5 --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Utilities.pdb.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5978f8f3dd274e848fbb7a123bde0a6f +timeCreated: 1488828285 +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Serialization.dll b/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Serialization.dll index b3dcd53..5bef928 100644 Binary files a/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Serialization.dll and b/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Serialization.dll differ diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Serialization.dll.meta b/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Serialization.dll.meta index 3805f9b..ac8769d 100644 --- a/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Serialization.dll.meta +++ b/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Serialization.dll.meta @@ -1,49 +1,17 @@ fileFormatVersion: 2 guid: d2a8f0021d6b47c5923d8972dfb81ef1 +timeCreated: 1488828285 PluginImporter: - externalObjects: {} - serializedVersion: 2 + serializedVersion: 1 iconMap: {} executionOrder: {} - defineConstraints: [] isPreloaded: 0 isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 platformData: - - first: - : Linux - second: + Android: enabled: 1 settings: {} - - first: - : LinuxUniversal - second: - enabled: 1 - settings: {} - - first: - : OSXIntel - second: - enabled: 1 - settings: {} - - first: - : OSXIntel64 - second: - enabled: 1 - settings: {} - - first: - : PSM - second: - enabled: 0 - settings: {} - - first: - Android: Android - second: - enabled: 1 - settings: {} - - first: - Any: - second: + Any: enabled: 0 settings: Exclude Android: 0 @@ -68,47 +36,41 @@ PluginImporter: Exclude XboxOne: 1 Exclude iOS: 1 Exclude tvOS: 1 - - first: - Editor: Editor - second: + Editor: enabled: 0 settings: DefaultValueInitialized: true - - first: - Standalone: Linux64 - second: + Linux: enabled: 1 - settings: - CPU: - - first: - Standalone: OSXUniversal - second: + settings: {} + Linux64: enabled: 1 - settings: - CPU: - - first: - Standalone: Win - second: + settings: {} + LinuxUniversal: enabled: 1 - settings: - CPU: - - first: - Standalone: Win64 - second: + settings: {} + OSXIntel: enabled: 1 - settings: - CPU: - - first: - Windows Store Apps: WindowsStoreApps - second: + settings: {} + OSXIntel64: + enabled: 1 + settings: {} + OSXUniversal: + enabled: 1 + settings: {} + PSM: + enabled: 0 + settings: {} + Win: + enabled: 1 + settings: {} + Win64: + enabled: 1 + settings: {} + WindowsStoreApps: enabled: 0 settings: CPU: AnyCPU - - first: - iPhone: iOS - second: - enabled: 1 - settings: {} userData: assetBundleName: assetBundleVariant: diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Serialization.pdb b/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Serialization.pdb new file mode 100644 index 0000000..1d5fa0b Binary files /dev/null and b/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Serialization.pdb differ diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Serialization.pdb.meta b/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Serialization.pdb.meta new file mode 100644 index 0000000..e007cbe --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Serialization.pdb.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d2a8f0021d6b47c5923d8972dfb80a6f +timeCreated: 1488828285 +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Utilities.dll b/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Utilities.dll index ca0aed7..ca86fbb 100644 Binary files a/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Utilities.dll and b/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Utilities.dll differ diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Utilities.dll.meta b/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Utilities.dll.meta index c2e8786..f158c55 100644 --- a/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Utilities.dll.meta +++ b/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Utilities.dll.meta @@ -1,49 +1,17 @@ fileFormatVersion: 2 guid: 1e0a9643dc0d4b46bf2321f72c4e503e +timeCreated: 1488828285 PluginImporter: - externalObjects: {} - serializedVersion: 2 + serializedVersion: 1 iconMap: {} executionOrder: {} - defineConstraints: [] isPreloaded: 0 isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 platformData: - - first: - : Linux - second: + Android: enabled: 1 settings: {} - - first: - : LinuxUniversal - second: - enabled: 1 - settings: {} - - first: - : OSXIntel - second: - enabled: 1 - settings: {} - - first: - : OSXIntel64 - second: - enabled: 1 - settings: {} - - first: - : PSM - second: - enabled: 0 - settings: {} - - first: - Android: Android - second: - enabled: 1 - settings: {} - - first: - Any: - second: + Any: enabled: 0 settings: Exclude Android: 0 @@ -68,47 +36,41 @@ PluginImporter: Exclude XboxOne: 1 Exclude iOS: 1 Exclude tvOS: 1 - - first: - Editor: Editor - second: + Editor: enabled: 0 settings: DefaultValueInitialized: true - - first: - Standalone: Linux64 - second: + Linux: enabled: 1 - settings: - CPU: - - first: - Standalone: OSXUniversal - second: + settings: {} + Linux64: enabled: 1 - settings: - CPU: - - first: - Standalone: Win - second: + settings: {} + LinuxUniversal: enabled: 1 - settings: - CPU: - - first: - Standalone: Win64 - second: + settings: {} + OSXIntel: enabled: 1 - settings: - CPU: - - first: - Windows Store Apps: WindowsStoreApps - second: + settings: {} + OSXIntel64: + enabled: 1 + settings: {} + OSXUniversal: + enabled: 1 + settings: {} + PSM: + enabled: 0 + settings: {} + Win: + enabled: 1 + settings: {} + Win64: + enabled: 1 + settings: {} + WindowsStoreApps: enabled: 0 settings: CPU: AnyCPU - - first: - iPhone: iOS - second: - enabled: 1 - settings: {} userData: assetBundleName: assetBundleVariant: diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Utilities.pdb b/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Utilities.pdb new file mode 100644 index 0000000..8830129 Binary files /dev/null and b/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Utilities.pdb differ diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Utilities.pdb.meta b/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Utilities.pdb.meta new file mode 100644 index 0000000..a12e646 --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Utilities.pdb.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1e0a9643dc0d4b46bf2321f72c4e0a6f +timeCreated: 1488828285 +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.dll b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.dll index 13a622c..769bc7b 100644 Binary files a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.dll and b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.dll differ diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.dll.meta b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.dll.meta index 342fe20..77ae929 100644 --- a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.dll.meta +++ b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.dll.meta @@ -1,7 +1,6 @@ fileFormatVersion: 2 guid: 47a84ebde4ec47fabb620b30cc7a3e5c timeCreated: 1488828285 -licenseType: Store PluginImporter: serializedVersion: 1 iconMap: {} diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.pdb b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.pdb new file mode 100644 index 0000000..b8f14ac Binary files /dev/null and b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.pdb differ diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.pdb.meta b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.pdb.meta new file mode 100644 index 0000000..1958589 --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.pdb.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 47a84ebde4ec47fabb620b30cc7a0a6f +timeCreated: 1488828285 +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.xml b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.xml index 8a70a95..0649312 100644 --- a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.xml +++ b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.xml @@ -352,11 +352,6 @@ - - - Gets the height of the button. If it's zero or below then use default. - - Use this to override the label on the button. @@ -380,7 +375,33 @@ - Whether the containing object or scene (if there is one) should be marked dirty when the button is clicked. True by default. + Whether the containing object or scene (if there is one) should be marked dirty when the button is clicked. True by default. Note that if this is false, undo for any changes caused by the button click is also disabled, as registering undo events also causes dirtying. + + + + + Gets the height of the button. If it's zero or below then use default. + + + + + The icon to be displayed inside the button. + + + + + The alignment of the icon that is displayed inside the button. + + + + + The alignment of the button represented by a range from 0 to 1 where 0 is the left edge of the available space and 1 is the right edge. + ButtonAlignment only has an effect when Stretch is set to false. + + + + + Whether the button should stretch to fill all of the available space. Default value is true. @@ -468,6 +489,26 @@ Size of the button in pixels. Button style for methods with parameters. + + + Creates a button in the inspector with a custom icon. + + The icon to be displayed inside the button. + The alignment of the icon that is displayed inside the button. + + + + Creates a button in the inspector with a custom icon. + + The icon to be displayed inside the button. + + + + Creates a button in the inspector with a custom icon. + + The icon to be displayed inside the button. + Custom name for the button. + ButtonGroup is used on any instance function, and adds buttons to the inspector organized into horizontal groups. @@ -527,6 +568,26 @@ + + + Gets the height of the button. If it's zero or below then use default. + + + + + The alignment of the icon that is displayed inside the button. + + + + + The alignment of the button represented by a range from 0 to 1 where 0 is the left edge of the available space and 1 is the right edge. + + + + + Whether the button should stretch to fill all of the available space. Default value is true. + + Organizes the button into the specified button group. @@ -562,6 +623,106 @@ + + + ColorPalette is used on any Color property, and allows for choosing colors from different definable palettes. + Use this to allow the user to choose from a set of predefined color options. + + + See and edit the color palettes in Tools > Odin > Inspector > Preferences > Drawers > Color Palettes. + The color property is not tied to the color palette, and can be edited. Therefore the color will also not update if the ColorPalette is edited. + + + The following example shows how ColorPalette is applied to a property. The user can freely choose between all available ColorPalettes. + + public class ColorPaletteExamples : MonoBehaviour + { + [ColorPalette] + public Color ColorOptions; + + [ColorPalette("Underwater")] + public Color UnderwaterColor; + + [ColorPalette("Fall"), HideLabel] + public Color WideColorPalette; + + [ColorPalette("My Palette")] + public Color MyColor; + + [ColorPalette("Clovers")] + public Color[] ColorArray; + } + + + + + + Gets the name of the palette. + + + + + Indicates if the color palette should show alpha values or not. + + + + + Adds a color palette options to a Color property. + + + + + Adds color options to a Color property from a specific palette. + + Name of the palette. + + + + CustomContextMenu is used on any property, and adds a custom options to the context menu for the property. + Use this for when you want to add custom actions to the context menu of a property. + + + CustomContextMenu currently does not support static functions. + + + The following example shows how CustomContextMenu is used to add a custom option to a property. + + public class MyComponent : MonoBehaviour + { + [CustomContextMenu("My custom option", "MyAction")] + public Vector3 MyVector; + + private void MyAction() + { + MyVector = Random.onUnitSphere; + } + } + + + + + + + The name of the menu item. + + + + + The name of the callback method. Obsolete; use the Action member instead. + + + + + A resolved string defining the action to take when the context menu is clicked. + + + + + Adds a custom option to the context menu of the property. + + The name of the menu item. + A resolved string defining the action to take when the context menu is clicked. + Instead of making a new attribute, and a new drawer, for a one-time thing, you can with this attribute, make a method that acts as a custom property drawer. @@ -622,6 +783,214 @@ A resolved string that defines the custom drawer action to take, such as an expression or method invocation. + + + Delays applying changes to properties while they still being edited in the inspector. + Similar to Unity's built-in Delayed attribute, but this attribute can also be applied to properties. + + + + + DetailedInfoBox is used on any property, and displays a message box that can be expanded to show more details. + Use this to convey a message to a user, and give them the option to see more details. + + + The following example shows how DetailedInfoBox is used on a field. + + public class MyComponent : MonoBehaviour + { + [DetailedInfoBox("This is a message", "Here is some more details about that message")] + public int MyInt; + } + + + + + + + The message for the message box. + + + + + The hideable details of the message box. + + + + + Type of the message box. + + + + + Optional name of a member to hide or show the message box. + + + + + Displays a message box with hideable details. + + The message for the message box. + The hideable details of the message box. + Type of the message box. + Optional name of a member to hide or show the message box. + + + + Customize the behavior for dictionaries in the inspector. + + + + + Specify an alternative key label for the dictionary drawer. + + + + + Specify an alternative value label for the dictionary drawer. + + + + + Specify how the dictionary should draw its items. + + + + + Gets or sets a value indicating whether this instance is read only. + + + + + Gets or sets a value indicating the default key column width of the dictionary. + + + + + DisableContextMenu is used on any property and disables the context menu for that property. + Use this if you do not want the context menu to be available for a property. + + + The following example shows how DisableContextMenu is used on a property. + + public class MyComponent : MonoBehaviour + { + [DisableContextMenu] + public Vector3 MyVector; + } + + + + + + + Whether to disable the context menu for the member itself. + + + + + Whether to disable the context menu for collection elements. + + + + + Initializes a new instance of the class. + + Whether to disable the context menu for the member itself. + Whether to also disable the context menu of collection elements. + + + + DisableIf is used on any property, and can disable or enable the property in the inspector. + Use this to disable properties when they are irrelevant. + + + The following example shows how a property can be disabled by the state of a field. + + public class MyComponent : MonoBehaviour + { + public bool DisableProperty; + + [DisableIf("DisableProperty")] + public int MyInt; + + public SomeEnum SomeEnumField; + + [DisableIf("SomeEnumField", SomeEnum.SomeEnumMember)] + public string SomeString; + } + + + + The following examples show how a property can be disabled by a function. + + public class MyComponent : MonoBehaviour + { + [EnableIf("MyDisableFunction")] + public int MyInt; + + private bool MyDisableFunction() + { + // ... + } + } + + + + + + + + The name of a bool member field, property or method. Obsolete; use the Condition member instead. + + + + + A resolved string that defines the condition to check the value of, such as a member name or an expression. + + + + + The optional condition value. + + + + + Disables a property in the inspector, based on the value of a resolved string. + + A resolved string that defines the condition to check the value of, such as a member name or an expression. + + + + Disables a property in the inspector, if the resolved string evaluates to the specified value. + + A resolved string that defines the condition to check the value of, such as a member name or an expression. + Value to check against. + + + + Disables a member based on which type of a prefab and instance it is in. + + + + + DisableInEditorMode is used on any property, and disables the property when not in play mode. + Use this when you only want a property to be editable when in play mode. + + + The following example shows how DisableInEditorMode is used to disable a property when in the editor. + + public class MyComponent : MonoBehaviour + { + [DisableInEditorMode] + public int MyInt; + } + + + + + + Disables a property if it is drawn within an . @@ -632,6 +1001,27 @@ Disables a property if it is drawn from a non-prefab asset or instance. + + + DisableInPlayMode is used on any property, and disables the property when in play mode. + Use this to prevent users from editing a property when in play mode. + + + The following example shows how DisableInPlayMode is used to disable a property when in play mode. + + public class MyComponent : MonoBehaviour + { + [DisableInPlayMode] + public int MyInt; + } + + + + + + + + Disables a property if it is drawn from a prefab asset. @@ -647,16 +1037,213 @@ Disables a property if it is drawn from a prefab asset or a prefab instance. + + + DisallowModificationsIn disables / grays out members, preventing modifications from being made and enables validation, + providing error messages in case a modification was made prior to introducing the attribute. + + + + + + + + DisplayAsString is used on any property, and displays a string in the inspector as text. + Use this for when you want to show a string in the inspector, but not allow for any editing. + + + DisplayAsString uses the property's ToString method to display the property as a string. + + + The following example shows how DisplayAsString is used to display a string property as text in the inspector. + + public class MyComponent : MonoBehaviour + { + [DisplayAsString] + public string MyInt = 5; + + // You can combine with to display a message in the inspector. + [DisplayAsString, HideLabel] + public string MyMessage = "This string will be displayed as text in the inspector"; + + [DisplayAsString(false)] + public string InlineMessage = "This string is very long, but has been configured to not overflow."; + } + + + + + + + + If true, the string will overflow past the drawn space and be clipped when there's not enough space for the text. + If false the string will expand to multiple lines, if there's not enough space when drawn. + + + + + How the string should be aligned. + + + + + The size of the font. + + + + + If true the string will support rich text. + + + + + String for formatting the value. Type must implement the IFormattable interface. + + + + + Displays the property as a string in the inspector. + + + + + Displays the property as a string in the inspector. + + Value indicating if the string should overflow past the available space, or expand to multiple lines when there's not enough horizontal space. + + + + Displays the property as a string in the inspector. + + How the string should be aligned. + + + + Displays the property as a string in the inspector. + + The size of the font. + + + + Displays the property as a string in the inspector. + + Value indicating if the string should overflow past the available space, or expand to multiple lines when there's not enough horizontal space. + How the string should be aligned. + + + + Displays the property as a string in the inspector. + + Value indicating if the string should overflow past the available space, or expand to multiple lines when there's not enough horizontal space. + The size of the font. + + + + Displays the property as a string in the inspector. + + The size of the font. + How the string should be aligned. + + + + Displays the property as a string in the inspector. + + Value indicating if the string should overflow past the available space, or expand to multiple lines when there's not enough horizontal space. + The size of the font. + How the string should be aligned. + + + + Displays the property as a string in the inspector. + + How the string should be aligned. + If true the string will support rich text. + + + + Displays the property as a string in the inspector. + + The size of the font. + If true the string will support rich text. + + + + Displays the property as a string in the inspector. + + Value indicating if the string should overflow past the available space, or expand to multiple lines when there's not enough horizontal space. + How the string should be aligned. + If true the string will support rich text. + + + + Displays the property as a string in the inspector. + + Value indicating if the string should overflow past the available space, or expand to multiple lines when there's not enough horizontal space. + The size of the font. + If true the string will support rich text. + + + + Displays the property as a string in the inspector. + + The size of the font. + How the string should be aligned. + If true the string will support rich text. + + + + Displays the property as a string in the inspector. + + Value indicating if the string should overflow past the available space, or expand to multiple lines when there's not enough horizontal space. + The size of the font. + How the string should be aligned. + If true the string will support rich text. + Indicates that the member should not be drawn as a value reference, if it becomes a reference to another value in the tree. Beware, and use with care! This may lead to infinite draw loops! + + + DontApplyToListElements is used on other attributes, and indicates that those attributes should be applied only to the list, and not to the elements of the list. + Use this on attributes that should only work on a list or array property as a whole, and not on each element of the list. + + + The following example shows how DontApplyToListElements is used on . + + [DontApplyToListElements] + [AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)] + public sealed class VisibleIfAttribute : Attribute + { + public string MemberName { get; private set; } + + public VisibleIfAttribute(string memberName) + { + this.MemberName = memberName; + } + } + + + Tells the validation system that this member should not be validated. It will not show validation messages in the inspector, and it will not be scanned by the project validator. + + + DrawWithUnity can be applied to a field or property to make Odin draw it using Unity's old drawing system. Use it if you want to selectively disable Odin drawing for a particular member. + + + Note that this attribute does not mean "disable Odin completely for this property"; it is visual only in nature, and in fact represents an Odin drawer which calls into Unity's old property drawing system. As Odin is still ultimately responsible for arranging the drawing of the property, and since other attributes exist with a higher priority than this attribute, and it is not guaranteed that Unity will draw the property if another attribute is present to override this one. + + + + + Force Odin to draw this value as an IMGUI-embedded UI Toolkit Visual Element. + + An attribute that enables GUI. @@ -672,6 +1259,82 @@ + + + EnableIf is used on any property, and can enable or disable the property in the inspector. + Use this to enable properties when they are relevant. + + + The following example shows how a property can be enabled by the state of a field. + + public class MyComponent : MonoBehaviour + { + public bool EnableProperty; + + [EnableIf("EnableProperty")] + public int MyInt; + + public SomeEnum SomeEnumField; + + [EnableIf("SomeEnumField", SomeEnum.SomeEnumMember)] + public string SomeString; + } + + + + The following examples show how a property can be enabled by a function. + + public class MyComponent : MonoBehaviour + { + [EnableIf("MyEnableFunction")] + public int MyInt; + + private bool MyEnableFunction() + { + // ... + } + } + + + + + + + + + + + The name of a bool member field, property or method. Obsolete; use the Condition member instead. + + + + + A resolved string that defines the condition to check the value of, such as a member name or an expression. + + + + + The optional condition value. + + + + + Enables a property in the inspector, based on the value of a resolved string. + + A resolved string that defines the condition to check the value of, such as a member name or an expression. + + + + Enables a property in the inspector, if the resolved string evaluates to the specified value. + + A resolved string that defines the condition to check the value of, such as a member name or an expression. + Value to check against. + + + + Enables a member based on which type of a prefab and instance it is. + + Draws an enum selector in the inspector with next and previous buttons to let you cycle through the available values for the enum property. @@ -694,56 +1357,90 @@ + + + Draws an enum in a horizontal button group instead of a dropdown. + + + + public class MyComponent : MonoBehvaiour + { + [EnumToggleButtons] + public MyBitmaskEnum MyBitmaskEnum; + + [EnumToggleButtons] + public MyEnum MyEnum; + } + + [Flags] + public enum MyBitmaskEnum + { + A = 1 << 1, // 1 + B = 1 << 2, // 2 + C = 1 << 3, // 4 + ALL = A | B | C + } + + public enum MyEnum + { + A, + B, + C + } + + + + - - FilePath is used on string properties, and provides an interface for file paths. - - - The following example demonstrates how FilePath is used. - - public class FilePathExamples : MonoBehaviour - { - // By default, FilePath provides a path relative to the Unity project. - [FilePath] - public string UnityProjectPath; + + FilePath is used on string properties, and provides an interface for file paths. + + + The following example demonstrates how FilePath is used. + + public class FilePathExamples : MonoBehaviour + { + // By default, FilePath provides a path relative to the Unity project. + [FilePath] + public string UnityProjectPath; - // It is possible to provide custom parent path. Parent paths can be relative to the Unity project, or absolute. - [FilePath(ParentFolder = "Assets/Plugins/Sirenix")] - public string RelativeToParentPath; + // It is possible to provide custom parent path. Parent paths can be relative to the Unity project, or absolute. + [FilePath(ParentFolder = "Assets/Plugins/Sirenix")] + public string RelativeToParentPath; - // Using parent path, FilePath can also provide a path relative to a resources folder. - [FilePath(ParentFolder = "Assets/Resources")] - public string ResourcePath; + // Using parent path, FilePath can also provide a path relative to a resources folder. + [FilePath(ParentFolder = "Assets/Resources")] + public string ResourcePath; - // Provide a comma seperated list of allowed extensions. Dots are optional. - [FilePath(Extensions = "cs")] - public string ScriptFiles; + // Provide a comma seperated list of allowed extensions. Dots are optional. + [FilePath(Extensions = "cs")] + public string ScriptFiles; - // By setting AbsolutePath to true, the FilePath will provide an absolute path instead. - [FilePath(AbsolutePath = true)] - [BoxGroup("Conditions")] - public string AbsolutePath; + // By setting AbsolutePath to true, the FilePath will provide an absolute path instead. + [FilePath(AbsolutePath = true)] + [BoxGroup("Conditions")] + public string AbsolutePath; - // FilePath can also be configured to show an error, if the provided path is invalid. - [FilePath(RequireValidPath = true)] - public string ValidPath; + // FilePath can also be configured to show an error, if the provided path is invalid. + [FilePath(RequireValidPath = true)] + public string ValidPath; - // By default, FilePath will enforce the use of forward slashes. It can also be configured to use backslashes instead. - [FilePath(UseBackslashes = true)] - public string Backslashes; + // By default, FilePath will enforce the use of forward slashes. It can also be configured to use backslashes instead. + [FilePath(UseBackslashes = true)] + public string Backslashes; - // FilePath also supports member references with the $ symbol. - [FilePath(ParentFolder = "$DynamicParent", Extensions = "$DynamicExtensions")] - public string DynamicFilePath; + // FilePath also supports member references with the $ symbol. + [FilePath(ParentFolder = "$DynamicParent", Extensions = "$DynamicExtensions")] + public string DynamicFilePath; - public string DynamicParent = "Assets/Plugin/Sirenix"; + public string DynamicParent = "Assets/Plugin/Sirenix"; - public string DynamicExtensions = "cs, unity, jpg"; - } - - - - + public string DynamicExtensions = "cs, unity, jpg"; + } + + + + @@ -777,6 +1474,11 @@ By default FilePath enforces forward slashes. Set UseBackslashes to true if you want backslashes instead. + + + If true the file path will include the file's extension. + + Gets or sets a value indicating whether the path should be read only. @@ -852,12 +1554,211 @@ By default FolderPath enforces forward slashes. Set UseBackslashes to true if you want backslashes instead. + + + FoldoutGroup is used on any property, and organizes properties into a foldout. + Use this to organize properties, and to allow the user to hide properties that are not relevant for them at the moment. + + + The following example shows how FoldoutGroup is used to organize properties into a foldout. + + public class MyComponent : MonoBehaviour + { + [FoldoutGroup("MyGroup")] + public int A; + + [FoldoutGroup("MyGroup")] + public int B; + + [FoldoutGroup("MyGroup")] + public int C; + } + + + + The following example shows how properties can be organizes into multiple foldouts. + + public class MyComponent : MonoBehaviour + { + [FoldoutGroup("First")] + public int A; + + [FoldoutGroup("First")] + public int B; + + [FoldoutGroup("Second")] + public int C; + } + + + + + + + + + + + Gets a value indicating whether or not the foldout should be expanded by default. + + + + + Gets a value indicating whether or not the Expanded property has been set. + + + + + Adds the property to the specified foldout group. + + Name of the foldout group. + The order of the group in the inspector. + + + + Adds the property to the specified foldout group. + + Name of the foldout group. + Whether or not the foldout should be expanded by default. + The order of the group in the inspector. + + + + Combines the foldout property with another. + + The group to combine with. + + + + GUIColor is used on any property and changes the GUI color used to draw the property. + + + The following example shows how GUIColor is used on a properties to create a rainbow effect. + + public class MyComponent : MonoBehaviour + { + [GUIColor(1f, 0f, 0f)] + public int A; + + [GUIColor(1f, 0.5f, 0f, 0.2f)] + public int B; + + [GUIColor("GetColor")] + public int C; + + private Color GetColor() { return this.A == 0 ? Color.red : Color.white; } + } + + + + + + The GUI color of the property. + + + + Supports a variety of color formats, including named colors (e.g. "red", "orange", "green", "blue"), hex codes (e.g. "#FF0000" and "#FF0000FF"), and RGBA (e.g. "RGBA(1,1,1,1)") or RGB (e.g. "RGB(1,1,1)"), including Odin attribute expressions (e.g "@this.MyColor"). Here are the available named colors: black, blue, clear, cyan, gray, green, grey, magenta, orange, purple, red, transparent, transparentBlack, transparentWhite, white, yellow, lightblue, lightcyan, lightgray, lightgreen, lightgrey, lightmagenta, lightorange, lightpurple, lightred, lightyellow, darkblue, darkcyan, darkgray, darkgreen, darkgrey, darkmagenta, darkorange, darkpurple, darkred, darkyellow. + + + + Sets the GUI color for the property. + + The red channel. + The green channel. + The blue channel. + The alpha channel. + + + + Sets the GUI color for the property. + + Supports a variety of color formats, including named colors (e.g. "red", "orange", "green", "blue"), hex codes (e.g. "#FF0000" and "#FF0000FF"), and RGBA (e.g. "RGBA(1,1,1,1)") or RGB (e.g. "RGB(1,1,1)"), including Odin attribute expressions (e.g "@this.MyColor"). + Indicates that Odin should hide the reference box, if this property would otherwise be drawn as a reference to another property, due to duplicate reference values being encountered. Note that if the value is referencing itself recursively, then the reference box will be drawn regardless of this attribute in all recursive draw calls. + + + HideIf is used on any property and can hide the property in the inspector. + Use this to hide irrelevant properties based on the current state of the object. + + + This example shows a component with fields hidden by the state of another field. + + public class MyComponent : MonoBehaviour + { + public bool HideProperties; + + [HideIf("HideProperties")] + public int MyInt; + + [HideIf("HideProperties", false)] + public string MyString; + + public SomeEnum SomeEnumField; + + [HideIf("SomeEnumField", SomeEnum.SomeEnumMember)] + public string SomeString; + } + + + + This example shows a component with a field that is hidden when the game object is inactive. + + public class MyComponent : MonoBehaviour + { + [HideIf("MyVisibleFunction")] + public int MyHideableField; + + private bool MyVisibleFunction() + { + return !this.gameObject.activeInHierarchy; + } + } + + + + + + + + + The name of a bool member field, property or method. Obsolete; use the Condition member instead. + + + + + A resolved string that defines the condition to check the value of, such as a member name or an expression. + + + + + The optional condition value. + + + + + Whether or not to slide the property in and out when the state changes. + + + + + Hides a property in the inspector, based on the value of a resolved string. + + A resolved string that defines the condition to check the value of, such as a member name or an expression. + Whether or not to slide the property in and out when the state changes. + + + + Hides a property in the inspector, if the resolved string evaluates to the specified value. + + A resolved string that defines the condition to check the value of, such as a member name or an expression. + Value to check against. + Whether or not to slide the property in and out when the state changes. +

HideIfGroup allows for showing or hiding a group of properties based on a condition.

@@ -911,6 +1812,31 @@
Another ShowIfGroup attribute.
+ + + Hides a member based on which type of a prefab and instance it is in. + + + + + HideInEditorMode is used on any property, and hides the property when not in play mode. + Use this when you only want a property to only be visible play mode. + + + The following example shows how HideInEditorMode is used to hide a property when in the editor. + + public class MyComponent : MonoBehaviour + { + [HideInEditorMode] + public int MyInt; + } + + + + + + + Hides a property if it is drawn within an . @@ -921,6 +1847,26 @@ Hides a property if it is drawn from a non prefab instance or asset. + + + HideInPlayMode is used on any property, and hides the property when not in editor mode. + Use this when you only want a property to only be visible the editor. + + + The following example shows how HideInPlayMode is used to hide a property when in play mode. + + public class MyComponent : MonoBehaviour + { + [HideInPlayMode] + public int MyInt; + } + + + + + + + Hides a property if it is drawn from a prefab asset. @@ -941,6 +1887,42 @@ The HideInTables attribute is used to prevent members from showing up as columns in tables drawn using the . + + + HideLabel is used on any property, and hides the label in the inspector. + Use this to hide the label of properties in the inspector. + + + The following example show how HideLabel is used to hide the label of a game object property. + + public class MyComponent : MonoBehaviour + { + [HideLabel] + public GameObject MyGameObjectWithoutLabel; + } + + + + + + + Apply HideMonoScript to your class to prevent the Script property from being shown in the inspector. + + This attribute has the same effect on a single type that the global configuration option "Show Mono Script In Editor" in "Preferences -> Odin Inspector -> General -> Drawers" has globally when disabled. + + + + The following example shows how to use this attribute. + + [HideMonoScript] + public class MyComponent : MonoBehaviour + { + // The Script property will not be shown for this component in the inspector + } + + + + Apply HideNetworkBehaviourFields to your class to prevent the special "Network Channel" and "Network Send Interval" properties from being shown in the inspector for a NetworkBehaviour. @@ -958,6 +1940,534 @@ + + + Hides the polymorphic object-picker shown above the properties of non-Unity serialized reference types. + + + When the object picker is hidden, you can right click and set the instance to null, in order to set a new value. + If you don't want this behavior, you can use attribute to ensure people can't change the value. + + + + + public class MyComponent : SerializedMonoBehaviour + { + [Header("Hidden Object Pickers")] + [Indent] + [HideReferenceObjectPicker] + public MyCustomReferenceType OdinSerializedProperty1; + + [Indent] + [HideReferenceObjectPicker] + public MyCustomReferenceType OdinSerializedProperty2; + + [Indent] + [Header("Shown Object Pickers")] + public MyCustomReferenceType OdinSerializedProperty3; + + [Indent] + public MyCustomReferenceType OdinSerializedProperty4; + + public class MyCustomReferenceType + { + public int A; + public int B; + public int C; + } + } + + + + + + HorizontalGroup is used group multiple properties horizontally in the inspector. + The width can either be specified as percentage or pixels. + All values between 0 and 1 will be treated as a percentage. + If the width is 0 the column will be automatically sized. + Margin-left and right can only be specified in pixels. + + + The following example shows how three properties have been grouped together horizontally. + + // The width can either be specified as percentage or pixels. + // All values between 0 and 1 will be treated as a percentage. + // If the width is 0 the column will be automatically sized. + // Margin-left and right can only be specified in pixels. + + public class HorizontalGroupAttributeExamples : MonoBehaviour + { + [HorizontalGroup] + public int A; + + [HideLabel, LabelWidth (150)] + [HorizontalGroup(150)] + public LayerMask B; + + // LabelWidth can be helpfull when dealing with HorizontalGroups. + [HorizontalGroup("Group 1"), LabelWidth(15)] + public int C; + + [HorizontalGroup("Group 1"), LabelWidth(15)] + public int D; + + [HorizontalGroup("Group 1"), LabelWidth(15)] + public int E; + + // Having multiple properties in a column can be achived using multiple groups. Checkout the "Combining Group Attributes" example. + [HorizontalGroup("Split", 0.5f, PaddingRight = 15)] + [BoxGroup("Split/Left"), LabelWidth(15)] + public int L; + + [BoxGroup("Split/Right"), LabelWidth(15)] + public int M; + + [BoxGroup("Split/Left"), LabelWidth(15)] + public int N; + + [BoxGroup("Split/Right"), LabelWidth(15)] + public int O; + + // Horizontal Group also has supprot for: Title, MarginLeft, MarginRight, PaddingLeft, PaddingRight, MinWidth and MaxWidth. + [HorizontalGroup("MyButton", MarginLeft = 0.25f, MarginRight = 0.25f)] + public void SomeButton() + { + + } + } + + + + + + + + + + + The width. Values between 0 and 1 will be treated as percentage, 0 = auto, otherwise pixels. + + + + + The margin left. Values between 0 and 1 will be treated as percentage, 0 = ignore, otherwise pixels. + + + + + The margin right. Values between 0 and 1 will be treated as percentage, 0 = ignore, otherwise pixels. + + + + + The padding left. Values between 0 and 1 will be treated as percentage, 0 = ignore, otherwise pixels. + + + + + The padding right. Values between 0 and 1 will be treated as percentage, 0 = ignore, otherwise pixels. + + + + + The minimum Width. Values between 0 and 1 will be treated as percentage, 0 = ignore, otherwise pixels. + + + + + The maximum Width. Values between 0 and 1 will be treated as percentage, 0 = ignore, otherwise pixels. + + + + + The width between each column. Values between 0 and 1 will be treated as percentage, otherwise pixels. + + + + + Adds a title above the horizontal group. + + + + + Fallback to using the default label width, whatever that might be. + + + + + The label width, 0 = auto. + + + + + Organizes the property in a horizontal group. + + The group for the property. + The width of the property. Values between 0 and 1 are interpolated as a percentage, otherwise pixels. + The left margin in pixels. + The right margin in pixels. + The order of the group in the inspector. + + + + Organizes the property in a horizontal group. + + The width of the property. Values between 0 and 1 are interpolated as a percentage, otherwise pixels. + The left margin in pixels. + The right margin in pixels. + The order of the group in the inspector. + + + + Merges the values of two group attributes together. + + The other group to combine with. + + + + Indent is used on any property and moves the property's label to the right. + Use this to clearly organize properties in the inspector. + + + The following example shows how a property is indented by Indent. + + public class MyComponent : MonoBehaviour + { + [Indent] + public int IndentedInt; + } + + + + + + Indicates how much a property should be indented. + + + + + Indents a property in the inspector. + + How much a property should be indented. + + + + InfoBox is used on any property, and display a text box above the property in the inspector. + Use this to add comments or warn about the use of different properties. + + + The following example shows different info box types. + + public class MyComponent : MonoBehaviour + { + [InfoBox("This is an int property")] + public int MyInt; + + [InfoBox("This info box is a warning", InfoMessageType.Warning)] + public float MyFloat; + + [InfoBox("This info box is an error", InfoMessageType.Error)] + public object MyObject; + + [InfoBox("This info box is just a box", InfoMessageType.None)] + public Vector3 MyVector; + } + + + + The following example how info boxes can be hidden by fields and properties. + + public class MyComponent : MonoBehaviour + { + [InfoBox("This info box is hidden by an instance field.", "InstanceShowInfoBoxField")] + public int MyInt; + public bool InstanceShowInfoBoxField; + + [InfoBox("This info box is hideable by a static field.", "StaticShowInfoBoxField")] + public float MyFloat; + public static bool StaticShowInfoBoxField; + + [InfoBox("This info box is hidden by an instance property.", "InstanceShowInfoBoxProperty")] + public int MyOtherInt; + public bool InstanceShowInfoBoxProperty { get; set; } + + [InfoBox("This info box is hideable by a static property.", "StaticShowInfoBoxProperty")] + public float MyOtherFloat; + public static bool StaticShowInfoBoxProperty { get; set; } + } + + + + The following example shows how info boxes can be hidden by functions. + + public class MyComponent : MonoBehaviour + { + [InfoBox("This info box is hidden by an instance function.", "InstanceShowFunction")] + public int MyInt; + public bool InstanceShowFunction() + { + return this.MyInt == 0; + } + + [InfoBox("This info box is hidden by a static function.", "StaticShowFunction")] + public short MyShort; + public bool StaticShowFunction() + { + return true; + } + + // You can also specify a function with the same type of parameter. + // Use this to specify the same function, for multiple different properties. + [InfoBox("This info box is hidden by an instance function with a parameter.", "InstanceShowParameterFunction")] + public GameObject MyGameObject; + public bool InstanceShowParameterFunction(GameObject property) + { + return property != null; + } + + [InfoBox("This info box is hidden by a static function with a parameter.", "StaticShowParameterFunction")] + public Vector3 MyVector; + public bool StaticShowParameterFunction(Vector3 property) + { + return property.magnitude == 0f; + } + } + + + + + + + + The message to display in the info box. + + + + + The type of the message box. + + + + + Optional member field, property or function to show and hide the info box. + + + + + When true the InfoBox will ignore the GUI.enable flag and always draw as enabled. + + + + + The icon to be displayed next to the message. + + + + Supports a variety of color formats, including named colors (e.g. "red", "orange", "green", "blue"), hex codes (e.g. "#FF0000" and "#FF0000FF"), and RGBA (e.g. "RGBA(1,1,1,1)") or RGB (e.g. "RGB(1,1,1)"), including Odin attribute expressions (e.g "@this.MyColor"). Here are the available named colors: black, blue, clear, cyan, gray, green, grey, magenta, orange, purple, red, transparent, transparentBlack, transparentWhite, white, yellow, lightblue, lightcyan, lightgray, lightgreen, lightgrey, lightmagenta, lightorange, lightpurple, lightred, lightyellow, darkblue, darkcyan, darkgray, darkgreen, darkgrey, darkmagenta, darkorange, darkpurple, darkred, darkyellow. + + + + Displays an info box above the property. + + The message for the message box. Supports referencing a member string field, property or method by using $. + The type of the message box. + Name of member bool to show or hide the message box. + + + + Displays an info box above the property. + + The message for the message box. Supports referencing a member string field, property or method by using $. + Name of member bool to show or hide the message box. + + + + Displays an info box above the property. + + The message for the message box. Supports referencing a member string field, property or method by using $. + The icon to be displayed next to the message. + Name of member bool to show or hide the message box. + + + + The inline button adds a button to the end of a property. + + + Due to a bug, multiple inline buttons are currently not supported. + + + The following examples demonstrates how InlineButton can be used. + + public class MyComponent : MonoBehaviour + { + // Adds a button to the end of the A property. + [InlineButton("MyFunction")] + public int A; + + // This is example demonstrates how you can change the label of the button. + // InlineButton also supports refering to string members with $. + [InlineButton("MyFunction", "Button")] + public int B; + + private void MyFunction() + { + // ... + } + } + + + + + + + + Name of member method to call when the button is clicked. Obsolete; use the Action member instead. + + + + + A resolved string that defines the action to perform when the button is clicked, such as an expression or method invocation. + + + + + Optional label of the button. + + + + + Optional resolved string that specifies a condition for whether to show the inline button or not. + + + + Supports a variety of color formats, including named colors (e.g. "red", "orange", "green", "blue"), hex codes (e.g. "#FF0000" and "#FF0000FF"), and RGBA (e.g. "RGBA(1,1,1,1)") or RGB (e.g. "RGB(1,1,1)"), including Odin attribute expressions (e.g "@this.MyColor"). Here are the available named colors: black, blue, clear, cyan, gray, green, grey, magenta, orange, purple, red, transparent, transparentBlack, transparentWhite, white, yellow, lightblue, lightcyan, lightgray, lightgreen, lightgrey, lightmagenta, lightorange, lightpurple, lightred, lightyellow, darkblue, darkcyan, darkgray, darkgreen, darkgrey, darkmagenta, darkorange, darkpurple, darkred, darkyellow. + + + Supports a variety of color formats, including named colors (e.g. "red", "orange", "green", "blue"), hex codes (e.g. "#FF0000" and "#FF0000FF"), and RGBA (e.g. "RGBA(1,1,1,1)") or RGB (e.g. "RGB(1,1,1)"), including Odin attribute expressions (e.g "@this.MyColor"). Here are the available named colors: black, blue, clear, cyan, gray, green, grey, magenta, orange, purple, red, transparent, transparentBlack, transparentWhite, white, yellow, lightblue, lightcyan, lightgray, lightgreen, lightgrey, lightmagenta, lightorange, lightpurple, lightred, lightyellow, darkblue, darkcyan, darkgray, darkgreen, darkgrey, darkmagenta, darkorange, darkpurple, darkred, darkyellow. + + + + Draws a button to the right of the property. + + A resolved string that defines the action to perform when the button is clicked, such as an expression or method invocation. + Optional label of the button. + + + + Draws a button to the right of the property. + + A resolved string that defines the action to perform when the button is clicked, such as an expression or method invocation. + The icon to be shown inside the button. + Optional label of the button. + + + + InlineAttribute is used on any property or field with a type that inherits from UnityEngine.Object. This includes components and assets etc. + + + + public class InlineEditorExamples : MonoBehaviour + { + [DisableInInlineEditors] + public Vector3 DisabledInInlineEditors; + + [HideInInlineEditors] + public Vector3 HiddenInInlineEditors; + + [InlineEditor] + public Transform InlineComponent; + + [InlineEditor(InlineEditorModes.FullEditor)] + public Material FullInlineEditor; + + [InlineEditor(InlineEditorModes.GUIAndHeader)] + public Material InlineMaterial; + + [InlineEditor(InlineEditorModes.SmallPreview)] + public Material[] InlineMaterialList; + + [InlineEditor(InlineEditorModes.LargePreview)] + public GameObject InlineObjectPreview; + + [InlineEditor(InlineEditorModes.LargePreview)] + public Mesh InlineMeshPreview; + } + + + + + + + + If true, the inline editor will start expanded. + + + + + Draw the header editor header inline. + + + + + Draw editor GUI inline. + + + + + Draw editor preview inline. + + + + + Maximum height of the inline editor. If the inline editor exceeds the specified height, a scrollbar will appear. + Values less or equals to zero will let the InlineEditor expand to its full size. + + + + + The size of the editor preview if drawn together with GUI. + + + + + The size of the editor preview if drawn alone. + + + + + If false, this will prevent the InlineEditor attribute from incrementing the InlineEditorAttributeDrawer.CurrentInlineEditorDrawDepth. + This is helpful in cases where you want to draw the entire editor, and disregard attributes + such as [] and []. + + + + + How the InlineEditor attribute drawer should draw the object field. + + + + + Whether to set GUI.enabled = false when drawing an editor for an asset that is locked by source control. Defaults to true. + + + + + Where to draw the preview. + + + + + Initializes a new instance of the class. + + The inline editor mode. + How the object field should be drawn. + + + + Initializes a new instance of the class. + + How the object field should be drawn. + The Inline Property is used to place the contents of a type next to the label, instead of being rendered in a foldout. @@ -1007,6 +2517,83 @@ Specify a label width for all child properties. + + + LabelText is used to change the labels of properties. + Use this if you want a different label than the name of the property. + + + The following example shows how LabelText is applied to a few property fields. + + public MyComponent : MonoBehaviour + { + [LabelText("1")] + public int MyInt1; + + [LabelText("2")] + public int MyInt2; + + [LabelText("3")] + public int MyInt3; + } + + + + + + + The new text of the label. + + + + + Whether the label text should be nicified before it is displayed, IE, "m_someField" becomes "Some Field". + If the label text is resolved via a member reference, an expression, or the like, then the evaluated result + of that member reference or expression will be nicified. + + + + + The icon to be displayed. + + + + Supports a variety of color formats, including named colors (e.g. "red", "orange", "green", "blue"), hex codes (e.g. "#FF0000" and "#FF0000FF"), and RGBA (e.g. "RGBA(1,1,1,1)") or RGB (e.g. "RGB(1,1,1)"), including Odin attribute expressions (e.g "@this.MyColor"). Here are the available named colors: black, blue, clear, cyan, gray, green, grey, magenta, orange, purple, red, transparent, transparentBlack, transparentWhite, white, yellow, lightblue, lightcyan, lightgray, lightgreen, lightgrey, lightmagenta, lightorange, lightpurple, lightred, lightyellow, darkblue, darkcyan, darkgray, darkgreen, darkgrey, darkmagenta, darkorange, darkpurple, darkred, darkyellow. + + + + Give a property a custom label. + + The new text of the label. + + + + Give a property a custom icon. + + The icon to be shown next to the property. + + + + Give a property a custom label. + + The new text of the label. + Whether to nicify the label text. + + + + Give a property a custom label with a custom icon. + + The new text of the label. + The icon to be displayed. + + + + Give a property a custom label with a custom icon. + + The new text of the label. + Whether to nicify the label text. + The icon to be displayed. + LabelWidth is used to change the width of labels for properties. @@ -1034,6 +2621,415 @@ The width of the label. + + + Customize the behavior for lists and arrays in the inspector. + + + This example shows how you can add your own custom add button to a list. + + [ListDrawerSettings(HideAddButton = true, OnTitleBarGUI = "DrawTitleBarGUI")] + public List<MyType> SomeList; + + #if UNITY_EDITOR + private void DrawTitleBarGUI() + { + if (SirenixEditorGUI.ToolbarButton(EditorIcons.Plus)) + { + this.SomeList.Add(new MyType()); + } + } + #endif + + + + This attribute is scheduled for refactoring. + + + + + If true, the add button will not be rendered in the title toolbar. You can use OnTitleBarGUI to implement your own add button. + + + true if [hide add button]; otherwise, false. + + + + + If true, the remove button will not be rendered on list items. You can use OnBeginListElementGUI and OnEndListElementGUI to implement your own remove button. + + + true if [hide remove button]; otherwise, false. + + + + + Specify the name of a member inside each list element which defines the label being drawn for each list element. + + + + + Override the default behaviour for adding objects to the list. + If the referenced member returns the list type element, it will be called once per selected object. + If the referenced method returns void, it will only be called once regardless of how many objects are selected. + + + + + Calls a method before each list element. The member referenced must have a return type of void, and an index parameter of type int which represents the element index being drawn. + + + + + Calls a method after each list element. The member referenced must have a return type of void, and an index parameter of type int which represents the element index being drawn. + + + + + If true, object/type pickers will never be shown when the list add button is clicked, and default(T) will always be added instantly instead, where T is the element type of the list. + + + + + Whether adding a new element should copy the last element. False by default. + + + + A resolved string with "int index" and "Color defaultColor" parameters that lets you control the color of individual elements. Supports a variety of color formats, including named colors (e.g. "red", "orange", "green", "blue"), hex codes (e.g. "#FF0000" and "#FF0000FF"), and RGBA (e.g. "RGBA(1,1,1,1)") or RGB (e.g. "RGB(1,1,1)"), including Odin attribute expressions (e.g "@this.MyColor"). Here are the available named colors: black, blue, clear, cyan, gray, green, grey, magenta, orange, purple, red, transparent, transparentBlack, transparentWhite, white, yellow, lightblue, lightcyan, lightgray, lightgreen, lightgrey, lightmagenta, lightorange, lightpurple, lightred, lightyellow, darkblue, darkcyan, darkgray, darkgreen, darkgrey, darkmagenta, darkorange, darkpurple, darkred, darkyellow. + + + + Override the default setting specified in the Advanced Odin Preferences window and explicitly tell whether paging should be enabled or not. + + + + + Override the default setting specified in the Advanced Odin Preferences window and explicitly tell whether items should be draggable or not. + + + + + Override the default setting specified in the Advanced Odin Preferences window and explicitly tells how many items each page should contain. + + + + + Mark a list as read-only. This removes all editing capabilities from the list such as Add, Drag and delete, + but without disabling GUI for each element drawn as otherwise would be the case if the was used. + + + + + Override the default setting specified in the Advanced Odin Preferences window and explicitly tell whether or not item count should be shown. + + + + + Whether to show a foldout for the collection or not. If this is set to false, the collection will *always* be expanded. + + + + + Whether to show a foldout for the collection or not. If this is set to false, the collection will *always* be expanded. + + This documentation used to wrongly state that this value would override the default setting specified in the Advanced Odin Preferences + window and explicitly tell whether or not the list should be expanded or collapsed by default. This value *would* do that, but it would + also simultaneously act as ShowFoldout, leading to weird and unintuitive behaviour. + + + + + + Override the default setting specified in the Odin Preferences window and explicitly tell whether or not the list should be expanded or collapsed by default. + Note that this will override the persisted expand state, as this is set *every time* the collection drawer is initialized. + + + + + If true, a label is drawn for each element which shows the index of the element. + + + + + Use this to inject custom GUI into the title-bar of the list. + + + + + Whether the Paging property is set. + + + + + Whether the ShowItemCount property is set. + + + + + Whether the NumberOfItemsPerPage property is set. + + + + + Whether the Draggable property is set. + + + + + Whether the IsReadOnly property is set. + + + + + Whether the ShowIndexLabels property is set. + + + + + Whether the DefaultExpandedState property is set. + + + + + MaxValue is used on primitive fields. It caps value of the field to a maximum value. + Use this to define a maximum value for the field. + + + Note that this attribute only works in the editor! Values changed from scripting will not be capped at a maximum. + + + The following example shows a component where a speed value must be less than or equal to 200. + + public class Car : MonoBehaviour + { + // The speed of the car must be less than or equal to 200. + [MaxValue(200)] + public float Speed; + } + + + + The following example shows how MaxValue can be combined with . + + public class Health : MonoBehaviour + { + // The speed value must be between 0 and 200. + [MinValue(0), MaxValue(200)] + public float Speed; + } + + + + + + + The maximum value for the property. + + + + + The string with which to resolve a maximum value. This could be a field, property or method name, or an expression. + + + + + Sets a maximum value for the property in the inspector. + + The max value. + + + + Sets a maximum value for the property in the inspector. + + The string with which to resolve a maximum value. This could be a field, property or method name, or an expression. + + + + Draw a special slider the user can use to specify a range between a min and a max value. + Uses a Vector2 where x is min and y is max. + + + The following example shows how MinMaxSlider is used. + + public class Player : MonoBehaviour + { + [MinMaxSlider(4, 5)] + public Vector2 SpawnRadius; + } + + + + + + The hardcoded min value for the slider. + + + + + The hardcoded max value for the slider. + + + + + The name of a field, property or method to get the min value from. Obsolete; use MinValueGetter instead. + + + + + A resolved string that should evaluate to a float value, which is used as the min bounds. + + + + + The name of a field, property or method to get the max value from. Obsolete; use MaxValueGetter instead. + + + + + A resolved string that should evaluate to a float value, which is used as the max bounds. + + + + + The name of a Vector2 field, property or method to get the min max values from. Obsolete; use MinMaxValueGetter instead. + + + + + A resolved string that should evaluate to a Vector2 value, which is used as the min/max bounds. If this is non-null, it overrides the behaviour of the MinValue, MinValueGetter, MaxValue and MaxValueGetter members. + + + + + Draw float fields for min and max value. + + + + + Draws a min-max slider in the inspector. X will be set to min, and Y will be set to max. + + The min value. + The max value. + If true number fields will drawn next to the MinMaxSlider. + + + + Draws a min-max slider in the inspector. X will be set to min, and Y will be set to max. + + A resolved string that should evaluate to a float value, which is used as the min bounds. + The max value. + If true number fields will drawn next to the MinMaxSlider. + + + + Draws a min-max slider in the inspector. X will be set to min, and Y will be set to max. + + The min value. + A resolved string that should evaluate to a float value, which is used as the max bounds. + If true number fields will drawn next to the MinMaxSlider. + + + + Draws a min-max slider in the inspector. X will be set to min, and Y will be set to max. + + A resolved string that should evaluate to a float value, which is used as the min bounds. + A resolved string that should evaluate to a float value, which is used as the max bounds. + If true number fields will drawn next to the MinMaxSlider. + + + + Draws a min-max slider in the inspector. X will be set to min, and Y will be set to max. + + A resolved string that should evaluate to a Vector2 value, which is used as the min/max bounds. If this is non-null, it overrides the behaviour of the MinValue, MinValueGetter, MaxValue and MaxValueGetter members. + If true number fields will drawn next to the MinMaxSlider. + + + + MinValue is used on primitive fields. It caps value of the field to a minimum value. + Use this to define a minimum value for the field. + + + Note that this attribute only works in the editor! Values changed from scripting will not be capped at a minimum. + + + The following example shows a player component that must have at least 1 life. + + public class Player : MonoBehaviour + { + // The life value must be set to at least 1. + [MinValue(1)] + public int Life; + } + + + + The following example shows how MinValue can be combined with + + public class Health : MonoBehaviour + { + // The health value must be between 0 and 100. + [MinValue(0), MaxValue(100)] + public float Health; + } + + + + + + + The minimum value for the property. + + + + + The string with which to resolve a minimum value. This could be a field, property or method name, or an expression. + + + + + Sets a minimum value for the property in the inspector. + + The minimum value. + + + + Sets a minimum value for the property in the inspector. + + The string with which to resolve a minimum value. This could be a field, property or method name, or an expression. + + + + MultiLineProperty is used on any string property. + Use this to allow users to edit strings in a multi line textbox. + + + MultiLineProperty is similar to Unity's but can be applied to both fields and properties. + + + The following example shows how MultiLineProperty is applied to properties. + + public class MyComponent : MonoBehaviour + { + [MultiLineProperty] + public string MyString; + + [ShowInInspector, MultiLineProperty(10)] + public string PropertyString; + } + + + + + + The number of lines for the text box. + + + + + Makes a multiline textbox for editing strings. + + The number of lines for the text box. + @@ -1110,6 +3106,99 @@ This constructor should be used when the attribute is placed on a non-method member. + + + OnInspectorGUI is used on any property, and will call the specified function whenever the inspector code is running. + Use this to create custom inspector GUI for an object. + + + + + public MyComponent : MonoBehaviour + { + [OnInspectorGUI] + private void MyInspectorGUI() + { + GUILayout.Label("Label drawn from callback"); + } + } + + + + The following example shows how a callback can be set before another property. + + public MyComponent : MonoBehaviour + { + [OnInspectorGUI("MyInspectorGUI", false)] + public int MyField; + + private void MyInspectorGUI() + { + GUILayout.Label("Label before My Field property"); + } + } + + + + The following example shows how callbacks can be added both before and after a property. + + public MyComponent : MonoBehaviour + { + [OnInspectorGUI("GUIBefore", "GUIAfter")] + public int MyField; + + private void GUIBefore() + { + GUILayout.Label("Label before My Field property"); + } + + private void GUIAfter() + { + GUILayout.Label("Label after My Field property"); + } + } + + + + + + The resolved action string that defines the action to be invoked before the property is drawn, if any. + + + + + The resolved action string that defines the action to be invoked after the property is drawn, if any. + + + + + The name of the method to be called before the property is drawn, if any. Obsolete; use the Prepend member instead. + + + + + The name of the method to be called after the property is drawn, if any. Obsolete; use the Append member instead. + + + + + Calls a function decorated with this attribute, when the inspector is being drawn. + + + + + Adds callbacks to the specified action when the property is being drawn. + + The resolved action string that defines the action to be invoked. + If true the method will be called after the property has been drawn. Otherwise the method will be called before. + + + + Adds callbacks to the specified actions when the property is being drawn. + + The resolved action string that defines the action to be invoked before the property is drawn, if any. + The resolved action string that defines the action to be invoked after the property is drawn, if any. + The OnInspectorInit attribute takes in an action string as an argument (typically the name of a method to be invoked, or an expression to be executed), and executes that action when the property's drawers are initialized in the inspector. @@ -1194,11 +3283,156 @@ + + + + OnValueChanged works on properties and fields, and calls the specified function + whenever the value has been changed via the inspector. + + + + Note that this attribute only works in the editor! Properties changed by script will not call the function. + + + The following example shows how OnValueChanged is used to provide a callback for a property. + + public class MyComponent : MonoBehaviour + { + [OnValueChanged("MyCallback")] + public int MyInt; + + private void MyCallback() + { + // .. + } + } + + + + The following example show how OnValueChanged can be used to get a component from a prefab property. + + public class MyComponent : MonoBehaviour + { + [OnValueChanged("OnPrefabChange")] + public GameObject MyPrefab; + + // RigidBody component of MyPrefab. + [SerializeField, HideInInspector] + private RigidBody myPrefabRigidbody; + + private void OnPrefabChange() + { + if(MyPrefab != null) + { + myPrefabRigidbody = MyPrefab.GetComponent<Rigidbody>(); + } + else + { + myPrefabRigidbody = null; + } + } + } + + + + + + Name of callback member function. Obsolete; use the Action member instead. + + + + + A resolved string that defines the action to perform when the value is changed, such as an expression or method invocation. + + + + + Whether to perform the action when a child value of the property is changed. + + + + + Whether to perform the action when an undo or redo event occurs via UnityEditor.Undo.undoRedoPerformed. True by default. + + + + + Whether to perform the action when the property is initialized. This will generally happen when the property is first viewed/queried (IE when the inspector is first opened, or when its containing foldout is first expanded, etc), and whenever its type or a parent type changes, or it is otherwise forced to rebuild. + + + + + Adds a callback for when the property's value is changed. + + A resolved string that defines the action to perform when the value is changed, such as an expression or method invocation. + Whether to perform the action when a child value of the property is changed. + + + + Overrides the 'Reference Required by Default' rule to allow for null values. + Has no effect if the rule is disabled. + + This attribute does not do anything unless you have Odin Validator and the 'Reference Required by Default' rule is enabled. + + + + + Specifies how non-default constructors are handled. + + + + + Excludes types with non default constructors from the Selector. + + + + + Attempts to find the most straightforward constructor to call, prioritizing default values. + + + + + Uses if no default constructor is found. + + + + + Logs a warning instead of constructing the object, indicating that an attempt was made to construct an object without a default constructor. + + + + + Determines whether the base type should be displayed in the drawer. + + + + + Indicates if the drawer should be read-only once a value is assigned. + + + + + Specifies how non-default constructors are handled. + + + + + Specifies a custom function for creating an instance of the selected . + + Does not get called for UnityEngine.Object types. + + + The resolver expects any method that takes a single parameter of , where the parameter is named 'type', and which returns an . + + + Implementation example: public object Method(Type type). + + Draws a square ObjectField which renders a preview for UnityEngine.Object types. - This object field also adds support for drag and drop, dragging an object to another square object field, swaps the values. + This object field also adds support for drag and drop, dragging an object to another square object field, swaps the values. If you hold down control while letting go it will replace the value, And you can control + click the object field to quickly delete the value it holds. @@ -1212,7 +3446,7 @@ { [PreviewField] public UnityEngine.Object SomeObject; - + [PreviewField] public Texture SomeTexture; @@ -1228,6 +3462,11 @@ The height of the object field + + + The FilterMode to be used for the preview. + + Left aligned. @@ -1238,6 +3477,11 @@ Whether an alignment value is specified. + + + A resolved value that should resolve to the desired preview texture. + + Draws a square object field which renders a preview for UnityEngine.Object type objects. @@ -1249,6 +3493,21 @@ The height of the preview field. + + + Draws a square object field which renders a preview for UnityEngine.Object type objects. + + A resolved value that should resolve to the desired preview texture. + The filter mode to be used for the preview texture. + + + + Draws a square object field which renders a preview for UnityEngine.Object type objects. + + A resolved value that should resolve to the desired preview texture. + The height of the preview field. + The filter mode to be used for the preview texture. + Draws a square object field which renders a preview for UnityEngine.Object type objects. @@ -1256,6 +3515,23 @@ The height of the preview field. The alignment of the preview field. + + + Draws a square object field which renders a preview for UnityEngine.Object type objects. + + A resolved value that should resolve to the desired preview texture. + The alignment of the preview field. + The filter mode to be used for the preview texture. + + + + Draws a square object field which renders a preview for UnityEngine.Object type objects. + + A resolved value that should resolve to the desired preview texture. + The height of the preview field. + The alignment of the preview field. + The filter mode to be used for the preview texture. + Draws a square object field which renders a preview for UnityEngine.Object type objects. @@ -1390,9 +3666,7 @@ - - Optional resolved string that should evaluate to a Color value, to dynamically change the color of the progress bar. - + Supports a variety of color formats, including named colors (e.g. "red", "orange", "green", "blue"), hex codes (e.g. "#FF0000" and "#FF0000FF"), and RGBA (e.g. "RGBA(1,1,1,1)") or RGB (e.g. "RGB(1,1,1)"), including Odin attribute expressions (e.g "@this.MyColor"). Here are the available named colors: black, blue, clear, cyan, gray, green, grey, magenta, orange, purple, red, transparent, transparentBlack, transparentWhite, white, yellow, lightblue, lightcyan, lightgray, lightgreen, lightgrey, lightmagenta, lightorange, lightpurple, lightred, lightyellow, darkblue, darkcyan, darkgray, darkgreen, darkgrey, darkmagenta, darkorange, darkpurple, darkred, darkyellow. @@ -1402,10 +3676,7 @@ - - Optional resolved string that should evaluate to a Color value, to dynamically change the background color of the progress bar. - Default background color is (0.16, 0.16, 0.16, 1). - + Optional resolved string that should evaluate to a Color value, to dynamically change the background color of the progress bar. Default background color is (0.16, 0.16, 0.16, 1). It supports a variety of color formats, including named colors (e.g. "red", "orange", "green", "blue"), hex codes (e.g. "#FF0000" and "#FF0000FF"), and RGBA (e.g. "RGBA(1,1,1,1)") or RGB (e.g. "RGB(1,1,1)"), including Odin attribute expressions (e.g "@this.MyColor"). Here are the available named colors: black, blue, clear, cyan, gray, green, grey, magenta, orange, purple, red, transparent, transparentBlack, transparentWhite, white, yellow, lightblue, lightcyan, lightgray, lightgreen, lightgrey, lightmagenta, lightorange, lightpurple, lightred, lightyellow, darkblue, darkcyan, darkgray, darkgreen, darkgrey, darkmagenta, darkorange, darkpurple, darkred, darkyellow. @@ -1482,6 +3753,183 @@ Gets a value indicating if the user has set a custom ValueLabelAlignment value. + + + Attribute to derive from if you wish to create a new property group type, such as box groups or tab groups. + Note that this attribute has special behaviour for "combining" several attributes into one, as one group, + may be declared across attributes in several members, completely out of order. See . + + + All group attributes for a group with the same name (and of the same attribute type) are combined into a single representative group attribute using the method, which is called by the method. + This behaviour is a little unusual, but it is important that you understand it when creating groups with many custom parameters that may have to be combined. + + + This example shows how could be implemented. + + [AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)] + public class BoxGroupAttribute : PropertyGroupAttribute + { + public string Label { get; private set; } + public bool ShowLabel { get; private set; } + public bool CenterLabel { get; private set; } + + public BoxGroupAttribute(string group, bool showLabel = true, bool centerLabel = false, float order = 0) + : base(group, order) + { + this.Label = group; + this.ShowLabel = showLabel; + this.CenterLabel = centerLabel; + } + + protected override void CombineValuesWith(PropertyGroupAttribute other) + { + // The given attribute parameter is *guaranteed* to be of type BoxGroupAttribute. + var attr = other as BoxGroupAttribute; + + // If this attribute has no label, we the other group's label, thus preserving the label across combines. + if (this.Label == null) + { + this.Label = attr.Label; + } + + // Combine ShowLabel and CenterLabel parameters. + this.ShowLabel |= attr.ShowLabel; + this.CenterLabel |= attr.CenterLabel; + } + } + + + + + + + + + + + The ID used to grouping properties together. + + + + + The name of the group. This is the last part of the group ID if there is a path, otherwise it is just the group ID. + + + + + The order of the group. + + + + + Whether to hide the group by default when all its children are not visible. True by default. + + + + + If not null, this resolved string controls the group's visibility. Note that if is true, there must be *both* a visible child *and* this condition must be true, before the group is shown. + + + + + Whether to animate the visibility changes of this group or make the visual transition instantly. True by default. + + + + + Initializes a new instance of the class. + + The group identifier. + The group order. + + + + Initializes a new instance of the class. + + The group identifier. + + + + Combines this attribute with another attribute of the same type. + This method invokes the virtual method to invoke custom combine logic. + All group attributes are combined to one attribute used by a single OdinGroupDrawer. + Example: protected override void CombineValuesWith(PropertyGroupAttribute other) { this.Title = this.Title ?? (other as MyGroupAttribute).Title; } + + The attribute to combine with. + The instance that the method was invoked on. + The argument 'other' was null. + + Attributes to combine are not of the same type. + or + PropertyGroupAttributes to combine must have the same group id. + + + + + Override this method to add custom combine logic to your group attribute. This method determines how your group's parameters combine when spread across multiple attribute declarations in the same class. + Remember, in .NET, member order is not guaranteed, so you never know which order your attributes will be combined in. + + The attribute to combine with. This parameter is guaranteed to be of the correct attribute type. + + This example shows how attributes are combined. + + protected override void CombineValuesWith(PropertyGroupAttribute other) + { + // The given attribute parameter is *guaranteed* to be of type BoxGroupAttribute. + var attr = other as BoxGroupAttribute; + + // If this attribute has no label, we the other group's label, thus preserving the label across combines. + if (this.Label == null) + { + this.Label = attr.Label; + } + + // Combine ShowLabel and CenterLabel parameters. + this.ShowLabel |= attr.ShowLabel; + this.CenterLabel |= attr.CenterLabel; + } + + + + + + PropertyOrder is used on any property, and allows for ordering of properties. + Use this to define in which order your properties are shown. + + + Lower order values will be drawn before higher values. + There is unfortunately no way of ensuring that properties are in the same order, as they appear in your class. PropertyOrder overcomes this. + + + The following example shows how PropertyOrder is used to order properties in the inspector. + + public class MyComponent : MonoBehaviour + { + [PropertyOrder(1)] + public int MySecondProperty; + + [PropertyOrder(-1)] + public int MyFirstProperty; + } + + + + + + The order for the property. + + + + + Initializes a new instance of the class. + + + + + Defines a custom order for the property. + + The order for the property. + PropertyRange attribute creates a slider control to set the value of a property to between the specified range. @@ -1626,6 +4074,280 @@ Adds a space between properties. + + + PropertyTooltip is used on any property, and creates tooltips for when hovering the property in the inspector. + Use this to explain the purpose, or how to use a property. + + + This is similar to Unity's but can be applied to both fields and properties. + + + The following example shows how PropertyTooltip is applied to various properties. + + public class MyComponent : MonoBehaviour + { + [PropertyTooltip("This is an int property.")] + public int MyField; + + [ShowInInspector, PropertyTooltip("This is another int property.")] + public int MyProperty { get; set; } + } + + + + + + + + + + + The message shown in the tooltip. + + + + + Adds a tooltip to the property in the inspector. + + The message shown in the tooltip. + + + + ReadOnly is used on any property, and prevents the property from being changed in the inspector. + Use this for when you want to see the value of a property in the inspector, but don't want it to be changed. + + + This attribute only affects the inspector! Values can still be changed by script. + + + The following example shows how a field can be displayed in the editor, but not be editable. + + public class Health : MonoBehaviour + { + public int MaxHealth; + + [ReadOnly] + public int CurrentHealth; + } + + + + ReadOnly can also be combined with . + + public class Health : MonoBehaviour + { + public int MaxHealth; + + [ShowInInspector, ReadOnly] + private int currentHealth; + } + + + + + + + Required is used on any object property, and draws a message in the inspector if the property is missing. + Use this to clearly mark fields as necessary to the object. + + + The following example shows different uses of the Required attribute. + + public class MyComponent : MonoBehaviour + { + [Required] + public GameObject MyPrefab; + + [Required(InfoMessageType.Warning)] + public Texture2D MyTexture; + + [Required("MyMesh is nessessary for this component.")] + public Mesh MyMesh; + + [Required("MyTransform might be important.", InfoMessageType.Info)] + public Transform MyTransform; + } + + + + + + + + The message of the info box. + + + + + The type of the info box. + + + + + Adds an error box to the inspector, if the property is missing. + + + + + Adds an info box to the inspector, if the property is missing. + + The message to display in the error box. + The type of info box to draw. + + + + Adds an error box to the inspector, if the property is missing. + + The message to display in the error box. + + + + Adds an info box to the inspector, if the property is missing. + + The type of info box to draw. + + + + Makes a member required based on which type of a prefab and instance it is in. + + + + + The message of the info box. + + + + + The type of the info box. + + + + + Adds an error box to the inspector, if the property is missing. + + + + + Adds an info box to the inspector, if the property is missing. + + The message to display in the error box. + The type of info box to draw. + + + + Adds an error box to the inspector, if the property is missing. + + The message to display in the error box. + + + + Adds an info box to the inspector, if the property is missing. + + The type of info box to draw. + + + + The message of the info box. + + + + + The type of the info box. + + + + + Adds an error box to the inspector, if the property is missing. + + + + + Adds an info box to the inspector, if the property is missing. + + The message to display in the error box. + The type of info box to draw. + + + + Adds an error box to the inspector, if the property is missing. + + The message to display in the error box. + + + + Adds an info box to the inspector, if the property is missing. + + The type of info box to draw. + + + + + The minimum length of the collection. If not set, there is no minimum length restriction. + + + + + The maximum length of the collection. If not set, there is no maximum length restriction. + + + + + A C# expression for getting the minimum length of the collection, for example "@this.otherList.Count". + If set, MinLength will be the fallback in case nothing in case MinLengthGetter returns null. + + + + + A C# expression for getting the maximum length of the collection, for example "@this.otherList.Count". + If set, MaxLength will be the fallback in case nothing in case MaxLengthGetter returns null. + + + + + Limits the collection to be contain the specified number of elements. + + + + + Limits the collection to be contain the specified number of elements. + + The minimum and maximum length of the collection. + + + + Limits the collection to be contain the specified number of elements. + + The minimum length of the collection. + The maximum length of the collection. + + + + Limits the collection to be contain the specified number of elements. + + The minimum length of the collection. + A C# expression for getting the maximum length of the collection, for example "@this.otherList.Count". If set, MaxLength will be the fallback in case nothing in case MaxLengthGetter returns null. + + + + Limits the collection to be contain the specified number of elements. + + The minimum and maximum length of the collection. + + + + Limits the collection to be contain the specified number of elements. + + A C# expression for getting the minimum length of the collection, for example "@this.otherList.Count". If set, MinLength will be the fallback in case nothing in case MinLengthGetter returns null. + A C# expression for getting the maximum length of the collection, for example "@this.otherList.Count". If set, MaxLength will be the fallback in case nothing in case MaxLengthGetter returns null. + + + + Limits the collection to be contain the specified number of elements. + + A C# expression for getting the minimum length of the collection, for example "@this.otherList.Count". If set, MinLength will be the fallback in case nothing in case MinLengthGetter returns null. + The maximum length of the collection. + Groups buttons into a group that will position and resize the buttons based on the amount of available layout space. @@ -1704,6 +4426,147 @@ The attribute to combine with. + + + SceneObjectsOnly is used on object properties, and restricts the property to scene objects, and not project assets. + Use this when you want to ensure an object is a scene object, and not from a project asset. + + + The following example shows a component with a game object property, that must be from a scene, and not a prefab asset. + + public MyComponent : MonoBehaviour + { + [SceneObjectsOnly] + public GameObject MyPrefab; + } + + + + + + + Adds a search filter that can search the children of the field or type on + which it is applied. Note that this does not currently work when directly + applied to dictionaries, though a search field "above" the dictionary will + still search the dictionary's properties if it is searching recursively. + + + + + Whether to use fuzzy string matching for the search. + Default value: true. + + + + + The options for which things to use to filter the search. + Default value: All. + + + + + Whether to search recursively, or only search the top level properties. + Default value: true. + + + + + + ShowDrawerChain lists all prepend, append and value drawers being used in the inspector. + This is great in situations where you want to debug, and want to know which drawers might be involved in drawing the property. + + Your own custom drawers are highlighted with a green label. + Drawers, that have not been called during the draw chain, will be greyed out in the inspector to make it clear which drawers have had an effect on the properties. + + + + public class MyComponent : MonoBehaviour + { + [ShowDrawerChain] + public int IndentedInt; + } + + + + + + ShowIf is used on any property and can hide the property in the inspector. + Use this to hide irrelevant properties based on the current state of the object. + + + This example shows a component with fields hidden by the state of another field. + + public class MyComponent : MonoBehaviour + { + public bool ShowProperties; + + [ShowIf("showProperties")] + public int MyInt; + + [ShowIf("showProperties", false)] + public string MyString; + + public SomeEnum SomeEnumField; + + [ShowIf("SomeEnumField", SomeEnum.SomeEnumMember)] + public string SomeString; + } + + + + This example shows a component with a field that is hidden when the game object is inactive. + + public class MyComponent : MonoBehaviour + { + [ShowIf("MyVisibleFunction")] + public int MyHideableField; + + private bool MyVisibleFunction() + { + return this.gameObject.activeInHierarchy; + } + } + + + + + + + + + The name of a bool member field, property or method. Obsolete; use the Condition member instead. + + + + + A resolved string that defines the condition to check the value of, such as a member name or an expression. + + + + + The optional condition value. + + + + + Whether or not to slide the property in and out when the state changes. + + + + + Shows a property in the inspector, based on the value of a resolved string. + + A resolved string that defines the condition to check the value of, such as a member name or an expression. + Whether or not to slide the property in and out when the state changes. + + + + Shows a property in the inspector, if the resolved string evaluates to the specified value. + + A resolved string that defines the condition to check the value of, such as a member name or an expression. + Value to check against. + Whether or not to slide the property in and out when the state changes. +

ShowIfGroup allows for showing or hiding a group of properties based on a condition.

@@ -1757,11 +4620,43 @@
Another ShowIfGroup attribute.
+ + + Shows a member based on which type of a prefab and instance it is in. + + Only shows a property if it is drawn within an . + + + ShowInInspector is used on any member, and shows the value in the inspector. Note that the value being shown due to this attribute DOES NOT mean that the value is being serialized. + + + This can for example be combined with to allow for live debugging of values. + + + + The following example shows how ShowInInspector is used to show properties in the inspector, that otherwise wouldn't. + + public class MyComponent : MonoBehaviour + { + [ShowInInspector] + private int myField; + + [ShowInInspector] + public int MyProperty { get; set; } + } + + + + + + Marks a type as being specially serialized. Odin uses this attribute to check whether it should include non-Unity-serialized members in the inspector. + + @@ -1826,6 +4721,14 @@ If true the suffix label will be drawn on top of the property, instead of after. + + + The icon to be displayed. + + + + Supports a variety of color formats, including named colors (e.g. "red", "orange", "green", "blue"), hex codes (e.g. "#FF0000" and "#FF0000FF"), and RGBA (e.g. "RGBA(1,1,1,1)") or RGB (e.g. "RGB(1,1,1)"), including Odin attribute expressions (e.g "@this.MyColor"). Here are the available named colors: black, blue, clear, cyan, gray, green, grey, magenta, orange, purple, red, transparent, transparentBlack, transparentWhite, white, yellow, lightblue, lightcyan, lightgray, lightgreen, lightgrey, lightmagenta, lightorange, lightpurple, lightred, lightyellow, darkblue, darkcyan, darkgray, darkgreen, darkgrey, darkmagenta, darkorange, darkpurple, darkred, darkyellow. + Draws a label at the end of the property. @@ -1833,6 +4736,176 @@ The text of the label. If true the suffix label will be drawn on top of the property, instead of after. + + + Draws a label at the end of the property. + + The text of the label. + The icon to be displayed. + If true the suffix label will be drawn on top of the property, instead of after. + + + + Draws a label at the end of the property. + + The icon to be displayed. + + + + SuppressInvalidAttributeError is used on members to suppress the inspector error message you get when applying an attribute to a value that it's not supposed to work on. + This can be very useful for applying attributes to generic parameter values, when it only applies to some of the possible types that the value might become. + + + The following example shows a case where the attribute might be useful. + + public class NamedValue<T> + { + public string Name; + + // The Range attribute will be applied if T is compatible with it, but if T is not compatible, an error will not be shown. + [SuppressInvalidAttributeError, Range(0, 10)] + public T Value; + } + + + + + + TabGroup is used on any property, and organizes properties into different tabs. + Use this to organize different value to make a clean and easy to use inspector. + + + Use groups to create multiple tab groups, each with multiple tabs and even sub tabs. + + + The following example shows how to create a tab group with two tabs. + + public class MyComponent : MonoBehaviour + { + [TabGroup("First")] + public int MyFirstInt; + + [TabGroup("First")] + public int AnotherInt; + + [TabGroup("Second")] + public int MySecondInt; + } + + + + The following example shows how multiple groups of tabs can be created. + + public class MyComponent : MonoBehaviour + { + [TabGroup("A", "FirstGroup")] + public int FirstGroupA; + + [TabGroup("B", "FirstGroup")] + public int FirstGroupB; + + // The second tab group has been configured to have constant height across all tabs. + [TabGroup("A", "SecondGroup", true)] + public int SecondgroupA; + + [TabGroup("B", "SecondGroup")] + public int SecondGroupB; + + [TabGroup("B", "SecondGroup")] + public int AnotherInt; + } + + + + This example demonstrates how multiple tabs groups can be combined to create tabs in tabs. + + public class MyComponent : MonoBehaviour + { + [TabGroup("ParentGroup", "First Tab")] + public int A; + + [TabGroup("ParentGroup", "Second Tab")] + public int B; + + // Specify 'First Tab' as a group, and another child group to the 'First Tab' group. + [TabGroup("ParentGroup/First Tab/InnerGroup", "Inside First Tab A")] + public int C; + + [TabGroup("ParentGroup/First Tab/InnerGroup", "Inside First Tab B")] + public int D; + + [TabGroup("ParentGroup/Second Tab/InnerGroup", "Inside Second Tab")] + public int E; + } + + + + + + + The default tab group name which is used when the single-parameter constructor is called. + + + + + Name of the tab. + + + + + Should this tab be the same height as the rest of the tab group. + + + + + If true, the content of each page will not be contained in any box. + + + + + If true, the tab group will be hidden if it only contains one tab. + + + + Supports a variety of color formats, including named colors (e.g. "red", "orange", "green", "blue"), hex codes (e.g. "#FF0000" and "#FF0000FF"), and RGBA (e.g. "RGBA(1,1,1,1)") or RGB (e.g. "RGB(1,1,1)"), including Odin attribute expressions (e.g "@this.MyColor"). Here are the available named colors: black, blue, clear, cyan, gray, green, grey, magenta, orange, purple, red, transparent, transparentBlack, transparentWhite, white, yellow, lightblue, lightcyan, lightgray, lightgreen, lightgrey, lightmagenta, lightorange, lightpurple, lightred, lightyellow, darkblue, darkcyan, darkgray, darkgreen, darkgrey, darkmagenta, darkorange, darkpurple, darkred, darkyellow. + + + + Specify how tabs should be layouted. + + + + + Organizes the property into the specified tab in the default group. + Default group name is '_DefaultTabGroup' + + The tab. + if set to true [use fixed height]. + The order. + + + + Organizes the property into the specified tab in the specified group. + + The group to attach the tab to. + The name of the tab. + Set to true to have a constant height across the entire tab group. + The order of the group. + + + + Organizes the property into the specified tab in the specified group. + + The group to attach the tab to. + The name of the tab. + Set to true to have a constant height across the entire tab group. + The order of the group. + + + + Name of all tabs in this group. + + The TableColumnWidth attribute is used to further customize the width of a column in tables drawn using the . @@ -2063,6 +5136,336 @@ If true, tables are drawn with rows/columns reversed (C# initialization order). + + + A resolved string that should evaluate to a tuple (string, LabelDirection) which will be used as the label for the rows and columns of the table. + + + [TableMatrix(SquareCells = true, Labels = "GetLabel")] + public int[,] ChessBoard = new int[8, 8]; + + private (string, LabelDirection) GetLabel(int[,] array, TableAxis axis, int index) + { + var chessFileLetters = "ABCDEFGH"; + + switch (axis) + { + case TableAxis.Y: + return ((array.GetLength(1) - index).ToString(), LabelDirection.LeftToRight); + case TableAxis.X: + return (chessFileLetters[index].ToString(), LabelDirection.TopToBottom); + default: + return (index.ToString(), LabelDirection.LeftToRight); + } + } + + + + + Title is used to make a bold header above a property. + + + The following example shows how Title is used on different properties. + + public class TitleExamples : MonoBehaviour + { + [Title("Titles and Headers")] + [InfoBox( + "The Title attribute has the same purpose as Unity's Header attribute," + + "but it also supports properties, and methods." + + "\n\nTitle also offers more features such as subtitles, options for horizontal underline, bold text and text alignment." + + "\n\nBoth attributes, with Odin, supports either static strings, or refering to members strings by adding a $ in front.")] + public string MyTitle = "My Dynamic Title"; + public string MySubtitle = "My Dynamic Subtitle"; + + [Title("Static title")] + public int C; + public int D; + + [Title("Static title", "Static subtitle")] + public int E; + public int F; + + [Title("$MyTitle", "$MySubtitle")] + public int G; + public int H; + + [Title("Non bold title", "$MySubtitle", bold: false)] + public int I; + public int J; + + [Title("Non bold title", "With no line seperator", horizontalLine: false, bold: false)] + public int K; + public int L; + + [Title("$MyTitle", "$MySubtitle", TitleAlignments.Right)] + public int M; + public int N; + + [Title("$MyTitle", "$MySubtitle", TitleAlignments.Centered)] + public int O; + public int P; + + [Title("$Combined", titleAlignment: TitleAlignments.Centered)] + public int Q; + public int R; + + [ShowInInspector] + [Title("Title on a Property")] + public int S { get; set; } + + [Title("Title on a Method")] + [Button] + public void DoNothing() + { } + + public string Combined { get { return this.MyTitle + " - " + this.MySubtitle; } } + } + + + + + + + + The title displayed above the property in the inspector. + + + + + Optional subtitle. + + + + + If true the title will be displayed with a bold font. + + + + + Gets a value indicating whether or not to draw a horizontal line below the title. + + + + + Title alignment. + + + + + Creates a title above any property in the inspector. + + The title displayed above the property in the inspector. + Optional subtitle + Title alignment + Horizontal line + If true the title will be drawn with a bold font. + + + + Groups properties vertically together with a title, an optional subtitle, and an optional horizontal line. + + + + + Optional subtitle. + + + + + Title alignment. + + + + + Gets a value indicating whether or not to draw a horizontal line below the title. + + + + + If true the title will be displayed with a bold font. + + + + + Gets a value indicating whether or not to indent all group members. + + + + + Groups properties vertically together with a title, an optional subtitle, and an optional horizontal line. + + The title- + Optional subtitle. + The text alignment. + Horizontal line. + Bold text. + Whether or not to indent all group members. + The group order. + + + + Combines TitleGroup attributes. + + The other group attribute to combine with. + + + + Toggle is used on any field or property, and allows to enable or disable the property in the inspector. + Use this to create a property that can be turned off or on. + + + Toggle does current not support any static members for toggling. + + + The following example shows how Toggle is used to create a toggleable property. + + public class MyComponent : MonoBehaviour + { + [Toggle("Enabled")] + public MyToggleable MyToggler = new MyToggleable(); + } + + public class MyToggleable + { + public bool Enabled; + + public int MyValue; + } + + + + + + + + Name of any bool field or property to enable or disable the object. + + + + + If true, all other open toggle groups will collapse once another one opens. + + + + + Create a togglable property in the inspector. + + Name of any bool field or property to enable or disable the object. + + + + ToggleGroup is used on any field, and create a toggleable group of options. + Use this to create options that can be enabled or disabled. + + + The functions as the ID for the ToggleGroup, and therefore all members of a toggle group must specify the same toggle member. + This attribute does not support static members! + + + The following example shows how ToggleGroup is used to create two separate toggleable groups. + + public class MyComponent : MonoBehaviour + { + // This attribute has a title specified for the group. The title only needs to be applied to a single attribute for a group. + [ToggleGroup("FirstToggle", order: -1, groupTitle: "First")] + public bool FirstToggle; + + [ToggleGroup("FirstToggle")] + public int MyInt; + + // This group specifies a member string as the title of the group. A property or a function can also be used. + [ToggleGroup("SecondToggle", titleStringMemberName: "SecondGroupTitle")] + public bool SecondToggle { get; set; } + + [ToggleGroup("SecondToggle")] + public float MyFloat; + + [HideInInspector] + public string SecondGroupTitle = "Second"; + } + + + + "/> + + + + Title of the toggle group in the inspector. + If null will be used instead. + + + + + If true, all other open toggle groups will collapse once another one opens. + + + + + Creates a ToggleGroup. See . + + Name of any bool field or property to enable or disable the ToggleGroup. + The order of the group. + Use this to name the group differently than toggleMemberName. + + + + Creates a ToggleGroup. See . + + Name of any bool field or property to enable or disable the ToggleGroup. + Use this to name the group differently than toggleMemberName. + + + + Obsolete constructor overload. + + Obsolete overload. + Obsolete overload. + Obsolete overload. + Obsolete overload. + + + + Name of any bool field, property or function to enable or disable the ToggleGroup. + + + + + Name of any string field, property or function, to title the toggle group in the inspector. + If null will be used instead. + + + + + Combines the ToggleGroup with another ToggleGroup. + + Another ToggleGroup. + + + + Draws the checkbox before the label instead of after. + + ToggleLeftAttribute can be used an all fields and properties of type boolean + + + public class MyComponent : MonoBehaviour + { + [ToggleLeft] + public bool MyBoolean; + } + + + + + + Specifies whether a base type should be used instead of all types. + + + + + Filters the result. + + Name of any field, property or method member that implements IList. E.g. arrays or Lists. Obsolete; use the FilterGetter member instead. @@ -2118,2686 +5521,198 @@ The message to display in the info box. - + + Specifies if the '<none>' item is shown. + + + Specifies if categories are shown. + + - VerticalGroup is used to gather properties together in a vertical group in the inspector. - This doesn't do much in and of itself, but in combination with other groups, such as it can be very useful. + Specifies if namespaces are preferred over assembly category names for category names. + + + + + Function for filtering types displayed in the Type Selector. - The following example demonstrates how VerticalGroup can be used in conjunction with - - public class MyComponent : MonoBehaviour - { - [HorizontalGroup("Split")] - [VerticalGroup("Split/Left")] - public Vector3 Vector; - - [VerticalGroup("Split/Left")] - public GameObject First; - - [VerticalGroup("Split/Left")] - public GameObject Second; - - [VerticalGroup("Split/Right", PaddingTop = 18f)] - public int A; - - [VerticalGroup("Split/Right")] - public int B; - } - - - - - - - - - - - Space in pixels at the top of the group. - - - - - Space in pixels at the bottom of the group. - - - - - Groups properties vertically. - - The group ID. - The group order. - - - - Groups properties vertically. - GroupId: _DefaultVerticalGroup - - The group order. - - - - Combines properties that have been group vertically. - - The group attribute to combine with. - - - - Not yet documented. - - - - - Not yet documented. - - - - - Adds a search filter that can search the children of the field or type on - which it is applied. Note that this does not currently work when directly - applied to dictionaries, though a search field "above" the dictionary will - still search the dictionary's properties if it is searching recursively. - - - - - Whether to use fuzzy string matching for the search. - Default value: true. - - - - - The options for which things to use to filter the search. - Default value: All. - - - - - Whether to search recursively, or only search the top level properties. - Default value: true. - - - - - When this attribute is added is added to another attribute, then attributes from that attribute - will also be added to the property in the attribute processing step. - - - - - How the InlineEditor attribute drawer should draw the object field. - - - - - Draws the object field in a box. - - - - - Draws the object field with a foldout. - - - - - Hides the object field unless it's null. - - - - - Hidden the object field also when the object is null. - - - - - Implement this interface to create custom matching - logic for search filtering in the inspector. - - - The following example shows how you might do this: - - public class MyCustomClass : ISearchFilterable - { - public bool SearchEnabled; - public string MyStr; - - public bool IsMatch(string searchString) - { - if (SearchEnabled) - { - return MyStr.Contains(searchString); - } - - return false; - } - } - - - - - - How the square object field should be aligned. - - - - - - Left aligned. - - - - - Aligned to the center. - - - - - Right aligned. - - - - - Options for filtering search. - - - - - Title alignment enum used by various attributes. - - - - - - - Title and subtitle left aligned. - - - - - Title and subtitle centered aligned. - - - - - Title and subtitle right aligned. - - - - - Title on the left, subtitle on the right. - - - - - Groups properties vertically together with a title, an optional subtitle, and an optional horizontal line. - - - - - Optional subtitle. - - - - - Title alignment. - - - - - Gets a value indicating whether or not to draw a horizontal line below the title. - - - - - If true the title will be displayed with a bold font. - - - - - Gets a value indicating whether or not to indent all group members. - - - - - Groups properties vertically together with a title, an optional subtitle, and an optional horizontal line. - - The title- - Optional subtitle. - The text alignment. - Horizontal line. - Bold text. - Whether or not to indent all group members. - The group order. - - - - Combines TitleGroup attributes. - - The other group attribute to combine with. - - - - Various built-in button sizes. - - - - - Small button size, fits well with properties in the inspector. - - - - - A larger button. - - - - - A very large button. - - - - - A gigantic button. Twice as big as Large - - - - - ColorPalette is used on any Color property, and allows for choosing colors from different definable palettes. - Use this to allow the user to choose from a set of predefined color options. - - - See and edit the color palettes in Tools > Odin Inspector > Drawers > Color Palettes. - The color property is not tied to the color palette, and can be edited. Therefore the color will also not update if the ColorPalette is edited. - - - The following example shows how ColorPalette is applied to a property. The user can freely choose between all available ColorPalettes. - - public class ColorPaletteExamples : MonoBehaviour - { - [ColorPalette] - public Color ColorOptions; - - [ColorPalette("Underwater")] - public Color UnderwaterColor; - - [ColorPalette("Fall"), HideLabel] - public Color WideColorPalette; - - [ColorPalette("My Palette")] - public Color MyColor; - - [ColorPalette("Clovers")] - public Color[] ColorArray; - } - - - - - - Gets the name of the palette. - - - - - Indicates if the color palette should show alpha values or not. - - - - - Adds a color palette options to a Color property. - - - - - Adds color options to a Color property from a specific palette. - - Name of the palette. - - - - CustomContextMenu is used on any property, and adds a custom options to the context menu for the property. - Use this for when you want to add custom actions to the context menu of a property. - - - CustomContextMenu currently does not support static functions. - - - The following example shows how CustomContextMenu is used to add a custom option to a property. - - public class MyComponent : MonoBehaviour - { - [CustomContextMenu("My custom option", "MyAction")] - public Vector3 MyVector; - - private void MyAction() - { - MyVector = Random.onUnitSphere; - } - } - - - - - - - The name of the menu item. - - - - - The name of the callback method. Obsolete; use the Action member instead. - - - - - A resolved string defining the action to take when the context menu is clicked. - - - - - Adds a custom option to the context menu of the property. - - The name of the menu item. - A resolved string defining the action to take when the context menu is clicked. - - - - Delays applying changes to properties while they still being edited in the inspector. - Similar to Unity's built-in Delayed attribute, but this attribute can also be applied to properties. - - - - - DetailedInfoBox is used on any property, and displays a message box that can be expanded to show more details. - Use this to convey a message to a user, and give them the option to see more details. - - - The following example shows how DetailedInfoBox is used on a field. - - public class MyComponent : MonoBehaviour - { - [DetailedInfoBox("This is a message", "Here is some more details about that message")] - public int MyInt; - } - - - - - - - The message for the message box. - - - - - The hideable details of the message box. - - - - - Type of the message box. - - - - - Optional name of a member to hide or show the message box. - - - - - Displays a message box with hideable details. - - The message for the message box. - The hideable details of the message box. - Type of the message box. - Optional name of a member to hide or show the message box. - - - - Various display modes for the dictionary to draw its items. - - - - - Draws all dictionary items in two columns. The left column contains all key values, the right column displays all values. - - - - - Draws each dictionary item in a box with the key in the header and the value inside the box. - Whether or not the box is expanded or collapsed by default, is determined by the - "Expand Foldout By Default" setting found in the preferences window "Tools > Odin Inspector > Preferences > Drawers > Settings". - - - - - Draws each dictionary item in a collapsed foldout with the key in the header and the value inside the box. - - - - - Draws each dictionary item in an expanded foldout with the key in the header and the value inside the box. - - - - - Customize the behavior for dictionaries in the inspector. - - - - - Specify an alternative key label for the dictionary drawer. - - - - - Specify an alternative value label for the dictionary drawer. - - - - - Specify how the dictionary should draw its items. - - - - - Gets or sets a value indicating whether this instance is read only. - - - - - Gets or sets a value indicating the default key column width of the dictionary. - - - - - DisableContextMenu is used on any property and disables the context menu for that property. - Use this if you do not want the context menu to be available for a property. - - - The following example shows how DisableContextMenu is used on a property. - - public class MyComponent : MonoBehaviour - { - [DisableContextMenu] - public Vector3 MyVector; - } - - - - - - - Whether to disable the context menu for the member itself. - - - - - Whether to disable the context menu for collection elements. - - - - - Initializes a new instance of the class. - - Whether to disable the context menu for the member itself. - Whether to also disable the context menu of collection elements. - - - - DisableIf is used on any property, and can disable or enable the property in the inspector. - Use this to disable properties when they are irrelevant. - - - The following example shows how a property can be disabled by the state of a field. - - public class MyComponent : MonoBehaviour - { - public bool DisableProperty; - - [DisableIf("DisableProperty")] - public int MyInt; - - public SomeEnum SomeEnumField; - - [DisableIf("SomeEnumField", SomeEnum.SomeEnumMember)] - public string SomeString; - } - - - - The following examples show how a property can be disabled by a function. - - public class MyComponent : MonoBehaviour - { - [EnableIf("MyDisableFunction")] - public int MyInt; - - private bool MyDisableFunction() - { - // ... - } - } - - - - - - - - The name of a bool member field, property or method. Obsolete; use the Condition member instead. - - - - - A resolved string that defines the condition to check the value of, such as a member name or an expression. - - - - - The optional condition value. - - - - - Disables a property in the inspector, based on the value of a resolved string. - - A resolved string that defines the condition to check the value of, such as a member name or an expression. - - - - Disables a property in the inspector, if the resolved string evaluates to the specified value. - - A resolved string that defines the condition to check the value of, such as a member name or an expression. - Value to check against. - - - - DisableInEditorMode is used on any property, and disables the property when not in play mode. - Use this when you only want a property to be editable when in play mode. - - - The following example shows how DisableInEditorMode is used to disable a property when in the editor. - - public class MyComponent : MonoBehaviour - { - [DisableInEditorMode] - public int MyInt; - } - - - - - - - - - DisableInPlayMode is used on any property, and disables the property when in play mode. - Use this to prevent users from editing a property when in play mode. - - - The following example shows how DisableInPlayMode is used to disable a property when in play mode. - - public class MyComponent : MonoBehaviour - { - [DisableInPlayMode] - public int MyInt; - } - - - - - - - - - - - DisplayAsString is used on any property, and displays a string in the inspector as text. - Use this for when you want to show a string in the inspector, but not allow for any editing. - - - DisplayAsString uses the property's ToString method to display the property as a string. - - - The following example shows how DisplayAsString is used to display a string property as text in the inspector. - - public class MyComponent : MonoBehaviour - { - [DisplayAsString] - public string MyInt = 5; - - // You can combine with to display a message in the inspector. - [DisplayAsString, HideLabel] - public string MyMessage = "This string will be displayed as text in the inspector"; - - [DisplayAsString(false)] - public string InlineMessage = "This string is very long, but has been configured to not overflow."; - } - - - - - - - - If true, the string will overflow past the drawn space and be clipped when there's not enough space for the text. - If false the string will expand to multiple lines, if there's not enough space when drawn. - - - - - Displays the property as a string in the inspector. - - - - - Displays the property as a string in the inspector. - - Value indicating if the string should overflow past the available space, or expand to multiple lines when there's not enough horizontal space. - - - - DontApplyToListElements is used on other attributes, and indicates that those attributes should be applied only to the list, and not to the elements of the list. - Use this on attributes that should only work on a list or array property as a whole, and not on each element of the list. - - - The following example shows how DontApplyToListElements is used on . - - [DontApplyToListElements] - [AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)] - public sealed class VisibleIfAttribute : Attribute - { - public string MemberName { get; private set; } - - public VisibleIfAttribute(string memberName) - { - this.MemberName = memberName; - } - } - - - - - - DrawWithUnity can be applied to a field or property to make Odin draw it using Unity's old drawing system. Use it if you want to selectively disable Odin drawing for a particular member. - - - Note that this attribute does not mean "disable Odin completely for this property"; it is visual only in nature, and in fact represents an Odin drawer which calls into Unity's old property drawing system. As Odin is still ultimately responsible for arranging the drawing of the property, and since other attributes exist with a higher priority than this attribute, and it is not guaranteed that Unity will draw the property if another attribute is present to override this one. - - - - - The inline button adds a button to the end of a property. - - - Due to a bug, multiple inline buttons are currently not supported. - - - The following examples demonstrates how InlineButton can be used. - - public class MyComponent : MonoBehaviour - { - // Adds a button to the end of the A property. - [InlineButton("MyFunction")] - public int A; - - // This is example demonstrates how you can change the label of the button. - // InlineButton also supports refering to string members with $. - [InlineButton("MyFunction", "Button")] - public int B; - - private void MyFunction() - { - // ... - } - } - - - - - - - - Name of member method to call when the button is clicked. Obsolete; use the Action member instead. - - - - - A resolved string that defines the action to perform when the button is clicked, such as an expression or method invocation. - - - - - Optional label of the button. - - - - - Optional resolved string that specifies a condition for whether to show the inline button or not. - - - - - Draws a button to the right of the property. - - A resolved string that defines the action to perform when the button is clicked, such as an expression or method invocation. - Optional label of the button. - - - - Not yet documented. - - - - - Not yet documented. - - Not yet documented. - - - - Not yet documented. - - Not yet documented. - Not yet documented. - - - - ShowForPrefabOnlyAttribute is used on any field or property, and only shows properties from prefab assets inspector. - Use this to ensure the same value on a property, across all instances of a prefab. - - - On non-prefab objects or instances, this attribute does nothing, and allows properties to be edited as normal. - - - The following example shows how ShowForPrefabOnlyAttribute is used on properties. - - public class MyComponent - { - [ShowForPrefabOnlyAttribute] - public int MyInt; - } - - - - - - - - - - - EnableForPrefabOnly is used on any field or property, and only allows editing of values from prefab assets inspector. - Use this to ensure the same value on a property, across all instances of a prefab. - - - On non-prefab objects or instances, this attribute does nothing, and allows properties to be edited as normal. - - - The following example shows how EnableForPrefabOnly is used on properties. - - public class MyComponent - { - [EnableForPrefabOnly] - public int MyInt; - } - - - - - - - - - - - EnableIf is used on any property, and can enable or disable the property in the inspector. - Use this to enable properties when they are relevant. - - - The following example shows how a property can be enabled by the state of a field. - - public class MyComponent : MonoBehaviour - { - public bool EnableProperty; - - [EnableIf("EnableProperty")] - public int MyInt; - - public SomeEnum SomeEnumField; - - [EnableIf("SomeEnumField", SomeEnum.SomeEnumMember)] - public string SomeString; - } - - - - The following examples show how a property can be enabled by a function. - - public class MyComponent : MonoBehaviour - { - [EnableIf("MyEnableFunction")] - public int MyInt; - - private bool MyEnableFunction() - { - // ... - } - } - - - - - - - - - - - The name of a bool member field, property or method. Obsolete; use the Condition member instead. - - - - - A resolved string that defines the condition to check the value of, such as a member name or an expression. - - - - - The optional condition value. - - - - - Enables a property in the inspector, based on the value of a resolved string. - - A resolved string that defines the condition to check the value of, such as a member name or an expression. - - - - Enables a property in the inspector, if the resolved string evaluates to the specified value. - - A resolved string that defines the condition to check the value of, such as a member name or an expression. - Value to check against. - - - - Draws an enum in a horizontal button group instead of a dropdown. - - - - public class MyComponent : MonoBehvaiour - { - [EnumToggleButtons] - public MyBitmaskEnum MyBitmaskEnum; - - [EnumToggleButtons] - public MyEnum MyEnum; - } - - [Flags] - public enum MyBitmaskEnum - { - A = 1 << 1, // 1 - B = 1 << 2, // 2 - C = 1 << 3, // 4 - ALL = A | B | C - } - - public enum MyEnum - { - A, - B, - C - } - - - - - - - HideIf is used on any property and can hide the property in the inspector. - Use this to hide irrelevant properties based on the current state of the object. - - - This example shows a component with fields hidden by the state of another field. - - public class MyComponent : MonoBehaviour - { - public bool HideProperties; - - [HideIf("HideProperties")] - public int MyInt; - - [HideIf("HideProperties", false)] - public string MyString; - - public SomeEnum SomeEnumField; - - [HideIf("SomeEnumField", SomeEnum.SomeEnumMember)] - public string SomeString; - } - - - - This example shows a component with a field that is hidden when the game object is inactive. - - public class MyComponent : MonoBehaviour - { - [HideIf("MyVisibleFunction")] - public int MyHideableField; - - private bool MyVisibleFunction() - { - return !this.gameObject.activeInHierarchy; - } - } - - - - - - - - - The name of a bool member field, property or method. Obsolete; use the Condition member instead. - - - - - A resolved string that defines the condition to check the value of, such as a member name or an expression. - - - - - The optional condition value. - - - - - Whether or not to slide the property in and out when the state changes. - - - - - Hides a property in the inspector, based on the value of a resolved string. - - A resolved string that defines the condition to check the value of, such as a member name or an expression. - Whether or not to slide the property in and out when the state changes. - - - - Hides a property in the inspector, if the resolved string evaluates to the specified value. - - A resolved string that defines the condition to check the value of, such as a member name or an expression. - Value to check against. - Whether or not to slide the property in and out when the state changes. - - - - HideInPlayMode is used on any property, and hides the property when not in editor mode. - Use this when you only want a property to only be visible the editor. - - - The following example shows how HideInPlayMode is used to hide a property when in play mode. - - public class MyComponent : MonoBehaviour - { - [HideInPlayMode] - public int MyInt; - } - - - - - - - - - - HideInEditorMode is used on any property, and hides the property when not in play mode. - Use this when you only want a property to only be visible play mode. - - - The following example shows how HideInEditorMode is used to hide a property when in the editor. - - public class MyComponent : MonoBehaviour - { - [HideInEditorMode] - public int MyInt; - } - - - - - - - - - - Apply HideMonoScript to your class to prevent the Script property from being shown in the inspector. - - This attribute has the same effect on a single type that the global configuration option "Show Mono Script In Editor" in "Preferences -> Odin Inspector -> General -> Drawers" has globally when disabled. - - - - The following example shows how to use this attribute. - - [HideMonoScript] - public class MyComponent : MonoBehaviour - { - // The Script property will not be shown for this component in the inspector - } - - - - - - - Hides the polymorphic object-picker shown above the properties of non-Unity serialized reference types. - - - When the object picker is hidden, you can right click and set the instance to null, in order to set a new value. - If you don't want this behavior, you can use attribute to ensure people can't change the value. - - - - - public class MyComponent : SerializedMonoBehaviour - { - [Header("Hidden Object Pickers")] - [Indent] - [HideReferenceObjectPicker] - public MyCustomReferenceType OdinSerializedProperty1; - - [Indent] - [HideReferenceObjectPicker] - public MyCustomReferenceType OdinSerializedProperty2; - - [Indent] - [Header("Shown Object Pickers")] - public MyCustomReferenceType OdinSerializedProperty3; - - [Indent] - public MyCustomReferenceType OdinSerializedProperty4; - - public class MyCustomReferenceType - { - public int A; - public int B; - public int C; - } - } - - - - - - HorizontalGroup is used group multiple properties horizontally in the inspector. - The width can either be specified as percentage or pixels. - All values between 0 and 1 will be treated as a percentage. - If the width is 0 the column will be automatically sized. - Margin-left and right can only be specified in pixels. - - - The following example shows how three properties have been grouped together horizontally. - - // The width can either be specified as percentage or pixels. - // All values between 0 and 1 will be treated as a percentage. - // If the width is 0 the column will be automatically sized. - // Margin-left and right can only be specified in pixels. - - public class HorizontalGroupAttributeExamples : MonoBehaviour - { - [HorizontalGroup] - public int A; - - [HideLabel, LabelWidth (150)] - [HorizontalGroup(150)] - public LayerMask B; - - // LabelWidth can be helpfull when dealing with HorizontalGroups. - [HorizontalGroup("Group 1"), LabelWidth(15)] - public int C; - - [HorizontalGroup("Group 1"), LabelWidth(15)] - public int D; - - [HorizontalGroup("Group 1"), LabelWidth(15)] - public int E; - - // Having multiple properties in a column can be achived using multiple groups. Checkout the "Combining Group Attributes" example. - [HorizontalGroup("Split", 0.5f, PaddingRight = 15)] - [BoxGroup("Split/Left"), LabelWidth(15)] - public int L; - - [BoxGroup("Split/Right"), LabelWidth(15)] - public int M; - - [BoxGroup("Split/Left"), LabelWidth(15)] - public int N; - - [BoxGroup("Split/Right"), LabelWidth(15)] - public int O; - - // Horizontal Group also has supprot for: Title, MarginLeft, MarginRight, PaddingLeft, PaddingRight, MinWidth and MaxWidth. - [HorizontalGroup("MyButton", MarginLeft = 0.25f, MarginRight = 0.25f)] - public void SomeButton() - { - - } - } - - - - - - - - - - - The width. Values between 0 and 1 will be treated as percentage, 0 = auto, otherwise pixels. - - - - - The margin left. Values between 0 and 1 will be treated as percentage, 0 = ignore, otherwise pixels. - - - - - The margin right. Values between 0 and 1 will be treated as percentage, 0 = ignore, otherwise pixels. - - - - - The padding left. Values between 0 and 1 will be treated as percentage, 0 = ignore, otherwise pixels. - - - - - The padding right. Values between 0 and 1 will be treated as percentage, 0 = ignore, otherwise pixels. - - - - - The minimum Width. Values between 0 and 1 will be treated as percentage, 0 = ignore, otherwise pixels. - - - - - The maximum Width. Values between 0 and 1 will be treated as percentage, 0 = ignore, otherwise pixels. - - - - - Adds a title above the horizontal group. - - - - - The label width, 0 = auto. - - - - - Organizes the property in a horizontal group. - - The group for the property. - The width of the property. Values between 0 and 1 are interpolated as a percentage, otherwise pixels. - The left margin in pixels. - The right margin in pixels. - The order of the group in the inspector. - - - - Organizes the property in a horizontal group. - - The width of the property. Values between 0 and 1 are interpolated as a percentage, otherwise pixels. - The left margin in pixels. - The right margin in pixels. - The order of the group in the inspector. - - - - Merges the values of two group attributes together. - - The other group to combine with. - - - - InlineAttribute is used on any property or field with a type that inherits from UnityEngine.Object. This includes components and assets etc. - - - - public class InlineEditorExamples : MonoBehaviour - { - [DisableInInlineEditors] - public Vector3 DisabledInInlineEditors; - - [HideInInlineEditors] - public Vector3 HiddenInInlineEditors; - - [InlineEditor] - public Transform InlineComponent; - - [InlineEditor(InlineEditorModes.FullEditor)] - public Material FullInlineEditor; - - [InlineEditor(InlineEditorModes.GUIAndHeader)] - public Material InlineMaterial; - - [InlineEditor(InlineEditorModes.SmallPreview)] - public Material[] InlineMaterialList; - - [InlineEditor(InlineEditorModes.LargePreview)] - public GameObject InlineObjectPreview; - - [InlineEditor(InlineEditorModes.LargePreview)] - public Mesh InlineMeshPreview; - } - - - - - - - - If true, the inline editor will start expanded. - - - - - Draw the header editor header inline. - - - - - Draw editor GUI inline. - - - - - Draw editor preview inline. - - - - - Maximum height of the inline editor. If the inline editor exceeds the specified height, a scrollbar will appear. - Values less or equals to zero will let the InlineEditor expand to its full size. - - - - - The size of the editor preview if drawn together with GUI. - - - - - The size of the editor preview if drawn alone. - - - - - If false, this will prevent the InlineEditor attribute from incrementing the InlineEditorAttributeDrawer.CurrentInlineEditorDrawDepth. - This is helpful in cases where you want to draw the entire editor, and disregard attributes - such as [] and []. - - - - - How the InlineEditor attribute drawer should draw the object field. - - - - - Whether to set GUI.enabled = false when drawing an editor for an asset that is locked by source control. Defaults to true. - - - - - Initializes a new instance of the class. - - The inline editor mode. - How the object field should be drawn. - - - - Initializes a new instance of the class. - - How the object field should be drawn. - - - - SuppressInvalidAttributeError is used on members to suppress the inspector error message you get when applying an attribute to a value that it's not supposed to work on. - This can be very useful for applying attributes to generic parameter values, when it only applies to some of the possible types that the value might become. - - - The following example shows a case where the attribute might be useful. - - public class NamedValue<T> - { - public string Name; - - // The Range attribute will be applied if T is compatible with it, but if T is not compatible, an error will not be shown. - [SuppressInvalidAttributeError, Range(0, 10)] - public T Value; - } - - - - - - Editor modes for - - - - - - Draws only the editor GUI - - - - - Draws the editor GUI and the editor header. - - - - - Draws the editor GUI to the left, and a small editor preview to the right. - - - - - Draws a small editor preview without any GUI. - - - - - Draws a large editor preview without any GUI. - - - - - Draws the editor header and GUI to the left, and a small editor preview to the right. - - - - - ShowDrawerChain lists all prepend, append and value drawers being used in the inspector. - This is great in situations where you want to debug, and want to know which drawers might be involved in drawing the property. + The resolver expects any method that takes a single parameter of , with the parameter name 'type', and which returns a indicating whether the is included or not; - Your own custom drawers are highlighted with a green label. - Drawers, that have not been called during the draw chain, will be greyed out in the inspector to make it clear which drawers have had an effect on the properties. - - - - public class MyComponent : MonoBehaviour - { - [ShowDrawerChain] - public int IndentedInt; - } - + + Implementation example: public bool SomeFilterMethod(Type type). - + + - Marks a type as being specially serialized. Odin uses this attribute to check whether it should include non-Unity-serialized members in the inspector. + The unit of underlying value. - + + + The unit displayed in the number field. + + + + + Name of the underlying unit. + + + + + Name of the unit displayed in the number field. + + + + + If true the number field is drawn as read-only text. + + + + + If true disables the option to change display unit with the right-click context menu. + + + + + Displays the number as a unit field. + + The unit of underlying value. + + + + Displays the number as a unit field. + + The name of the underlying value. + + + + Displays the number as a unit field. + + The unit of underlying value. + The unit to display the value as in the inspector. + + + + Displays the number as a unit field. + + The unit of underlying value. + The unit to display the value as in the inspector. + + + + Displays the number as a unit field. + + The unit of underlying value. + The unit to display the value as in the inspector. + + + + Displays the number as a unit field. + + The unit of underlying value. + The unit to display the value as in the inspector. + + + + Units for use with and . + + + - FoldoutGroup is used on any property, and organizes properties into a foldout. - Use this to organize properties, and to allow the user to hide properties that are not relevant for them at the moment. + ValidateInput is used on any property, and allows to validate input from inspector. + Use this to enforce correct values. + + ValidateInput refuses invalid values. + ValidateInput only works in the editor. Values changed through scripting will not be validated. + - The following example shows how FoldoutGroup is used to organize properties into a foldout. + The following examples shows how a speed value can be forced to be above 0. public class MyComponent : MonoBehaviour - { - [FoldoutGroup("MyGroup")] - public int A; + { + [ValidateInput("ValidateInput")] + public float Speed; - [FoldoutGroup("MyGroup")] - public int B; + // Specify custom output message and message type. + [ValidateInput("ValidateInput", "Health must be more than 0!", InfoMessageType.Warning)] + public float Health; - [FoldoutGroup("MyGroup")] - public int C; - } + private bool ValidateInput(float property) + { + return property > 0f; + } + } - The following example shows how properties can be organizes into multiple foldouts. + The following example shows how a static function could also be used. public class MyComponent : MonoBehaviour - { - [FoldoutGroup("First")] - public int A; - - [FoldoutGroup("First")] - public int B; - - [FoldoutGroup("Second")] - public int C; - } - - - - - - - - - - - Gets a value indicating whether or not the foldout should be expanded by default. - - - - - Gets a value indicating whether or not the Expanded property has been set. - - - - - Adds the property to the specified foldout group. - - Name of the foldout group. - The order of the group in the inspector. - - - - Adds the property to the specified foldout group. - - Name of the foldout group. - Whether or not the foldout should be expanded by default. - The order of the group in the inspector. - - - - Combines the foldout property with another. - - The group to combine with. - - - - GUIColor is used on any property and changes the GUI color used to draw the property. - - - The following example shows how GUIColor is used on a properties to create a rainbow effect. - - public class MyComponent : MonoBehaviour - { - [GUIColor(1f, 0f, 0f)] - public int A; - - [GUIColor(1f, 0.5f, 0f, 0.2f)] - public int B; - - [GUIColor("GetColor")] - public int C; - - private Color GetColor() { return this.A == 0 ? Color.red : Color.white; } - } - - - - - - The GUI color of the property. - - - - - The name of a local field, member or property that returns a Color. Both static and instance methods are supported. - - - - - Sets the GUI color for the property. - - The red channel. - The green channel. - The blue channel. - The alpha channel. - - - - Sets the GUI color for the property. - - Specify the name of a local field, member or property that returns a Color. - - - - HideLabel is used on any property, and hides the label in the inspector. - Use this to hide the label of properties in the inspector. - - - The following example show how HideLabel is used to hide the label of a game object property. - - public class MyComponent : MonoBehaviour - { - [HideLabel] - public GameObject MyGameObjectWithoutLabel; - } - - - - - - - Indent is used on any property and moves the property's label to the right. - Use this to clearly organize properties in the inspector. - - - The following example shows how a property is indented by Indent. - - public class MyComponent : MonoBehaviour - { - [Indent] - public int IndentedInt; - } - - - - - - Indicates how much a property should be indented. - - - - - Indents a property in the inspector. - - How much a property should be indented. - - - - InfoBox is used on any property, and display a text box above the property in the inspector. - Use this to add comments or warn about the use of different properties. - - - The following example shows different info box types. - - public class MyComponent : MonoBehaviour - { - [InfoBox("This is an int property")] + { + [ValidateInput("StaticValidateFunction")] public int MyInt; - [InfoBox("This info box is a warning", InfoMessageType.Warning)] - public float MyFloat; - - [InfoBox("This info box is an error", InfoMessageType.Error)] - public object MyObject; - - [InfoBox("This info box is just a box", InfoMessageType.None)] - public Vector3 MyVector; - } - - - - The following example how info boxes can be hidden by fields and properties. - - public class MyComponent : MonoBehaviour - { - [InfoBox("This info box is hidden by an instance field.", "InstanceShowInfoBoxField")] - public int MyInt; - public bool InstanceShowInfoBoxField; - - [InfoBox("This info box is hideable by a static field.", "StaticShowInfoBoxField")] - public float MyFloat; - public static bool StaticShowInfoBoxField; - - [InfoBox("This info box is hidden by an instance property.", "InstanceShowInfoBoxProperty")] - public int MyOtherInt; - public bool InstanceShowInfoBoxProperty { get; set; } - - [InfoBox("This info box is hideable by a static property.", "StaticShowInfoBoxProperty")] - public float MyOtherFloat; - public static bool StaticShowInfoBoxProperty { get; set; } - } - - - - The following example shows how info boxes can be hidden by functions. - - public class MyComponent : MonoBehaviour - { - [InfoBox("This info box is hidden by an instance function.", "InstanceShowFunction")] - public int MyInt; - public bool InstanceShowFunction() + private static bool StaticValidateFunction(int property) { - return this.MyInt == 0; + return property != 0; } - - [InfoBox("This info box is hidden by a static function.", "StaticShowFunction")] - public short MyShort; - public bool StaticShowFunction() - { - return true; - } - - // You can also specify a function with the same type of parameter. - // Use this to specify the same function, for multiple different properties. - [InfoBox("This info box is hidden by an instance function with a parameter.", "InstanceShowParameterFunction")] - public GameObject MyGameObject; - public bool InstanceShowParameterFunction(GameObject property) - { - return property != null; - } - - [InfoBox("This info box is hidden by a static function with a parameter.", "StaticShowParameterFunction")] - public Vector3 MyVector; - public bool StaticShowParameterFunction(Vector3 property) - { - return property.magnitude == 0f; - } - } - - - - - - - - The message to display in the info box. - - - - - The type of the message box. - - - - - Optional member field, property or function to show and hide the info box. - - - - - When true the InfoBox will ignore the GUI.enable flag and always draw as enabled. - - - - - Displays an info box above the property. - - The message for the message box. Supports referencing a member string field, property or method by using $. - The type of the message box. - Name of member bool to show or hide the message box. - - - - Displays an info box above the property. - - The message for the message box. Supports referencing a member string field, property or method by using $. - Name of member bool to show or hide the message box. - - - - Draw a special slider the user can use to specify a range between a min and a max value. - Uses a Vector2 where x is min and y is max. - - - The following example shows how MinMaxSlider is used. - - public class Player : MonoBehaviour - { - [MinMaxSlider(4, 5)] - public Vector2 SpawnRadius; - } - - - - - - The hardcoded min value for the slider. - - - - - The hardcoded max value for the slider. - - - - - The name of a field, property or method to get the min value from. Obsolete; use MinValueGetter instead. - - - - - A resolved string that should evaluate to a float value, which is used as the min bounds. - - - - - The name of a field, property or method to get the max value from. Obsolete; use MaxValueGetter instead. - - - - - A resolved string that should evaluate to a float value, which is used as the max bounds. - - - - - The name of a Vector2 field, property or method to get the min max values from. Obsolete; use MinMaxValueGetter instead. - - - - - A resolved string that should evaluate to a Vector2 value, which is used as the min/max bounds. If this is non-null, it overrides the behaviour of the MinValue, MinValueGetter, MaxValue and MaxValueGetter members. - - - - - Draw float fields for min and max value. - - - - - Draws a min-max slider in the inspector. X will be set to min, and Y will be set to max. - - The min value. - The max value. - If true number fields will drawn next to the MinMaxSlider. - - - - Draws a min-max slider in the inspector. X will be set to min, and Y will be set to max. - - A resolved string that should evaluate to a float value, which is used as the min bounds. - The max value. - If true number fields will drawn next to the MinMaxSlider. - - - - Draws a min-max slider in the inspector. X will be set to min, and Y will be set to max. - - The min value. - A resolved string that should evaluate to a float value, which is used as the max bounds. - If true number fields will drawn next to the MinMaxSlider. - - - - Draws a min-max slider in the inspector. X will be set to min, and Y will be set to max. - - A resolved string that should evaluate to a float value, which is used as the min bounds. - A resolved string that should evaluate to a float value, which is used as the max bounds. - If true number fields will drawn next to the MinMaxSlider. - - - - Draws a min-max slider in the inspector. X will be set to min, and Y will be set to max. - - A resolved string that should evaluate to a Vector2 value, which is used as the min/max bounds. If this is non-null, it overrides the behaviour of the MinValue, MinValueGetter, MaxValue and MaxValueGetter members. - If true number fields will drawn next to the MinMaxSlider. - - - - Draws the checkbox before the label instead of after. - - ToggleLeftAttribute can be used an all fields and properties of type boolean - - - public class MyComponent : MonoBehaviour - { - [ToggleLeft] - public bool MyBoolean; - } - - - - - - LabelText is used to change the labels of properties. - Use this if you want a different label than the name of the property. - - - The following example shows how LabelText is applied to a few property fields. - - public MyComponent : MonoBehaviour - { - [LabelText("1")] - public int MyInt1; - - [LabelText("2")] - public int MyInt2; - - [LabelText("3")] - public int MyInt3; - } - - - - - - - The new text of the label. - - - - - Whether the label text should be nicified before it is displayed, IE, "m_someField" becomes "Some Field". - If the label text is resolved via a member reference, an expression, or the like, then the evaluated result - of that member reference or expression will be nicified. - - - - - Give a property a custom label. - - The new text of the label. - - - - Give a property a custom label. - - The new text of the label. - Whether to nicify the label text. - - - - Customize the behavior for lists and arrays in the inspector. - - - This example shows how you can add your own custom add button to a list. - - [ListDrawerSettings(HideAddButton = true, OnTitleBarGUI = "DrawTitleBarGUI")] - public List<MyType> SomeList; - - #if UNITY_EDITOR - private void DrawTitleBarGUI() - { - if (SirenixEditorGUI.ToolbarButton(EditorIcons.Plus)) - { - this.SomeList.Add(new MyType()); - } - } - #endif - - - - This attribute is scheduled for refactoring. - - - - - If true, the add button will not be rendered in the title toolbar. You can use OnTitleBarGUI to implement your own add button. - - - true if [hide add button]; otherwise, false. - - - - - If true, the remove button will not be rendered on list items. You can use OnBeginListElementGUI and OnEndListElementGUI to implement your own remove button. - - - true if [hide remove button]; otherwise, false. - - - - - Specify the name of a member inside each list element which defines the label being drawn for each list element. - - - - - Override the default behaviour for adding objects to the list. - If the referenced member returns the list type element, it will be called once per selected object. - If the referenced method returns void, it will only be called once regardless of how many objects are selected. - - - - - Calls a method before each list element. The member referenced must have a return type of void, and an index parameter of type int which represents the element index being drawn. - - - - - Calls a method after each list element. The member referenced must have a return type of void, and an index parameter of type int which represents the element index being drawn. - - - - - If true, object/type pickers will never be shown when the list add button is clicked, and default(T) will always be added instantly instead, where T is the element type of the list. - - - - - Whether adding a new element should copy the last element. False by default. - - - - - A resolved string with "int index" and "Color defaultColor" parameters that lets you control the color of individual elements. - - - - - Override the default setting specified in the Advanced Odin Preferences window and explicitly tell whether paging should be enabled or not. - - - - - Override the default setting specified in the Advanced Odin Preferences window and explicitly tell whether items should be draggable or not. - - - - - Override the default setting specified in the Advanced Odin Preferences window and explicitly tells how many items each page should contain. - - - - - Mark a list as read-only. This removes all editing capabilities from the list such as Add, Drag and delete, - but without disabling GUI for each element drawn as otherwise would be the case if the was used. - - - - - Override the default setting specified in the Advanced Odin Preferences window and explicitly tell whether or not item count should be shown. - - - - - Override the default setting specified in the Advanced Odin Preferences window and explicitly tell whether or not the list should be expanded or collapsed by default. - - - - - If true, a label is drawn for each element which shows the index of the element. - - - - - Use this to inject custom GUI into the title-bar of the list. - - - - - Whether the Paging property is set. - - - - - Whether the ShowItemCount property is set. - - - - - Whether the NumberOfItemsPerPage property is set. - - - - - Whether the Draggable property is set. - - - - - Whether the IsReadOnly property is set. - - - - - Whether the Expanded property is set. - - - - - Whether the ShowIndexLabels property is set. - - - - - MaxValue is used on primitive fields. It caps value of the field to a maximum value. - Use this to define a maximum value for the field. - - - Note that this attribute only works in the editor! Values changed from scripting will not be capped at a maximum. - - - The following example shows a component where a speed value must be less than or equal to 200. - - public class Car : MonoBehaviour - { - // The speed of the car must be less than or equal to 200. - [MaxValue(200)] - public float Speed; - } - - - - The following example shows how MaxValue can be combined with . - - public class Health : MonoBehaviour - { - // The speed value must be between 0 and 200. - [MinValue(0), MaxValue(200)] - public float Speed; - } - - - - - - - The maximum value for the property. - - - - - The string with which to resolve a maximum value. This could be a field, property or method name, or an expression. - - - - - Sets a maximum value for the property in the inspector. - - The max value. - - - - Sets a maximum value for the property in the inspector. - - The string with which to resolve a maximum value. This could be a field, property or method name, or an expression. - - - - MinValue is used on primitive fields. It caps value of the field to a minimum value. - Use this to define a minimum value for the field. - - - Note that this attribute only works in the editor! Values changed from scripting will not be capped at a minimum. - - - The following example shows a player component that must have at least 1 life. - - public class Player : MonoBehaviour - { - // The life value must be set to at least 1. - [MinValue(1)] - public int Life; - } - - - - The following example shows how MinValue can be combined with - - public class Health : MonoBehaviour - { - // The health value must be between 0 and 100. - [MinValue(0), MaxValue(100)] - public float Health; - } - - - - - - - The minimum value for the property. - - - - - The string with which to resolve a minimum value. This could be a field, property or method name, or an expression. - - - - - Sets a minimum value for the property in the inspector. - - The minimum value. - - - - Sets a minimum value for the property in the inspector. - - The string with which to resolve a minimum value. This could be a field, property or method name, or an expression. - - - - MultiLineProperty is used on any string property. - Use this to allow users to edit strings in a multi line textbox. - - - MultiLineProperty is similar to Unity's but can be applied to both fields and properties. - - - The following example shows how MultiLineProperty is applied to properties. - - public class MyComponent : MonoBehaviour - { - [MultiLineProperty] - public string MyString; - - [ShowInInspector, MultiLineProperty(10)] - public string PropertyString; - } - - - - - - The number of lines for the text box. - - - - - Makes a multiline textbox for editing strings. - - The number of lines for the text box. - - - - PropertyTooltip is used on any property, and creates tooltips for when hovering the property in the inspector. - Use this to explain the purpose, or how to use a property. - - - This is similar to Unity's but can be applied to both fields and properties. - - - The following example shows how PropertyTooltip is applied to various properties. - - public class MyComponent : MonoBehaviour - { - [PropertyTooltip("This is an int property.")] - public int MyField; - - [ShowInInspector, PropertyTooltip("This is another int property.")] - public int MyProperty { get; set; } - } - - - - - - - - - - - The message shown in the tooltip. - - - - - Adds a tooltip to the property in the inspector. - - The message shown in the tooltip. - - - - ReadOnly is used on any property, and disabled the property from being changed in the inspector. - Use this for when you want to see the value of a property in the inspector, but don't want it to be changed. - - - This attribute only affects the inspector! Values can still be changed by script. - - - The following example shows how a field can be displayed in the editor, but not be editable. - - public class Health : MonoBehaviour - { - public int MaxHealth; - - [ReadOnly] - public int CurrentHealth; - } - - - - ReadOnly can also be combined with . - - public class Health : MonoBehaviour - { - public int MaxHealth; - - [ShowInInspector, ReadOnly] - private int currentHealth; - } - - - - - - - OnInspectorGUI is used on any property, and will call the specified function whenever the inspector code is running. - Use this to create custom inspector GUI for an object. - - - - - public MyComponent : MonoBehaviour - { - [OnInspectorGUI] - private void MyInspectorGUI() - { - GUILayout.Label("Label drawn from callback"); - } - } - - - - The following example shows how a callback can be set before another property. - - public MyComponent : MonoBehaviour - { - [OnInspectorGUI("MyInspectorGUI", false)] - public int MyField; - - private void MyInspectorGUI() - { - GUILayout.Label("Label before My Field property"); - } - } - - - - The following example shows how callbacks can be added both before and after a property. - - public MyComponent : MonoBehaviour - { - [OnInspectorGUI("GUIBefore", "GUIAfter")] - public int MyField; - - private void GUIBefore() - { - GUILayout.Label("Label before My Field property"); - } - - private void GUIAfter() - { - GUILayout.Label("Label after My Field property"); - } - } - - - - - - The resolved action string that defines the action to be invoked before the property is drawn, if any. - - - - - The resolved action string that defines the action to be invoked after the property is drawn, if any. - - - - - The name of the method to be called before the property is drawn, if any. Obsolete; use the Prepend member instead. - - - - - The name of the method to be called after the property is drawn, if any. Obsolete; use the Append member instead. - - - - - Calls a function decorated with this attribute, when the inspector is being drawn. - - - - - Adds callbacks to the specified action when the property is being drawn. - - The resolved action string that defines the action to be invoked. - If true the method will be called after the property has been drawn. Otherwise the method will be called before. - - - - Adds callbacks to the specified actions when the property is being drawn. - - The resolved action string that defines the action to be invoked before the property is drawn, if any. - The resolved action string that defines the action to be invoked after the property is drawn, if any. - - - - - OnValueChanged works on properties and fields, and calls the specified function - whenever the value has been changed via the inspector. - - - - Note that this attribute only works in the editor! Properties changed by script will not call the function. - - - The following example shows how OnValueChanged is used to provide a callback for a property. - - public class MyComponent : MonoBehaviour - { - [OnValueChanged("MyCallback")] - public int MyInt; - - private void MyCallback() - { - // .. - } - } - - - - The following example show how OnValueChanged can be used to get a component from a prefab property. - - public class MyComponent : MonoBehaviour - { - [OnValueChanged("OnPrefabChange")] - public GameObject MyPrefab; - - // RigidBody component of MyPrefab. - [SerializeField, HideInInspector] - private RigidBody myPrefabRigidbody; - - private void OnPrefabChange() - { - if(MyPrefab != null) - { - myPrefabRigidbody = MyPrefab.GetComponent<Rigidbody>(); - } - else - { - myPrefabRigidbody = null; - } - } - } - - - - - - Name of callback member function. Obsolete; use the Action member instead. - - - - - A resolved string that defines the action to perform when the value is changed, such as an expression or method invocation. - - - - - Whether to perform the action when a child value of the property is changed. - - - - - Whether to perform the action when an undo or redo event occurs via UnityEditor.Undo.undoRedoPerformed. True by default. - - - - - Whether to perform the action when the property is initialized. This will generally happen when the property is first viewed/queried (IE when the inspector is first opened, or when its containing foldout is first expanded, etc), and whenever its type or a parent type changes, or it is otherwise forced to rebuild. - - - - - Adds a callback for when the property's value is changed. - - A resolved string that defines the action to perform when the value is changed, such as an expression or method invocation. - Whether to perform the action when a child value of the property is changed. - - - - Attribute to derive from if you wish to create a new property group type, such as box groups or tab groups. - Note that this attribute has special behaviour for "combining" several attributes into one, as one group, - may be declared across attributes in several members, completely out of order. See . - - - All group attributes for a group with the same name (and of the same attribute type) are combined into a single representative group attribute using the method, which is called by the method. - This behaviour is a little unusual, but it is important that you understand it when creating groups with many custom parameters that may have to be combined. - - - This example shows how could be implemented. - - [AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)] - public class BoxGroupAttribute : PropertyGroupAttribute - { - public string Label { get; private set; } - public bool ShowLabel { get; private set; } - public bool CenterLabel { get; private set; } - - public BoxGroupAttribute(string group, bool showLabel = true, bool centerLabel = false, float order = 0) - : base(group, order) - { - this.Label = group; - this.ShowLabel = showLabel; - this.CenterLabel = centerLabel; - } - - protected override void CombineValuesWith(PropertyGroupAttribute other) - { - // The given attribute parameter is *guaranteed* to be of type BoxGroupAttribute. - var attr = other as BoxGroupAttribute; - - // If this attribute has no label, we the other group's label, thus preserving the label across combines. - if (this.Label == null) - { - this.Label = attr.Label; - } - - // Combine ShowLabel and CenterLabel parameters. - this.ShowLabel |= attr.ShowLabel; - this.CenterLabel |= attr.CenterLabel; - } - } - - - - - - - - - - - The ID used to grouping properties together. - - - - - The name of the group. This is the last part of the group ID if there is a path, otherwise it is just the group ID. - - - - - The order of the group. - - - - - Whether to hide the group by default when all its children are not visible. True by default. - - - - - If not null, this resolved string controls the group's visibility. Note that if is true, there must be *both* a visible child *and* this condition must be true, before the group is shown. - - - - - Whether to animate the visibility changes of this group or make the visual transition instantly. True by default. - - - - - Initializes a new instance of the class. - - The group identifier. - The group order. - - - - Initializes a new instance of the class. - - The group identifier. - - - - Combines this attribute with another attribute of the same type. - This method invokes the virtual method to invoke custom combine logic. - All group attributes are combined to one attribute used by a single OdinGroupDrawer. - Example: protected override void CombineValuesWith(PropertyGroupAttribute other) { this.Title = this.Title ?? (other as MyGroupAttribute).Title; } - - The attribute to combine with. - The instance that the method was invoked on. - The argument 'other' was null. - - Attributes to combine are not of the same type. - or - PropertyGroupAttributes to combine must have the same group id. - - - - - Override this method to add custom combine logic to your group attribute. This method determines how your group's parameters combine when spread across multiple attribute declarations in the same class. - Remember, in .NET, member order is not guaranteed, so you never know which order your attributes will be combined in. - - The attribute to combine with. This parameter is guaranteed to be of the correct attribute type. - - This example shows how attributes are combined. - - protected override void CombineValuesWith(PropertyGroupAttribute other) - { - // The given attribute parameter is *guaranteed* to be of type BoxGroupAttribute. - var attr = other as BoxGroupAttribute; - - // If this attribute has no label, we the other group's label, thus preserving the label across combines. - if (this.Label == null) - { - this.Label = attr.Label; - } - - // Combine ShowLabel and CenterLabel parameters. - this.ShowLabel |= attr.ShowLabel; - this.CenterLabel |= attr.CenterLabel; - } - - - - - - PropertyOrder is used on any property, and allows for ordering of properties. - Use this to define in which order your properties are shown. - - - Lower order values will be drawn before higher values. - There is unfortunately no way of ensuring that properties are in the same order, as they appear in your class. PropertyOrder overcomes this. - - - The following example shows how PropertyOrder is used to order properties in the inspector. - - public class MyComponent : MonoBehaviour - { - [PropertyOrder(1)] - public int MySecondProperty; - - [PropertyOrder(-1)] - public int MyFirstProperty; - } - - - - - - The order for the property. - - - - - Initializes a new instance of the class. - - - - - Defines a custom order for the property. - - The order for the property. - - - - Required is used on any object property, and draws a message in the inspector if the property is missing. - Use this to clearly mark fields as necessary to the object. - - - The following example shows different uses of the Required attribute. - - public class MyComponent : MonoBehaviour - { - [Required] - public GameObject MyPrefab; - - [Required(InfoMessageType.Warning)] - public Texture2D MyTexture; - - [Required("MyMesh is nessessary for this component.")] - public Mesh MyMesh; - - [Required("MyTransform might be important.", InfoMessageType.Info)] - public Transform MyTransform; } - + - + - The message of the info box. + Default message for invalid values. - + - The type of the info box. + OBSOLETE; use the Condition member instead. + A resolved string that should evaluate to a boolean value, and which should validate the input. Note that in expressions, the $value named parameter, and in methods, a parameter named value, can be used to get the validated value instead of referring to the value by its containing member. This makes it easier to reuse validation strings. - + - Adds an error box to the inspector, if the property is missing. + A resolved string that should evaluate to a boolean value, and which should validate the input. Note that in expressions, the $value named parameter, and in methods, a parameter named value, can be used to get the validated value instead of referring to the value by its containing member. This makes it easier to reuse validation strings. - + - Adds an info box to the inspector, if the property is missing. + The type of the message. - The message to display in the error box. - The type of info box to draw. - + - Adds an error box to the inspector, if the property is missing. + Whether to also trigger validation when changes to child values happen. This is true by default. - The message to display in the error box. - + - Adds an info box to the inspector, if the property is missing. + If true, the validation method will not only be executed when the User has changed the value. It'll run once every frame in the inspector. - The type of info box to draw. - + - SceneObjectsOnly is used on object properties, and restricts the property to scene objects, and not project assets. - Use this when you want to ensure an object is a scene object, and not from a project asset. + Initializes a new instance of the class. - - The following example shows a component with a game object property, that must be from a scene, and not a prefab asset. - - public MyComponent : MonoBehaviour - { - [SceneObjectsOnly] - public GameObject MyPrefab; - } - - - + A resolved string that should evaluate to a boolean value, and which should validate the input. Note that in expressions, the $value named parameter, and in methods, a parameter named value, can be used to get the validated value instead of referring to the value by its containing member. This makes it easier to reuse validation strings. + Default message for invalid values. + Type of the message. + + + + Obsolete. Rejecting invalid input is no longer supported. Use the other constructors instead. + + Obsolete overload. + Obsolete overload. + Obsolete overload. + Obsolete overload. @@ -4983,6 +5898,11 @@ Whether values selected by the value dropdown should be copies of the original or references (in the case of reference types). Defaults to true. + + + If this is set to true, the actual property value will *only* be changed *once*, when the selection in the dropdown is fully confirmed. + + Creates a dropdown menu for a property. @@ -5099,571 +6019,69 @@ The name of this item. - - - ShowInInspector is used on any member, and shows the value in the inspector. Note that the value being shown due to this attribute DOES NOT mean that the value is being serialized. - - - This can for example be combined with to allow for live debugging of values. - - - - The following example shows how ShowInInspector is used to show properties in the inspector, that otherwise wouldn't. - - public class MyComponent : MonoBehaviour - { - [ShowInInspector] - private int myField; - - [ShowInInspector] - public int MyProperty { get; set; } - } - - - - - - TabGroup is used on any property, and organizes properties into different tabs. - Use this to organize different value to make a clean and easy to use inspector. - - - Use groups to create multiple tab groups, each with multiple tabs and even sub tabs. - - - The following example shows how to create a tab group with two tabs. - - public class MyComponent : MonoBehaviour - { - [TabGroup("First")] - public int MyFirstInt; - - [TabGroup("First")] - public int AnotherInt; - - [TabGroup("Second")] - public int MySecondInt; - } - - - - The following example shows how multiple groups of tabs can be created. - - public class MyComponent : MonoBehaviour - { - [TabGroup("A", "FirstGroup")] - public int FirstGroupA; - - [TabGroup("B", "FirstGroup")] - public int FirstGroupB; - - // The second tab group has been configured to have constant height across all tabs. - [TabGroup("A", "SecondGroup", true)] - public int SecondgroupA; - - [TabGroup("B", "SecondGroup")] - public int SecondGroupB; - - [TabGroup("B", "SecondGroup")] - public int AnotherInt; - } - - - - This example demonstrates how multiple tabs groups can be combined to create tabs in tabs. - - public class MyComponent : MonoBehaviour - { - [TabGroup("ParentGroup", "First Tab")] - public int A; - - [TabGroup("ParentGroup", "Second Tab")] - public int B; - - // Specify 'First Tab' as a group, and another child group to the 'First Tab' group. - [TabGroup("ParentGroup/First Tab/InnerGroup", "Inside First Tab A")] - public int C; - - [TabGroup("ParentGroup/First Tab/InnerGroup", "Inside First Tab B")] - public int D; - - [TabGroup("ParentGroup/Second Tab/InnerGroup", "Inside Second Tab")] - public int E; - } - - - - - + - The default tab group name which is used when the single-parameter constructor is called. - - - - - Name of the tab. - - - - - Should this tab be the same height as the rest of the tab group. - - - - - If true, the content of each page will not be contained in any box. - - - - - If true, the tab group will be hidden if it only contains one tab. - - - - - Organizes the property into the specified tab in the default group. - Default group name is '_DefaultTabGroup' - - The tab. - if set to true [use fixed height]. - The order. - - - - Organizes the property into the specified tab in the specified group. - - The group to attach the tab to. - The name of the tab. - Set to true to have a constant height across the entire tab group. - The order of the group. - - - - Name of all tabs in this group. - - - - - Combines the tab group with another group. - - The other group. - - - - Not yet documented. - - Not yet documented. - - - - Not yet documented. - - Not yet documented. - - - - Title is used to make a bold header above a property. + VerticalGroup is used to gather properties together in a vertical group in the inspector. + This doesn't do much in and of itself, but in combination with other groups, such as it can be very useful. - The following example shows how Title is used on different properties. + The following example demonstrates how VerticalGroup can be used in conjunction with - public class TitleExamples : MonoBehaviour + public class MyComponent : MonoBehaviour { - [Title("Titles and Headers")] - [InfoBox( - "The Title attribute has the same purpose as Unity's Header attribute," + - "but it also supports properties, and methods." + - "\n\nTitle also offers more features such as subtitles, options for horizontal underline, bold text and text alignment." + - "\n\nBoth attributes, with Odin, supports either static strings, or refering to members strings by adding a $ in front.")] - public string MyTitle = "My Dynamic Title"; - public string MySubtitle = "My Dynamic Subtitle"; - - [Title("Static title")] - public int C; - public int D; - - [Title("Static title", "Static subtitle")] - public int E; - public int F; - - [Title("$MyTitle", "$MySubtitle")] - public int G; - public int H; - - [Title("Non bold title", "$MySubtitle", bold: false)] - public int I; - public int J; - - [Title("Non bold title", "With no line seperator", horizontalLine: false, bold: false)] - public int K; - public int L; - - [Title("$MyTitle", "$MySubtitle", TitleAlignments.Right)] - public int M; - public int N; - - [Title("$MyTitle", "$MySubtitle", TitleAlignments.Centered)] - public int O; - public int P; - - [Title("$Combined", titleAlignment: TitleAlignments.Centered)] - public int Q; - public int R; - - [ShowInInspector] - [Title("Title on a Property")] - public int S { get; set; } - - [Title("Title on a Method")] - [Button] - public void DoNothing() - { } - - public string Combined { get { return this.MyTitle + " - " + this.MySubtitle; } } + [HorizontalGroup("Split")] + [VerticalGroup("Split/Left")] + public Vector3 Vector; + + [VerticalGroup("Split/Left")] + public GameObject First; + + [VerticalGroup("Split/Left")] + public GameObject Second; + + [VerticalGroup("Split/Right", PaddingTop = 18f)] + public int A; + + [VerticalGroup("Split/Right")] + public int B; } - - + + + + + - + - The title displayed above the property in the inspector. + Space in pixels at the top of the group. - + - Optional subtitle. + Space in pixels at the bottom of the group. - + - If true the title will be displayed with a bold font. + Groups properties vertically. + The group ID. + The group order. - + - Gets a value indicating whether or not to draw a horizontal line below the title. + Groups properties vertically. + GroupId: _DefaultVerticalGroup + The group order. - + - Title alignment. + Combines properties that have been group vertically. - - - - Creates a title above any property in the inspector. - - The title displayed above the property in the inspector. - Optional subtitle - Title alignment - Horizontal line - If true the title will be drawn with a bold font. - - - - Toggle is used on any field or property, and allows to enable or disable the property in the inspector. - Use this to create a property that can be turned off or on. - - - Toggle does current not support any static members for toggling. - - - The following example shows how Toggle is used to create a toggleable property. - - public class MyComponent : MonoBehaviour - { - [Toggle("Enabled")] - public MyToggleable MyToggler = new MyToggleable(); - } - - public class MyToggleable - { - public bool Enabled; - - public int MyValue; - } - - - - - - - - Name of any bool field or property to enable or disable the object. - - - - - If true, all other open toggle groups will collapse once another one opens. - - - - - Create a togglable property in the inspector. - - Name of any bool field or property to enable or disable the object. - - - - ToggleGroup is used on any field, and create a toggleable group of options. - Use this to create options that can be enabled or disabled. - - - The functions as the ID for the ToggleGroup, and therefore all members of a toggle group must specify the same toggle member. - This attribute does not support static members! - - - The following example shows how ToggleGroup is used to create two separate toggleable groups. - - public class MyComponent : MonoBehaviour - { - // This attribute has a title specified for the group. The title only needs to be applied to a single attribute for a group. - [ToggleGroup("FirstToggle", order: -1, groupTitle: "First")] - public bool FirstToggle; - - [ToggleGroup("FirstToggle")] - public int MyInt; - - // This group specifies a member string as the title of the group. A property or a function can also be used. - [ToggleGroup("SecondToggle", titleStringMemberName: "SecondGroupTitle")] - public bool SecondToggle { get; set; } - - [ToggleGroup("SecondToggle")] - public float MyFloat; - - [HideInInspector] - public string SecondGroupTitle = "Second"; - } - - - - "/> - - - - Title of the toggle group in the inspector. - If null will be used instead. - - - - - If true, all other open toggle groups will collapse once another one opens. - - - - - Creates a ToggleGroup. See . - - Name of any bool field or property to enable or disable the ToggleGroup. - The order of the group. - Use this to name the group differently than toggleMemberName. - - - - Creates a ToggleGroup. See . - - Name of any bool field or property to enable or disable the ToggleGroup. - Use this to name the group differently than toggleMemberName. - - - - Obsolete constructor overload. - - Obsolete overload. - Obsolete overload. - Obsolete overload. - Obsolete overload. - - - - Name of any bool field, property or function to enable or disable the ToggleGroup. - - - - - Name of any string field, property or function, to title the toggle group in the inspector. - If null will be used instead. - - - - - Combines the ToggleGroup with another ToggleGroup. - - Another ToggleGroup. - - - - ValidateInput is used on any property, and allows to validate input from inspector. - Use this to enforce correct values. - - - ValidateInput refuses invalid values. - ValidateInput only works in the editor. Values changed through scripting will not be validated. - - - The following examples shows how a speed value can be forced to be above 0. - - public class MyComponent : MonoBehaviour - { - [ValidateInput("ValidateInput")] - public float Speed; - - // Specify custom output message and message type. - [ValidateInput("ValidateInput", "Health must be more than 0!", InfoMessageType.Warning)] - public float Health; - - private bool ValidateInput(float property) - { - return property > 0f; - } - } - - - - The following example shows how a static function could also be used. - - public class MyComponent : MonoBehaviour - { - [ValidateInput("StaticValidateFunction")] - public int MyInt; - - private static bool StaticValidateFunction(int property) - { - return property != 0; - } - } - - - - - - - - Default message for invalid values. - - - - - OBSOLETE; use the Condition member instead. - A resolved string that should evaluate to a boolean value, and which should validate the input. Note that in expressions, the $value named parameter, and in methods, a parameter named value, can be used to get the validated value instead of referring to the value by its containing member. This makes it easier to reuse validation strings. - - - - - A resolved string that should evaluate to a boolean value, and which should validate the input. Note that in expressions, the $value named parameter, and in methods, a parameter named value, can be used to get the validated value instead of referring to the value by its containing member. This makes it easier to reuse validation strings. - - - - - The type of the message. - - - - - Whether to also trigger validation when changes to child values happen. This is true by default. - - - - - If true, the validation method will not only be executed when the User has changed the value. It'll run once every frame in the inspector. - - - - - Initializes a new instance of the class. - - A resolved string that should evaluate to a boolean value, and which should validate the input. Note that in expressions, the $value named parameter, and in methods, a parameter named value, can be used to get the validated value instead of referring to the value by its containing member. This makes it easier to reuse validation strings. - Default message for invalid values. - Type of the message. - - - - Obsolete. Rejecting invalid input is no longer supported. Use the other constructors instead. - - Obsolete overload. - Obsolete overload. - Obsolete overload. - Obsolete overload. - - - - ShowIf is used on any property and can hide the property in the inspector. - Use this to hide irrelevant properties based on the current state of the object. - - - This example shows a component with fields hidden by the state of another field. - - public class MyComponent : MonoBehaviour - { - public bool ShowProperties; - - [ShowIf("showProperties")] - public int MyInt; - - [ShowIf("showProperties", false)] - public string MyString; - - public SomeEnum SomeEnumField; - - [ShowIf("SomeEnumField", SomeEnum.SomeEnumMember)] - public string SomeString; - } - - - - This example shows a component with a field that is hidden when the game object is inactive. - - public class MyComponent : MonoBehaviour - { - [ShowIf("MyVisibleFunction")] - public int MyHideableField; - - private bool MyVisibleFunction() - { - return this.gameObject.activeInHierarchy; - } - } - - - - - - - - - The name of a bool member field, property or method. Obsolete; use the Condition member instead. - - - - - A resolved string that defines the condition to check the value of, such as a member name or an expression. - - - - - The optional condition value. - - - - - Whether or not to slide the property in and out when the state changes. - - - - - Shows a property in the inspector, based on the value of a resolved string. - - A resolved string that defines the condition to check the value of, such as a member name or an expression. - Whether or not to slide the property in and out when the state changes. - - - - Shows a property in the inspector, if the resolved string evaluates to the specified value. - - A resolved string that defines the condition to check the value of, such as a member name or an expression. - Value to check against. - Whether or not to slide the property in and out when the state changes. + The group attribute to combine with. @@ -5702,6 +6120,74 @@ The lowest value for the property. The highest value for the property. + + + Not yet documented. + + + + + Not yet documented. + + + + + Various built-in button sizes. + + + + + Small button size, fits well with properties in the inspector. + + + + + A larger button. + + + + + A very large button. + + + + + A gigantic button. Twice as big as Large + + + + + Various display modes for the dictionary to draw its items. + + + + + Draws all dictionary items in two columns. The left column contains all key values, the right column displays all values. + + + + + Draws each dictionary item in a box with the key in the header and the value inside the box. + Whether or not the box is expanded or collapsed by default, is determined by the + "Expand Foldout By Default" setting found in the preferences window "Tools > Odin > Inspector > Preferences > Drawers > Settings". + + + + + Draws each dictionary item in a collapsed foldout with the key in the header and the value inside the box. + + + + + Draws each dictionary item in an expanded foldout with the key in the header and the value inside the box. + + + + + When this attribute is added is added to another attribute, then attributes from that attribute + will also be added to the property in the attribute processing step. + + Type of info message box. This enum matches Unity's MessageType enum which could not be used since it is located in the UnityEditor assembly. @@ -5727,5 +6213,229 @@ Error message box. + + + Editor modes for + + + + + + Draws only the editor GUI + + + + + Draws the editor GUI and the editor header. + + + + + Draws the editor GUI to the left, and a small editor preview to the right. + + + + + Draws a small editor preview without any GUI. + + + + + Draws a large editor preview without any GUI. + + + + + Draws the editor header and GUI to the left, and a small editor preview to the right. + + + + + How the InlineEditor attribute drawer should draw the object field. + + + + + Draws the object field in a box. + + + + + Draws the object field with a foldout. + + + + + Hides the object field unless it's null. + + + + + Hidden the object field also when the object is null. + + + + + Implement this interface to create custom matching + logic for search filtering in the inspector. + + + The following example shows how you might do this: + + public class MyCustomClass : ISearchFilterable + { + public bool SearchEnabled; + public string MyStr; + + public bool IsMatch(string searchString) + { + if (SearchEnabled) + { + return MyStr.Contains(searchString); + } + + return false; + } + } + + + + + + Any type implementing this interface will be considered to be validating itself using the implemented logic, as if a custom validator had been written for it. + + + + + Not yet documented. + + + + + Not yet documented. + + Not yet documented. + + + + Not yet documented. + + Not yet documented. + Not yet documented. + + + + How the square object field should be aligned. + + + + + + Left aligned. + + + + + Aligned to the center. + + + + + Right aligned. + + + + + The prefab kind returned by + + + + + None. + + + + + Instances of prefabs in scenes. + + + + + Instances of prefabs nested inside other prefabs. + + + + + Regular prefab assets. + + + + + Prefab variant assets. + + + + + Non-prefab component or gameobject instances in scenes. + + + + + Instances of regular prefabs, and prefab variants in scenes or nested in other prefabs. + + + + + Prefab assets and prefab variant assets. + + + + + Prefab Instances, as well as non-prefab instances. + + + + + All kinds + + + + + Options for filtering search. + + + + + Title alignment enum used by various attributes. + + + + + + + Title and subtitle left aligned. + + + + + Title and subtitle centered aligned. + + + + + Title and subtitle right aligned. + + + + + Title on the left, subtitle on the right. + + + + Specifies the types to include based on certain criteria. + + + Represents types that are not interfaces, abstracts, or generics. + diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.xml.meta b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.xml.meta index 69c0201..ba9d6b6 100644 --- a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.xml.meta +++ b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.xml.meta @@ -1,7 +1,6 @@ fileFormatVersion: 2 guid: 47a84ebde4ec47fabb620b30cc7a096f timeCreated: 1488828285 -licenseType: Store DefaultImporter: userData: assetBundleName: diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.dll b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.dll index 61cb544..8a16c89 100644 Binary files a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.dll and b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.dll differ diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.dll.meta b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.dll.meta index 5d439d6..57f5b0e 100644 --- a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.dll.meta +++ b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.dll.meta @@ -1,7 +1,6 @@ fileFormatVersion: 2 guid: a4865f1ab4504ed8a368670db22f409c timeCreated: 1488828285 -licenseType: Store PluginImporter: serializedVersion: 1 iconMap: {} diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.pdb b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.pdb new file mode 100644 index 0000000..2834971 Binary files /dev/null and b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.pdb differ diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.pdb.meta b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.pdb.meta new file mode 100644 index 0000000..16aa788 --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.pdb.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a4865f1ab4504ed8a368670db22f0a6f +timeCreated: 1488828285 +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.xml b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.xml index 451020d..7d29698 100644 --- a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.xml +++ b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.xml @@ -220,6 +220,200 @@ Remember to call UnityEditor.EditorUtility.SetDirty(ColorPaletteManager.Instance) after modifying the list. + + + Editor Only Mode Utility. + + + + + Gaither all necessary information about the editor only state. + + + + + Disables Editor Only Mode. + + + + + Enables editor only mode. + + + + + Checks to see whether Editor Only Mode is enabled. + + + + + Checks to see whether Odin Inspector is installed in Source Code mode. + + + + + Contains general configuration for all Odin drawers. + + You can modify the configuration in the Odin Preferences window found in 'Tools -> Odin Inspector -> Preferences -> Drawers -> General', + or by locating the configuration file stored as a serialized object in the Sirenix folder under 'Odin Inspector/Config/Editor/GeneralDrawerConfig'. + + + + + + Specify whether or not the script selector above components should be drawn. + + + + + Specify whether or not the script selector above components should be drawn. + + + + + Specify whether or not the warning for properties that do not support prefab modifications should be shown in the inspector. + + + + + Specify whether or not the warning for properties that do not support prefab modifications should be shown in the inspector. + + + + + Specifies the maximum depth to which a property can draw itself recursively before the system refuses to draw it any deeper. + + + + + If set to true, most foldouts throughout the inspector will be expanded by default. + + + + + If set to true, buttons will show the result values from invoking them in the inspector by default. + + + + + Specify the animation speed for most foldouts throughout the inspector. + + + + + Specify the shaking duration for most shaking animations throughout the inspector. + + + + + Specify the animation speed for + + + + + When true the component labels, for vector fields, will be hidden when the field is too narrow. + + + + + Specify how the Quaternion struct should be shown in the inspector. + + + + + Gets or sets a value indicating whether [use improved enum drop down]. + + + + + Gets or sets a value indicating whether [use improved enum drop down]. + + + + + Specify whether or not a list should hide the foldout triangle when the list is empty. + + + + + Specifies whether a list should hide the foldout triangle when the list is empty. + + + + + Specify whether or not lists should hide the paging buttons when the list is collapsed. + + + + + Specify whether or not lists should hide the paging buttons when there is only one page. + + + + + Specify the number of elements drawn per page. + + + + + Specify whether or not lists should be expanded or collapsed by default. + + + + + Specify whether or not to include a button which expands the list, showing all pages at once. + + + + + Specify whether or not lists should show item count. + + + + + Specify whether or not lists should show item count. + + + + + Specify the color of even list elements when in the dark skin. + + + + + Specify the color of odd list elements when in the dark skin. + + + + + Specify the color of even list elements when in the light skin. + + + + + Specify the color of odd list elements when in the light skin. + + + + + Gets or sets the default size of the preview object field. + + + + + Gets or sets the default alignment of the preview object field. + + + + + Gets or sets which types should be drawn by default by the preview object field. + + + + + Resets all settings to default. + + Configurations for Odin DLLs import settings. @@ -236,6 +430,195 @@ Gets a value indicating whether or not automatic configuration of Odin's DLL import settings is supported by the current Unity version. + + + + Tell Odin which types should be drawn or should not be drawn by Odin. + + + You can modify which types should be drawn by Odin in the Preferences window found in 'Tools -> Odin Inspector -> Preferences -> Editor Types', + or by locating the configuration file stored as a serialized object in the Sirenix folder under 'Odin Inspector/Config/Editor/InspectorConfig'. + + + + + + Whether Odin is enabled in the inspector or not. + + + + + InspectorDefaultEditors is a bitmask used to tell which types should have an Odin Editor generated. + + + + + The config which contains configuration data for which types Odin should draw in the inspector. + + + + + Updates Unity with the current Odin editor configuration. + + + + + InspectorDefaultEditors is a bitmask used to tell which types should have an Odin Editor generated. + + + + + + Excludes all types. + + + + + UserTypes includes all custom user scripts that are not located in an editor or plugin folder. + + + + + PluginTypes includes all types located in the plugins folder and are not located in an editor folder. + + + + + UnityTypes includes all types depended on UnityEngine and from UnityEngine, except editor, plugin and user types. + + + + + OtherTypes include all other types that are not depended on UnityEngine or UnityEditor. + + + + + Contains configuration data for which types Odin should draw in the inspector. + + + Note that this class supports assigning arbitrary editor types to inspect any Unity object type. The Editor Types GUI in preferences simply does not, as of now, support assigning editors of any other type than . However, the API is open to further customization. + When an editor is generated for a type, a new editor type is added to the GeneratedOdinEditors assembly, which is derived from the assigned editor type - in most cases, . + You can check if an editor is compatible using . + + . + . + + + + The type binder that the uses to bind types to names, and names to types. + This is usually an instance of . + + + + + Resets the drawing configuration to the default values. + + + + + Gets a list of all drawn types that have entries in the drawing config. + + + + + Forces the config's internal drawer type to value type lookup cache to rebuild itself. + + + + + Clears the editor type entry for the given drawer, so it will be set to Unity's default. + + The drawn type to clear the editor for. + drawnType is null + + + + Assigns a given editor to draw a given type. + + The drawn type to assign an editor type for. + The editor type to assign. When generating editors, a type derived from this editor will be created and set to draw the given drawn type. + drawnType + The type " + editorType.GetNiceName() + " is not a valid base editor for type " + drawnType.GetNiceName() + ". Check criteria using . + + + + Determines whether an editor value has been assigned for a given drawn type. + + The drawn type to check. + drawnType is null + + + + Gets which editor type would draw the given type. If the type has not been assigned a custom editor type in the config, the default editor type is returned using . + + The drawn type to get an editor type for. + The editor that would draw the given type. + drawnType is null + + + + Gets the default editor that this type would have, if no custom editor was set for this type in particular. This is calculated using the value of . + + The drawn type to get the default editor for. + The editor that would draw this type by default, or null, if there is no default Odin-defined editor for the drawn type. + drawnType is null + + + + Checks whether the given editor can be assigned to draw any type using the class. + + Type of the editor to check. + True if the editor is valid, otherwise false + + + + Checks whether the given editor can be assigned to draw a given type using the class. + This method checks the attribute on the type for whether the given type is compatible. + + Type of the editor to check. + Type of the drawn value to check. If this parameter is null, the drawn type is not checked for compatibility with the editor type; only the editor type itself is checked for validity. + True if the editor is valid, otherwise false + editorType + + + + Gets the type that an editor draws, by extracting it from the editor's attribute, if it is declared. + This method returns null for abstract editor types, as those can never draw anything. + + Type of the editor. + Whether the editor in question is also an editor for types derived from the given type. + + editorType + + + + A type that indicates that a drawer is missing. + + + + + Draws an instance, and contains methods getting all types that should be drawn by Odin. + Note that this class keeps a lot of static state, and is only intended to draw the instance of that exists in the singleton asset. If used to draw other instances, odd behaviour may occur. + + . + . + + + + Determines whether Odin is capable of creating a custom editor for a given type. + + + + + Gets an array of all assigned editor types, and the types they have to draw. + + + + + Draws the property. + + Installed Odin Inspector Version Info. @@ -256,6 +639,922 @@ Whether the current version of Odin is an enterprise version. + + + Contains information about an editor type which is assigned to draw a certain type in the inspector. + This class uses the instance to bind types to names, and names to types. + + . + . + . + + + + A default, empty value. + + + + + The name of the type to be drawn. + + + + + The name of the editor type. + + + + + Initializes a new instance of the struct. + + The drawn type. + drawnType is null + + + + Initializes a new instance of the struct. + + The drawn type. + The editor type. + drawnType is null + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Determines whether the specified , is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Implements the operator ==. + + The x. + The y. + + The result of the operator. + + + + + Implements the operator !=. + + The x. + The y. + + The result of the operator. + + + + + A contextual value attached to an , mapped to a key, contained in a . + + + + + The contained value. + + + + + Creates a new PropertyContext. + + + + + Performs an explicit conversion from to . + + The context. + + The result of the conversion. + + + + + Returns a that represents this instance, of the format ": Value.ToString()". + + + A that represents this instance. + + + + + Contains a context for an , which offers the ability to address persistent values by key across several editor GUI frames. + Use this in drawers to store contextual editor-only values such as the state of a foldout. + + + + + Initializes a new instance of the class. + + The property. + property + + + + Gets a global context value for a given key, using a given delegate to generate a default value if the context doesn't already exist. + Global contexts are not associated with any one specific drawer, and so are shared across all drawers for this property. + + The type of the context value to get. + The key of the context value to get. + A delegate for generating a default value. + The found context. + + + + Gets a global context value for a given key, using a given default value if the context doesn't already exist. + Global contexts are not associated with any one specific drawer, and so are shared across all drawers for this property. + + The type of the context value to get. + The key of the context value to get. + The default value to set if the context value doesn't exist yet. + The found context. + + + + Gets a global context value for a given key, and creates a new instance of as a default value if the context doesn't already exist. + Global contexts are not associated with any one specific drawer, and so are shared across all drawers for this property. + + The type of the context value to get. + The key of the context value to get. + The found context. + + + + Gets a object and creates a object for it. + + The type of the value of the context. + The instance of the drawer. + The key for the context. + The default value for the context. + + + + Gets a object and creates a object for it. + Returns true when the is first created. Otherwise false. + + The type of the value of the context. + The instance of the drawer. + The key for the context. + The object. + Returns true when the is first created. Otherwise false. + + + + Swaps context values with a given . + + The context to swap with. + + + + An can implement this interface to indicate that it defines right-click context menu items for properties that it draws. + + + + + Method that is invoked when a user has right-clicked a property, and the context menu is being built. The method is invoked in order of drawer priority. + + The property that has been right-clicked on. + The generic menu instance that is being built. Add items to this. + + + + A polymorphic alias for getting and setting the values of an . + + The type of the owner. + The type of the value. + The type of the property owner. + The type of the property value. + + + + Gets the type of the owner. + + + + + Gets the type of the value. + + + + + Whether the value is readonly. + + + + + Initializes a new instance of the class. + + The information. + info + + + + Gets the value from a given weakly typed owner. + + The weakly typed owner. + The found value. + + + + Gets the value from a given owner. + + The owner. + owner is null + + + + Sets the weakly typed value on a given weakly typed owner. + + The owner. + The value. + + + + Sets the value on a given owner. + + The owner. + The value. + + + + Responsible for getting and setting values on properties. + + The type of the owner. + The type of the value. + + + + + Whether the value is readonly. + + + + + Gets the type of the owner. + + + + + Gets the type of the value. + + + + + Initializes a new instance of the class. + + The field member to represent. + if set to true [is readonly]. + + + + Initializes a new instance of the class. + + The getter. + The setter. + getter + + + + Initializes a new instance of the class. + + The getter. + The setter. + getter + + + + Gets the value from a given owner. + + The owner. + The found value. + owner is null + + + + Gets the value from a given weakly typed owner. + + The weakly typed owner. + The found value. + + + + Sets the weakly typed value on a given weakly typed owner. + + The owner. + The value. + + + + Sets the value on a given owner. + + The owner. + The value. + + + + Contains meta-data information about a property in the inspector, that can be used to create an actual property instance. + + + + + The name of the property. + + + + + Gets a value indicating whether this InspectorPropertyInfo has any backing members. + + + + + Gets a value indicating whether this InspectorPropertyInfo has only a single backing member. + + + + + The member info of the property. If the property has many member infos, such as if it is a group property, the first member info of is returned. + + + + + Indicates which type of property it is. + + + + + The serialization backend for this property. + + + + + The type on which this property is declared. + + + + + The base type of the value which this property represents. If there is no value, this will be null. + + + + + Whether this property is editable or not. + + + + + All member infos of the property. There will only be more than one member if it is an . + + + + + The order value of this property. Properties are (by convention) ordered by ascending order, IE, lower order values are shown first in the inspector. The final actual ordering of properties is decided upon by the property resolver. + + + + + The attributes associated with this property. + + + + + Whether this property only exists as a Unity , and has no associated managed member to represent it. + This case requires some special one-off custom behaviour in a few places. + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Gets the first attribute of a given type on this property. + + + + + Gets the first attribute of a given type on this property, which is not contained in a given hashset. + + The attributes to exclude. + + + + Gets all attributes of a given type on the property. + + + + + The s of all the individual properties in this group. + + + + + Gets the property's method delegate, if there is one. Note that this is null if a method property is backed by an actual method member. + + + + + Gets all s for a given type. + + The parent property. + The type to get infos for. + if set to true members that are serialized by Odin will be included. + + + + Gets an aliased version of a member, with the declaring type name included in the member name, so that there are no conflicts with private fields and properties with the same name in different classes in the same inheritance hierarchy. + + + + + Represents a property in the inspector, and provides the hub for all functionality related to that property. + + + + + Gets the property which is the ultimate root of this property's serialization. + + + + + The name of the property. + + + + + The nice name of the property, usually as converted by . + + + + + The cached label of the property, usually containing . + + + + + The full Odin path of the property. To get the Unity property path, see . + + + + + The child index of this property. + + + + + Gets the resolver for this property's children. + + + + + The current recursive draw depth, incremented for each time that the property has caused itself to be drawn recursively. + Note that this is the current recursion level, not the total amount of recursions so far this frame. + + + + + The amount of times that the property has been drawn so far this frame. + + + + + How deep in the drawer chain the property currently is, in the current drawing session as determined by . + + + + + Whether this property supports having prefab modifications applied or not. + + + + + Gets an immutable list of the components attached to the property. + + + + + Gets an immutable list of processed attributes for the property. + + + + + Gets an array of the state updaters of the property. Don't change the contents of this array! + + + + + The value entry that represents the base value of this property. + + + + + The value entry that represents the strongly typed value of the property; this is possibly an alias entry in case of polymorphism. + + + + + The parent of the property. If null, this property is a root-level property in the . + + + + + The of this property. + + + + + The that this property exists in. + + + + + The children of this property. + + + + + The context container of this property. + + + + + The last rect that this property was drawn within. + + + + + The type on which this property is declared. This is the same as . + + + + + The parent values of this property, by selection index; this represents the values that 'own' this property, on which it is declared. + + + + + The full Unity property path of this property; note that this is merely a converted version of , and not necessarily a path to an actual Unity property. + In the case of Odin-serialized data, for example, no Unity properties will exist at this path. + + + + + The full path of this property as used by deep reflection, containing all the necessary information to find this property through reflection only. This is used as the path for prefab modifications. + + + + + The full path of this property as used by prefab modifications and the deep reflection system, containing all the necessary information to find this property through reflection only. + + + + + The PropertyState of the property at the current draw count index. + + + + + Gets the component of a given type on the property, or null if the property does not have a component of the given type. + + + + + Marks the property's serialization root values dirty if they are derived from UnityEngine.Object. + + + + + Records the property's serialization root for undo to prepare for undoable changes, with a custom string that includes the property path and Unity object name. If a message is specified, it is included in the custom undo string. + + + + + Gets the first attribute of a given type on this property. + + + + + Gets the first attribute of a given type on this property, which is not contained in a given hashset. + + The attributes to exclude. + + + + Gets all attributes of a given type on the property. + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Draws this property in the inspector. + + + + + Draws this property in the inspector with a given default label. This default label may be overridden by attributes on the drawn property. + + + + + Push a draw session. This is used by and . + + + + + Increments the current drawer chain index. This is used by . + + + + + Pop a draw session. This is used by and . + + + + + Gets the next property in the , or null if none is found. + + Whether to include children or not. + Whether to only include visible properties. + + + + Finds the first parent property that matches a given predicate. + + + + + Finds the first child recursively, that matches a given predicate. + + + + + Updates the property. This method resets the temporary context, and updates the value entry and the property children. + + If true, the property will update regardless of whether it has already updated for the current . + + + + Populates a generic menu with items from all drawers for this property that implement . + + + + + Determines whether this property is the child of another property in the hierarchy. + + The property to check whether this property is the child of. + other is null + + + + Determines whether this property is a parent of another property in the hierarchy. + + The property to check whether this property is the parent of. + other is null + + + + Handles all prefab modifications that apply to the targets of a property tree, if any. This class determines which properties have modifications, what the modifications are, auto-applies modifications if the current instance values do not correspond to the prefab values, and also provides an API for modifying those modifications. + NOTE: This class is liable to see a lot of changes, as the prefab modification system is slated to be redesigned for increased extendability in the future. Do not depend overly on the current API. + + + + + The prefabs for each prefab instance represented by the property tree, if any. + + + + + Whether any of the values the property tree represents are prefab instances. + + + + + A prefab tree for the prefabs of this property tree's prefab instances, if any exist. + + + + + Gets the Unity PropertyModification for the property at this path, if there are any. + + The property path to get the modification for. + The index of the tree target to get the modification for. + Whether any children of the path have modifications registered. + + + + + Gets the Odin prefab modification type of a given property, if any. + + The property to check. + + + The prefab modification type of the property if it has one, otherwise null. + + + + + Registers a modification of type for a given property. + + The property to register a modification for. + Selection index of the target to register a modification for. + The modified list length. + + Property " + property.Path + " does not have a value entry; cannot register prefab modification to this property. + or + newLength cannot be negative! + + + + + Registers a modification of type for a given property. + + The property to register a modification for. + Selection index of the target to register a modification for. + Whether to force the change to be registered immediately, rather than at the end of frame. + Property " + property.Path + " does not have a value entry; cannot register prefab modification to this property. + + + + Calculates a delta between the current dictionary property and its prefab counterpart, and registers that delta as a modification. + + The property to register a modification for. + Selection index of the target. + Property " + property.Path + " does not have a value entry; cannot register prefab modification to this property. + + + + Adds a remove key modification to the dictionary modifications of a given property. + + The property to register a modification for. + Selection index of the target. + The key to be removed. + Property " + property.Path + " does not have a value entry; cannot register prefab modification to this property. + + + + Adds an add key modification to the dictionary modifications of a given property. + + The property to register a modification for. + Selection index of the target. + The key to be added. + Property " + property.Path + " does not have a value entry; cannot register prefab modification to this property. + + + + Removes all dictionary modifications on a property for a given dictionary key value. + + The property to remove a key modification for. + Selection index of the target. + The key to remove modifications for. + key + + + + Removes all prefab modifications of a given type on a given property. + + The property to remove modifications for. + Selection index of the target. + Type of the modification to remove. + + + + Gets all prefab modifications in this property tree for a given selection index. + + + + + + + Represents the children of an . + + + + + The that this instance handles children for. + + + + + Gets a child by index. This is an alias for . + + The index of the child to get. + The child at the given index. + + + + Gets a child by name. This is an alias for . + + The name of the child to get. + The child, if a child was found; otherwise, null. + + + + Gets a child by name. This is an alias for . + + The name of the child to get. + The child, if a child was found; otherwise, null. + + + + Initializes a new instance of the class. + + The property to handle children for. + property is null + + + + The number of children on the property. + + + + + Updates this instance of . + + + + + Gets a child by name. + + The name of the child to get. + The child, if a child was found; otherwise, null. + name + + + + Gets a child by name. + + The name of the child to get. + The child, if a child was found; otherwise, null. + name + + + + Gets a child by index. + + The index of the child to get. + + The child at the given index. + + The given index was out of range. + + + + Gets the path of the child at a given index. + + The index to get the path of. + The path of the child at the given index. + The given index was out of range. + + + + Returns an IEnumerable that recursively yields all children of the property, depth first. + + + + + Gets the property's already created children. If the child count is less than or equal to 10000, children are returned in order. If the count is larger than 10000, they are returned in no particular order. + + + + + Gets the enumerator. + + + + + Gets the enumerator. + + This is a class for creating, getting and modifying a property's various states. An instance of this class always comes attached to an InspectorProperty. @@ -372,199 +1671,650 @@ Resets all states to their default values. Persistent states will be updated to their persistent cached value if one exists. - + - Contains information about a change that is going to occur/has occurred to a collection. - - - - - - Specifies the kinds of changes that can occur to collections. + Represents a set of values of the same type as a tree of properties that can be drawn in the inspector, and provides an array of utilities for querying the tree of properties. - + - Unknown collection change, the change was not specified by the invoking code. + Delegate for on property value changed callback. - + - The change is adding a value to the collection. Value and SelectionIndex will be set. + This will be replaced by an IMGUIDrawingComponent in patch 3.2. - + - The change is inserting a value into the collection. Index, Value and SelectionIndex will be set. + The component providers that create components for each property in the tree. If you change this list after the tree has been used, you should call tree.RootProperty.RefreshSetup() to make the changes update properly throughout the tree. - + - The change is removing a value from the collection. Value and SelectionIndex will be set. + The that this tree represents, if the tree was created for a . - + - The change is removing a value at an index from the collection. Index and SelectionIndex will be set. + The current update ID of the tree. This is incremented once, each update, and is used by to avoid updating multiple times in the same update round. - + - The change is clearing the collection. SelectionIndex will be set. + The type of the values that the property tree represents. - + - The change is removing a key from the collection. Key and SelectionIndex will be set. + The actual values that the property tree represents. - + - The change is setting the value of a key in the collection. Key, Value and SelectionIndex will be set. + The number of root properties in the tree. - + - Handles all prefab modifications that apply to the targets of a property tree, if any. This class determines which properties have modifications, what the modifications are, auto-applies modifications if the current instance values do not correspond to the prefab values, and also provides an API for modifying those modifications. - NOTE: This class is liable to see a lot of changes, as the prefab modification system is slated to be redesigned for increased extendability in the future. Do not depend overly on the current API. + The prefab modification handler of the tree. - + - The prefabs for each prefab instance represented by the property tree, if any. + Whether this property tree also represents members that are specially serialized by Odin. - + - Whether any of the values the property tree represents are prefab instances. + Gets a value indicating whether or not to draw the mono script object field at the top of the property tree. - + - A prefab tree for the prefabs of this property tree's prefab instances, if any exist. + Gets a value indicating whether or not the PropertyTree is inspecting a static type. - + - Gets the Unity PropertyModification for the property at this path, if there are any. + The serialization backend used to determine how to draw this property tree. Set this to control. - The property path to get the modification for. - The index of the tree target to get the modification for. - Whether any children of the path have modifications registered. - - + - Gets the Odin prefab modification type of a given property, if any. + Gets or sets the for the PropertyTree. - The property to check. - - - The prefab modification type of the property if it has one, otherwise null. - - + - Registers a modification of type for a given property. + Gets or sets the for the PropertyTree. - The property to register a modification for. - Selection index of the target to register a modification for. - The modified list length. + + + + Gets or sets the for the PropertyTree. + + + + + Gets or sets the for the PropertyTree. + + + + + An event that is invoked whenever an undo or a redo is performed in the inspector. + The advantage of using this event on a property tree instance instead of + is that this event will be desubscribed from + when the selection changes and the property + tree is no longer being used, allowing the GC to collect the property tree. + + + + + This event is invoked whenever the value of any property in the entire property tree is changed through the property system. + + + + + Creates a new for all target values of a . + + + + + Gets the root property of the tree. + + + + + Gets the secret root property of the tree, which hosts the property resolver used to resolve the "actual" root properties of the tree. + + + + + Registers that a given property is dirty and needs its changes to be applied at the end of the current frame. + + + + + Schedules a delegate to be invoked at the end of the current GUI frame. + + The action delegate to be delayed. + + + + Schedules a delegate to be invoked at the end of the next Repaint GUI frame. + + The action to be delayed. + + + + Enumerates over the properties of the tree. + + Whether to include children of the root properties or not. If set to true, every property in the entire tree will be enumerated. + Whether to only include visible properties. Properties whose parents are invisible are considered invisible. + + + + Gets the property at the given path. Note that this is the path found in , not the Unity path. + + The path of the property to get. + + + + Gets the property at the given path. Note that this is the path found in , not the Unity path. + + The path of the property to get. + + + + + Gets the property at the given Unity path. + + The Unity path of the property to get. + + + + Gets the property at the given Unity path. + + The Unity path of the property to get. + + + + + Gets the property at the given deep reflection path. + + The deep reflection path of the property to get. + + + + Gets the property at the given Odin prefab modification path. + + The prefab modification path of the property to get. + + + + Gets the property at the given Odin prefab modification path. + + The prefab modification path of the property to get. + + + + + Draw the property tree, and handles management of undo, as well as marking scenes and drawn assets dirty. + + This is a shorthand for calling + , + and . + . + + + + + + Draws a search bar for the property tree, and draws the search results if the search bar is used. + If this method returns true, the property tree should generally not be drawn normally afterwards. + Note that this method will throw exceptions if the property tree is not set up to be searchable; for that, see . + + True if the property tree is being searched and is currently drawing its search results, otherwise false. + + + + Gets a Unity property for the given Odin or Unity path. If there is no for this property tree, or no such property is found in the , a property will be emitted using . + + The Odin or Unity path to the property to get. + + + + Gets a Unity property for the given Odin or Unity path. If there is no for this property tree, or no such property is found in the , a property will be emitted using . + + The Odin or Unity path to the property to get. + The backing field of the Unity property. + + + + Checks whether a given object instance is referenced anywhere in the tree, and if it is, gives the path of the first time the object reference was encountered as an out parameter. + + The reference value to check. + The first found path of the object. + + + + Gets the number of references to a given object instance in this tree. + + + + + Updates all properties in the entire tree, and validates the prefab state of the tree, if applicable. + + + + + Replaces all occurrences of a value with another value, in the entire tree. + + The value to find all instances of. + The value to replace the found values with. + + + + Gets the root tree property at a given index. + + The index of the property to get. + + + + Invokes the actions that have been delayed using and . + + + + + Applies all changes made with properties to the inspected target tree values, and marks all changed Unity objects dirty. + + true if any values were changed, otherwise false + + + + Invokes the OnValidate method on the property tree's targets if they are derived from and have the method defined. + + + + + Registers an object reference to a given path; this is used to ensure that objects are always registered after having been encountered once. + + The referenced object. + The property that contains the reference. + + + + Creates a PropertyTree to inspect the static values of the given type. + + The type to inspect. + A PropertyTree instance for inspecting the type. + + + + Creates a new for a given target value. + + The target to create a tree for. + target is null + + + + Creates a new for a given target value. + + The target to create a tree for. + The serialization backend to use for the tree root. + target is null + + + + Creates a new for a set of given target values. + Note that the targets all need to be of the same type. + + The targets to create a tree for. + targets is null + + + + Creates a new for all target values of a . + + The serialized object to create a tree for. + serializedObject is null + + + + Creates a new for all target values of a . + + The serialized object to create a tree for. + serializedObject is null + The serialization backend to use for the tree root. + + + + Creates a new for a set of given target values. + Note that the targets all need to be of the same type. + + The targets to create a tree for. + + + + Creates a new for a set of given target values. + Note that the targets all need to be of the same type. + + The targets to create a tree for. + The serialization backend to use for the tree root. + + + + Creates a new for a set of given target values, represented by a given . + Note that the targets all need to be of the same type. + + The targets to create a tree for. + The serialized object to create a tree for. Note that the target values of the given must be the same values given in the targets parameter. + + + + Creates a new for a set of given target values, represented by a given . + Note that the targets all need to be of the same type. + + The targets to create a tree for. + The serialized object to create a tree for. Note that the target values of the given must be the same values given in the targets parameter. + The serialization backend to use for the tree root. + + + + Sets whether the property tree should be searchable or not, and allows the passing in of a custom SearchableAttribute instance to configure the search. + + Whether the tree should be set to be searchable or not. + If the tree is set to be searchable, then if this parameter is not null, it will be used to configure the property tree search. If the parameter is null, the SearchableAttribute on the tree's will be used. If that property has no such attribute, then default search settings will be applied. + + + + Represents a set of strongly typed values as a tree of properties that can be drawn in the inspector, and provides an array of utilities for querying the tree of properties. + This class also handles management of prefab modifications. + + + + + Gets the root property of the tree. + + + + + Gets the secret root property of the PropertyTree. + + + + + Gets the for the PropertyTree. + + + + + The current update ID of the tree. This is incremented once, each update, and is used by to avoid updating multiple times in the same update round. + + + + + The that this tree represents, if the tree was created for a . + + + + + The type of the values that the property tree represents. + + + + + The strongly types actual values that the property tree represents. + + + + + The weakly types actual values that the property tree represents. + + + + + The number of root properties in the tree. + + + + + Whether this property tree also represents members that are specially serialized by Odin. + + + + + Initializes a new instance of the class, inspecting only the target () type's static members. + + + + + Initializes a new instance of the class. + + The serialized object to represent. + + + + Initializes a new instance of the class. + + The targets to represent. + + + + Initializes a new instance of the class. + + The targets to represent. + The serialized object to represent. Note that the target values of the given must be the same values given in the targets parameter. + targets is null - Property " + property.Path + " does not have a value entry; cannot register prefab modification to this property. + There must be at least one target. or - newLength cannot be negative! + A given target is a null value. - + - Registers a modification of type for a given property. + Initializes a new instance of the class. - The property to register a modification for. - Selection index of the target to register a modification for. - Whether to force the change to be registered immediately, rather than at the end of frame. - Property " + property.Path + " does not have a value entry; cannot register prefab modification to this property. + The targets to represent. + The serialized object to represent. Note that the target values of the given must be the same values given in the targets parameter. + The serialization backend to use for the tree root. + targets is null + + There must be at least one target. + or + A given target is a null value. + - + - Calculates a delta between the current dictionary property and its prefab counterpart, and registers that delta as a modification. + Applies all changes made with properties to the inspected target tree values. - The property to register a modification for. - Selection index of the target. - Property " + property.Path + " does not have a value entry; cannot register prefab modification to this property. + + true if any values were changed, otherwise false + - + - Adds a remove key modification to the dictionary modifications of a given property. + Registers that a given property is dirty and needs its changes to be applied at the end of the current frame. - The property to register a modification for. - Selection index of the target. - The key to be removed. - Property " + property.Path + " does not have a value entry; cannot register prefab modification to this property. + + - + - Adds an add key modification to the dictionary modifications of a given property. - - The property to register a modification for. - Selection index of the target. - The key to be added. - Property " + property.Path + " does not have a value entry; cannot register prefab modification to this property. - - - - Removes all dictionary modifications on a property for a given dictionary key value. - - The property to remove a key modification for. - Selection index of the target. - The key to remove modifications for. - key - - - - Removes all prefab modifications of a given type on a given property. - - The property to remove modifications for. - Selection index of the target. - Type of the modification to remove. - - - - Gets all prefab modifications in this property tree for a given selection index. - - - - - - - Default implementation and the version that will be used when no other OdinAttributeProcessorLocator instance have been given to a PropertyTree. - This implementation will find all AttributeProcessor definitions not marked with the . + Updates all properties in the entire tree, and validates the prefab state of the tree, if applicable. - + - Singleton instance of the DefaultOdinAttributeProcessorLocator class. + Checks whether a given object instance is referenced anywhere in the tree, and if it is, gives the path of the first time the object reference was encountered as an out parameter. + + The reference value to check. + The first found path of the object. + + + + Gets the number of references to a given object instance in this tree. + + + + + + Gets the property at the given path. Note that this is the path found in , not the Unity path. + + The path of the property to get. + + + + Gets the property at the given path. Note that this is the path found in , not the Unity path. + + The path of the property to get. + + + + + Finds the property at the specified unity path. + + The unity path for the property. + The property found at the path. + + + + Finds the property at the specified unity path. + + The unity path for the property. + + The property found at the path. + + + + Finds the property at the specified modification path. + + The prefab modification path for the property. + The property found at the path. + + + + Finds the property at the specified modification path. + + The prefab modification path for the property. + + The property found at the path. + + + + Gets a Unity property for the given Odin or Unity path. If there is no for this property tree, or no such property is found in the , a property will be emitted using . + + The Odin or Unity path to the property to get. + The backing field of the Unity property. + + + + Enumerates over the properties of the tree. WARNING: For tree that have large targets with lots of data, this may involve massive amounts of work as the full tree structure is resolved. USE THIS METHOD SPARINGLY AND ONLY WHEN ABSOLUTELY NECESSARY! + + Whether to include children of the root properties or not. If set to true, every property in the entire tree will be enumerated. + /// Whether to only include visible properties. Properties whose parents are invisible are considered invisible. + + + + Replaces all occurrences of a value with another value, in the entire tree. + + The value to find all instances of. + The value to replace the found values with. + + The value to replace with must either be null or be the same type as the value to replace (" + from.GetType().Name + "). + + + + Gets the root tree property at a given index. + + The index of the property to get. + + + + Schedules a delegate to be invoked at the end of the current GUI frame. + + The action delegate to be delayed. + action + + + + Schedules a delegate to be invoked at the end of the next Repaint GUI frame. + + The action to be delayed. + action + + + + Invokes the actions that have been delayed using and . - + - Type search index used for matching to properties. + Enumeration describing the different types of properties that exist. - + - Gets a list of to process attributes for the specified child member of the parent property. + Property represents a value. - The parent of the member. - Child member of the parent property. - List of to process attributes for the specified member. - + - Gets a list of to process attributes for the specified property. + Property represents a method. + + + + + Property represents a named group of properties. + + + + + Enumeration for designating whether a has a special state,. + + + + + The value entry has no special state. + + + + + The property is a reference to another property. Get the path of the referenced property from . + + + + + The value entry is a null value. + + + + + The value entry has a primitive value conflict across selected indices. + A primitive value conflict is when primitive values, such a strings or floats, differ. + + + + + The value entry has a reference value conflict across selected indices. + A reference value conflict is when the types of reference type values differ, or when some values are null while others are not. + + + + + The value entry has a reference path conflict across selected indices. + A reference path conflict is when the property consists of references to many conflicting paths. Use to get paths to all referenced objects. + + + + + The value entry has a collection length conflict across selected indices. + A collection length conflict is when the property represents multiple parallel collections, and their lengths differ. - The property to find attribute porcessors for. - List of to process attributes for the speicied member. @@ -648,27 +2398,6 @@ Attribute processor that can add, change and remove attributes from a property. - - - Base class definition for OdinAttributeProcessorLocator. Responsible for finding and creating instances to process attributes for properties. - Default OdinAttributeProcessorLocator have been implemented as . - - - - - Gets a list of to process attributes for the specified child member of the parent property. - - The parent of the member. - Child member of the parent property. - List of to process attributes for the specified member. - - - - Gets a list of to process attributes for the specified property. - - The property to find attribute porcessors for. - List of to process attributes for the speicied member. - Find attributes attached to the type definition of a property and adds to them to attribute list. @@ -696,6 +2425,37 @@ The property to process. The list of attributes for the property. + + + Default implementation and the version that will be used when no other OdinAttributeProcessorLocator instance have been given to a PropertyTree. + This implementation will find all AttributeProcessor definitions not marked with the . + + + + + Singleton instance of the DefaultOdinAttributeProcessorLocator class. + + + + + Type search index used for matching to properties. + + + + + Gets a list of to process attributes for the specified child member of the parent property. + + The parent of the member. + Child member of the parent property. + List of to process attributes for the specified member. + + + + Gets a list of to process attributes for the specified property. + + The property to find attribute porcessors for. + List of to process attributes for the speicied member. + Default implementation and the version that will be used by if no other instance have been specified. @@ -713,6 +2473,27 @@ The property to get an instance for. An instance of to resolver the specified property. + + + Base class definition for OdinAttributeProcessorLocator. Responsible for finding and creating instances to process attributes for properties. + Default OdinAttributeProcessorLocator have been implemented as . + + + + + Gets a list of to process attributes for the specified child member of the parent property. + + The parent of the member. + Child member of the parent property. + List of to process attributes for the specified member. + + + + Gets a list of to process attributes for the specified property. + + The property to find attribute porcessors for. + List of to process attributes for the speicied member. + Base class for locator of . Use for default implementation. @@ -732,92 +2513,103 @@ For now, it only exists to denote which internally defined resolvers support prefab modifications being set. - + - Responsible for getting and setting values on properties. + Contains information about a change that is going to occur/has occurred to a collection. - The type of the owner. - The type of the value. - + - + - Whether the value is readonly. + Specifies the kinds of changes that can occur to collections. - + - Gets the type of the owner. + Unknown collection change, the change was not specified by the invoking code. - + - Gets the type of the value. + The change is adding a value to the collection. Value and SelectionIndex will be set. - + - Initializes a new instance of the class. + The change is inserting a value into the collection. Index, Value and SelectionIndex will be set. - The field member to represent. - if set to true [is readonly]. - + - Initializes a new instance of the class. + The change is removing a value from the collection. Value and SelectionIndex will be set. - The getter. - The setter. - getter - + - Initializes a new instance of the class. + The change is removing a value at an index from the collection. Index and SelectionIndex will be set. - The getter. - The setter. - getter - + - Gets the value from a given owner. + The change is clearing the collection. SelectionIndex will be set. - The owner. - The found value. - owner is null - + - Gets the value from a given weakly typed owner. + The change is removing a key from the collection. Key and SelectionIndex will be set. - The weakly typed owner. - The found value. - + - Sets the weakly typed value on a given weakly typed owner. + The change is setting the value of a key in the collection. Key, Value and SelectionIndex will be set. - The owner. - The value. - + - Sets the value on a given owner. + Class that describes the different possible serialization backends that a property can have, + and specifies the capabilities of each backend. - The owner. - The value. - + - Gets all s for a given type. + The property is serialized by Unity's polymorphic serialization backend via the [SerializeReference] attribute. Polymorphism, null values and cyclical references are supported. - The parent property. - The type to get infos for. - if set to true members that are serialized by Odin will be included. - + - Gets an aliased version of a member, with the declaring type name included in the member name, so that there are no conflicts with private fields and properties with the same name in different classes in the same inheritance hierarchy. + The property is serialized by Unity's classic serialization backend. Polymorphism, null values and types such as are not supported. + + + + + The property is serialized by Odin. Polymorphism, null values and types such as are supported. + + + + + The property is not serialized by anything - possibly because it is a method, possibly because it is a field or property shown in the inspector without being serialized. + In the case of fields or properties, polymorphism, null values and types such as are supported, but will not be saved. + + + + + The property is not serialized by anything - possibly because it is a method, possibly because it is a field or property shown in the inspector without being serialized. + In the case of fields or properties, polymorphism, null values and types such as are supported, but will not be saved. + + + + + The property is serialized by Unity's classic serialization backend. Polymorphism, null values and types such as are not supported. + + + + + The property is serialized by Unity's polymorphic serialization backend via the [SerializeReference] attribute. Polymorphism, null values and cyclical references are supported. + + + + + The property is serialized by Odin. Polymorphism, null values and types such as are supported. @@ -835,6 +2627,1329 @@ Gets the strongly typed ValueEntry of the OdinValueStateUpdater's property. + + + Represents a weakly typed collection of values for a - one value per selected inspector target. + + + + + Whether the values have been changed since was last called. + + + + + Marks the value collection as being clean again. This is typically called at the end of the current GUI frame, during . + + + + + Marks the value collection as being dirty, regardless of any value changes. + + + + + Reverts the value collection to its origin values (found in ) from the last call, and marks the value collection as being clean again. + + + + + Force sets the value, ignoring whether it is editable or not. + Note that this will fail on list element value entries where is true on the parent value entry. + + The selection index of the value. + The value to be set. + + + + The original values of the value collection, such as they were immediately after the last call. + + + + + Represents a strongly typed collection of values for a - one value per selected inspector target. + + + + + Gets the value at the given selection index. + + + + + The number of values in the collection. + + + + + The original values of the value collection, such as they were immediately after the last call. + + + + + Force sets the value, ignoring whether it is editable or not. + Note that this will fail on list element value entries where is true on the parent value entry. + + The selection index of the value. + The value to be set. + + + + Represents the values of an , and contains utilities for querying the values' type and getting and setting them. + + + + + The number of parallel values this entry represents. This will always be exactly equal to the count of . + + + + + Whether this value entry is editable or not. + + + + + If this value entry has the override type , this is the path of the property it references. + + + + + The actual serialization backend for this value entry, possibly inherited from the serialization backend of the root property this entry is a child of. + Note that this is *not* always equal to . + + + + + The property whose values this value entry represents. + + + + + Provides access to the weakly typed values of this value entry. + + + + + Whether this value entry has been changed from its prefab counterpart. + + + + + Whether this value entry has had its list length changed from its prefab counterpart. + + + + + Whether this value entry has had its dictionary values changes from its prefab counterpart. + + + + + A weakly typed smart value that represents the first element of the value entry's value collection, but has "smart logic" for setting the value that detects relevant changes and applies them in parallel. + This lets you often just use the smart value instead of having to deal with the tedium of multiple parallel values. + + + + + The type from which this value entry comes. If this value entry represents a member value, this is the declaring type of the member. If the value entry represents a collection element, this is the type of the collection. + + + + + The most precise known contained type of the value entry. If polymorphism is in effect, this will be some type derived from . + + + + + The base type of the value entry. If this is value entry represents a member value, this is the type of the member. If the value entry represents a collection element, this is the element type of the collection. + + + + + The special state of the value entry. + + + + + Whether this value entry is an alias, or not. Value entry aliases are used to provide strongly typed value entries in the case of polymorphism. + + + + + The context container of this property. + + + + + Whether this type is marked as an atomic type using a . + + + + + An event that is invoked during , when any values have changed. + + + + + An event that is invoked during , when any child values have changed. + + + + + Updates the values contained in this value entry to the actual values in the target objects, and updates its state (override, type of value, etc.) accordingly. + + + + + Applies the changes made to this value entry to the target objects, and registers prefab modifications as necessary. + + True if any changes were made, otherwise, false. + + + + Checks whether the values in this value entry are equal to the values in another value entry. + Note, both value entries must have the same value type, and must represent values that are .NET value types. + + + + + Determines whether the value at the given selection index is different from the given prefab value, as is relevant for prefab modification checks. + If the value is a reference type, null and type difference is checked. If value is a value type, a comparer from is used. + This method is best ignored unless you know what you are doing. + + The value to check differences against. + The selection index to compare against. + + + + Represents the strongly typed values of an , and contains utilities for querying the values' type and getting and setting them. + + + + + Provides access to the strongly typed values of this value entry. + + + + + A strongly typed smart value that represents the first element of the value entry's value collection, but has "smart logic" for setting the value that detects relevant changes and applies them in parallel. + This lets you often just use the smart value instead of having to deal with the tedium of multiple parallel values. + + + + + Determines whether the value at the given selection index is different from the given prefab value, as is relevant for prefab modification checks. + If the value is a reference type, null and type difference is checked. If value is a value type, a comparer from is used. + This method is best ignored unless you know what you are doing. + + The value to check differences against. + The selection index to compare against. + + + + An internally used interface that is used by value entries during , that lets value entries force each other to set values directly to their target objects. + This interface should not be used by people who do not know what they are doing. + + + + + Sets the actual value of a value entry, for a given selection index. + + + + + An internally used interface that is used by value entries during , that lets value entries force each other to set values directly to their target objects. + This interface should not be used by people who do not know what they are doing. + + + + + Sets the actual value of a value entry, for a given selection index. + + + + + Represents a weakly typed collection of values for a - one value per selected inspector target. + + + + + The property whose values are represented. + + + + + Initializes a new instance of the class. + + The property to represent. + property is null + + + + Whether the values have been changed since was last called. + + + + + The number of values in the collection. + + + + + Gets a value indicating whether this instance is synchronized. + + + true if this instance is synchronized; otherwise, false. + + + + + Gets the synchronization root object. + + + The synchronization root object. + + + + + The original values of the (loosely typed) value collection, such as they were immediately after the last call. + + + + + Gets or sets the weakly typed at the specified index. + + + The value. + + The index to set. + + + + Gets an enumerator for the collection. + + + + + Marks the value collection as being clean again. This is typically called at the end of the current GUI frame, during . + + + + + Reverts the value collection to its origin values (found in ) from the last call, and marks the value collection as being clean again. + + + + + Determines whether the collection contains the specified value. + + The value. + + true if the collection contains the specified value; otherwise, false. + + + + + Copies the collection to an array. + + The array to copy to. + The index to copy from. + + + + Gets the index of the given value, or -1 if the value was not found. + + The value to get the index of. + The index of the given value, or -1 if the value was not found. + + + + Gets the weakly typed value at the given index. + + The index of the value to get. + The weakly typed value at the given index + + + + Sets the weakly typed value at the given index. + + The index to set the value of. + The value to set. + + + + Force sets the value, ignoring whether it is editable or not. + Note that this will fail on list element value entries where is true on the parent value entry. + + The selection index of the value. + The value to be set. + + + + Marks the value collection as being dirty, regardless of any value changes. + + + + + Represents a strongly typed collection of values for a - one value per selected inspector target. + + The element type of the collection. + + + + + Initializes a new instance of the class. + + The property. + The internal array. + The original array. + The internal atom array. + The original atom array. + + + + Whether the values have been changed since was last called. + + + + + The number of values in the collection. + + + + + Gets a value indicating whether this instance is synchronized. + + + true if this instance is synchronized; otherwise, false. + + + + + Gets the synchronization root object. + + + The synchronization root object. + + + + + The original values of the (loosely typed) value collection, such as they were immediately after the last call. + + + + + Gets or sets the at the specified index. + + + The . + + The index. + + + + + Gets an enumerator for the collection. + + + + + Marks the value collection as being clean again. This is typically called at the end of the current GUI frame, during . + + + + + Reverts the value collection to its origin values (found in ) from the last call, and marks the value collection as being clean again. + + + + + Copies the collection to an array. + + The array to copy to. + The index to copy from. + + + + Gets the weakly typed value at the given index. + + The index of the value to get. + + The weakly typed value at the given index + + + + + Sets the weakly typed value at the given index. + + The index to set the value of. + The value to set. + + + + Determines whether the collection contains the specified value. + + The value. + + true if the collection contains the specified value; otherwise, false. + + + + + Gets the index of the given value, or -1 if the value was not found. + + The value to get the index of. + + The index of the given value, or -1 if the value was not found. + + + + + Force sets the value, ignoring whether it is editable or not. + Note that this will fail on list element value entries where is true on the parent value entry. + + The selection index of the value. + The value to be set. + + + + Force sets the value, ignoring whether it is editable or not. + Note that this will fail on list element value entries where is true on the parent value entry. + + The selection index of the value. + The value to be set. + + + + + Marks the value collection as being dirty, regardless of any value changes. + + + + + Represents an alias for a strongly typed collection of values for a - one value per selected inspector target. + This class ensures that polymorphism works in the inspector, and can be strongly typed in applicable cases. + + The type of the aliased collection. + The polymorphic type of this collection, which is assignable to . + + + + + + Initializes a new instance of the class. + + The property. + The aliased collection. + Not yet documented. + Not yet documented. + aliasedCollection + + + + Whether the values have been changed since was last called. + + + + + The number of values in the collection. + + + + + Gets a value indicating whether this instance is synchronized. + + + true if this instance is synchronized; otherwise, false. + + + + + Gets the synchronization root object. + + + The synchronization root object. + + + + + The original values of the (loosely typed) value collection, such as they were immediately after the last call. + + + + + The original values of the value collection, such as they were immediately after the last call. + + + + + Gets or sets the at the specified index. + + + The . + + The index. + + + + + Gets an enumerator for the collection. + + + + + + Marks the value collection as being clean again. This is typically called at the end of the current GUI frame, during . + + + + + Reverts the value collection to its origin values (found in ) from the last call, and marks the value collection as being clean again. + + + + + Determines whether the collection contains the specified value. + + The value. + + true if the collection contains the specified value; otherwise, false. + + + + + Gets the index of the given value, or -1 if the value was not found. + + The value to get the index of. + + The index of the given value, or -1 if the value was not found. + + + + + Copies the collection to an array. + + The array to copy to. + The index to copy from. + + + + Gets the weakly typed value at the given index. + + The index of the value to get. + + The weakly typed value at the given index + + + + + Sets the weakly typed value at the given index. + + The index to set the value of. + The value to set. + + + + Force sets the value, ignoring whether it is editable or not. + Note that this will fail on list element value entries where is true on the parent value entry. + + The selection index of the value. + The value to be set. + + + + Force sets the value, ignoring whether it is editable or not. + Note that this will fail on list element value entries where is true on the parent value entry. + + The selection index of the value. + The value to be set. + + + + Marks the value collection as being dirty, regardless of any value changes. + + + + + Represents the values of an , and contains utilities for querying the values' type and getting and setting them. + + + + + + Delegate type used for the events and . + + + + + The nearest parent property that has a value. + That is, the property from which this value + entry will fetch its parentvalues from in order + to extract its own values. + + If is null, this is a root property. + + + + + Whether this value entry represents a boxed value type. + + + + + The number of parallel values this entry represents. This will always be exactly equal to the count of . + + + + + Whether this value entry is editable or not. + + + + + If this value entry has the override type , this is the path of the property it references. + + + + + The actual serialization backend for this value entry, possibly inherited from the serialization backend of the root property this entry is a child of. + Note that this is *not* always equal to . + + + + + The property whose values this value entry represents. + + + + + Provides access to the weakly typed values of this value entry. + + + + + Whether this value entry has been changed from its prefab counterpart. + + + + + Whether this value entry has had its list length changed from its prefab counterpart. + + + + + Whether this value entry has had its dictionary values changes from its prefab counterpart. + + + + + A weakly typed smart value that represents the first element of the value entry's value collection, but has "smart logic" for setting the value that detects relevant changes and applies them in parallel. + This lets you often just use the smart value instead of having to deal with the tedium of multiple parallel values. + + + + + The type from which this value entry comes. If this value entry represents a member value, this is the declaring type of the member. If the value entry represents a collection element, this is the type of the collection. + + + + + The most precise known contained type of the value entry. If polymorphism is in effect, this will be some type derived from . + + + + + The base type of the value entry. If this is value entry represents a member value, this is the type of the member. If the value entry represents a collection element, this is the element type of the collection. + + + + + The special state of the value entry. + + + + + Whether this value entry is an alias, or not. Value entry aliases are used to provide strongly typed value entries in the case of polymorphism. + + + + + The context container of this property. + + + + + Whether this type is marked as an atomic type using a . + + + + + An event that is invoked during , when any values have changed. + + + + + An event that is invoked during , when any child values have changed. + + + + + Updates the values contained in this value entry to the actual values in the target objects, and updates its state (override, type of value, etc.) accordingly. + + + + + Checks whether the values in this value entry are equal to the values in another value entry. + Note, both value entries must have the same value type, and must represent values that are .NET value types. + + + + + + + Applies the changes made to this value entry to the target objects, and registers prefab modifications as necessary. + + + True if any changes were made, otherwise, false. + + + + + Determines the value state of this value entry. + + + + + Determines what the most precise contained type is on this value entry. + + + + + Updates all values in this value entry from the target tree values. + + + + + Initializes this value entry. + + + + + Creates an alias value entry of a given type, for a given value entry. This is used to implement polymorphism in Odin. + + + + + Creates a value entry for a given property, of a given value type. Note that the created value entry is returned un-updated, and needs to have called on it before it can be used. + + + + + Determines whether the value at the given selection index is different from the given prefab value, as is relevant for prefab modification checks. + If the value is a reference type, null and type difference is checked. If value is a value type, a comparer from is used. + This method is best ignored unless you know what you are doing. + + The value to check differences against. + The selection index to compare against. + + + + Represents the values of an , and contains utilities for querying the values' type and getting and setting them. + + The type of the value. + + + + + An equality comparer for comparing values of type . This is gotten using . + + + + + Whether .is a primitive type; that is, the type is primitive, a string, or an enum. + + + + + Whether is a value type. + + + + + Whether is derived from . + + + + + Whether the type of the value is marked atomic. + + + + + If the type of the value is marked atomic, this an instance of an atom handler for the value type. + + + + + Initializes a new instance of the class. + + + + + Provides access to the weakly typed values of this value entry. + + + + + Provides access to the strongly typed values of this value entry. + + + + + Whether this type is marked as an atomic type using a . + + + + + A weakly typed smart value that represents the first element of the value entry's value collection, but has "smart logic" for setting the value that detects relevant changes and applies them in parallel. + This lets you often just use the smart value instead of having to deal with the tedium of multiple parallel values. + + + + + A strongly typed smart value that represents the first element of the value entry's value collection, but has "smart logic" for setting the value that detects relevant changes and applies them in parallel. + This lets you often just use the smart value instead of having to deal with the tedium of multiple parallel values. + + + + + An array containing the original values as they were at the beginning of frame. + + + + + An array containing the current modified set of values. + + + + + An array containing the current modified set of atomic values. + + + + + An array containing the original set of atomic values. + + + + + Initializes this value entry. + + + + + Sets the actual target tree value. + + + + + Checks whether the values in this value entry are equal to the values in another value entry. + Note, both value entries must have the same value type, and must represent values that are .NET value types. + + + + + Determines whether the value at the given selection index is different from the given prefab value, as is relevant for prefab modification checks. + If the value is a reference type, null and type difference is checked. If value is a value type, a comparer from is used. + This method is best ignored unless you know what you are doing. + + The value to check differences against. + The selection index to compare against. + + + + Determines whether the value at the given selection index is different from the given prefab value, as is relevant for prefab modification checks. + If the value is a reference type, null and type difference is checked. If value is a value type, a comparer from is used. + This method is best ignored unless you know what you are doing. + + The value to check differences against. + The selection index to compare against. + + + + Represents the values of an , and contains utilities for querying the values' type and getting and setting them. + + The type of the parent. + The type of the value. + + + + + The type from which this value entry comes. If this value entry represents a member value, this is the declaring type of the member. If the value entry represents a collection element, this is the type of the collection. + + + + + Determines what the most precise contained type is on this value entry. + + + + + Initializes this value entry. + + + + + Updates all values in this value entry from the target tree values. + + + + + Determines the value state of this value entry. + + + + + Applies the changes made to this value entry to the target objects, and registers prefab modifications as necessary. + + + True if any changes were made, otherwise, false. + + + + + Gets the parent value at the given index. + + + + + A polymorphic alias for a instance, used to implement strongly typed polymorphism in Odin. + + + + + The number of parallel values this entry represents. This will always be exactly equal to the count of . + + + + + Whether this value entry is editable or not. + + + + + If this value entry has the override type , this is the path of the property it references. + + + + + The actual serialization backend for this value entry, possibly inherited from the serialization backend of the root property this entry is a child of. + Note that this is *not* always equal to . + + + + + The property whose values this value entry represents. + + + + + Provides access to the weakly typed values of this value entry. + + + + + Whether this value entry has been changed from its prefab counterpart. + + + + + Whether this value entry has had its list length changed from its prefab counterpart. + + + + + Whether this value entry has had its dictionary values changes from its prefab counterpart. + + + + + A weakly typed smart value that represents the first element of the value entry's value collection, but has "smart logic" for setting the value that detects relevant changes and applies them in parallel. + This lets you often just use the smart value instead of having to deal with the tedium of multiple parallel values. + + + + + The type from which this value entry comes. If this value entry represents a member value, this is the declaring type of the member. If the value entry represents a collection element, this is the type of the collection. + + + + + The most precise known contained type of the value entry. If polymorphism is in effect, this will be some type derived from . + + + + + The base type of the value entry. If this is value entry represents a member value, this is the type of the member. If the value entry represents a collection element, this is the element type of the collection. + + + + + The generic value type of the value entry alias itself, IE, the PropertyValueEntryAlias implements the IPropertyValueEntry<TValue> interface - this member returns TValue regardless of the actual type of the backing objects. This is a performance shortcut to checking TValue using reflection, used internally by the property system to determine whether a value entry alias needs to be swapped out with an alias for a different type. + + + + + The special state of the value entry. + + + + + Whether this value entry is an alias, or not. Value entry aliases are used to provide strongly typed value entries in the case of polymorphism. + + + + + The context container of this property. + + + + + Whether this type is marked as an atomic type using a . + + + + + An event that is invoked during , when any values have changed. + + + + + An event that is invoked during , when any child values have changed. + + + + + Applies the changes made to this value entry to the target objects, and registers prefab modifications as necessary. + + + True if any changes were made, otherwise, false. + + + + + Updates the values contained in this value entry to the actual values in the target objects, and updates its state (override, type of value, etc.) accordingly. + + + + + Checks whether the values in this value entry are equal to the values in another value entry. + Note, both value entries must have the same value type, and must represent values that are .NET value types. + + + + + Sets the actual value of a value entry, for a given selection index. + + + + + Determines whether the value at the given selection index is different from the given prefab value, as is relevant for prefab modification checks. + If the value is a reference type, null and type difference is checked. If value is a value type, a comparer from is used. + This method is best ignored unless you know what you are doing. + + The value to check differences against. + The selection index to compare against. + + + + A polymorphic alias for a instance, used to implement strongly typed polymorphism in Odin. + + + + + Initializes a new instance of the class. + + The value entry to alias. + valueEntry is null + + + + Provides access to the strongly typed values of this value entry. + + + + + A strongly typed smart value that represents the first element of the value entry's value collection, but has "smart logic" for setting the value that detects relevant changes and applies them in parallel. + This lets you often just use the smart value instead of having to deal with the tedium of multiple parallel values. + + + + + A weakly typed smart value that represents the first element of the value entry's value collection, but has "smart logic" for setting the value that detects relevant changes and applies them in parallel. + This lets you often just use the smart value instead of having to deal with the tedium of multiple parallel values. + + + + + The number of parallel values this entry represents. This will always be exactly equal to the count of . + + + + + Whether this value entry is editable or not. + + + + + If this value entry has the override type , this is the path of the property it references. + + + + + The actual serialization backend for this value entry, possibly inherited from the serialization backend of the root property this entry is a child of. + Note that this is *not* always equal to . + + + + + The property whose values this value entry represents. + + + + + Provides access to the weakly typed values of this value entry. + + + + + Whether this value entry has been changed from its prefab counterpart. + + + + + Whether this value entry has had its list length changed from its prefab counterpart. + + + + + Whether this value entry has had its dictionary values changes from its prefab counterpart. + + + + + The type from which this value entry comes. If this value entry represents a member value, this is the declaring type of the member. If the value entry represents a collection element, this is the type of the collection. + + + + + The most precise known contained type of the value entry. If polymorphism is in effect, this will be some type derived from . + + + + + The base type of the value entry. If this is value entry represents a member value, this is the type of the member. If the value entry represents a collection element, this is the element type of the collection. + + + + + The generic value type of the value entry alias itself, IE, the PropertyValueEntryAlias implements the IPropertyValueEntry<TValue> interface - this member returns TValue regardless of the actual type of the backing objects. This is a performance shortcut to checking TValue using reflection, used internally by the property system to determine whether a value entry alias needs to be swapped out with an alias for a different type. + + + + + The special state of the value entry. + + + + + Whether this type is marked as an atomic type using a . + + + + + An event that is invoked during , when any values have changed. + + + + + An event that is invoked during , when any child values have changed. + + + + + Applies the changes made to this value entry to the target objects, and registers prefab modifications as necessary. + + + True if any changes were made, otherwise, false. + + + + + Updates the values contained in this value entry to the actual values in the target objects, and updates its state (override, type of value, etc.) accordingly. + + + + + Checks whether the values in this value entry are equal to the values in another value entry. + Note, both value entries must have the same value type, and must represent values that are .NET value types. + + + + + Sets the actual value of a value entry, for a given selection index. + + + + + Determines whether the value at the given selection index is different from the given prefab value, as is relevant for prefab modification checks. + If the value is a reference type, null and type difference is checked. If value is a value type, a comparer from is used. + This method is best ignored unless you know what you are doing. + + The value to check differences against. + The selection index to compare against. + + + + Determines whether the value at the given selection index is different from the given prefab value, as is relevant for prefab modification checks. + If the value is a reference type, null and type difference is checked. If value is a value type, a comparer from is used. + This method is best ignored unless you know what you are doing. + + The value to check differences against. + The selection index to compare against. + + + + Draws properties marked with . + Displays a configurable list of assets, where each item can be enabled or disabled. + + + + + + + + + + Draws the property. + + + + + Populates the generic menu for the property. + + + + + Not yet documented. + + + + + Not yet documented. + + Initializes this instance. @@ -845,126 +3960,19 @@ Draws the property with GUILayout support. This method is called by DrawPropertyImplementation if the GUICallType is set to GUILayout, which is the default. - + - Draws members marked with . + Odin drawer for . - - - Draws a warning message for non-serialized properties that sports both the SerializeField and the ShowInInspector attribute. - - - - - Determines if the drawer can draw the property. - - The property to test. - true if the drawer can draw the property; otherwise false. - - + Initializes the drawer. - + - Draws the warning message and calls the next drawer. - - The label for the property. - - - - Draws properties marked with . - - - - - - - - - - Draws a space for properties marked with the PropertySpace attribute. - - - - - Initializes this instance. - - - - - Draws the property. - - - - - Drawer for the ShowPropertyResolver attribute. - - - - - - TextArea attribute drawer. - - - - - Draws the property in the Rect provided. This method does not support the GUILayout, and is only called by DrawPropertyImplementation if the GUICallType is set to Rect, which is not the default. - If the GUICallType is set to Rect, both GetRectHeight and DrawPropertyRect needs to be implemented. - If the GUICallType is set to GUILayout, implementing DrawPropertyLayout will suffice. - - The label. This can be null, so make sure your drawer supports that. - - - - Draws properties marked with . - - - - - Initializes this instance. - - - - - Draws the property with GUILayout support. This method is called by DrawPropertyImplementation if the GUICallType is set to GUILayout, which is the default. - - - - - Drawer for the ResponsiveButtonGroupAttribute. - - - - - Draws the property with GUILayout support. - - - - - Drawer for the attribute. - - - - - Draws the property. - - - - - The default method drawer that draws most buttons. - - - - - Initializes this instance. - - - - - Draws the property layout. + Not yet documented. @@ -977,6 +3985,170 @@ Draws the property. + + + Draws Color properties marked with . + + + + + Draws the property. + + + + + Adds a generic menu option to properties marked with . + + + + + + + + Populates the generic menu for the property. + + + + + Draws the property. + + + + + Draws properties marked with . + + + + + + Draws char properties marked with . + + + + + Draws the property. + + + + + Draws string properties marked with . + + + + + Draws the property. + + + + + Draws sbyte properties marked with . + + + + + Draws the property. + + + + + Draws byte properties marked with . + + + + + Draws the property. + + + + + Draws short properties marked with . + + + + + Draws the property. + + + + + Draws ushort properties marked with . + + + + + Draws the property. + + + + + Draws int properties marked with . + + + + + Draws the property. + + + + + Draws uint properties marked with . + + + + + Draws the property. + + + + + Draws long properties marked with . + + + + + Draws the property. + + + + + Draws ulong properties marked with . + + + + + Draws the property. + + + + + Draws float properties marked with . + + + + + Draws the property. + + + + + Draws double properties marked with . + + + + + Draws the property. + + + + + Draws decimal properties marked with . + + + + + Draws the property. + + Draws char properties marked with . @@ -1107,6 +4279,47 @@ Draws the property. + + + Draws properties marked with . + + + + + + + + + Initializes this instance. + + + + + Draws the property. + + + + + Draws properties marked with . + Calls the properties ToString method to get the string to draw. + + + + + + + + + + + Draws the property. + + + + + Draws members marked with . + + Odin drawer for the . @@ -1122,55 +4335,21 @@ Draws the property. - + - Draws properties marked with as a square ObjectField which renders a preview for UnityEngine.Object types. - This object field also adds support for drag and drop, dragging an object to another square object field, swaps the values. - If you hold down control while letting go it will replace the value, And you can control + click the object field to quickly delete the value it holds. + Draws an enum in a horizontal button group instead of a dropdown. - + + + Returns true if the drawer can draw the type. + + + Draws the property. - - - The TableList attirbute drawer. - - - - - - Determines whether this instance [can draw attribute property] the specified property. - - - - - Initializes this instance. - - - - - Draws the property layout. - - - - - Draws Color properties marked with . - - - - - Draws the property. - - - - - Draws properties marked with . - - - Not yet documented. @@ -1206,6 +4385,78 @@ Adds customs generic menu options. + + + Draws properties marked with . + This drawer sets the current GUI color, before calling the next drawer in the chain. + + + + + + + + + + Draws the property. + + + + + Draws properties marked with . + + + + + + + + + + Draws the property. + + + + + Draws properties marked with . + + + + + + + + + + Draws the property. + + + + + Draws properties marked with . + + + + + + Draws the property. + + + + + Draws properties marked with . + Draws an info box above the property. Error and warning info boxes can be tracked by Odin Scene Validator. + + + + + + + + + Draws the property. + + Draws properties marked with @@ -1216,6 +4467,69 @@ Draws the property. + + + Static GUI information reguarding the InlineEditor attribute. + + + + + Gets a value indicating how many InlineEditors we are currently in. + + + + + Draws properties marked with . + + + + + + + Initializes this instance. + + + + + Draws the property layout. + + The label. + + + + + + + Will set GUI.enabled to false during some cases, to avoid the Preview eating events when it really shouldn't. + + + + Drawer for the attribute. + + + + + Draws the property. + + + + + Draws properties marked with . + Creates a new GUIContent, with the provided label text, before calling further down in the drawer chain. + + + + + + + + + + + + Draws the attribute. + + Draws properties marked with the . @@ -1233,6 +4547,72 @@ Draws the attribute. + + + Draws Vector2 properties marked with . + + + + + + + + + + + Draws string properties marked with . + This drawer only works for string fields, unlike . + + + + + + + + + + Draws the property. + + + + + Draws string properties marked with . + This drawer works for both string field and properties, unlike . + + + + + + + + + + Draws the property. + + + + + Draws a warning message for non-serialized properties that sports both the SerializeField and the ShowInInspector attribute. + + + + + Determines if the drawer can draw the property. + + The property to test. + true if the drawer can draw the property; otherwise false. + + + + Initializes the drawer. + + + + + Draws the warning message and calls the next drawer. + + The label for the property. + @@ -1250,6 +4630,54 @@ Draws The Property. + + + Draws properties marked with . + + + + + + + + + + Draws properties marked with . + Calls the method, the attribute is either attached to, or the method that has been specified in the attribute, to allow for custom GUI drawing. + + + + + + + + + + Draws the property. + + + + + Draws properties marked with . + + + + + + + + + + Draws properties marked with as a square ObjectField which renders a preview for UnityEngine.Object types. + This object field also adds support for drag and drop, dragging an object to another square object field, swaps the values. + If you hold down control while letting go it will replace the value, And you can control + click the object field to quickly delete the value it holds. + + + + + Draws the property. + + Common base implementation for progress bar attribute drawers. @@ -1712,282 +5140,17 @@ Draws the property. - + - Draws an enum in a horizontal button group instead of a dropdown. + Draws a space for properties marked with the PropertySpace attribute. - - - Returns true if the drawer can draw the type. - - - - - Draws the property. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Draws char properties marked with . - - - - - Draws the property. - - - - - Draws string properties marked with . - - - - - Draws the property. - - - - - Draws sbyte properties marked with . - - - - - Draws the property. - - - - - Draws byte properties marked with . - - - - - Draws the property. - - - - - Draws short properties marked with . - - - - - Draws the property. - - - - - Draws ushort properties marked with . - - - - - Draws the property. - - - - - Draws int properties marked with . - - - - - Draws the property. - - - - - Draws uint properties marked with . - - - - - Draws the property. - - - - - Draws long properties marked with . - - - - - Draws the property. - - - - - Draws ulong properties marked with . - - - - - Draws the property. - - - - - Draws float properties marked with . - - - - - Draws the property. - - - - - Draws double properties marked with . - - - - - Draws the property. - - - - - Draws decimal properties marked with . - - - - - Draws the property. - - - - - Draws properties marked with . - - - - - - - + Initializes this instance. - - - Draws the property. - - - - - Draws properties marked with . - This drawer sets the current GUI color, before calling the next drawer in the chain. - - - - - - - - - - Draws the property. - - - - - Static GUI information reguarding the InlineEditor attribute. - - - - - Gets a value indicating how many InlineEditors we are currently in. - - - - - Draws properties marked with . - - - - - - - Initializes this instance. - - - - - Draws the property layout. - - The label. - - - - Draws Vector2 properties marked with . - - - - - - - - - - - Show drawer chain attribute drawer. - - - - - Draws the property. - - - - - Draws properties marked with . - - - - - - Initializes this instance. - - - - - Draws the property. - - - - - Draws properties marked with . - - - - - - - - - Draws the property. - - - - - Draws properties marked with . - - - - + Draws the property. @@ -2162,434 +5325,65 @@ Draws the property. - + - Draws properties marked with . - Calls the properties ToString method to get the string to draw. + Show drawer chain attribute drawer. - - - - - - - + Draws the property. - + - Drawer for the + Drawer for the ShowPropertyResolver attribute. - + - + - Draws the property. + Draws properties marked with . - - - - Drawer for the - - - - - - Draws the property. - - - - - Draws properties marked with . - - - - - - - Draws the property. - - - - - Char property drawer. - - - - - Draws the property. - - - - - Delegate property drawer. This drawer is rather simplistic for now, and will receive significant upgrades in the future. - - - - - See . - - - - - Draws the property. - - - - - Property drawer for . - - - - - Draws the property. - - - - - Base class to derive from for value drawers that merely wish to cause a value to be drawn by Unity. - - - - - Draws the property. - - - - - Gradient property drawer. - - - - - Int property drawer. - - - - - Draws the property. - - - - - The GUIStyleState Drawer - - - - - - Initializes this instance. - - - - - Draws the property with GUILayout support. - - - - - LayerMask property drawer. - - - - - Draws the property. - - - - - Base class for two-dimensional array drawers. - - - - - Override this method in order to define custom type constraints to specify whether or not a type should be drawn by the drawer. - Note that Odin's has full support for generic class constraints, so most often you can get away with not overriding CanDrawTypeFilter. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Draws the property. - - - - - This method gets called from DrawPropertyLayout right before the table and error message is drawn. - - - - - Compares the element. - - - - - Draws a table cell element. - - The rect. - The input value. - The output value. - - - - Draws the element. - - - - - Property drawer for nullables. - - - - - Draws the property. - - - - - Quaternion property drawer. - - - - - Draws the property. - - - - - Populates the generic menu for the property. - - - - - Type property drawer - - - - - - Draws the property. - - - - - Draws properties marked with . - Displays a configurable list of assets, where each item can be enabled or disabled. - - - - - - - - - - Draws the property. - - - - - Populates the generic menu for the property. - - - - - Odin drawer for . - - - - - Initializes the drawer. - - - - - Not yet documented. - - - - - Adds a generic menu option to properties marked with . - - - - - - - - Populates the generic menu for the property. - - - - - Draws the property. - - - - - Draws properties marked with . - - - - - - - - Draws the property. - - - - - Draws properties marked with . - - - - - - - - - - Draws the property. - - - - - Draws properties marked with . - - - - - - Draws the property. - - - - - Draws properties marked with . - Draws an info box above the property. Error and warning info boxes can be tracked by Odin Scene Validator. - - - - - - - - - Draws the property. - - - - - Draws properties marked with . - Creates a new GUIContent, with the provided label text, before calling further down in the drawer chain. - - - - - - - - - - - - Draws the attribute. - - - - - Draws string properties marked with . - This drawer only works for string fields, unlike . - - - - - - - - - - Draws the property. - - - - - Draws string properties marked with . - This drawer works for both string field and properties, unlike . - - - - - - - - - - Draws the property. - - - - - Draws properties marked with . - Calls the method, the attribute is either attached to, or the method that has been specified in the attribute, to allow for custom GUI drawing. - - - - - - - - - - Draws the property. - - - - - Draws properties marked with . - - - - - - - - - - Draws properties marked with . - - - - - Draws the property. - - - + Initializes this instance. - + - Draws the property with GUILayout support. This method is called by DrawPropertyImplementation if the GUICallType is set to GUILayout, which is the default. + Draws the property. + + + Draws properties marked with . + + + + + + + + + Draws the property. + + + + + TextArea attribute drawer. + + + + + Draws the property in the Rect provided. This method does not support the GUILayout, and is only called by DrawPropertyImplementation if the GUICallType is set to Rect, which is not the default. + If the GUICallType is set to Rect, both GetRectHeight and DrawPropertyRect needs to be implemented. + If the GUICallType is set to GUILayout, implementing DrawPropertyLayout will suffice. + + The label. This can be null, so make sure your drawer supports that. + Draws properties marked with . @@ -2602,6 +5396,28 @@ Draws the property. + + + Draws properties marked with . + + + + + + Draws the property. + + + + + Draws properties marked with . + + + + + + Draws the property. + + Draws properties marked with . @@ -2624,6 +5440,21 @@ Draws the property. + + + Draws properties marked with . + + + + + Initializes this instance. + + + + + Draws the property with GUILayout support. This method is called by DrawPropertyImplementation if the GUICallType is set to GUILayout, which is the default. + + Draws all Unity DecoratorDrawers within prepend attribute drawers within Odin. @@ -2639,6 +5470,71 @@ Draws the property. + + + Draws properties marked with . + + + + + Draws the property. + + + + + Initializes this instance. + + + + + Draws the property with GUILayout support. This method is called by DrawPropertyImplementation if the GUICallType is set to GUILayout, which is the default. + + + + + Draws Vector2Int properties marked with . + + + + + Initializes the drawer by resolving any optional references to members for min/max value. + + + + + Draws the property. + + + + + Vector2Int proprety drawer. + + + + + Draws the property. + + + + + Populates the generic menu for the property. + + + + + Vector3Int property drawer. + + + + + Draws the property. + + + + + Populates the generic menu for the property. + + Draws all properties grouped together with the @@ -2682,6 +5578,27 @@ Draws the property. + + + Drawer for the + + + + + + Draws the property. + + + + + Drawer for the ResponsiveButtonGroupAttribute. + + + + + Draws the property with GUILayout support. + + Draws all properties grouped together with the @@ -2693,13 +5610,14 @@ Draws the property. - + - Draws properties marked with . + Draws properties marked with . - + + - + Draws the property. @@ -2715,16 +5633,32 @@ Draws the property.
- + - Draws all nullable reference types, with an object field. + Drawer for the + - + Draws the property. + + + The default method drawer that draws most buttons. + + + + + Initializes this instance. + + + + + Draws the property layout. + + Returns a value that indicates if this drawer can be used for the given property. @@ -2836,6 +5770,31 @@ Draws the property. + + + Char property drawer. + + + + + Draws the property. + + + + + Property drawer for anything that has a . + + + + + Initializes the drawer. + + + + + Draws the property. + + Color32 property drawer. @@ -2886,6 +5845,31 @@ Draws the property. + + + Delegate property drawer. This drawer is rather simplistic for now, and will receive significant upgrades in the future. + + + + + See . + + + + + Draws the property. + + + + + Property drawer for . + + + + + Draws the property. + + Double property drawer. @@ -2896,6 +5880,16 @@ Draws the property. + + + Base class to derive from for value drawers that merely wish to cause a value to be drawn by Unity. + + + + + Draws the property. + + Enum property drawer. @@ -2911,6 +5905,37 @@ Draws the property. + + + Gradient property drawer. + + + + + Int property drawer. + + + + + Draws the property. + + + + + The GUIStyleState Drawer + + + + + + Initializes this instance. + + + + + Draws the property with GUILayout support. + + Short property drawer. @@ -2941,21 +5966,41 @@ Draws the property. - + - Property drawer for anything that has a . + LayerMask property drawer. - - - Initializes the drawer. - - - + Draws the property. + + + Property drawer for nullables. + + + + + Draws the property. + + + + + Quaternion property drawer. + + + + + Draws the property. + + + + + Populates the generic menu for the property. + + SByte property drawer. @@ -2966,6 +6011,22 @@ Draws the property. + + + Retrieves the index of a filtered item; if the collection is not filtered, it just returns the passed index. + + The index to find. + + + The index in the collection of the filtered item, + or the passed index if the collection is not filtered. + + + + This is thrown if it's unable to find the index in the original collection, + this indicates a discrepancy between the filtered collection and the original collection. + + Float property drawer. @@ -2986,6 +6047,87 @@ Draws the property. + + + The TableList attirbute drawer. + + + + + + Determines whether this instance [can draw attribute property] the specified property. + + + + + Initializes this instance. + + + + + Draws the property layout. + + + + + Base class for two-dimensional array drawers. + + + + + Override this method in order to define custom type constraints to specify whether or not a type should be drawn by the drawer. + Note that Odin's has full support for generic class constraints, so most often you can get away with not overriding CanDrawTypeFilter. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Draws the property. + + + + + This method gets called from DrawPropertyLayout right before the table and error message is drawn. + + + + + Compares the element. + + + + + Draws a table cell element. + + The rect. + The input value. + The output value. + + + + Draws the element. + + + + + Type property drawer + + + + + + Draws the property. + + Ushort property drawer. @@ -3086,3298 +6228,20 @@ Populates the generic menu for the property. - + + + Draws properties marked with . + + + + + + + Draws the property. - - - Descripes an attribute example. - - - - - The type of the example object. - - - - - The name of the example. - - - - - The description of the example. - - - - - Raw code of the example. - - - - - The example declared as a Unity component. - - - - - Sorting value of the example. Examples with lower order values should come before examples with higher order values. - - - - - Preview object of the example. - - - - - Extension method for List<Attribute> - - - - - Determines whether the list contains a specific attribute. - - The type of attribute. - The attribute list. - - true if the specified attribute list has attribute; otherwise, false. - - - - - Adds the attribute if not exist. - - The type of attribute. - The attribute list. - - - - - Adds the attribute if not exist. - - The type of attribute. - The attribute list. - - - - - Adds the attribute if not exist. - - The type of attribute. - The attribute list. - - - - - Adds the attribute if not exist. - - The type of attribute. - The attribute list. - The attribute. - - - - - Removes the type of the attribute of. - - The type of attribute. - The attribute list. - - - - - Odin has its own implementations for these attribute drawers; never use Unity's. - - - - - Gets the priority of a given drawer type. - - - - - Helper class to get values from InspectorProperties. This class is deprecated and fully replaced by . - - - - - If any error occurred while looking for members, it will be stored here. - - - - - Gets the referenced member information. - - - - - Gets the value. - - - - - Gets all values from all targets. - - - - - The content padding - - - - - Draws the menu tree. - - - - - Gets the value selected value. - - - - - Invokes BuildMenuTree. - - - - - Use this attribute to prevent a type from being included in Odin systems. - The attribute can be applied to Odin drawers, Odin property resolvers and Odin attribute processor types. - - - - - To safely change anything in the type cache, you must be holding this lock. - - - - - Put this attribute on a validator class to prevent the ValidatorDrawer from running that validator in the inspector. - Typically you would use this for a validation-related attribute that has its own, complex custom drawer that should - handle the validation and error/warning drawing while the inspector is being drawn, but still needs a validator to - run for the project validation scans. - - - - - Apply this to an assembly to register validators for the validation system. - This enables locating of all relevant validator types very quickly. - - - - - This attribute can be placed on an assembly to register a value resolver creator that should be queried when a value resolver is being created. - - - - - This attribute can be placed on an assembly to register a value resolver creator that should be queried when a value resolver is being created. - - The resolver - - - - - A ValueResolver resolves a string to a value of a given type, given an InspectorProperty instance to use as context. Call to get an instance of a ValueResolver. - Value resolvers are a globally extendable system that can be hooked into and modified or changed by creating and registering a . - See Odin's tutorials for details and examples of how to use ValueResolvers. - - - - - The context of this ValueResolver, containing all of its configurations and values it needs to function. For performance and simplicity reasons, this is a single very large struct that is passed around by ref to anything that needs it. - - - - - The current error message that the resolver has, or null if there is no error message. This is a shortcut for writing "resolver.Context.ErrorMessage". - - - - - Whether there is an error message at the moment. This is a shortcut for writing "resolver.Context.ErrorMessage != null". - - - - - The type of value that this resolver instance is supposed to get. - - - - - Gets a value from the value resolver in a weakly typed manner. - - The selection index at which to get the value, in the case of multi-selection. Defaults to 0. - The value that was gotten. - - - - Draws an error message box if there is an error, and does nothing if there is no error. - - - - - Creates a new value resolver instance from a pre-built context struct, in a weakly typed fashion, though the result - is the same as using a strongly typed generic overload. This is a more advanced use that requires you to - know how the context needs to be set up before value resolution happens. However, this allows you to do more advanced - things like adjust various context values before string resolution happens. - - The pre-built context that should be used to get a resolver. - - - - Creates a new value resolver instance from a pre-built context struct. This is a more advanced use that requires you to - know how the context needs to be set up before value resolution happens. However, this allows you to do more advanced - things like adjust various context values before string resolution happens. - - The pre-built context that should be used to get a resolver. - - - - Creates a new value resolver instance in a weakly typed fashion, though the result is the same as using a strongly typed generic overload. - This is useful when you don't know at compile time which type you want to resolve. - - The type of value that the new resolver should resolve. - The property that is the context for the resolution to happen in. - The string that should be resolved to a value. - - - - Creates a new value resolver instance in a weakly typed fashion, though the result is the same as using a strongly typed generic overload. - This is useful when you don't know at compile time which type you want to resolve. - - The type of value that the new resolver should resolve. - The property that is the context for the resolution to happen in. - The string that should be resolved to a value. - The extra named args that this resolver has access to. Passing in a named arg that already exists will silently override the pre-existing named arg. - - - - Creates a new value resolver instance. - - The type of value that the new resolver should resolve. - The property that is the context for the resolution to happen in. - The string that should be resolved to a value. - - - - Creates a new value resolver instance. - - The type of value that the new resolver should resolve. - The property that is the context for the resolution to happen in. - The string that should be resolved to a value. - The extra named args that this resolver has access to. Passing in a named arg that already exists will silently override the pre-existing named arg. - - - - Creates a new value resolver instance in a weakly typed fashion, though the result is the same as using a strongly typed generic overload. - This is useful when you don't know at compile time which type you want to resolve. - - The type of value that the new resolver should resolve. - The property that is the context for the resolution to happen in. - The string that should be resolved to a value. - The value that the resolver should return if the string cannot be resolved to anything, or if there is an error in creating a resolver, or if resolution itself throws an exception. - - - - Creates a new value resolver instance in a weakly typed fashion, though the result is the same as using a strongly typed generic overload. - This is useful when you don't know at compile time which type you want to resolve. - - The type of value that the new resolver should resolve. - The property that is the context for the resolution to happen in. - The string that should be resolved to a value. - The value that the resolver should return if the string cannot be resolved to anything, or if there is an error in creating a resolver, or if resolution itself throws an exception. - The extra named args that this resolver has access to. Passing in a named arg that already exists will silently override the pre-existing named arg. - - - - Creates a new value resolver instance meant to resolve a string value in particular. This is a shorthand for creating a string resolver that has the resolved string as a fallback value. - This special case will get you the behaviour where, if you pass in a string that is not meant to be resolved in a special way, the value resolver will just pass you that string back as the result value. - - The property that is the context for the resolution to happen in. - The string that should be resolved to a value. - - - - Creates a new value resolver instance meant to resolve a string value in particular. This is a shorthand for creating a string resolver that has the resolved string as a fallback value. - This special case will get you the behaviour where, if you pass in a string that is not meant to be resolved in a special way, the value resolver will just pass you that string back as the result value. - - The property that is the context for the resolution to happen in. - The string that should be resolved to a value. - The extra named args that this resolver has access to. Passing in a named arg that already exists will silently override the pre-existing named arg. - - - - Creates a new value resolver instance. - - The type of value that the new resolver should resolve. - The property that is the context for the resolution to happen in. - The string that should be resolved to a value. - The value that the resolver should return if the string cannot be resolved to anything, or if there is an error in creating a resolver, or if resolution itself throws an exception. - - - - Creates a new value resolver instance. - - The type of value that the new resolver should resolve. - The property that is the context for the resolution to happen in. - The string that should be resolved to a value. - The value that the resolver should return if the string cannot be resolved to anything, or if there is an error in creating a resolver, or if resolution itself throws an exception. - The extra named args that this resolver has access to. Passing in a named arg that already exists will silently override the pre-existing named arg. - - - - Gets a nicely formatted string that lists all the errors in the given set of value resolvers. The returned value is null if there are no errors. - - - - - Gets a nicely formatted string that lists all the errors in the given set of value resolvers. The returned value is null if there are no errors. - - - - - Draws error boxes for all errors in the given value resolvers, or does nothing if there are no errors. This is equivalent to calling DrawError() on all resolvers passed to this method. - - - - - Draws error boxes for all errors in the given value resolvers, or does nothing if there are no errors. This is equivalent to calling DrawError() on all resolvers passed to this method. - - - - - A ValueResolver resolves a string to a value of a given type, given an InspectorProperty instance to use as context. Call to get an instance of a ValueResolver. - Value resolvers are a globally extendable system that can be hooked into and modified or changed by creating and registering a . - See Odin's tutorials for details and examples of how to use ValueResolvers. - - - - - The delegate that does the actual value resolution. You should not call this manually, but instead call . - - - - - The type of value that this resolver instance is supposed to get. Always equal to typeof(). - - - - - Gets a value from the value resolver. - - The selection index at which to get the value, in the case of multi-selection. Defaults to 0. - The value that was gotten. - - - - Gets a value from the value resolver in a weakly typed manner. - - The selection index at which to get the value, in the case of multi-selection. Defaults to 0. - The value that was gotten. - - - - This struct contains all of a ValueResolver's configurations and values it needs to function. For performance and simplicity reasons, this is a single very large struct that lives on a ValueResolver instance and is passed around by ref to anything that needs it. - - - - - The property that *provides* the context for the value resolution. This is the instance that was passed to the resolver when it was created. Note that this is different from , which is based on this value, but almost always isn't the same InspectorProperty instance. - - - - - The error message, if a valid value resolution wasn't found, or if creation of the value resolver failed because was invalid, or if value resolution was run but threw an exception. (In this last case, will be true.) - - - - - The named values that are available to the value resolver. Use this field only to get and set named values - once the ValueResolver has been created, new named values will have no effect. - - - - - This is the fallback value that the value resolver will return if there is an error or failed resolution for any reason. - - - - - Whether there is a fallback value. This boolean exists because then null is also a valid fallback value. This boolean will always be true if an overload is used that takes a fallback value parameter. - - - - - This will be true if is not null and the message was caused by an exception thrown by code invoked during an actual value resolution. - - - - - Whether exceptions thrown during value resolution should be logged to the console. - - - - - The type of value that the resolver is resolving. - - - - - The string that is resolved to get a value. - - - - - Whether the value resolver should sync ref parameters of invoked methods with named values. If this is true, then if a ref or out parameter value is changed during value resolution, the named value associated with that parameter will also be changed to the same value. - - - - - Whether this context has been resolved. - - - - - The type that is the parent of the value resolution, ie, the type that is the context. This is the same as .ValueEntry.TypeOfValue. - - - - - The property that *is* the context for the value resolution. This is not the instance that was passed to the resolver when it was created, but this value is based on that instance. This is the property that provides the actual context - for example, if is for a member of a type - or for an element in a collection contained by a member - this value will be the parent property for the type that contains that member. Only if is the tree's root property is the same as . - - - - - Gets the parent value which provides the context of the resolver. - - The selection index of the parent value to get. - - - - Sets the parent value which provides the context of the resolver. - - The selection index of the parent value to set. - The value to set. - - - - Adds the default named values of "property" and "value" to the context's named values. - This method is usually automatically invoked when a resolver is created, so there - is no need to invoke it manually. - - - - - The Odin Getting Started Window - - - - - - Shows the window. - - - - - Initialize get called by OnEnable and by OnGUI after assembly reloads - which often happens when you recompile or enter and exit play mode. - - - - - Gets a value indicating whether the window should draw a scroll view. - - - - - Draws the Odin Editor Window. - - - - - Priority for and types. - - - - - Priority of the resolver. - - - - - Initializes a new instance of the class. - - The higher the priority, the earlier it will be processed. - - - - Draws an editor window with a menu tree. - - - - public class OdinMenuEditorWindowExample : OdinMenuEditorWindow - { - [SerializeField, HideLabel] - private SomeData someData = new SomeData(); - - protected override OdinMenuTree BuildMenuTree() - { - OdinMenuTree tree = new OdinMenuTree(supportsMultiSelect: true) - { - { "Home", this, EditorIcons.House }, // draws the someDataField in this case. - { "Odin Settings", null, EditorIcons.SettingsCog }, - { "Odin Settings/Color Palettes", ColorPaletteManager.Instance, EditorIcons.EyeDropper }, - { "Odin Settings/AOT Generation", AOTGenerationConfig.Instance, EditorIcons.SmartPhone }, - { "Camera current", Camera.current }, - { "Some Class", this.someData } - }; - - tree.AddAllAssetsAtPath("More Odin Settings", SirenixAssetPaths.OdinEditorConfigsPath, typeof(ScriptableObject), true) - .AddThumbnailIcons(); - - tree.AddAssetAtPath("Odin Getting Started", SirenixAssetPaths.SirenixPluginPath + "Getting Started With Odin.asset"); - - var customMenuItem = new OdinMenuItem(tree, "Menu Style", tree.DefaultMenuStyle); - tree.MenuItems.Insert(2, customMenuItem); - - tree.Add("Menu/Items/Are/Created/As/Needed", new GUIContent()); - tree.Add("Menu/Items/Are/Created", new GUIContent("And can be overridden")); - - // As you can see, Odin provides a few ways to quickly add editors / objects to your menu tree. - // The API also gives you full control over the selection, etc.. - // Make sure to check out the API Documentation for OdinMenuEditorWindow, OdinMenuTree and OdinMenuItem for more information on what you can do! - - return tree; - } - } - - - - - - - - - - - - - Called when the window is destroyed. Remember to call base.OnDestroy(); - - - - - Builds the menu tree. - - - - - Gets or sets the width of the menu. - - - - - Gets a value indicating whether the menu is resizable. - - - - - Gets the menu tree. - - - - - Gets or sets a value indicating whether to draw the menu search bar. - - - - - Gets or sets the custom search function. - - - - - Forces the menu tree rebuild. - - - - - Tries to select the menu item with the specified object. - - - - - Draws the menu tree selection. - - - - - Draws the Odin Editor Window. - - - - - The method that draws the menu. - - - - - A menu item that represents one or more objects. - - - - - - - - - - The default toggled state - - - - - Initializes a new instance of the class. - - The Odin menu tree instance the menu item belongs to. - The name of the menu item. - The instance the value item represents. - - - - Occurs right after the menu item is done drawing, and right before mouse input is handles so you can take control of that. - - - - - Occurs when the user has right-clicked the menu item. - - - - - Gets the child menu items. - - - The child menu items. - - - - - Gets the index location of the menu item. - - - - - Gets or sets a value indicating whether the menu item is visible. - Not that setting this to false will not hide its children as well. For that see use Toggled. - - - - - Gets or sets the icon that is used when the menu item is not selected. - - - - - Gets or sets the icon that is used when the menu item is selected. - - - - - Gets a value indicating whether this instance is selected. - - - - - Gets the menu tree instance. - - - - - Gets or sets the raw menu item name. - - - - - Gets or sets the search string used when searching for menu items. - - - - - Gets the next visual menu item. - - - - - Gets the parent menu item. - - - - - Gets the previous visual menu item. - - - - - Gets the drawn rect. - - - - - Gets the drawn label rect. - - - - - Gets or sets the style. If null is specified, then the menu trees DefaultMenuStyle is used. - - - - - Deselects this instance. - - - - - Selects the specified add to selection. - - - - - Gets the child menu items recursive in a DFS. - - Whether to include it self in the collection. - - - - Gets the child menu items recursive in a DFS. - - Whether to include it self in the collection. - Whether to include the root. - - - - Gets the full menu item path. - - - - - Gets the first object of the - - - - - Gets the object instances the menu item represents - - - - - Sets the object instance - - - - - Sets the object instances - - - - - Gets or sets the value the menu item represents. - - - - - Gets a nice menu item name. If the raw name value is null or a dollar sign, then the name is retrieved from the object itself via ToString(). - - - - - Gets or sets a value indicating whether this is toggled / expanded. This value tries it best to be persistent. - - - - - Gets or sets the icon getter. - - - - - Draws this menu item followed by all of its child menu items - - The indent level. - - - - Draws the menu item with the specified indent level. - - - - - Override this to add custom GUI to the menu items. - This is called right after the menu item is done drawing, and right before mouse input is handles so you can take control of that. - - - - - Handles the mouse events. - - The rect. - The triangle rect. - - - - The style settings used by . - - A nice trick to style your menu is to add the tree.DefaultMenuStyle to the tree itself, - and style it live. Once you are happy, you can hit the Copy CSharp Snippet button, - remove the style from the menu tree, and paste the style directly into your code. - - - - - - - - - - - Gets or sets the default selected style. - - - - - Gets or sets the selected label style. - - - - - The height of the menu item. - - - - - The global offset of the menu item content - - - - - The vertical offset of the menu item label - - - - - The number of pixels to indent per level indent level. - - - - - The size of the icon. - - - - - The size of the icon. - - - - - The transparency of icons when the menu item is not selected. - - - - - The padding between the icon and other content. - - - - - Whether to draw the a foldout triangle for menu items with children. - - - - - The size of the foldout triangle icon. - - - - - The padding between the foldout triangle icon and other content. - - - - - Whether or not to align the triangle left or right of the content. - If right, then the icon is pushed all the way to the right at a fixed position ignoring the indent level. - - - - - Whether to draw borders between menu items. - - - - - The horizontal border padding. - - - - - The border alpha. - - - - - The background color for when a menu item is selected. - - - - - The background color for when a menu item is selected. - - - - - The background color for when a menu item is selected. - - - - - The background color for when a menu item is selected. - - - - - Sets the height of the menu item. - - - - - Sets the global offset of the menu item content - - - - - Sets the number of pixels to indent per level indent level. - - - - - Sets the size of the icon. - - - - - Sets the size of the icon. - - - - - Sets the transparency of icons when the menu item is not selected. - - - - - Sets the padding between the icon and other content. - - - - - Sets whether to draw the a foldout triangle for menu items with children. - - - - - Sets the size of the foldout triangle icon. - - - - - Sets the padding between the foldout triangle icon and other content. - - - - - Sets whether or not to align the triangle left or right of the content. - If right, then the icon is pushed all the way to the right at a fixed position ignoring the indent level. - - - - - Sets whether to draw borders between menu items. - - - - - Sets the border alpha. - - - - - Sets the border alpha. - - - - - Sets the background color for when a menu item is selected. - - - - - Sets the background color for when a menu item is selected. - - - - - Creates and returns an instance of a menu style that makes it look like Unity's project window. - - - - - OdinMenuTree provides a tree of s, and helps with selection, inserting menu items into the tree, and can handle keyboard navigation for you. - - - - OdinMenuTree tree = new OdinMenuTree(supportsMultiSelect: true) - { - { "Home", this, EditorIcons.House }, - { "Odin Settings", null, EditorIcons.SettingsCog }, - { "Odin Settings/Color Palettes", ColorPaletteManager.Instance, EditorIcons.EyeDropper }, - { "Odin Settings/AOT Generation", AOTGenerationConfig.Instance, EditorIcons.SmartPhone }, - { "Camera current", Camera.current }, - { "Some Class", this.someData } - }; - - tree.AddAllAssetsAtPath("Some Menu Item", "Some Asset Path", typeof(ScriptableObject), true) - .AddThumbnailIcons(); - - tree.AddAssetAtPath("Some Second Menu Item", "SomeAssetPath/SomeAssetFile.asset"); - - var customMenuItem = new OdinMenuItem(tree, "Menu Style", tree.DefaultMenuStyle); - tree.MenuItems.Insert(2, customMenuItem); - - tree.Add("Menu/Items/Are/Created/As/Needed", new GUIContent()); - tree.Add("Menu/Items/Are/Created", new GUIContent("And can be overridden")); - - OdinMenuTrees are typically used with s but is made to work perfectly fine on its own for other use cases. - OdinMenuItems can be inherited and and customized to fit your needs. - - // Draw stuff - someTree.DrawMenuTree(); - // Draw stuff - someTree.HandleKeybaordMenuNavigation(); - - - - - - - - - - - Gets the currently active menu tree. - - - - - Gets the selection. - - - - - Gets the root menu items. - - - - - Gets the root menu item. - - - - - If true, all indent levels will be ignored, and all menu items with IsVisible == true will be drawn. - - - - - Adds a menu item with the specified object instance at the the specified path. - - - - - Adds a menu item with the specified object instance and icon at the the specified path. - - - - - Adds a menu item with the specified object instance and icon at the the specified path. - - - - - Adds a menu item with the specified object instance and icon at the the specified path. - - - - - Adds a collection of objects to the menu tree and returns all menu items created in random order. - - - - - Adds a collection of objects to the menu tree and returns all menu items created in random order. - - - - - Gets or sets the default menu item style from Config.DefaultStyle. - - - - - Gets or sets the default drawing configuration. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - if set to true [supports multi select]. - - - - Initializes a new instance of the class. - - if set to true [supports multi select]. - The default menu item style. - - - - Initializes a new instance of the class. - - - - - Scrolls to the specified menu item. - - - - - Enumerates the tree with a DFS. - - if set to true then the invisible root menu item is included. - - - - Enumerates the tree with a DFS. - - The predicate. - if set to true then the invisible root menu item is included. - - - - Enumerates the tree with a DFS. - - - - - Draws the menu tree recursively. - - - - - Marks the dirty. This will cause a tree.UpdateTree() in the beginning of the next Layout frame. - - - - - Draws the search toolbar. - - - - - Updates the menu tree. This method is usually called automatically when needed. - - - - - Handles the keyboard menu navigation. Call this at the end of your GUI scope, to prevent the menu tree from stealing input events from other text fields. - - Returns true, if anything was changed via the keyboard. - - - - Handles the keyboard menu navigation. Call this at the end of your GUI scope, to prevent the menu tree from stealing input events from other text fields. - - Returns true, if anything was changed via the keyboard. - - - - This class fixes a bug where Unity's Undo.RecordObject does not mark ScriptableObjects dirty when - a change is recorded for them. It does this by subscribing to the Undo.postprocessModifications - event, and marking all modified ScriptableObjects dirty manually. - - - - - The config used by OdinMenuTree to specify which features of the Menu Tree should be used when drawing. - - - - - Gets or sets the default menu item style. - - - - - The automatic scroll on selection changed. True by default. - - - - - Whether to draw the tree in a scrollable view. True by default. - - - - - Whether to handle keyboard navigation after it's done drawing. True by default. - - - - - Whether to draw a searchbar above the menu tree. True by default. - - - - - Whether to the menu items expanded state should be cached. True by default. - - - - - Whether to automatically set focus on the search bar when the tree is drawn for the first time. True by default. - - - - - The scroll-view position. - - - - - The search term. - - - - - The height of the search toolbar. - - - - - Gets or sets the search function. Null by default. - - - - - By default, the MenuTree.Selection is confirmed when menu items are double clicked, - Set this to false if you don't want that behaviour. - - - - - By default, the MenuTree.Selection is confirmed when menu items are double clicked, - Set this to false if you don't want that behaviour. - - - - - Class with utility methods for s and s. - - - - OdinMenuTree tree = new OdinMenuTree(); - tree.AddAllAssetsAtPath("Some Menu Item", "Some Asset Path", typeof(ScriptableObject), true) - .AddThumbnailIcons(); - tree.AddAssetAtPath("Some Second Menu Item", "SomeAssetPath/SomeAssetFile.asset"); - // etc... - - - - - - - - - - - Adds the menu item at the specified menu item path and populates the result list with all menu items created in order to add the menuItem at the specified path. - - The tree instance. - The result list. - The menu item path. - The menu item. - - - - Adds the menu item at specified menu item path, and returns all menu items created in order to add the menuItem at the specified path. - - The tree. - The menu item path. - The menu item. - Returns all menu items created in order to add the menu item at the specified menu item path. - - - - Gets the menu item at the specified path, returns null non was found. - - - - - Adds all asset instances from the specified path and type into a single at the specified menu item path, and returns all menu items created in order to add the menuItem at the specified path.. - - The tree. - The menu item path. - The asset folder path. - The type of objects. - Whether to search for assets in subdirectories as well. - Returns all menu items created in order to add the menu item at the specified menu item path. - - - - Adds all assets at the specified path. Each asset found gets its own menu item inside the specified menu item path. - - The tree. - The menu item path. - The asset folder path. - The type. - Whether to search for assets in subdirectories as well. - If true, sub-directories in the assetFolderPath will no longer get its own sub-menu item at the specified menu item path. - Returns all menu items created in order to add the menu item at the specified menu item path. - - - - Adds all assets at the specified path. Each asset found gets its own menu item inside the specified menu item path. - - The tree. - The menu item path. - The asset folder path. - Whether to search for assets in subdirectories as well. - If true, sub-directories in the assetFolderPath will no longer get its own sub-menu item at the specified menu item path. - Returns all menu items created in order to add the menu item at the specified menu item path. - - - - Adds the asset at the specified menu item path and returns all menu items created in order to end up at the specified menu path. - - The tree. - The menu item path. - The asset path. - Returns all menu items created in order to add the menu item at the specified menu item path. - - - - Adds the asset at the specified menu item path and returns all menu items created in order to end up at the specified menu path. - - The tree. - The menu item path. - The asset path. - The type. - Returns all menu items created in order to add the menu item at the specified menu item path. - - - - Sorts the entire tree of menu items recursively by name with respects to numbers. - - - - - Sorts the collection of menu items recursively by name with respects to numbers. This is a stable sort, meaning that equivalently ordered items will remain in the same order as they start. - - - - - Sorts the collection of menu items recursively using a given custom comparison. This is a stable sort, meaning that equivalently ordered items will remain in the same order as they start. - - - - - Adds the specified object at the specified menu item path and returns all menu items created in order to end up at the specified menu path. - - The tree. - The menu path. - The object instance. - Set this to true if you want Odin serialzied members such as dictionaries and generics to be shown as well. - Returns all menu items created in order to add the menu item at the specified menu item path. - - - - Assigns the specified icon to all menu items in the collection with the specified ObjectInstanceType. - - - - - Assigns the specified icon to all menu items in the collection with the specified ObjectInstanceType. - - - - - Assigns the specified icon to all menu items in the collection. - - - - - Assigns the specified icon to all menu items in the collection. - - - - - Assigns the specified icon to the last menu item in the collection. - - - - - Assigns the specified icon to the last menu item in the collection. - - - - - Assigns the specified icon to the last menu item in the collection. - - - - - Assigns the specified icon to the last menu item in the collection. - - - - - Assigns the specified icon to all menu items in the collection. - - - - - Assigns the specified icon to all menu items in the collection. - - - - - Assigns the specified icon to all menu items in the collection. - - - - - Assigns the asset mini thumbnail as an icon to all menu items in the collection. If the menu items object is null then a Unity folder icon is assigned. - - - - - Assigns the asset mini thumbnail as an icon to all menu items in the collection. If the menu items object is null then a Unity folder icon is assigned. - - - - - Constants which describe the type of change that was made to the OdinMenuTrees's Selection - - - - - - A menu item was removed. - - - - - A menu item was selected. - - - - - The selection was cleared. - - - - - Handles the selection of a Odin Menu Tree with support for multi selection. - - - - - - - - - - Initializes a new instance of the class. - - if set to true [supports multi select]. - - - - Occurs whenever the selection has changed. - - - - - Occurs whenever the selection has changed. - - - - - Usually occurs whenever the user hits return, or double click a menu item. - - - - - Gets the count. - - - - - Gets the first selected value, returns null if non is selected. - - - - - Gets all selected values. - - - - - Gets or sets a value indicating whether multi selection is supported. - - - - - Gets the at the specified index. - - - - - Adds a menu item to the selection. If the menu item is already selected, then the item is pushed to the bottom of the selection list. - If multi selection is off, then the previous selected menu item is removed first. - Adding a item to the selection triggers . - - The item. - - - - Clears the selection and triggers . - - - - - Determines whether an OdinMenuItem is selected. - - - - - Copies all the elements of the current array to the specified array starting at the specified destination array index. - - - - - Gets the enumerator. - - - - - Searches for the specified menu item and returns the index location. - - - - - Removes the specified menu item and triggers . - - - - - Removes the menu item at the specified index and triggers . - - - - - Triggers OnSelectionConfirmed. - - - - - Used in to associate name to a value in the GenericSelector. - - - - - - The value. - - - - - The name. - - - - - Initializes a new instance of the struct. - - - - - If the - - - - - Opens a window which displays a list of all icons available from . - - - - - Opens a window which displays a list of all icons available from . - - - - - Builds the selection tree. - - - - - A feature-rich enum selector with support for flag enums. - - - - KeyCode someEnumValue; - - [OnInspectorGUI] - void OnInspectorGUI() - { - // Use the selector manually. See the documentation for OdinSelector for more information. - if (GUILayout.Button("Open Enum Selector")) - { - EnumSelector<KeyCode> selector = new EnumSelector<KeyCode>(); - selector.SetSelection(this.someEnumValue); - selector.SelectionConfirmed += selection => this.someEnumValue = selection.FirstOrDefault(); - selector.ShowInPopup(); // Returns the Odin Editor Window instance, in case you want to mess around with that as well. - } - - // Draw an enum dropdown field which uses the EnumSelector popup: - this.someEnumValue = EnumSelector<KeyCode>.DrawEnumField(new GUIContent("My Label"), this.someEnumValue); - } - - // All Odin Selectors can be rendered anywhere with Odin. This includes the EnumSelector. - EnumSelector<KeyCode> inlineSelector; - - [ShowInInspector] - EnumSelector<KeyCode> InlineSelector - { - get { return this.inlineSelector ?? (this.inlineSelector = new EnumSelector<KeyCode>()); } - set { } - } - - - - - - - - - - - By default, the enum type will be drawn as the title for the selector. No title will be drawn if the string is null or empty. - - - - - Gets a value indicating whether this instance is flag enum. - - - - - Initializes a new instance of the class. - - - - - Populates the tree with all enum values. - - - - - When ShowInPopup is called, without a specified window width, this method gets called. - Here you can calculate and give a good default width for the popup. - The default implementation returns 0, which will let the popup window determine the width itself. This is usually a fixed value. - - - - - Gets the currently selected enum value. - - - - - Selects an enum. - - - - - Draws an enum selector field using the enum selector. - - - - - Draws an enum selector field using the enum selector. - - - - - Draws an enum selector field using the enum selector. - - - - - Draws an enum selector field using the enum selector. - - - - - In simple one-off use cases, making a custom OdinSelector might not be needed, as the GenericSelecor - can be populated with anything and customized a great deal. - - - - SomeType someValue; - - [OnInspectorGUI] - void OnInspectorGUI() - { - if (GUILayout.Button("Open Generic Selector Popup")) - { - List<SomeType> source = ...; - GenericSelector<SomeType> selector = new GenericSelector<SomeType>("Title", false, x => x.Path, source); - selector.SetSelection(this.someValue); - selector.SelectionTree.Config.DrawSearchToolbar = false; - selector.SelectionTree.DefaultMenuStyle.Height = 22; - selector.SelectionConfirmed += selection => this.someValue = selection.FirstOrDefault() - var window = selector.ShowInPopup(); - window.OnEndGUI += () => { EditorGUILayout.HelpBox("A quick way of injecting custom GUI to the editor window popup instance.", MessageType.Info); }; - window.OnClose += selector.SelectionTree.Selection.ConfirmSelection; // Confirm selection when window clses. - } - } - - - - - - - - - - - Gets or sets a value indicating whether [flattened tree]. - - - - - Gets or sets a value indicating whether [checkbox toggle]. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Gets the title. No title will be drawn if the string is null or empty. - - - - - Draws the selection tree. This gets drawn using the OnInspectorGUI attribute. - - - - - Builds the selection tree. - - - - - OdinSelectors is an abstract base class that combines OdinMenuTrees and OdinEditorWindows to help making feature-rich selectors and popup selectors. - - - - public class MySelector : OdinSelector<SomeType> - { - private readonly List<SomeType> source; - private readonly bool supportsMultiSelect; - - public MySelector(List<SomeType> source, bool supportsMultiSelect) - { - this.source = source; - this.supportsMultiSelect = supportsMultiSelect; - } - - protected override void BuildSelectionTree(OdinMenuTree tree) - { - tree.Config.DrawSearchToolbar = true; - tree.Selection.SupportsMultiSelect = this.supportsMultiSelect; - - tree.Add("Defaults/None", null); - tree.Add("Defaults/A", new SomeType()); - tree.Add("Defaults/B", new SomeType()); - - tree.AddRange(this.source, x => x.Path, x => x.SomeTexture); - } - - [OnInspectorGUI] - private void DrawInfoAboutSelectedItem() - { - SomeType selected = this.GetCurrentSelection().FirstOrDefault(); - - if (selected != null) - { - GUILayout.Label("Name: " + selected.Name); - GUILayout.Label("Data: " + selected.Data); - } - } - } - - Usage: - - void OnGUI() - { - if (GUILayout.Button("Open My Selector")) - { - List<SomeType> source = this.GetListOfThingsToSelectFrom(); - MySelector selector = new MySelector(source, false); - - selector.SetSelection(this.someValue); - - selector.SelectionCancelled += () => { }; // Occurs when the popup window is closed, and no slection was confirmed. - selector.SelectionChanged += col => { }; - selector.SelectionConfirmed += col => this.someValue = col.FirstOrDefault(); - - selector.ShowInPopup(); // Returns the Odin Editor Window instance, in case you want to mess around with that as well. - } - } - - // All Odin Selectors can be rendered anywhere with Odin. - [ShowInInspector] - MySelector inlineSelector; - - - - - - - - - - - If true, a confirm selection button will be drawn in the title-bar. - - - - - Enables the single click to select. - - - - - Occurs when the window is closed, and no slection was confirmed. - - - - - Occurs when the menuTrees selection is changed and IsValidSelection returns true. - - - - - Occurs when the menuTrees selection is confirmed and IsValidSelection returns true. - - - - - Gets the selection menu tree. - - - - - Gets the title. No title will be drawn if the string is null or empty. - - - - - Gets the current selection from the menu tree whether it's valid or not. - - - - - Determines whether the specified collection is a valid collection. - If false, the SlectionChanged and SelectionConfirm events will not be called. - By default, this returns true if the collection contains one or more items. - - - - - Sets the selection. - - - - - Sets the selection. - - - - - Opens up the selector instance in a popup at the specified rect position. - The width of the popup is determined by DefaultWindowWidth, and the height is automatically calculated. - - - - - Opens up the selector instance in a popup at the specified rect position. - - - - - Opens up the selector instance in a popup at the specified rect position. - - - - - The mouse position is used as the position for the window. - Opens up the selector instance in a popup at the specified position. - - - - - Opens up the selector instance in a popup at the specified position. - - - - - Opens up the selector instance in a popup at the specified rect position. - - - - - Opens up the selector instance in a popup at the specified position. - The width of the popup is determined by DefaultWindowWidth, and the height is automatically calculated. - - - - - Opens up the selector instance in a popup with the specified width and height. - The mouse position is used as the position for the window. - - - - - Builds the selection tree. - - - - - When ShowInPopup is called, without a specifed window width, this methods gets called. - Here you can calculate and give a good default width for the popup. - The default implementation returns 0, which will let the popup window determain the width itself. This is usually a fixed value. - - - - - Triggers the selection changed event, but only if the current selection is valid. - - - - - Draw the selecotr manually. - - - - - Draws the selection tree. This gets drawn using the OnInspectorGUI attribute. - - - - - Draws dropwdown field, that creates and binds the selector to the dropdown field. - - - - - Draws dropwdown field, that creates and binds the selector to the dropdown field. - - - - - Draws dropwdown field, that creates and binds the selector to the dropdown field. - - - - - Draws dropwdown field, that creates and binds the selector to the dropdown field. - - - - - A feature-rich type selector. - - - - Type[] selectedTypes; - - void OnGUI() - { - // Use the selector manually. See the documentation for OdinSelector for more information. - if (GUILayout.Button("Open My Selector")) - { - TypeSelector selector = new TypeSelector(customListOfTypes); - TypeSelector selector = new TypeSelector(AssemblyTypeFlags.CustomTypes, supportsMultiSelect: true); - selector.SetSelection(this.selectedTypes); - selector.SelectionConfirmed += selection => this.selectedTypes = selection.ToArray(); - selector.ShowInPopup(); // Returns the Odin Editor Window instance, in case you want to mess around with that as well. - } - } - - - - - private static Type currentSelectedType; - private static IEnumerable<Type> currentSource; - private static Func<Rect, OdinSelector<Type>> createTypeSelector = (rect) => - { - TypeSelector selector = new TypeSelector(currentSource, false); - selector.SetSelection(currentSelectedType); - selector.ShowInPopup(rect); - return selector; - }; - - public static Type DrawTypeSelectorDropdown(GUIContent label, Type selectedType, IEnumerable<Type> source) - { - currentSource = source; - currentSelectedType = selectedType; - - var dropdownText = selectedType == null ? "None" : selectedType.GetNiceName(); - var selected = TypeSelector.DrawSelectorDropdown(label, dropdownText, createTypeSelector); - if (selected != null && selected.Any()) - { - selectedType = selected.FirstOrDefault(); - } - return selectedType; - } - - - - - - Builds the selection tree. - - - - - 450 - - - - - Sets the selected types. - - - - - Editor Only Mode Utility. - - - - - Gaither all necessary information about the editor only state. - - - - - Disables Editor Only Mode. - - - - - Enables editor only mode. - - - - - Checks to see whether Editor Only Mode is enabled. - - - - - Checks to see whether Odin Inspector is installed in Source Code mode. - - - - - Contains general configuration for all Odin drawers. - - You can modify the configuration in the Odin Preferences window found in 'Tools -> Odin Inspector -> Preferences -> Drawers -> General', - or by locating the configuration file stored as a serialized object in the Sirenix folder under 'Odin Inspector/Config/Editor/GeneralDrawerConfig'. - - - - - - Specify whether or not the script selector above components should be drawn. - - - - - Specify whether or not the warning for properties that do not support prefab modifications should be shown in the inspector. - - - - - Specify whether or not the warning for properties that do not support prefab modifications should be shown in the inspector. - - - - - Specifies the maximum depth to which a property can draw itself recursively before the system refuses to draw it any deeper. - - - - - If set to true, most foldouts throughout the inspector will be expanded by default. - - - - - If set to true, buttons will show the result values from invoking them in the inspector by default. - - - - - If set to true, type matching for things such as drawers will be precomputed in a separate thread based on a cache from the previously loaded AppDomain that is stored on disk in the Project's Temp folder, resulting in some overall speedups in some cases when doing first-time type matching. Requires a recompile/project reload before it takes any effect. - - - - - Specify the animation speed for most foldouts throughout the inspector. - - - - - Specify the shaking duration for most shaking animations throughout the inspector. - - - - - Specify the animation speed for - - - - - When true the component labels, for vector fields, will be hidden when the field is too narrow. - - - - - Specify how the Quaternion struct should be shown in the inspector. - - - - - Gets or sets a value indicating whether [use improved enum drop down]. - - - - - Gets or sets a value indicating whether [use improved enum drop down]. - - - - - Specify whether or not a list should hide the foldout triangle when the list is empty. - - - - - Specifies whether a list should hide the foldout triangle when the list is empty. - - - - - Specify whether or not lists should hide the paging buttons when the list is collapsed. - - - - - Specify whether or not lists should hide the paging buttons when there is only one page. - - - - - Specify the number of elements drawn per page. - - - - - Specify whether or not lists should be expanded or collapsed by default. - - - - - Specify whether or not to include a button which expands the list, showing all pages at once. - - - - - Specify whether or not lists should show item count. - - - - - Specify whether or not lists should show item count. - - - - - Specify the color of even list elements when in the dark skin. - - - - - Specify the color of odd list elements when in the dark skin. - - - - - Specify the color of even list elements when in the light skin. - - - - - Specify the color of odd list elements when in the light skin. - - - - - Gets or sets the default size of the preview object field. - - - - - Gets or sets the default alignment of the preview object field. - - - - - Gets or sets which types should be drawn by default by the preview object field. - - - - - Resets all settings to default. - - - - - - Tell Odin which types should be drawn or should not be drawn by Odin. - - - You can modify which types should be drawn by Odin in the Preferences window found in 'Tools -> Odin Inspector -> Preferences -> Editor Types', - or by locating the configuration file stored as a serialized object in the Sirenix folder under 'Odin Inspector/Config/Editor/InspectorConfig'. - - - - - - Whether Odin is enabled in the inspector or not. - - - - - InspectorDefaultEditors is a bitmask used to tell which types should have an Odin Editor generated. - - - - - The config which contains configuration data for which types Odin should draw in the inspector. - - - - - Updates Unity with the current Odin editor configuration. - - - - - InspectorDefaultEditors is a bitmask used to tell which types should have an Odin Editor generated. - - - - - - Excludes all types. - - - - - UserTypes includes all custom user scripts that are not located in an editor or plugin folder. - - - - - PluginTypes includes all types located in the plugins folder and are not located in an editor folder. - - - - - UnityTypes includes all types depended on UnityEngine and from UnityEngine, except editor, plugin and user types. - - - - - OtherTypes include all other types that are not depended on UnityEngine or UnityEditor. - - - - - Contains configuration data for which types Odin should draw in the inspector. - - - Note that this class supports assigning arbitrary editor types to inspect any Unity object type. The Editor Types GUI in preferences simply does not, as of now, support assigning editors of any other type than . However, the API is open to further customization. - When an editor is generated for a type, a new editor type is added to the GeneratedOdinEditors assembly, which is derived from the assigned editor type - in most cases, . - You can check if an editor is compatible using . - - . - . - - - - The type binder that the uses to bind types to names, and names to types. - This is usually an instance of . - - - - - Resets the drawing configuration to the default values. - - - - - Gets a list of all drawn types that have entries in the drawing config. - - - - - Forces the config's internal drawer type to value type lookup cache to rebuild itself. - - - - - Clears the editor type entry for the given drawer, so it will be set to Unity's default. - - The drawn type to clear the editor for. - drawnType is null - - - - Assigns a given editor to draw a given type. - - The drawn type to assign an editor type for. - The editor type to assign. When generating editors, a type derived from this editor will be created and set to draw the given drawn type. - drawnType - The type " + editorType.GetNiceName() + " is not a valid base editor for type " + drawnType.GetNiceName() + ". Check criteria using . - - - - Determines whether an editor value has been assigned for a given drawn type. - - The drawn type to check. - drawnType is null - - - - Gets which editor type would draw the given type. If the type has not been assigned a custom editor type in the config, the default editor type is returned using . - - The drawn type to get an editor type for. - The editor that would draw the given type. - drawnType is null - - - - Gets the default editor that this type would have, if no custom editor was set for this type in particular. This is calculated using the value of . - - The drawn type to get the default editor for. - The editor that would draw this type by default, or null, if there is no default Odin-defined editor for the drawn type. - drawnType is null - - - - Checks whether the given editor can be assigned to draw any type using the class. - - Type of the editor to check. - True if the editor is valid, otherwise false - - - - Checks whether the given editor can be assigned to draw a given type using the class. - This method checks the attribute on the type for whether the given type is compatible. - - Type of the editor to check. - Type of the drawn value to check. If this parameter is null, the drawn type is not checked for compatibility with the editor type; only the editor type itself is checked for validity. - True if the editor is valid, otherwise false - editorType - - - - Gets the type that an editor draws, by extracting it from the editor's attribute, if it is declared. - This method returns null for abstract editor types, as those can never draw anything. - - Type of the editor. - Whether the editor in question is also an editor for types derived from the given type. - - editorType - - - - A type that indicates that a drawer is missing. - - - - - Draws an instance, and contains methods getting all types that should be drawn by Odin. - Note that this class keeps a lot of static state, and is only intended to draw the instance of that exists in the singleton asset. If used to draw other instances, odd behaviour may occur. - - . - . - - - - Determines whether Odin is capable of creating a custom editor for a given type. - - - - - Gets an array of all assigned editor types, and the types they have to draw. - - - - - Draws the property. - - - - - Contains information about an editor type which is assigned to draw a certain type in the inspector. - This class uses the instance to bind types to names, and names to types. - - . - . - . - - - - A default, empty value. - - - - - The name of the type to be drawn. - - - - - The name of the editor type. - - - - - Initializes a new instance of the struct. - - The drawn type. - drawnType is null - - - - Initializes a new instance of the struct. - - The drawn type. - The editor type. - drawnType is null - - - - Determines whether the specified is equal to this instance. - - The to compare with this instance. - - true if the specified is equal to this instance; otherwise, false. - - - - - Returns a hash code for this instance. - - - A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - - - - - Determines whether the specified , is equal to this instance. - - The to compare with this instance. - - true if the specified is equal to this instance; otherwise, false. - - - - - Implements the operator ==. - - The x. - The y. - - The result of the operator. - - - - - Implements the operator !=. - - The x. - The y. - - The result of the operator. - - - - - Represents a weakly typed collection of values for a - one value per selected inspector target. - - - - - Whether the values have been changed since was last called. - - - - - Marks the value collection as being clean again. This is typically called at the end of the current GUI frame, during . - - - - - Marks the value collection as being dirty, regardless of any value changes. - - - - - Reverts the value collection to its origin values (found in ) from the last call, and marks the value collection as being clean again. - - - - - Force sets the value, ignoring whether it is editable or not. - Note that this will fail on list element value entries where is true on the parent value entry. - - The selection index of the value. - The value to be set. - - - - The original values of the value collection, such as they were immediately after the last call. - - - - - Represents a strongly typed collection of values for a - one value per selected inspector target. - - - - - Gets the value at the given selection index. - - - - - The number of values in the collection. - - - - - The original values of the value collection, such as they were immediately after the last call. - - - - - Force sets the value, ignoring whether it is editable or not. - Note that this will fail on list element value entries where is true on the parent value entry. - - The selection index of the value. - The value to be set. - - - - Represents an alias for a strongly typed collection of values for a - one value per selected inspector target. - This class ensures that polymorphism works in the inspector, and can be strongly typed in applicable cases. - - The type of the aliased collection. - The polymorphic type of this collection, which is assignable to . - - - - - - Initializes a new instance of the class. - - The property. - The aliased collection. - Not yet documented. - Not yet documented. - aliasedCollection - - - - Whether the values have been changed since was last called. - - - - - The number of values in the collection. - - - - - Gets a value indicating whether this instance is synchronized. - - - true if this instance is synchronized; otherwise, false. - - - - - Gets the synchronization root object. - - - The synchronization root object. - - - - - The original values of the (loosely typed) value collection, such as they were immediately after the last call. - - - - - The original values of the value collection, such as they were immediately after the last call. - - - - - Gets or sets the at the specified index. - - - The . - - The index. - - - - - Gets an enumerator for the collection. - - - - - - Marks the value collection as being clean again. This is typically called at the end of the current GUI frame, during . - - - - - Reverts the value collection to its origin values (found in ) from the last call, and marks the value collection as being clean again. - - - - - Determines whether the collection contains the specified value. - - The value. - - true if the collection contains the specified value; otherwise, false. - - - - - Gets the index of the given value, or -1 if the value was not found. - - The value to get the index of. - - The index of the given value, or -1 if the value was not found. - - - - - Copies the collection to an array. - - The array to copy to. - The index to copy from. - - - - Gets the weakly typed value at the given index. - - The index of the value to get. - - The weakly typed value at the given index - - - - - Sets the weakly typed value at the given index. - - The index to set the value of. - The value to set. - - - - Force sets the value, ignoring whether it is editable or not. - Note that this will fail on list element value entries where is true on the parent value entry. - - The selection index of the value. - The value to be set. - - - - Force sets the value, ignoring whether it is editable or not. - Note that this will fail on list element value entries where is true on the parent value entry. - - The selection index of the value. - The value to be set. - - - - Marks the value collection as being dirty, regardless of any value changes. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Represents the values of an , and contains utilities for querying the values' type and getting and setting them. - - - - - The number of parallel values this entry represents. This will always be exactly equal to the count of . - - - - - Whether this value entry is editable or not. - - - - - If this value entry has the override type , this is the path of the property it references. - - - - - The actual serialization backend for this value entry, possibly inherited from the serialization backend of the root property this entry is a child of. - Note that this is *not* always equal to . - - - - - The property whose values this value entry represents. - - - - - Provides access to the weakly typed values of this value entry. - - - - - Whether this value entry has been changed from its prefab counterpart. - - - - - Whether this value entry has had its list length changed from its prefab counterpart. - - - - - Whether this value entry has had its dictionary values changes from its prefab counterpart. - - - - - A weakly typed smart value that represents the first element of the value entry's value collection, but has "smart logic" for setting the value that detects relevant changes and applies them in parallel. - This lets you often just use the smart value instead of having to deal with the tedium of multiple parallel values. - - - - - The type from which this value entry comes. If this value entry represents a member value, this is the declaring type of the member. If the value entry represents a collection element, this is the type of the collection. - - - - - The most precise known contained type of the value entry. If polymorphism is in effect, this will be some type derived from . - - - - - The base type of the value entry. If this is value entry represents a member value, this is the type of the member. If the value entry represents a collection element, this is the element type of the collection. - - - - - The special state of the value entry. - - - - - Whether this value entry is an alias, or not. Value entry aliases are used to provide strongly typed value entries in the case of polymorphism. - - - - - The context container of this property. - - - - - Whether this type is marked as an atomic type using a . - - - - - An event that is invoked during , when any values have changed. - - - - - An event that is invoked during , when any child values have changed. - - - - - Updates the values contained in this value entry to the actual values in the target objects, and updates its state (override, type of value, etc.) accordingly. - - - - - Applies the changes made to this value entry to the target objects, and registers prefab modifications as necessary. - - True if any changes were made, otherwise, false. - - - - Checks whether the values in this value entry are equal to the values in another value entry. - Note, both value entries must have the same value type, and must represent values that are .NET value types. - - - - - Determines whether the value at the given selection index is different from the given prefab value, as is relevant for prefab modification checks. - If the value is a reference type, null and type difference is checked. If value is a value type, a comparer from is used. - This method is best ignored unless you know what you are doing. - - The value to check differences against. - The selection index to compare against. - - - - Represents the strongly typed values of an , and contains utilities for querying the values' type and getting and setting them. - - - - - Provides access to the strongly typed values of this value entry. - - - - - A strongly typed smart value that represents the first element of the value entry's value collection, but has "smart logic" for setting the value that detects relevant changes and applies them in parallel. - This lets you often just use the smart value instead of having to deal with the tedium of multiple parallel values. - - - - - Determines whether the value at the given selection index is different from the given prefab value, as is relevant for prefab modification checks. - If the value is a reference type, null and type difference is checked. If value is a value type, a comparer from is used. - This method is best ignored unless you know what you are doing. - - The value to check differences against. - The selection index to compare against. - - - - A polymorphic alias for a instance, used to implement strongly typed polymorphism in Odin. - - - - - The number of parallel values this entry represents. This will always be exactly equal to the count of . - - - - - Whether this value entry is editable or not. - - - - - If this value entry has the override type , this is the path of the property it references. - - - - - The actual serialization backend for this value entry, possibly inherited from the serialization backend of the root property this entry is a child of. - Note that this is *not* always equal to . - - - - - The property whose values this value entry represents. - - - - - Provides access to the weakly typed values of this value entry. - - - - - Whether this value entry has been changed from its prefab counterpart. - - - - - Whether this value entry has had its list length changed from its prefab counterpart. - - - - - Whether this value entry has had its dictionary values changes from its prefab counterpart. - - - - - A weakly typed smart value that represents the first element of the value entry's value collection, but has "smart logic" for setting the value that detects relevant changes and applies them in parallel. - This lets you often just use the smart value instead of having to deal with the tedium of multiple parallel values. - - - - - The type from which this value entry comes. If this value entry represents a member value, this is the declaring type of the member. If the value entry represents a collection element, this is the type of the collection. - - - - - The most precise known contained type of the value entry. If polymorphism is in effect, this will be some type derived from . - - - - - The base type of the value entry. If this is value entry represents a member value, this is the type of the member. If the value entry represents a collection element, this is the element type of the collection. - - - - - The special state of the value entry. - - - - - Whether this value entry is an alias, or not. Value entry aliases are used to provide strongly typed value entries in the case of polymorphism. - - - - - The context container of this property. - - - - - Whether this type is marked as an atomic type using a . - - - - - An event that is invoked during , when any values have changed. - - - - - An event that is invoked during , when any child values have changed. - - - - - Applies the changes made to this value entry to the target objects, and registers prefab modifications as necessary. - - - True if any changes were made, otherwise, false. - - - - - Updates the values contained in this value entry to the actual values in the target objects, and updates its state (override, type of value, etc.) accordingly. - - - - - Checks whether the values in this value entry are equal to the values in another value entry. - Note, both value entries must have the same value type, and must represent values that are .NET value types. - - - - - Sets the actual value of a value entry, for a given selection index. - - - - - Determines whether the value at the given selection index is different from the given prefab value, as is relevant for prefab modification checks. - If the value is a reference type, null and type difference is checked. If value is a value type, a comparer from is used. - This method is best ignored unless you know what you are doing. - - The value to check differences against. - The selection index to compare against. - - - - A polymorphic alias for a instance, used to implement strongly typed polymorphism in Odin. - - - - - Initializes a new instance of the class. - - The value entry to alias. - valueEntry is null - - - - Provides access to the strongly typed values of this value entry. - - - - - A strongly typed smart value that represents the first element of the value entry's value collection, but has "smart logic" for setting the value that detects relevant changes and applies them in parallel. - This lets you often just use the smart value instead of having to deal with the tedium of multiple parallel values. - - - - - A weakly typed smart value that represents the first element of the value entry's value collection, but has "smart logic" for setting the value that detects relevant changes and applies them in parallel. - This lets you often just use the smart value instead of having to deal with the tedium of multiple parallel values. - - - - - The number of parallel values this entry represents. This will always be exactly equal to the count of . - - - - - Whether this value entry is editable or not. - - - - - If this value entry has the override type , this is the path of the property it references. - - - - - The actual serialization backend for this value entry, possibly inherited from the serialization backend of the root property this entry is a child of. - Note that this is *not* always equal to . - - - - - The property whose values this value entry represents. - - - - - Provides access to the weakly typed values of this value entry. - - - - - Whether this value entry has been changed from its prefab counterpart. - - - - - Whether this value entry has had its list length changed from its prefab counterpart. - - - - - Whether this value entry has had its dictionary values changes from its prefab counterpart. - - - - - The type from which this value entry comes. If this value entry represents a member value, this is the declaring type of the member. If the value entry represents a collection element, this is the type of the collection. - - - - - The most precise known contained type of the value entry. If polymorphism is in effect, this will be some type derived from . - - - - - The base type of the value entry. If this is value entry represents a member value, this is the type of the member. If the value entry represents a collection element, this is the element type of the collection. - - - - - The special state of the value entry. - - - - - Whether this type is marked as an atomic type using a . - - - - - An event that is invoked during , when any values have changed. - - - - - An event that is invoked during , when any child values have changed. - - - - - Applies the changes made to this value entry to the target objects, and registers prefab modifications as necessary. - - - True if any changes were made, otherwise, false. - - - - - Updates the values contained in this value entry to the actual values in the target objects, and updates its state (override, type of value, etc.) accordingly. - - - - - Checks whether the values in this value entry are equal to the values in another value entry. - Note, both value entries must have the same value type, and must represent values that are .NET value types. - - - - - Sets the actual value of a value entry, for a given selection index. - - - - - Determines whether the value at the given selection index is different from the given prefab value, as is relevant for prefab modification checks. - If the value is a reference type, null and type difference is checked. If value is a value type, a comparer from is used. - This method is best ignored unless you know what you are doing. - - The value to check differences against. - The selection index to compare against. - - - - Determines whether the value at the given selection index is different from the given prefab value, as is relevant for prefab modification checks. - If the value is a reference type, null and type difference is checked. If value is a value type, a comparer from is used. - This method is best ignored unless you know what you are doing. - - The value to check differences against. - The selection index to compare against. - Draws short properties marked with . @@ -6477,309 +6341,463 @@ Not yet documented. - + - Draws properties marked with . - - - - - - - - - Draws the property. + Base drawer to inherit from to draw methods. - + - Base class for creating editor windows using Odin. + + Base class for attribute drawers. Use this class to create your own custom attribute drawers that will work for all types. + Alternatively you can derive from if you want to only support specific types. + + + + Odin supports the use of GUILayout and takes care of undo for you. It also takes care of multi-selection + in many simple cases. Check the manual for more information on handling multi-selection. + + + + Also note that Odin does not require that your custom attribute inherits from Unity's PropertyAttribute. + + + The attribute that this drawer should be applied to. + + + Checkout the manual for more information. + + + Example using the . - public class SomeWindow : OdinEditorWindow + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false)] + public class CustomRangeAttribute : System.Attribute { - [MenuItem("My Game/Some Window")] - private static void OpenWindow() + public float Min; + public float Max; + + public CustomRangeAttribute(float min, float max) { - GetWindow<SomeWindow>().Show(); + this.Min = min; + this.Max = max; } + } - [Button(ButtonSizes.Large)] - public void SomeButton() { } + // Remember to wrap your custom attribute drawer within a #if UNITY_EDITOR condition, or locate the file inside an Editor folder. - [TableList] - public SomeType[] SomeTableData; + public sealed class CustomRangeAttributeDrawer : OdinAttributeDrawer<CustomRangeAttribute, float> + { + protected override void DrawPropertyLayout(GUIContent label) + { + this.ValueEntry.SmartValue = EditorGUILayout.Slider(label, this.ValueEntry.SmartValue, this.Attribute.Min, this.Attribute.Max); + } + } + + // Usage: + public class MyComponent : MonoBehaviour + { + [CustomRangeAttribute(0, 1)] + public float MyFloat; } + + Example using the . - public class DrawSomeSingletonInAnEditorWindow : OdinEditorWindow + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false)] + public class GUITintColorAttribute : System.Attribute { - [MenuItem("My Game/Some Window")] - private static void OpenWindow() + public Color Color; + + public GUITintColorAttribute(float r, float g, float b, float a = 1) { - GetWindow<DrawSomeSingletonInAnEditorWindow>().Show(); + this.Color = new Color(r, g, b, a); + } + } + + // Remember to wrap your custom attribute drawer within a #if UNITY_EDITOR condition, or locate the file inside an Editor folder. + + public sealed class GUITintColorAttributeDrawer : OdinAttributeDrawer<GUITintColorAttribute> + { + protected override void DrawPropertyLayout(GUIContent label) + { + Color prevColor = GUI.color; + GUI.color *= this.Attribute.Color; + this.CallNextDrawer(label); + GUI.color = prevColor; + } + } + + // Usage: + public class MyComponent : MonoBehaviour + { + [GUITintColor(0, 1, 0)] + public float MyFloat; + } + + + + + + Odin uses multiple drawers to draw any given property, and the order in which these drawers are + called are defined using the . + Your custom drawer injects itself into this chain of drawers based on its . + If no is defined, a priority is generated automatically based on the type of the drawer. + Each drawer can ether choose to draw the property or not, or pass on the responsibility to the + next drawer by calling CallNextDrawer(), as the f attribute does in the example above. + + + + This means that there is no guarantee that your drawer will be called, sins other drawers + could have a higher priority than yours and choose not to call CallNextDrawer(). + + + + Note that Odin's has full support for generic class constraints, + and if that is not enough, you can also add additional type constraints by overriding CanDrawTypeFilter + + + + Also note that all custom property drawers needs to handle cases where the label provided by the DrawPropertyLayout is null, + otherwise exceptions will be thrown when in cases where the label is hidden. For instance when [HideLabel] is used, or the property is drawn within a list where labels are also not shown. + + + + [DrawerPriority(DrawerPriorityLevel.AttributePriority)] + public sealed class MyCustomAttributeDrawer<T> : OdinAttributeDrawer<MyCustomAttribute, T> where T : class + { + public override bool CanDrawTypeFilter(Type type) + { + return type != typeof(string); } - protected override object GetTarget() + protected override void DrawPropertyLayout(GUIContent label) { - return MySingleton.Instance; + // Draw property here. } } + + + + + + + + + + + + + + + + Gets the attribute that the OdinAttributeDrawer draws for. + + + + + Tells whether or not multiple attributes are allowed. + + + + + Draws the property with the given label. + Override this to implement your custom OdinAttributeDrawer. + + Optional label for the property. + + + + Tests if the drawer can draw for the specified property. + + The property to test. + true if the drawer can drawn the property. Otherwise false. + + + + Tests if the attribute drawer can draw for the specified property. + + The property to test. + true if the drawer can drawn the property. Otherwise false. + + + + + Base class for all type specific attribute drawers. For non-type specific attribute drawers see . + + + + Odin supports the use of GUILayout and takes care of undo for you. It also takes care of multi-selection + in many simple cases. Checkout the manual for more information on handling multi-selection. + + + + Also note that Odin does not require that your custom attribute inherits from Unity's PropertyAttribute. + + + + The attribute that this drawer should be applied to. + The type of the value the drawer should be drawing. Note that Odin's has full support for generic constraints. + + + Checkout the manual for more information. + + + Example using the . - private void InspectObjectInWindow() + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false)] + public class CustomRangeAttribute : System.Attribute { - OdinEditorWindow.InspectObject(someObject); + public float Min; + public float Max; + + public CustomRangeAttribute(float min, float max) + { + this.Min = min; + this.Max = max; + } } - - private void InspectObjectInDropDownWithAutoHeight() + + // Remember to wrap your custom attribute drawer within a #if UNITY_EDITOR condition, or locate the file inside an Editor folder. + + public sealed class CustomRangeAttributeDrawer : OdinAttributeDrawer<CustomRangeAttribute, float> { - var btnRect = GUIHelper.GetCurrentLayoutRect(); - OdinEditorWindow.InspectObjectInDropDown(someObject, btnRect, btnRect.width); + protected override void DrawPropertyLayout(GUIContent label) + { + this.ValueEntry.SmartValue = EditorGUILayout.Slider(label, this.ValueEntry.SmartValue, this.Attribute.Min, this.Attribute.Max); + } } - - private void InspectObjectInDropDown() + + // Usage: + public class MyComponent : MonoBehaviour { - var btnRect = GUIHelper.GetCurrentLayoutRect(); - OdinEditorWindow.InspectObjectInDropDown(someObject, btnRect, new Vector2(btnRect.width, 100)); - } - - private void InspectObjectInACenteredWindow() - { - var window = OdinEditorWindow.InspectObject(someObject); - window.position = GUIHelper.GetEditorWindowRect().AlignCenter(270, 200); - } - - private void OtherStuffYouCanDo() - { - var window = OdinEditorWindow.InspectObject(this.someObject); - - window.position = GUIHelper.GetEditorWindowRect().AlignCenter(270, 200); - window.titleContent = new GUIContent("Custom title", EditorIcons.RulerRect.Active); - window.OnClose += () => Debug.Log("Window Closed"); - window.OnBeginGUI += () => GUILayout.Label("-----------"); - window.OnEndGUI += () => GUILayout.Label("-----------"); + [CustomRangeAttribute(0, 1)] + public float MyFloat; } - + + + Example using the . + + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false)] + public class GUITintColorAttribute : System.Attribute + { + public Color Color; + + public GUITintColorAttribute(float r, float g, float b, float a = 1) + { + this.Color = new Color(r, g, b, a); + } + } + + // Remember to wrap your custom attribute drawer within a #if UNITY_EDITOR condition, or locate the file inside an Editor folder. + + public sealed class GUITintColorAttributeDrawer : OdinAttributeDrawer<GUITintColorAttribute> + { + protected override void DrawPropertyLayout(GUIContent label) + { + Color prevColor = GUI.color; + GUI.color *= this.Attribute.Color; + this.CallNextDrawer(label); + GUI.color = prevColor; + } + } + + // Usage: + public class MyComponent : MonoBehaviour + { + [GUITintColor(0, 1, 0)] + public float MyFloat; + } + + + + + + Odin uses multiple drawers to draw any given property, and the order in which these drawers are + called is defined using the . + Your custom drawer injects itself into this chain of drawers based on its . + If no is defined, a priority is generated automatically based on the type of the drawer. + Each drawer can ether choose to draw the property or not, or pass on the responsibility to the + next drawer by calling CallNextDrawer(), as the GUITintColor attribute does in the example above. + + + + This means that there is no guarantee that your drawer will be called, since other drawers + could have a higher priority than yours and choose not to call CallNextDrawer(). + + + + Note that Odin's has full support for generic class constraints, + and if that is not enough, you can also add additional type constraints by overriding CanDrawTypeFilter + + + + Also note that all custom property drawers needs to handle cases where the label provided by the DrawPropertyLayout is null, + otherwise exceptions will be thrown when in cases where the label is hidden. For instance when [HideLabel] is used, or the property is drawn within a list where labels are also not shown. + + + + [DrawerPriority(DrawerPriorityLevel.AttributePriority)] + public class MyCustomAttributeDrawer<T> : OdinAttributeDrawer<MyCustomAttribute, T> where T : class + { + public override bool CanDrawTypeFilter(Type type) + { + return type != typeof(string); + } + + protected override void DrawPropertyLayout(GUIContent label) + { + // Draw property here. + } + } + + + + + + + + + + + + + + - + - Occurs when the window is closed. + Gets the strongly typed ValueEntry of the OdinAttributeDrawer's property. - + - Occurs at the beginning the OnGUI method. + Draws the property with the given label. + Override this to implement your custom OdinAttributeDrawer. + Optional label for the property. - + - Occurs at the end the OnGUI method. + Tests if the drawer can draw for the specified property. + The property to test. + true if the drawer can drawn the property. Otherwise false. - + - Gets the label width to be used. Values between 0 and 1 are treated as percentages, and values above as pixels. + Tests if the attribute drawer can draw for the specified property. + The property to test. + true if the drawer can drawn the property. Otherwise false. - - - Gets or sets the window padding. x = left, y = right, z = top, w = bottom. - - - - - Gets a value indicating whether the window should draw a scroll view. - - - - - Gets a value indicating whether the window should draw a Unity editor preview, if possible. - - - - - Gets the default preview height for Unity editors. - - - - - Gets the target which which the window is supposed to draw. By default it simply returns the editor window instance itself. By default, this method is called by (). - - - - - Gets the targets to be drawn by the editor window. By default this simply yield returns the method. - - - - - At the start of each OnGUI event when in the Layout event, the GetTargets() method is called and cached into a list which you can access from here. - - - + - Pops up an editor window for the given object in a drop-down window which closes when it loses its focus. - This particular overload uses a few frames to calculate the height of the content before showing the window with a height that matches its content. + Base class for all Odin drawers. In order to create your own custom drawers you need to derive from one of the following drawers: - Protip: You can subscribe to OnClose if you want to know when that occurs. + + + + + + + Remember to provide your custom drawer with an in order for it to be located by the . + Drawers require a context, and are instantiated automatically by the . + Odin supports the use of GUILayout and takes care of undo for you. It also takes care of multi-selection in many simple cases. Checkout the manual for more information. + + + + + + + + + + + + + + + + + If true then this drawer will be skipped in the draw chain. Otherwise the drawer will be called as normal in the draw chain. - + - - Pops up an editor window for the given object in a drop-down window which closes when it loses its focus. - - Protip: You can subscribe to OnClose if you want to know when that occurs. + Gets a value indicating if the drawer has been initialized yet. - + - - Pops up an editor window for the given object in a drop-down window which closes when it loses its focus. - - Protip: You can subscribe to OnClose if you want to know when that occurs. + Gets the property this drawer draws for. - + - - Pops up an editor window for the given object in a drop-down window which closes when it loses its focus. - - Protip: You can subscribe to OnClose if you want to know when that occurs. + Override this method in order to define custom type constraints to specify whether or not a type should be drawn by the drawer. + Note that Odin's has full support for generic class constraints, so most often you can get away with not overriding CanDrawTypeFilter. + + The type. + + Returns true by default, unless overridden. + + + + + Initializes the drawer instance. + + + + + + Initializes the drawer instance. Override this to implement your own initialization logic. - + - - Pops up an editor window for the given object in a drop-down window which closes when it loses its focus. - - Protip: You can subscribe to OnClose if you want to know when that occurs. + Draws the property with a custom label. + + The label. Null is allow if you wish no label should be drawn. + + + + Draws the property with GUILayout support. + + The label. This can be null, so make sure your drawer supports that. + + + + Calls the next drawer in the draw chain. + + The label to pass on to the next drawer. + + + + Gets a value indicating if the drawer can draw for the specified property. + Override this to implement a custom property filter for your drawer. + + The property to test. + true if the drawer can draw for the property. Otherwise false. + + + + OdinDrawer extensions. - + - - Pops up an editor window for the given object in a drop-down window which closes when it loses its focus. - - Protip: You can subscribe to OnClose if you want to know when that occurs. - - - - - - Pops up an editor window for the given object in a drop-down window which closes when it loses its focus. - - Protip: You can subscribe to OnClose if you want to know when that occurs. - - - - - Pops up an editor window for the given object. - - - - - Inspects the object using an existing OdinEditorWindow. - - - - - Creates an editor window instance for the specified object, without opening the window. - - - - - The Odin property tree drawn. - - - - - Draws the Odin Editor Window. - - - - - Calls DrawEditor(index) for each of the currently drawing targets. - - - - - Initialize get called by OnEnable and by OnGUI after assembly reloads - which often happens when you recompile or enter and exit play mode. - - - - - Called when the window is enabled. Remember to call base.OnEnable(); - - - - - Draws the editor for the this.CurrentDrawingTargets[index]. - - - - - Uses the method to draw a preview for the this.CurrentDrawingTargets[index]. - - - - - Called when the window is destroyed. Remember to call base.OnDestroy(); - - - - - Called before starting to draw all editors for the . - - - - - Called after all editors for the has been drawn. - - - - - See ISerializationCallbackReceiver.OnBeforeSerialize for documentation on how to use this method. - - - - - Implement this method to receive a callback after unity serialized your object. - - - - - Unity property drawer for abstract types. - - - - - Initializes the property drawer. - - - - - Draws the property. - - - - - Not yet documented. - - - - - Not yet documented. + Gets a persistent value that will survive past multiple Unity Editor Application sessions. + The value is stored in the PersistentContextCache, which has a customizable max cache size. @@ -6812,32 +6830,6 @@ Called by Unity.
- - - Unity property attribute drawer. - - - - - Initializes the drawer. - - - - - Draws the proprety. - - - - - Not yet documented. - - - - - Utility class for locating and sorting property drawers for the inspector. - See Odin manual section 'Drawers in Depth' for details on how the DrawerLocator determines which drawers to use. - - @@ -6850,7 +6842,7 @@ Remember to provide your custom drawer with an - in order for it to be located by the . + in order for it to be located by the . @@ -6905,7 +6897,7 @@ - + @@ -6917,11 +6909,442 @@
The label. This can be null, so make sure your drawer supports that.
- + + + + Base class for all value drawers. Use this class to create your own custom drawers for any specific type. + + + + Remember to provide your custom drawer with an + in order for it to be located by the . + + + + Odin supports the use of GUILayout and takes care of undo for you. It also takes care of multi-selection + in many simple cases. Checkout the manual for more information on handling multi-selection. + + + + + Checkout the manual for more information. + + + + + public class MyCustomBaseType + { + + } + + public class MyCustomType : MyCustomBaseType + { + + } + + // Remember to wrap your custom attribute drawer within a #if UNITY_EDITOR condition, or locate the file inside an Editor folder. + + public sealed class MyCustomBaseTypeDrawer<T> : OdinValueDrawer<T> where T : MyCustomBaseType + { + protected override void DrawPropertyLayout(IPropertyValueEntry<T> entry, GUIContent label) + { + T value = entry.SmartValue; + // Draw your custom drawer here using GUILayout and EditorGUILAyout. + } + } + + // Usage: + // Both values will be drawn using the MyCustomBaseTypeDrawer + public class MyComponent : SerializedMonoBehaviour + { + public MyCustomBaseType A; + + public MyCustomType B; + } + + + + + + Odin uses multiple drawers to draw any given property, and the order in which these drawers are + called are defined using the . + Your custom drawer injects itself into this chain of drawers based on its . + If no is defined, a priority is generated automatically based on the type of the drawer. + Each drawer can ether choose to draw the property or not, or pass on the responsibility to the + next drawer by calling CallNextDrawer(). An example of this is provided in the documentation for . + + + + This means that there is no guarantee that your drawer will be called, sins other drawers + could have a higher priority than yours and choose not to call CallNextDrawer(). + + + + To avoid this, you can tell Odin, that your drawer is a PrependDecorator or an AppendDecorator drawer (see ) as shown in the example shows below. + Prepend and append decorators are always drawn and are also ordered by the . + + + + Note that Odin's have full support for generic class constraints, + and if that is not enough, you can also add additional type constraints by overriding CanDrawTypeFilter(Type type). + + + + Also note that all custom property drawers needs to handle cases where the label provided by the DrawPropertyLayout is null, + otherwise exceptions will be thrown when in cases where the label is hidden. For instance when [HideLabel] is used, or the property is drawn within a list where labels are also not shown. + + + + // [OdinDrawer(OdinDrawerBehaviour.DrawProperty)] // default + // [OdinDrawer(OdinDrawerBehaviour.AppendDecorator)] + [OdinDrawer(OdinDrawerBehaviour.PrependDecorator)] + [DrawerPriority(DrawerPriorityLevel.AttributePriority)] + public sealed class MyCustomTypeDrawer<T> : OdinValueDrawer<T> where T : MyCustomType + { + public override bool CanDrawTypeFilter(Type type) + { + return type != typeof(SomeType); + } + + protected override void DrawPropertyLayout(IPropertyValueEntry<T> entry, GUIContent label) + { + T value = entry.SmartValue; + // Draw property here. + } + } + + + + + + + + + + + + + + + + + - Base drawer to inherit from to draw methods. + The value entry of the property. + + + Draws the property with GUILayout support. + + The label. This can be null, so make sure your drawer supports that. + + + + Gets a value indicating if the drawer can draw for the specified property. + + The property to test. + true if the drawer can draw for the property. Otherwise false. + + + + Gets a value indicating if the drawer can draw for the specified property. + Override this to implement a custom property filter for your drawer. + + The property to test. + true if the drawer can draw for the property. Otherwise false. + + + + Unity property drawer for abstract types. + + + + + Initializes the property drawer. + + + + + Draws the property. + + + + + Property drawer for primitive composite properties. + + + + + Draws the property. + + + + + Draws the property field. + + + + + Unity property attribute drawer. + + + + + Initializes the drawer. + + + + + Draws the proprety. + + + + + Unity property drawer. + + + + + Initializes the property drawer. + + + + + Draws the property. + + + + + Descripes an attribute example. + + + + + The type of the example object. + + + + + The name of the example. + + + + + The description of the example. + + + + + Raw code of the example. + + + + + The example declared as a Unity component. + + + + + Sorting value of the example. Examples with lower order values should come before examples with higher order values. + + + + + Preview object of the example. + + + + + Checks whether the allocated has data associated with it. + + The index of the to check. + true if the has data associated with it; otherwise false. + + + + Gets the data associated with the at the given ; this is the second parameter assigned in the method. + + The index of the to retrieve the associated data from. + The associated data. + + + + Gets the data associated with the at the given ; this is the second parameter assigned in the method. + + The index of the to retrieve the associated data from. + The expected associated data type. + The associated data. + + + + Gets the indentation set for the at the given . + + The of the to retrieve the indentation for. + The indentation for the . + The indentation is set using during and . + + + + Creates a representing all the visible 's combined. + + The created . + + + + Allocates an in the view, with the option to associate a given with it. + + + + Ensure is called before calling this, and ensure is called after you're done with + + + Temporary. + This implementation will get refactored. + + + Temporary. + This implementation will get refactored. + + + + Draws a regular Unity ObjectField, but supports labels being nulls, and also adds a small button that will open the object in a new inspector window. + + Position and size of the field. + The label to use, or null if no label should be used. + The Unity object. + The Unity object type. This supports inheritance. + Whether to allow scene objects. + Determines if the Field is read-only. + Will be used for setting and updating the value, this provides a more consistent way to the handle changes. + If a property is assigned through the parameters, the return value should not be used for setting the , the drawer will handle that. + + + + Draws a regular Unity ObjectField, but supports labels being nulls, and also adds a small button that will open the object in a new inspector window. + + Position and size of the field. + The label to use, or null if no label should be used. + The Unity object. + The Unity object type. This supports inheritance. + Whether to allow scene objects. + Determines if the Field is read-only. + Will be used for setting and updating the value, this provides a more consistent way to the handle changes. + If a property is assigned through the parameters, the return value should not be used for setting the , the drawer will handle that. + + + + TODO + + + + + + + + + + + + + + + + If a property is assigned through the parameters, the return value should not be used for setting the , the drawer will handle that. + + + + TODO + + + + + + + + + + + + + + + + If a property is assigned through the parameters, the return value should not be used for setting the , the drawer will handle that. + + + + Contains a set of Unique IDs used for various parts of Odin that don't rely on ControlIds as the ID identifier for OdinObjectSelector. + + + + + Handles instantiating different versions of the Type Selector depending on the context. + + This handler only handles shared constructors between the two versions, for obsolete or unique constructors use the desired selector. + + + + Some drawers don't want to have its GUI disabled, even if the property is read-only or a ReadOnly attribute is defined on the property. + Use this attribute on any drawer to force GUI being enabled in these cases. + + + + + [AllowGUIEnabledForReadonly] + public sealed class SomeDrawerDrawer<T> : OdinValueDrawer<T> where T : class + { + } + + + + + + Extension method for List<Attribute> + + + + + Determines whether the list contains a specific attribute type. + + The type of attribute. + The attribute list. + + true if the specified attribute list has attribute; otherwise, false. + + + + + Adds a new instance of the given type of attribute if it's not in the list. + + The type of attribute. + The attribute list. + + + + + Gets the first instance of an attribute of the given type in the list. + + The type of attribute. + The attribute list. + + + + + Adds a new instance of the attribute to the list. + + The type of attribute. + The attribute list. + + + + + Removes all instances of the given type in the list. + + The type of attribute. + The attribute list. + + @@ -7213,6 +7636,16 @@ These drawers typically don't draw the property itself, and calls CallNextDrawer. + + + Odin has its own implementations for these attribute drawers; never use Unity's. + + + + + Gets the priority of a given drawer type. + + Base class for emitted MonoBehaviour-derived types that have been created by the . @@ -7303,6 +7736,11 @@ Gets the value contained in this scriptable object. + + + Unwraps TargetInvocationException and TypeInitializationException + + This class fixes Unity's about window, by invoking "UnityEditor.VisualStudioIntegration.UnityVSSupport.GetAboutWindowLabel" before any dynamic assemblies have been defined. @@ -7323,6 +7761,13 @@ + + + This class fixes a bug where Unity's Undo.RecordObject does not mark ScriptableObjects dirty when + a change is recorded for them. It does this by subscribing to the Undo.postprocessModifications + event, and marking all modified ScriptableObjects dirty manually. + + Specifies hows any given drawer should drawer the property. @@ -7343,464 +7788,31 @@ Draws the property using Unity's GUI, and EditorGUI. - - - - Base class for attribute drawers. Use this class to create your own custom attribute drawers that will work for all types. - Alternatively you can derive from if you want to only support specific types. - - - - Odin supports the use of GUILayout and takes care of undo for you. It also takes care of multi-selection - in many simple cases. Check the manual for more information on handling multi-selection. - - - - Also note that Odin does not require that your custom attribute inherits from Unity's PropertyAttribute. - - - - The attribute that this drawer should be applied to. - - - Checkout the manual for more information. - - - - Example using the . - - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false)] - public class CustomRangeAttribute : System.Attribute - { - public float Min; - public float Max; - - public CustomRangeAttribute(float min, float max) - { - this.Min = min; - this.Max = max; - } - } - - // Remember to wrap your custom attribute drawer within a #if UNITY_EDITOR condition, or locate the file inside an Editor folder. - - public sealed class CustomRangeAttributeDrawer : OdinAttributeDrawer<CustomRangeAttribute, float> - { - protected override void DrawPropertyLayout(GUIContent label) - { - this.ValueEntry.SmartValue = EditorGUILayout.Slider(label, this.ValueEntry.SmartValue, this.Attribute.Min, this.Attribute.Max); - } - } - - // Usage: - public class MyComponent : MonoBehaviour - { - [CustomRangeAttribute(0, 1)] - public float MyFloat; - } - - - - - Example using the . - - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false)] - public class GUITintColorAttribute : System.Attribute - { - public Color Color; - - public GUITintColorAttribute(float r, float g, float b, float a = 1) - { - this.Color = new Color(r, g, b, a); - } - } - - // Remember to wrap your custom attribute drawer within a #if UNITY_EDITOR condition, or locate the file inside an Editor folder. - - public sealed class GUITintColorAttributeDrawer : OdinAttributeDrawer<GUITintColorAttribute> - { - protected override void DrawPropertyLayout(GUIContent label) - { - Color prevColor = GUI.color; - GUI.color *= this.Attribute.Color; - this.CallNextDrawer(label); - GUI.color = prevColor; - } - } - - // Usage: - public class MyComponent : MonoBehaviour - { - [GUITintColor(0, 1, 0)] - public float MyFloat; - } - - - - - - Odin uses multiple drawers to draw any given property, and the order in which these drawers are - called are defined using the . - Your custom drawer injects itself into this chain of drawers based on its . - If no is defined, a priority is generated automatically based on the type of the drawer. - Each drawer can ether choose to draw the property or not, or pass on the responsibility to the - next drawer by calling CallNextDrawer(), as the f attribute does in the example above. - - - - This means that there is no guarantee that your drawer will be called, sins other drawers - could have a higher priority than yours and choose not to call CallNextDrawer(). - - - - Note that Odin's has full support for generic class constraints, - and if that is not enough, you can also add additional type constraints by overriding CanDrawTypeFilter - - - - Also note that all custom property drawers needs to handle cases where the label provided by the DrawPropertyLayout is null, - otherwise exceptions will be thrown when in cases where the label is hidden. For instance when [HideLabel] is used, or the property is drawn within a list where labels are also not shown. - - - - [DrawerPriority(DrawerPriorityLevel.AttributePriority)] - public sealed class MyCustomAttributeDrawer<T> : OdinAttributeDrawer<MyCustomAttribute, T> where T : class - { - public override bool CanDrawTypeFilter(Type type) - { - return type != typeof(string); - } - - protected override void DrawPropertyLayout(GUIContent label) - { - // Draw property here. - } - } - - - - - - - - - - - - - - - - + - Gets the attribute that the OdinAttributeDrawer draws for. + Helper class to get values from InspectorProperties. This class is deprecated and fully replaced by . - + - Tells whether or not multiple attributes are allowed. + If any error occurred while looking for members, it will be stored here. - + - Draws the property with the given label. - Override this to implement your custom OdinAttributeDrawer. - - Optional label for the property. - - - - Tests if the drawer can draw for the specified property. - - The property to test. - true if the drawer can drawn the property. Otherwise false. - - - - Tests if the attribute drawer can draw for the specified property. - - The property to test. - true if the drawer can drawn the property. Otherwise false. - - - - - Base class for all type specific attribute drawers. For non-type specific attribute drawers see . - - - - Odin supports the use of GUILayout and takes care of undo for you. It also takes care of multi-selection - in many simple cases. Checkout the manual for more information on handling multi-selection. - - - - Also note that Odin does not require that your custom attribute inherits from Unity's PropertyAttribute. - - - - The attribute that this drawer should be applied to. - The type of the value the drawer should be drawing. Note that Odin's has full support for generic constraints. - - - Checkout the manual for more information. - - - - Example using the . - - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false)] - public class CustomRangeAttribute : System.Attribute - { - public float Min; - public float Max; - - public CustomRangeAttribute(float min, float max) - { - this.Min = min; - this.Max = max; - } - } - - // Remember to wrap your custom attribute drawer within a #if UNITY_EDITOR condition, or locate the file inside an Editor folder. - - public sealed class CustomRangeAttributeDrawer : OdinAttributeDrawer<CustomRangeAttribute, float> - { - protected override void DrawPropertyLayout(GUIContent label) - { - this.ValueEntry.SmartValue = EditorGUILayout.Slider(label, this.ValueEntry.SmartValue, this.Attribute.Min, this.Attribute.Max); - } - } - - // Usage: - public class MyComponent : MonoBehaviour - { - [CustomRangeAttribute(0, 1)] - public float MyFloat; - } - - - - - Example using the . - - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false)] - public class GUITintColorAttribute : System.Attribute - { - public Color Color; - - public GUITintColorAttribute(float r, float g, float b, float a = 1) - { - this.Color = new Color(r, g, b, a); - } - } - - // Remember to wrap your custom attribute drawer within a #if UNITY_EDITOR condition, or locate the file inside an Editor folder. - - public sealed class GUITintColorAttributeDrawer : OdinAttributeDrawer<GUITintColorAttribute> - { - protected override void DrawPropertyLayout(GUIContent label) - { - Color prevColor = GUI.color; - GUI.color *= this.Attribute.Color; - this.CallNextDrawer(label); - GUI.color = prevColor; - } - } - - // Usage: - public class MyComponent : MonoBehaviour - { - [GUITintColor(0, 1, 0)] - public float MyFloat; - } - - - - - - Odin uses multiple drawers to draw any given property, and the order in which these drawers are - called is defined using the . - Your custom drawer injects itself into this chain of drawers based on its . - If no is defined, a priority is generated automatically based on the type of the drawer. - Each drawer can ether choose to draw the property or not, or pass on the responsibility to the - next drawer by calling CallNextDrawer(), as the GUITintColor attribute does in the example above. - - - - This means that there is no guarantee that your drawer will be called, since other drawers - could have a higher priority than yours and choose not to call CallNextDrawer(). - - - - Note that Odin's has full support for generic class constraints, - and if that is not enough, you can also add additional type constraints by overriding CanDrawTypeFilter - - - - Also note that all custom property drawers needs to handle cases where the label provided by the DrawPropertyLayout is null, - otherwise exceptions will be thrown when in cases where the label is hidden. For instance when [HideLabel] is used, or the property is drawn within a list where labels are also not shown. - - - - [DrawerPriority(DrawerPriorityLevel.AttributePriority)] - public class MyCustomAttributeDrawer<T> : OdinAttributeDrawer<MyCustomAttribute, T> where T : class - { - public override bool CanDrawTypeFilter(Type type) - { - return type != typeof(string); - } - - protected override void DrawPropertyLayout(GUIContent label) - { - // Draw property here. - } - } - - - - - - - - - - - - - - - - - - Gets the strongly typed ValueEntry of the OdinAttributeDrawer's property. + Gets the referenced member information. - + - Draws the property with the given label. - Override this to implement your custom OdinAttributeDrawer. - - Optional label for the property. - - - - Tests if the drawer can draw for the specified property. - - The property to test. - true if the drawer can drawn the property. Otherwise false. - - - - Tests if the attribute drawer can draw for the specified property. - - The property to test. - true if the drawer can drawn the property. Otherwise false. - - - - Some drawers don't want to have its GUI disabled, even if the property is read-only or a ReadOnly attribute is defined on the property. - Use this attribute on any drawer to force GUI being enabled in these cases. - - - - - [AllowGUIEnabledForReadonly] - public sealed class SomeDrawerDrawer<T> : OdinValueDrawer<T> where T : class - { - } - - - - - - - Base class for all Odin drawers. In order to create your own custom drawers you need to derive from one of the following drawers: - - - - - - - - Remember to provide your custom drawer with an in order for it to be located by the . - Drawers require a context, and are instantiated automatically by the . - Odin supports the use of GUILayout and takes care of undo for you. It also takes care of multi-selection in many simple cases. Checkout the manual for more information. - - - - - - - - - - - - - - - - - If true then this drawer will be skipped in the draw chain. Otherwise the drawer will be called as normal in the draw chain. + Gets the value. - + - Gets a value indicating if the drawer has been initialized yet. + Gets all values from all targets. - - - Gets the property this drawer draws for. - - - - - Override this method in order to define custom type constraints to specify whether or not a type should be drawn by the drawer. - Note that Odin's has full support for generic class constraints, so most often you can get away with not overriding CanDrawTypeFilter. - - The type. - - Returns true by default, unless overridden. - - - - - Initializes the drawer instance. - - - - - - Initializes the drawer instance. Override this to implement your own initialization logic. - - - - - Draws the property with a custom label. - - The label. Null is allow if you wish no label should be drawn. - - - - Draws the property with GUILayout support. - - The label. This can be null, so make sure your drawer supports that. - - - - Calls the next drawer in the draw chain. - - The label to pass on to the next drawer. - - - - Gets a value indicating if the drawer can draw for the specified property. - Override this to implement a custom property filter for your drawer. - - The property to test. - true if the drawer can draw for the property. Otherwise false. - Provides a variety of miscellaneous utilities widely used in the inspector. @@ -7853,151 +7865,6 @@ The message for the exception. An inner exception. - - - - Base class for all value drawers. Use this class to create your own custom drawers for any specific type. - - - - Remember to provide your custom drawer with an - in order for it to be located by the . - - - - Odin supports the use of GUILayout and takes care of undo for you. It also takes care of multi-selection - in many simple cases. Checkout the manual for more information on handling multi-selection. - - - - - Checkout the manual for more information. - - - - - public class MyCustomBaseType - { - - } - - public class MyCustomType : MyCustomBaseType - { - - } - - // Remember to wrap your custom attribute drawer within a #if UNITY_EDITOR condition, or locate the file inside an Editor folder. - - public sealed class MyCustomBaseTypeDrawer<T> : OdinValueDrawer<T> where T : MyCustomBaseType - { - protected override void DrawPropertyLayout(IPropertyValueEntry<T> entry, GUIContent label) - { - T value = entry.SmartValue; - // Draw your custom drawer here using GUILayout and EditorGUILAyout. - } - } - - // Usage: - // Both values will be drawn using the MyCustomBaseTypeDrawer - public class MyComponent : SerializedMonoBehaviour - { - public MyCustomBaseType A; - - public MyCustomType B; - } - - - - - - Odin uses multiple drawers to draw any given property, and the order in which these drawers are - called are defined using the . - Your custom drawer injects itself into this chain of drawers based on its . - If no is defined, a priority is generated automatically based on the type of the drawer. - Each drawer can ether choose to draw the property or not, or pass on the responsibility to the - next drawer by calling CallNextDrawer(). An example of this is provided in the documentation for . - - - - This means that there is no guarantee that your drawer will be called, sins other drawers - could have a higher priority than yours and choose not to call CallNextDrawer(). - - - - To avoid this, you can tell Odin, that your drawer is a PrependDecorator or an AppendDecorator drawer (see ) as shown in the example shows below. - Prepend and append decorators are always drawn and are also ordered by the . - - - - Note that Odin's have full support for generic class constraints, - and if that is not enough, you can also add additional type constraints by overriding CanDrawTypeFilter(Type type). - - - - Also note that all custom property drawers needs to handle cases where the label provided by the DrawPropertyLayout is null, - otherwise exceptions will be thrown when in cases where the label is hidden. For instance when [HideLabel] is used, or the property is drawn within a list where labels are also not shown. - - - - // [OdinDrawer(OdinDrawerBehaviour.DrawProperty)] // default - // [OdinDrawer(OdinDrawerBehaviour.AppendDecorator)] - [OdinDrawer(OdinDrawerBehaviour.PrependDecorator)] - [DrawerPriority(DrawerPriorityLevel.AttributePriority)] - public sealed class MyCustomTypeDrawer<T> : OdinValueDrawer<T> where T : MyCustomType - { - public override bool CanDrawTypeFilter(Type type) - { - return type != typeof(SomeType); - } - - protected override void DrawPropertyLayout(IPropertyValueEntry<T> entry, GUIContent label) - { - T value = entry.SmartValue; - // Draw property here. - } - } - - - - - - - - - - - - - - - - - - - The value entry of the property. - - - - - Draws the property with GUILayout support. - - The label. This can be null, so make sure your drawer supports that. - - - - Gets a value indicating if the drawer can draw for the specified property. - - The property to test. - true if the drawer can draw for the property. Otherwise false. - - - - Gets a value indicating if the drawer can draw for the specified property. - Override this to implement a custom property filter for your drawer. - - The property to test. - true if the drawer can draw for the property. Otherwise false. - Custom types used by the can choose to implement the ITemporaryContext @@ -8061,11 +7928,37 @@ The owner. + + + The content padding + + + + + Draws the menu tree. + + + + + Gets the value selected value. + + + + + Invokes BuildMenuTree. + + + + + Use this attribute to prevent a type from being included in Odin systems. + The attribute can be applied to Odin drawers, Odin property resolvers and Odin attribute processor types. + + When creating custom property drawers with or etc, an OdinDrawerAttribute must be defined on the custom drawer class itself in order to specify that the drawer is meant to be included in the inspector. - If no OdinDrawerAttribute is defined, the will ignore your drawer. + If no OdinDrawerAttribute is defined, the will ignore your drawer. Checkout the manual for more information. @@ -8098,1999 +7991,21 @@ Initializes a new instance of the class. - + - Property drawer for primitive composite properties. + Priority for and types. - + - Draws the property. + Priority of the resolver. - + - Draws the property field. - - - - - Represents the children of an . - - - - - The that this instance handles children for. - - - - - Gets a child by index. This is an alias for . - - The index of the child to get. - The child at the given index. - - - - Gets a child by name. This is an alias for . - - The name of the child to get. - The child, if a child was found; otherwise, null. - - - - Gets a child by name. This is an alias for . - - The name of the child to get. - The child, if a child was found; otherwise, null. - - - - Initializes a new instance of the class. - - The property to handle children for. - property is null - - - - The number of children on the property. - - - - - Updates this instance of . - - - - - Gets a child by name. - - The name of the child to get. - The child, if a child was found; otherwise, null. - name - - - - Gets a child by name. - - The name of the child to get. - The child, if a child was found; otherwise, null. - name - - - - Gets a child by index. - - The index of the child to get. - - The child at the given index. - - The given index was out of range. - - - - Gets the path of the child at a given index. - - The index to get the path of. - The path of the child at the given index. - The given index was out of range. - - - - Returns an IEnumerable that recursively yields all children of the property, depth first. - - - - - Gets the property's already created children. If the child count is less than or equal to 10000, children are returned in order. If the count is larger than 10000, they are returned in no particular order. - - - - - Gets the enumerator. - - - - - Gets the enumerator. - - - - - Represents a weakly typed collection of values for a - one value per selected inspector target. - - - - - The property whose values are represented. - - - - - Initializes a new instance of the class. - - The property to represent. - property is null - - - - Whether the values have been changed since was last called. - - - - - The number of values in the collection. - - - - - Gets a value indicating whether this instance is synchronized. - - - true if this instance is synchronized; otherwise, false. - - - - - Gets the synchronization root object. - - - The synchronization root object. - - - - - The original values of the (loosely typed) value collection, such as they were immediately after the last call. - - - - - Gets or sets the weakly typed at the specified index. - - - The value. - - The index to set. - - - - Gets an enumerator for the collection. - - - - - Marks the value collection as being clean again. This is typically called at the end of the current GUI frame, during . - - - - - Reverts the value collection to its origin values (found in ) from the last call, and marks the value collection as being clean again. - - - - - Determines whether the collection contains the specified value. - - The value. - - true if the collection contains the specified value; otherwise, false. - - - - - Copies the collection to an array. - - The array to copy to. - The index to copy from. - - - - Gets the index of the given value, or -1 if the value was not found. - - The value to get the index of. - The index of the given value, or -1 if the value was not found. - - - - Gets the weakly typed value at the given index. - - The index of the value to get. - The weakly typed value at the given index - - - - Sets the weakly typed value at the given index. - - The index to set the value of. - The value to set. - - - - Force sets the value, ignoring whether it is editable or not. - Note that this will fail on list element value entries where is true on the parent value entry. - - The selection index of the value. - The value to be set. - - - - Marks the value collection as being dirty, regardless of any value changes. - - - - - Represents a strongly typed collection of values for a - one value per selected inspector target. - - The element type of the collection. - - - - - Initializes a new instance of the class. - - The property. - The internal array. - The original array. - The internal atom array. - The original atom array. - - - - Whether the values have been changed since was last called. - - - - - The number of values in the collection. - - - - - Gets a value indicating whether this instance is synchronized. - - - true if this instance is synchronized; otherwise, false. - - - - - Gets the synchronization root object. - - - The synchronization root object. - - - - - The original values of the (loosely typed) value collection, such as they were immediately after the last call. - - - - - Gets or sets the at the specified index. - - - The . - - The index. - - - - - Gets an enumerator for the collection. - - - - - Marks the value collection as being clean again. This is typically called at the end of the current GUI frame, during . - - - - - Reverts the value collection to its origin values (found in ) from the last call, and marks the value collection as being clean again. - - - - - Copies the collection to an array. - - The array to copy to. - The index to copy from. - - - - Gets the weakly typed value at the given index. - - The index of the value to get. - - The weakly typed value at the given index - - - - - Sets the weakly typed value at the given index. - - The index to set the value of. - The value to set. - - - - Determines whether the collection contains the specified value. - - The value. - - true if the collection contains the specified value; otherwise, false. - - - - - Gets the index of the given value, or -1 if the value was not found. - - The value to get the index of. - - The index of the given value, or -1 if the value was not found. - - - - - Force sets the value, ignoring whether it is editable or not. - Note that this will fail on list element value entries where is true on the parent value entry. - - The selection index of the value. - The value to be set. - - - - Force sets the value, ignoring whether it is editable or not. - Note that this will fail on list element value entries where is true on the parent value entry. - - The selection index of the value. - The value to be set. - - - - - Marks the value collection as being dirty, regardless of any value changes. - - - - - A contextual value attached to an , mapped to a key, contained in a . - - - - - The contained value. - - - - - Creates a new PropertyContext. - - - - - Performs an explicit conversion from to . - - The context. - - The result of the conversion. - - - - - Returns a that represents this instance, of the format ": Value.ToString()". - - - A that represents this instance. - - - - - Contains a context for an , which offers the ability to address persistent values by key across several editor GUI frames. - Use this in drawers to store contextual editor-only values such as the state of a foldout. - - - - - Initializes a new instance of the class. - - The property. - property - - - - Gets a global context value for a given key, using a given delegate to generate a default value if the context doesn't already exist. - Global contexts are not associated with any one specific drawer, and so are shared across all drawers for this property. - - The type of the context value to get. - The key of the context value to get. - A delegate for generating a default value. - The found context. - - - - Gets a global context value for a given key, using a given default value if the context doesn't already exist. - Global contexts are not associated with any one specific drawer, and so are shared across all drawers for this property. - - The type of the context value to get. - The key of the context value to get. - The default value to set if the context value doesn't exist yet. - The found context. - - - - Gets a global context value for a given key, and creates a new instance of as a default value if the context doesn't already exist. - Global contexts are not associated with any one specific drawer, and so are shared across all drawers for this property. - - The type of the context value to get. - The key of the context value to get. - The found context. - - - - Local property contexts are obsolete. Use local drawer fields instead. - - - - - Local property contexts are obsolete. Use local drawer fields instead. - - - - - Local property contexts are obsolete. Use local drawer fields instead. - - - - - Local property contexts are obsolete. Use local drawer fields instead. - - - - - Local property contexts are obsolete. Use local drawer fields instead. - - - - - Local property contexts are obsolete. Use local drawer fields instead. - - - - - Local property contexts are obsolete. Use local drawer fields instead. - - - - - Local property contexts are obsolete. Use local drawer fields instead. - - - - - Local property contexts are obsolete. Use local drawer fields instead. - - - - - Local property contexts are obsolete. Use local drawer fields instead. - - - - - Local property contexts are obsolete. Use local drawer fields instead. - - - - - Local property contexts are obsolete. Use local drawer fields instead. - - - - - Local property contexts are obsolete. Use local drawer fields instead. - - - - - Local property contexts are obsolete. Use local drawer fields instead. - - - - - Local property contexts are obsolete. Use local drawer fields instead. - - - - - Gets a object and creates a object for it. - - The type of the value of the context. - The instance of the drawer. - The key for the context. - The default value for the context. - - - - Gets a object and creates a object for it. - Returns true when the is first created. Otherwise false. - - The type of the value of the context. - The instance of the drawer. - The key for the context. - The object. - Returns true when the is first created. Otherwise false. - - - - Swaps context values with a given . - - The context to swap with. - - - - An can implement this interface to indicate that it defines right-click context menu items for properties that it draws. - - - - - Method that is invoked when a user has right-clicked a property, and the context menu is being built. The method is invoked in order of drawer priority. - - The property that has been right-clicked on. - The generic menu instance that is being built. Add items to this. - - - - A polymorphic alias for getting and setting the values of an . - - The type of the owner. - The type of the value. - The type of the property owner. - The type of the property value. - - - - Gets the type of the owner. - - - - - Gets the type of the value. - - - - - Whether the value is readonly. - - - - - Initializes a new instance of the class. - - The information. - info - - - - Gets the value from a given weakly typed owner. - - The weakly typed owner. - The found value. - - - - Gets the value from a given owner. - - The owner. - owner is null - - - - Sets the weakly typed value on a given weakly typed owner. - - The owner. - The value. - - - - Sets the value on a given owner. - - The owner. - The value. - - - - Contains meta-data information about a property in the inspector, that can be used to create an actual property instance. - - - - - The name of the property. - - - - - Gets a value indicating whether this InspectorPropertyInfo has any backing members. - - - - - Gets a value indicating whether this InspectorPropertyInfo has only a single backing member. - - - - - The member info of the property. If the property has many member infos, such as if it is a group property, the first member info of is returned. - - - - - Indicates which type of property it is. - - - - - The serialization backend for this property. - - - - - The type on which this property is declared. - - - - - The base type of the value which this property represents. If there is no value, this will be null. - - - - - Whether this property is editable or not. - - - - - All member infos of the property. There will only be more than one member if it is an . - - - - - The order value of this property. Properties are (by convention) ordered by ascending order, IE, lower order values are shown first in the inspector. The final actual ordering of properties is decided upon by the property resolver. - - - - - The attributes associated with this property. - - - - - Whether this property only exists as a Unity , and has no associated managed member to represent it. - This case requires some special one-off custom behaviour in a few places. - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Gets the first attribute of a given type on this property. - - - - - Gets the first attribute of a given type on this property, which is not contained in a given hashset. - - The attributes to exclude. - - - - Gets all attributes of a given type on the property. - - - - - The s of all the individual properties in this group. - - - - - Gets the property's method delegate, if there is one. Note that this is null if a method property is backed by an actual method member. - - - - - Represents a property in the inspector, and provides the hub for all functionality related to that property. - - - - - Gets the property which is the ultimate root of this property's serialization. - - - - - The name of the property. - - - - - The nice name of the property, usually as converted by . - - - - - The cached label of the property, usually containing . - - - - - The full Odin path of the property. To get the Unity property path, see . - - - - - The child index of this property. - - - - - Gets the resolver for this property's children. - - - - - The current recursive draw depth, incremented for each time that the property has caused itself to be drawn recursively. - Note that this is the current recursion level, not the total amount of recursions so far this frame. - - - - - The amount of times that the property has been drawn so far this frame. - - - - - How deep in the drawer chain the property currently is, in the current drawing session as determined by . - - - - - Whether this property supports having prefab modifications applied or not. - - - - - Gets an immutable list of the components attached to the property. - - - - - Gets an immutable list of processed attributes for the property. - - - - - Gets an array of the state updaters of the property. Don't change the contents of this array! - - - - - The value entry that represents the base value of this property. - - - - - The value entry that represents the strongly typed value of the property; this is possibly an alias entry in case of polymorphism. - - - - - The parent of the property. If null, this property is a root-level property in the . - - - - - The of this property. - - - - - The that this property exists in. - - - - - The children of this property. - - - - - The context container of this property. - - - - - The last rect that this property was drawn within. - - - - - The type on which this property is declared. This is the same as . - - - - - The parent values of this property, by selection index; this represents the values that 'own' this property, on which it is declared. - - - - - The full Unity property path of this property; note that this is merely a converted version of , and not necessarily a path to an actual Unity property. - In the case of Odin-serialized data, for example, no Unity properties will exist at this path. - - - - - The full path of this property as used by deep reflection, containing all the necessary information to find this property through reflection only. This is used as the path for prefab modifications. - - - - - The full path of this property as used by prefab modifications and the deep reflection system, containing all the necessary information to find this property through reflection only. - - - - - The PropertyState of the property at the current draw count index. - - - - - Gets the component of a given type on the property, or null if the property does not have a component of the given type. - - - - - Marks the property's serialization root values dirty if they are derived from UnityEngine.Object. - - - - - Records the property's serialization root for undo to prepare for undoable changes, with a custom string that includes the property path and Unity object name. If a message is specified, it is included in the custom undo string. - - - - - Gets the first attribute of a given type on this property. - - - - - Gets the first attribute of a given type on this property, which is not contained in a given hashset. - - The attributes to exclude. - - - - Gets all attributes of a given type on the property. - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Draws this property in the inspector. - - - - - Draws this property in the inspector with a given default label. This default label may be overridden by attributes on the drawn property. - - - - - Push a draw session. This is used by and . - - - - - Increments the current drawer chain index. This is used by . - - - - - Pop a draw session. This is used by and . - - - - - Gets the next property in the , or null if none is found. - - Whether to include children or not. - Whether to only include visible properties. - - - - Finds the first parent property that matches a given predicate. - - - - - Finds the first child recursively, that matches a given predicate. - - - - - Updates the property. This method resets the temporary context, and updates the value entry and the property children. - - If true, the property will update regardless of whether it has already updated for the current . - - - - Populates a generic menu with items from all drawers for this property that implement . - - - - - Determines whether this property is the child of another property in the hierarchy. - - The property to check whether this property is the child of. - other is null - - - - Determines whether this property is a parent of another property in the hierarchy. - - The property to check whether this property is the parent of. - other is null - - - - Represents a set of values of the same type as a tree of properties that can be drawn in the inspector, and provides an array of utilities for querying the tree of properties. - - - - - Delegate for on property value changed callback. - - - - - The component providers that create components for each property in the tree. If you change this list after the tree has been used, you should call tree.RootProperty.RefreshSetup() to make the changes update properly throughout the tree. - - - - - The that this tree represents, if the tree was created for a . - - - - - The current update ID of the tree. This is incremented once, each update, and is used by to avoid updating multiple times in the same update round. - - - - - The type of the values that the property tree represents. - - - - - The actual values that the property tree represents. - - - - - The number of root properties in the tree. - - - - - The prefab modification handler of the tree. - - - - - Whether this property tree also represents members that are specially serialized by Odin. - - - - - Gets a value indicating whether or not to draw the mono script object field at the top of the property tree. - - - - - Gets a value indicating whether or not the PropertyTree is inspecting a static type. - - - - - Gets or sets the for the PropertyTree. - - - - - Gets or sets the for the PropertyTree. - - - - - Gets or sets the for the PropertyTree. - - - - - Gets or sets the for the PropertyTree. - - - - - An event that is invoked whenever an undo or a redo is performed in the inspector. - The advantage of using this event on a property tree instance instead of - is that this event will be desubscribed from - when the selection changes and the property - tree is no longer being used, allowing the GC to collect the property tree. - - - - - This event is invoked whenever the value of any property in the entire property tree is changed through the property system. - - - - - Creates a new for all target values of a . - - - - - Gets the root property of the tree. - - - - - Gets the secret root property of the tree, which hosts the property resolver used to resolve the "actual" root properties of the tree. - - - - - Registers that a given property is dirty and needs its changes to be applied at the end of the current frame. - - - - - Schedules a delegate to be invoked at the end of the current GUI frame. - - The action delegate to be delayed. - - - - Schedules a delegate to be invoked at the end of the next Repaint GUI frame. - - The action to be delayed. - - - - Enumerates over the properties of the tree. - - Whether to include children of the root properties or not. If set to true, every property in the entire tree will be enumerated. - Whether to only include visible properties. Properties whose parents are invisible are considered invisible. - - - - Gets the property at the given path. Note that this is the path found in , not the Unity path. - - The path of the property to get. - - - - Gets the property at the given path. Note that this is the path found in , not the Unity path. - - The path of the property to get. - - - - - Gets the property at the given Unity path. - - The Unity path of the property to get. - - - - Gets the property at the given Unity path. - - The Unity path of the property to get. - - - - - Gets the property at the given deep reflection path. - - The deep reflection path of the property to get. - - - - Gets the property at the given Odin prefab modification path. - - The prefab modification path of the property to get. - - - - Gets the property at the given Odin prefab modification path. - - The prefab modification path of the property to get. - - - - - Draw the property tree, and handles management of undo, as well as marking scenes and drawn assets dirty. - - This is a shorthand for calling - , - and . - . - - - - - - Draws a search bar for the property tree, and draws the search results if the search bar is used. - If this method returns true, the property tree should generally not be drawn normally afterwards. - Note that this method will throw exceptions if the property tree is not set up to be searchable; for that, see . - - True if the property tree is being searched and is currently drawing its search results, otherwise false. - - - - Gets a Unity property for the given Odin or Unity path. If there is no for this property tree, or no such property is found in the , a property will be emitted using . - - The Odin or Unity path to the property to get. - - - - Gets a Unity property for the given Odin or Unity path. If there is no for this property tree, or no such property is found in the , a property will be emitted using . - - The Odin or Unity path to the property to get. - The backing field of the Unity property. - - - - Checks whether a given object instance is referenced anywhere in the tree, and if it is, gives the path of the first time the object reference was encountered as an out parameter. - - The reference value to check. - The first found path of the object. - - - - Gets the number of references to a given object instance in this tree. - - - - - Updates all properties in the entire tree, and validates the prefab state of the tree, if applicable. - - - - - Replaces all occurrences of a value with another value, in the entire tree. - - The value to find all instances of. - The value to replace the found values with. - - - - Gets the root tree property at a given index. - - The index of the property to get. - - - - Invokes the actions that have been delayed using and . - - - - - Applies all changes made with properties to the inspected target tree values, and marks all changed Unity objects dirty. - - true if any values were changed, otherwise false - - - - Invokes the OnValidate method on the property tree's targets if they are derived from and have the method defined. - - - - - Registers an object reference to a given path; this is used to ensure that objects are always registered after having been encountered once. - - The referenced object. - The property that contains the reference. - - - - Creates a PropertyTree to inspect the static values of the given type. - - The type to inspect. - A PropertyTree instance for inspecting the type. - - - - Creates a new for a given target value. - - The target to create a tree for. - target is null - - - - Creates a new for a set of given target values. - Note that the targets all need to be of the same type. - - The targets to create a tree for. - targets is null - - - - Creates a new for all target values of a . - - The serialized object to create a tree for. - serializedObject is null - - - - Creates a new for a set of given target values. - Note that the targets all need to be of the same type. - - The targets to create a tree for. - - - - Creates a new for a set of given target values, represented by a given . - Note that the targets all need to be of the same type. - - The targets to create a tree for. - The serialized object to create a tree for. Note that the target values of the given must be the same values given in the targets parameter. - - - - Sets whether the property tree should be searchable or not, and allows the passing in of a custom SearchableAttribute instance to configure the search. - - Whether the tree should be set to be searchable or not. - If the tree is set to be searchable, then if this parameter is not null, it will be used to configure the property tree search. If the parameter is null, the SearchableAttribute on the tree's will be used. If that property has no such attribute, then default search settings will be applied. - - - - Represents a set of strongly typed values as a tree of properties that can be drawn in the inspector, and provides an array of utilities for querying the tree of properties. - This class also handles management of prefab modifications. - - - - - Gets the root property of the tree. - - - - - Gets the secret root property of the PropertyTree. - - - - - Gets the for the PropertyTree. - - - - - The current update ID of the tree. This is incremented once, each update, and is used by to avoid updating multiple times in the same update round. - - - - - The that this tree represents, if the tree was created for a . - - - - - The type of the values that the property tree represents. - - - - - The strongly types actual values that the property tree represents. - - - - - The weakly types actual values that the property tree represents. - - - - - The number of root properties in the tree. - - - - - Whether this property tree also represents members that are specially serialized by Odin. - - - - - Initializes a new instance of the class, inspecting only the target () type's static members. - - - - - Initializes a new instance of the class. - - The serialized object to represent. - - - - Initializes a new instance of the class. - - The targets to represent. - - - - Initializes a new instance of the class. - - The targets to represent. - The serialized object to represent. Note that the target values of the given must be the same values given in the targets parameter. - targets is null - - There must be at least one target. - or - A given target is a null value. - - - - - Applies all changes made with properties to the inspected target tree values. - - - true if any values were changed, otherwise false - - - - - Registers that a given property is dirty and needs its changes to be applied at the end of the current frame. - - - - - - - Updates all properties in the entire tree, and validates the prefab state of the tree, if applicable. - - - - - Checks whether a given object instance is referenced anywhere in the tree, and if it is, gives the path of the first time the object reference was encountered as an out parameter. - - The reference value to check. - The first found path of the object. - - - - Gets the number of references to a given object instance in this tree. - - - - - - Gets the property at the given path. Note that this is the path found in , not the Unity path. - - The path of the property to get. - - - - Gets the property at the given path. Note that this is the path found in , not the Unity path. - - The path of the property to get. - - - - - Finds the property at the specified unity path. - - The unity path for the property. - The property found at the path. - - - - Finds the property at the specified unity path. - - The unity path for the property. - - The property found at the path. - - - - Finds the property at the specified modification path. - - The prefab modification path for the property. - The property found at the path. - - - - Finds the property at the specified modification path. - - The prefab modification path for the property. - - The property found at the path. - - - - Gets a Unity property for the given Odin or Unity path. If there is no for this property tree, or no such property is found in the , a property will be emitted using . - - The Odin or Unity path to the property to get. - The backing field of the Unity property. - - - - Enumerates over the properties of the tree. WARNING: For tree that have large targets with lots of data, this may involve massive amounts of work as the full tree structure is resolved. USE THIS METHOD SPARINGLY AND ONLY WHEN ABSOLUTELY NECESSARY! - - Whether to include children of the root properties or not. If set to true, every property in the entire tree will be enumerated. - /// Whether to only include visible properties. Properties whose parents are invisible are considered invisible. - - - - Replaces all occurrences of a value with another value, in the entire tree. - - The value to find all instances of. - The value to replace the found values with. - - The value to replace with must either be null or be the same type as the value to replace (" + from.GetType().Name + "). - - - - Gets the root tree property at a given index. - - The index of the property to get. - - - - Schedules a delegate to be invoked at the end of the current GUI frame. - - The action delegate to be delayed. - action - - - - Schedules a delegate to be invoked at the end of the next Repaint GUI frame. - - The action to be delayed. - action - - - - Invokes the actions that have been delayed using and . - - - - - Enumeration describing the different types of properties that exist. - - - - - Property represents a value. - - - - - Property represents a method. - - - - - Property represents a named group of properties. - - - - - Enumeration for designating whether a has a special state,. - - - - - The value entry has no special state. - - - - - The property is a reference to another property. Get the path of the referenced property from . - - - - - The value entry is a null value. - - - - - The value entry has a primitive value conflict across selected indices. - A primitive value conflict is when primitive values, such a strings or floats, differ. - - - - - The value entry has a reference value conflict across selected indices. - A reference value conflict is when the types of reference type values differ, or when some values are null while others are not. - - - - - The value entry has a reference path conflict across selected indices. - A reference path conflict is when the property consists of references to many conflicting paths. Use to get paths to all referenced objects. - - - - - The value entry has a collection length conflict across selected indices. - A collection length conflict is when the property represents multiple parallel collections, and their lengths differ. - - - - - Class that describes the different possible serialization backends that a property can have, - and specifies the capabilities of each backend. - - - - - The property is serialized by Unity's polymorphic serialization backend via the [SerializeReference] attribute. Polymorphism, null values and cyclical references are supported. - - - - - The property is serialized by Unity's classic serialization backend. Polymorphism, null values and types such as are not supported. - - - - - The property is serialized by Odin. Polymorphism, null values and types such as are supported. - - - - - The property is not serialized by anything - possibly because it is a method, possibly because it is a field or property shown in the inspector without being serialized. - In the case of fields or properties, polymorphism, null values and types such as are supported, but will not be saved. - - - - - The property is not serialized by anything - possibly because it is a method, possibly because it is a field or property shown in the inspector without being serialized. - In the case of fields or properties, polymorphism, null values and types such as are supported, but will not be saved. - - - - - The property is serialized by Unity's classic serialization backend. Polymorphism, null values and types such as are not supported. - - - - - The property is serialized by Unity's polymorphic serialization backend via the [SerializeReference] attribute. Polymorphism, null values and cyclical references are supported. - - - - - The property is serialized by Odin. Polymorphism, null values and types such as are supported. - - - - - An internally used interface that is used by value entries during , that lets value entries force each other to set values directly to their target objects. - This interface should not be used by people who do not know what they are doing. - - - - - Sets the actual value of a value entry, for a given selection index. - - - - - An internally used interface that is used by value entries during , that lets value entries force each other to set values directly to their target objects. - This interface should not be used by people who do not know what they are doing. - - - - - Sets the actual value of a value entry, for a given selection index. - - - - - Represents the values of an , and contains utilities for querying the values' type and getting and setting them. - - - - - - Delegate type used for the events and . - - - - - The nearest parent property that has a value. - That is, the property from which this value - entry will fetch its parentvalues from in order - to extract its own values. - - If is null, this is a root property. - - - - - Whether this value entry represents a boxed value type. - - - - - The number of parallel values this entry represents. This will always be exactly equal to the count of . - - - - - Whether this value entry is editable or not. - - - - - If this value entry has the override type , this is the path of the property it references. - - - - - The actual serialization backend for this value entry, possibly inherited from the serialization backend of the root property this entry is a child of. - Note that this is *not* always equal to . - - - - - The property whose values this value entry represents. - - - - - Provides access to the weakly typed values of this value entry. - - - - - Whether this value entry has been changed from its prefab counterpart. - - - - - Whether this value entry has had its list length changed from its prefab counterpart. - - - - - Whether this value entry has had its dictionary values changes from its prefab counterpart. - - - - - A weakly typed smart value that represents the first element of the value entry's value collection, but has "smart logic" for setting the value that detects relevant changes and applies them in parallel. - This lets you often just use the smart value instead of having to deal with the tedium of multiple parallel values. - - - - - The type from which this value entry comes. If this value entry represents a member value, this is the declaring type of the member. If the value entry represents a collection element, this is the type of the collection. - - - - - The most precise known contained type of the value entry. If polymorphism is in effect, this will be some type derived from . - - - - - The base type of the value entry. If this is value entry represents a member value, this is the type of the member. If the value entry represents a collection element, this is the element type of the collection. - - - - - The special state of the value entry. - - - - - Whether this value entry is an alias, or not. Value entry aliases are used to provide strongly typed value entries in the case of polymorphism. - - - - - The context container of this property. - - - - - Whether this type is marked as an atomic type using a . - - - - - An event that is invoked during , when any values have changed. - - - - - An event that is invoked during , when any child values have changed. - - - - - Updates the values contained in this value entry to the actual values in the target objects, and updates its state (override, type of value, etc.) accordingly. - - - - - Checks whether the values in this value entry are equal to the values in another value entry. - Note, both value entries must have the same value type, and must represent values that are .NET value types. - - - - - - - Applies the changes made to this value entry to the target objects, and registers prefab modifications as necessary. - - - True if any changes were made, otherwise, false. - - - - - Determines the value state of this value entry. - - - - - Determines what the most precise contained type is on this value entry. - - - - - Updates all values in this value entry from the target tree values. - - - - - Initializes this value entry. - - - - - Creates an alias value entry of a given type, for a given value entry. This is used to implement polymorphism in Odin. - - - - - Creates a value entry for a given property, of a given value type. Note that the created value entry is returned un-updated, and needs to have called on it before it can be used. - - - - - Determines whether the value at the given selection index is different from the given prefab value, as is relevant for prefab modification checks. - If the value is a reference type, null and type difference is checked. If value is a value type, a comparer from is used. - This method is best ignored unless you know what you are doing. - - The value to check differences against. - The selection index to compare against. - - - - Represents the values of an , and contains utilities for querying the values' type and getting and setting them. - - The type of the value. - - - - - An equality comparer for comparing values of type . This is gotten using . - - - - - Whether .is a primitive type; that is, the type is primitive, a string, or an enum. - - - - - Whether is a value type. - - - - - Whether is derived from . - - - - - Whether the type of the value is marked atomic. - - - - - If the type of the value is marked atomic, this an instance of an atom handler for the value type. - - - - - Initializes a new instance of the class. - - - - - Provides access to the weakly typed values of this value entry. - - - - - Provides access to the strongly typed values of this value entry. - - - - - Whether this type is marked as an atomic type using a . - - - - - A weakly typed smart value that represents the first element of the value entry's value collection, but has "smart logic" for setting the value that detects relevant changes and applies them in parallel. - This lets you often just use the smart value instead of having to deal with the tedium of multiple parallel values. - - - - - A strongly typed smart value that represents the first element of the value entry's value collection, but has "smart logic" for setting the value that detects relevant changes and applies them in parallel. - This lets you often just use the smart value instead of having to deal with the tedium of multiple parallel values. - - - - - An array containing the original values as they were at the beginning of frame. - - - - - An array containing the current modified set of values. - - - - - An array containing the current modified set of atomic values. - - - - - An array containing the original set of atomic values. - - - - - Initializes this value entry. - - - - - Sets the actual target tree value. - - - - - Checks whether the values in this value entry are equal to the values in another value entry. - Note, both value entries must have the same value type, and must represent values that are .NET value types. - - - - - Determines whether the value at the given selection index is different from the given prefab value, as is relevant for prefab modification checks. - If the value is a reference type, null and type difference is checked. If value is a value type, a comparer from is used. - This method is best ignored unless you know what you are doing. - - The value to check differences against. - The selection index to compare against. - - - - Determines whether the value at the given selection index is different from the given prefab value, as is relevant for prefab modification checks. - If the value is a reference type, null and type difference is checked. If value is a value type, a comparer from is used. - This method is best ignored unless you know what you are doing. - - The value to check differences against. - The selection index to compare against. - - - - Represents the values of an , and contains utilities for querying the values' type and getting and setting them. - - The type of the parent. - The type of the value. - - - - - The type from which this value entry comes. If this value entry represents a member value, this is the declaring type of the member. If the value entry represents a collection element, this is the type of the collection. - - - - - Determines what the most precise contained type is on this value entry. - - - - - Initializes this value entry. - - - - - Updates all values in this value entry from the target tree values. - - - - - Determines the value state of this value entry. - - - - - Applies the changes made to this value entry to the target objects, and registers prefab modifications as necessary. - - - True if any changes were made, otherwise, false. - - - - - Gets the parent value at the given index. - - - - - Adds menu items to the Unity Editor, draws the About window, and the preference window found under Edit > Preferences > Odin Inspector. + Initializes a new instance of the class. + The higher the priority, the earlier it will be processed. @@ -10132,17 +8047,12 @@ Sirenix preferences window. - - - Open preferences page for configuration object. - - Opens the Odin inspector preferences window. - + Opens the Odin inspector preferences window. @@ -10237,6 +8147,20 @@ The instance, for evt. member references. The current string. + + + To safely change anything in the type cache, you must be holding this lock. + + + + + + + + + This is checked using . + + Gets a unique key for any given property within a drawer. @@ -10297,21 +8221,6 @@ A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - - - Unity property drawer. - - - - - Initializes the property drawer. - - - - - Draws the property. - - Provides utilities for emitting ScriptableObject and MonoBehaviour-derived types with specific property names and types, and providing instances of with those names and types. @@ -10373,6 +8282,2137 @@ Target count must be equal to or higher than 1. + + + Base class for creating editor windows using Odin. + + + + public class SomeWindow : OdinEditorWindow + { + [MenuItem("My Game/Some Window")] + private static void OpenWindow() + { + GetWindow<SomeWindow>().Show(); + } + + [Button(ButtonSizes.Large)] + public void SomeButton() { } + + [TableList] + public SomeType[] SomeTableData; + } + + + + + public class DrawSomeSingletonInAnEditorWindow : OdinEditorWindow + { + [MenuItem("My Game/Some Window")] + private static void OpenWindow() + { + GetWindow<DrawSomeSingletonInAnEditorWindow>().Show(); + } + + protected override object GetTarget() + { + return MySingleton.Instance; + } + } + + + + + private void InspectObjectInWindow() + { + OdinEditorWindow.InspectObject(someObject); + } + + private void InspectObjectInDropDownWithAutoHeight() + { + var btnRect = GUIHelper.GetCurrentLayoutRect(); + OdinEditorWindow.InspectObjectInDropDown(someObject, btnRect, btnRect.width); + } + + private void InspectObjectInDropDown() + { + var btnRect = GUIHelper.GetCurrentLayoutRect(); + OdinEditorWindow.InspectObjectInDropDown(someObject, btnRect, new Vector2(btnRect.width, 100)); + } + + private void InspectObjectInACenteredWindow() + { + var window = OdinEditorWindow.InspectObject(someObject); + window.position = GUIHelper.GetEditorWindowRect().AlignCenter(270, 200); + } + + private void OtherStuffYouCanDo() + { + var window = OdinEditorWindow.InspectObject(this.someObject); + + window.position = GUIHelper.GetEditorWindowRect().AlignCenter(270, 200); + window.titleContent = new GUIContent("Custom title", EditorIcons.RulerRect.Active); + window.OnClose += () => Debug.Log("Window Closed"); + window.OnBeginGUI += () => GUILayout.Label("-----------"); + window.OnEndGUI += () => GUILayout.Label("-----------"); + } + + + + + + + Occurs when the window is closed. + + + + + Occurs at the beginning the OnGUI method. + + + + + Occurs at the end the OnGUI method. + + + + + Gets the label width to be used. Values between 0 and 1 are treated as percentages, and values above as pixels. + + + + + Gets or sets the window padding. x = left, y = right, z = top, w = bottom. + + + + + Gets a value indicating whether the window should draw a scroll view. + + + + + Gets a value indicating whether the window should draw a Unity editor preview, if possible. + + + + + Gets the default preview height for Unity editors. + + + + + Gets the target which which the window is supposed to draw. By default it simply returns the editor window instance itself. By default, this method is called by (). + + + + + Gets the targets to be drawn by the editor window. By default this simply yield returns the method. + + + + + At the start of each OnGUI event when in the Layout event, the GetTargets() method is called and cached into a list which you can access from here. + + + + + + Pops up an editor window for the given object in a drop-down window which closes when it loses its focus. + This particular overload uses a few frames to calculate the height of the content before showing the window with a height that matches its content. + + Protip: You can subscribe to OnClose if you want to know when that occurs. + + + + + Measures the GUILayout content height and adjusts the window height accordingly. + Note that this feature becomes pointless if any layout group expands vertically. + + The max height of the window. + When the window height expands below the screen bounds, it will move the window + upwards when needed, enabling this will move it back down when the window height is decreased. + + + + + Pops up an editor window for the given object in a drop-down window which closes when it loses its focus. + + Protip: You can subscribe to OnClose if you want to know when that occurs. + + + + + + Pops up an editor window for the given object in a drop-down window which closes when it loses its focus. + + Protip: You can subscribe to OnClose if you want to know when that occurs. + + + + + + Pops up an editor window for the given object in a drop-down window which closes when it loses its focus. + + Protip: You can subscribe to OnClose if you want to know when that occurs. + + + + + + Pops up an editor window for the given object in a drop-down window which closes when it loses its focus. + + Protip: You can subscribe to OnClose if you want to know when that occurs. + + + + + + Pops up an editor window for the given object in a drop-down window which closes when it loses its focus. + + Protip: You can subscribe to OnClose if you want to know when that occurs. + + + + + + Pops up an editor window for the given object in a drop-down window which closes when it loses its focus. + + Protip: You can subscribe to OnClose if you want to know when that occurs. + + + + + Pops up an editor window for the given object. + + + + + Inspects the object using an existing OdinEditorWindow. + + + + + Creates an editor window instance for the specified object, without opening the window. + + + + + Creates an editor window instance for the specified object, without opening the window. + + + + + The Odin property tree drawn. + + + + + Draws the Odin Editor Window. + + + + + Calls DrawEditor(index) for each of the currently drawing targets. + + + + + Initialize get called by OnEnable and by OnGUI after assembly reloads + which often happens when you recompile or enter and exit play mode. + + + + + Called when the window is enabled. Remember to call base.OnEnable(); + + + + + Draws the editor for the this.CurrentDrawingTargets[index]. + + + + + Uses the method to draw a preview for the this.CurrentDrawingTargets[index]. + + + + + Called when the window is destroyed. Remember to call base.OnDestroy(); + + + + + Called before starting to draw all editors for the . + + + + + Called after all editors for the has been drawn. + + + + + See ISerializationCallbackReceiver.OnBeforeSerialize for documentation on how to use this method. + + + + + Implement this method to receive a callback after unity serialized your object. + + + + + Draws an editor window with a menu tree. + + + + public class OdinMenuEditorWindowExample : OdinMenuEditorWindow + { + [SerializeField, HideLabel] + private SomeData someData = new SomeData(); + + protected override OdinMenuTree BuildMenuTree() + { + OdinMenuTree tree = new OdinMenuTree(supportsMultiSelect: true) + { + { "Home", this, EditorIcons.House }, // draws the someDataField in this case. + { "Odin Settings", null, SdfIconType.GearFill }, + { "Odin Settings/Color Palettes", ColorPaletteManager.Instance, EditorIcons.EyeDropper }, + { "Odin Settings/AOT Generation", AOTGenerationConfig.Instance, EditorIcons.SmartPhone }, + { "Camera current", Camera.current }, + { "Some Class", this.someData } + }; + + tree.AddAllAssetsAtPath("More Odin Settings", SirenixAssetPaths.OdinEditorConfigsPath, typeof(ScriptableObject), true) + .AddThumbnailIcons(); + + tree.AddAssetAtPath("Odin Getting Started", SirenixAssetPaths.SirenixPluginPath + "Getting Started With Odin.asset"); + + var customMenuItem = new OdinMenuItem(tree, "Menu Style", tree.DefaultMenuStyle); + tree.MenuItems.Insert(2, customMenuItem); + + tree.Add("Menu/Items/Are/Created/As/Needed", new GUIContent()); + tree.Add("Menu/Items/Are/Created", new GUIContent("And can be overridden")); + + // As you can see, Odin provides a few ways to quickly add editors / objects to your menu tree. + // The API also gives you full control over the selection, etc.. + // Make sure to check out the API Documentation for OdinMenuEditorWindow, OdinMenuTree and OdinMenuItem for more information on what you can do! + + return tree; + } + } + + + + + + + + + + + + + Called when the window is destroyed. Remember to call base.OnDestroy(); + + + + + Builds the menu tree. + + + + + Gets or sets the width of the menu. + + + + + Gets a value indicating whether the menu is resizable. + + + + + Gets the menu tree. + + + + + Gets or sets a value indicating whether to draw the menu search bar. + + + + + Gets or sets the custom search function. + + + + + Forces the menu tree rebuild. + + + + + Tries to select the menu item with the specified object. + + + + + Draws the menu tree selection. + + + + + Draws the Odin Editor Window. + + + + + The method that draws the menu. + + + + + A menu item that represents one or more objects. + + + + + + + + + + The default toggled state + + + + + Initializes a new instance of the class. + + The Odin menu tree instance the menu item belongs to. + The name of the menu item. + The instance the value item represents. + + + + Occurs right after the menu item is done drawing, and right before mouse input is handles so you can take control of that. + + + + + Occurs when the user has right-clicked the menu item. + + + + + Gets the child menu items. + + + The child menu items. + + + + + Gets the index location of the menu item. + + + + + Gets or sets a value indicating whether the menu item is visible. + Not that setting this to false will not hide its children as well. For that see use Toggled. + + + + + Gets or sets the icon that is used when the menu item is not selected. + + + + + Gets or sets the icon that is used when the menu item is selected. + + + + + Gets a value indicating whether this instance is selected. + + + + + Determines whether this instance is selectable. + + + + + Determines whether this instance is enabled. + + + + + Gets the menu tree instance. + + + + + Gets or sets the raw menu item name. + + + + + Gets or sets the search string used when searching for menu items. + + + + + Gets the next visual menu item. + + + + + Gets the next selectable visual menu item. + + + + + Gets the parent menu item. + + + + + Gets the previous visual menu item. + + + + + Gets the previous selectable visual menu item. + + + + + Gets the drawn rect. + + + + + Gets the drawn label rect. + + + + + Gets or sets the style. If null is specified, then the menu trees DefaultMenuStyle is used. + + + + + Deselects this instance. + + + + + Selects the specified add to selection. + + + + + Gets the child menu items recursive in a DFS. + + Whether to include it self in the collection. + + + + Gets the child menu items recursive in a DFS. + + Whether to include it self in the collection. + Whether to include the root. + + + + Gets the full menu item path. + + + + + Gets the first object of the + + + + + Gets the object instances the menu item represents + + + + + Sets the object instance + + + + + Sets the object instances + + + + + Gets or sets the value the menu item represents. + + + + + Gets a nice menu item name. If the raw name value is null or a dollar sign, then the name is retrieved from the object itself via ToString(). + + + + + Gets or sets a value indicating whether this is toggled / expanded. This value tries it best to be persistent. + + + + + Gets or sets the icon getter. + + + + + Draws this menu item followed by all of its child menu items + + The indent level. + + + + Draws the menu item with the specified indent level. + + + + + Override this to add custom GUI to the menu items. + This is called right after the menu item is done drawing, and right before mouse input is handles so you can take control of that. + + + + + Handles the mouse events. + + The rect. + The triangle rect. + + + + The style settings used by . + + A nice trick to style your menu is to add the tree.DefaultMenuStyle to the tree itself, + and style it live. Once you are happy, you can hit the Copy CSharp Snippet button, + remove the style from the menu tree, and paste the style directly into your code. + + + + + + + + + + + Gets or sets the default selected style. + + + + + Gets or sets the selected label style. + + + + + The height of the menu item. + + + + + The global offset of the menu item content + + + + + The vertical offset of the menu item label + + + + + The number of pixels to indent per level indent level. + + + + + The size of the icon. + + + + + The size of the icon. + + + + + The transparency of icons when the menu item is not selected. + + + + + The padding between the icon and other content. + + + + + Whether to draw the a foldout triangle for menu items with children. + + + + + The size of the foldout triangle icon. + + + + + The padding between the foldout triangle icon and other content. + + + + + Whether or not to align the triangle left or right of the content. + If right, then the icon is pushed all the way to the right at a fixed position ignoring the indent level. + + + + + Whether to draw borders between menu items. + + + + + The horizontal border padding. + + + + + The border alpha. + + + + + The background color for when a menu item is selected. + + + + + The background color for when a menu item is selected. + + + + + The background color for when a menu item is selected. + + + + + The background color for when a menu item is selected. + + + + + The background color for when a menu item is selected. + + + + + The background color for when a menu item is selected. + + + + + Sets the height of the menu item. + + + + + Sets the global offset of the menu item content + + + + + Sets the number of pixels to indent per level indent level. + + + + + Sets the size of the icon. + + + + + Sets the size of the icon. + + + + + Sets the transparency of icons when the menu item is not selected. + + + + + Sets the padding between the icon and other content. + + + + + Sets whether to draw the a foldout triangle for menu items with children. + + + + + Sets the size of the foldout triangle icon. + + + + + Sets the padding between the foldout triangle icon and other content. + + + + + Sets whether or not to align the triangle left or right of the content. + If right, then the icon is pushed all the way to the right at a fixed position ignoring the indent level. + + + + + Sets whether to draw borders between menu items. + + + + + Sets the border alpha. + + + + + Sets the border alpha. + + + + + Sets the background color for when a menu item is selected. + + + + + Sets the background color for when a menu item is selected. + + + + + Creates and returns an instance of a menu style that makes it look like Unity's project window. + + + + + OdinMenuTree provides a tree of s, and helps with selection, inserting menu items into the tree, and can handle keyboard navigation for you. + + + + OdinMenuTree tree = new OdinMenuTree(supportsMultiSelect: true) + { + { "Home", this, EditorIcons.House }, + { "Odin Settings", null, SdfIconType.GearFill }, + { "Odin Settings/Color Palettes", ColorPaletteManager.Instance, EditorIcons.EyeDropper }, + { "Odin Settings/AOT Generation", AOTGenerationConfig.Instance, EditorIcons.SmartPhone }, + { "Camera current", Camera.current }, + { "Some Class", this.someData } + }; + + tree.AddAllAssetsAtPath("Some Menu Item", "Some Asset Path", typeof(ScriptableObject), true) + .AddThumbnailIcons(); + + tree.AddAssetAtPath("Some Second Menu Item", "SomeAssetPath/SomeAssetFile.asset"); + + var customMenuItem = new OdinMenuItem(tree, "Menu Style", tree.DefaultMenuStyle); + tree.MenuItems.Insert(2, customMenuItem); + + tree.Add("Menu/Items/Are/Created/As/Needed", new GUIContent()); + tree.Add("Menu/Items/Are/Created", new GUIContent("And can be overridden")); + + OdinMenuTrees are typically used with s but is made to work perfectly fine on its own for other use cases. + OdinMenuItems can be inherited and and customized to fit your needs. + + // Draw stuff + someTree.DrawMenuTree(); + // Draw stuff + someTree.HandleKeybaordMenuNavigation(); + + + + + + + + + + + Gets the currently active menu tree. + + + + + Gets the selection. + + + + + Gets the root menu items. + + + + + Gets the root menu item. + + + + + If true, all indent levels will be ignored, and all menu items with IsVisible == true will be drawn. + + + + + Adds a menu item with the specified object instance at the the specified path. + + Returns all menu items created in order to add the menu item at the specified path. + + + + Adds a menu item with the specified object instance and icon at the the specified path. + + Returns all menu items created in order to add the menu item at the specified path. + + + + Adds a menu item with the specified object instance and icon at the the specified path. + + Returns all menu items created in order to add the menu item at the specified path. + + + + Adds a menu item with the specified object instance and icon at the the specified path. + + Returns all menu items created in order to add the menu item at the specified path. + + + + Adds a menu item with the specified object instance and icon at the the specified path. + + Returns all menu items created in order to add the menu item at the specified path. + + + + Adds a collection of objects to the menu tree and returns all menu items created in random order. + + + + + Adds a collection of objects to the menu tree and returns all menu items created in random order. + + + + + Gets or sets the default menu item style from Config.DefaultStyle. + + + + + Gets or sets the default drawing configuration. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + if set to true [supports multi select]. + + + + Initializes a new instance of the class. + + if set to true [supports multi select]. + The default menu item style. + + + + Initializes a new instance of the class. + + + + + Sets the focus to the . + + + + + Scrolls to the specified menu item. + + + + + Enumerates the tree with a DFS. + + if set to true then the invisible root menu item is included. + + + + Enumerates the tree with a DFS. + + The predicate. + if set to true then the invisible root menu item is included. + + + + Enumerates the tree with a DFS. + + + + + Draws the menu tree recursively. + + + + + Marks the dirty. This will cause a tree.UpdateTree() in the beginning of the next Layout frame. + + + + + Indicates that the layout has changed and needs to be recomputed. + This is used when is enabled. + + + + + Draws the search toolbar. + + + + + Updates the menu tree. This method is usually called automatically when needed. + + + + + Handles the keyboard menu navigation. Call this at the end of your GUI scope, to prevent the menu tree from stealing input events from other text fields. + + Returns true, if anything was changed via the keyboard. + + + + Handles the keyboard menu navigation. Call this at the end of your GUI scope, to prevent the menu tree from stealing input events from other text fields. + + Returns true, if anything was changed via the keyboard. + + + + The config used by OdinMenuTree to specify which features of the Menu Tree should be used when drawing. + + + + + Gets or sets the default menu item style. + + + + + The automatic scroll on selection changed. True by default. + + + + + Whether to draw the tree in a scrollable view. True by default. + + + + + Whether to handle keyboard navigation after it's done drawing. True by default. + + + + + Whether to draw a searchbar above the menu tree. True by default. + + + + + Whether to the menu items expanded state should be cached. True by default. + + + + + Whether to automatically set focus on the search bar when the tree is drawn for the first time. True by default. + + + + + Whether to select menu items on mouse down, or on click. False by default. + + + + + The scroll-view position. + + + + + The search term. + + + + + The height of the search toolbar. + + + + + Will only handle layouting when there has been a hierarchical change (such as an item being expanded or collapsed). + + + This expects every item to have the same height specified in the style (). + This means no custom layouting is supported with this on. + + + + + Gets or sets the search function. Null by default. + + + + + By default, the MenuTree.Selection is confirmed when menu items are double clicked, + Set this to false if you don't want that behaviour. + + + + + By default, the MenuTree.Selection is confirmed when menu items are double clicked, + Set this to false if you don't want that behaviour. + + + + + Class with utility methods for s and s. + + + + OdinMenuTree tree = new OdinMenuTree(); + tree.AddAllAssetsAtPath("Some Menu Item", "Some Asset Path", typeof(ScriptableObject), true) + .AddThumbnailIcons(); + tree.AddAssetAtPath("Some Second Menu Item", "SomeAssetPath/SomeAssetFile.asset"); + // etc... + + + + + + + + + + + Adds the menu item at the specified menu item path and populates the result list with all menu items created in order to add the menuItem at the specified path. + + The tree instance. + The result list. + The menu item path. + The menu item. + + + + Adds the menu item at specified menu item path, and returns all menu items created in order to add the menuItem at the specified path. + + The tree. + The menu item path. + The menu item. + Returns all menu items created in order to add the menu item at the specified menu item path. + + + + Gets the menu item at the specified path, returns null non was found. + + + + + Adds all asset instances from the specified path and type into a single at the specified menu item path, and returns all menu items created in order to add the menuItem at the specified path.. + + The tree. + The menu item path. + The asset folder path. + The type of objects. + Whether to search for assets in subdirectories as well. + Returns all menu items created in order to add the menu item at the specified menu item path. + + + + Adds all assets at the specified path. Each asset found gets its own menu item inside the specified menu item path. + + The tree. + The menu item path. + The asset folder path. + The type. + Whether to search for assets in subdirectories as well. + If true, sub-directories in the assetFolderPath will no longer get its own sub-menu item at the specified menu item path. + Returns all menu items created in order to add the menu item at the specified menu item path. + + + + Adds all assets at the specified path. Each asset found gets its own menu item inside the specified menu item path. + + The tree. + The menu item path. + The asset folder path. + Whether to search for assets in subdirectories as well. + If true, sub-directories in the assetFolderPath will no longer get its own sub-menu item at the specified menu item path. + Returns all menu items created in order to add the menu item at the specified menu item path. + + + + Adds the asset at the specified menu item path and returns all menu items created in order to end up at the specified menu path. + + The tree. + The menu item path. + The asset path. + Returns all menu items created in order to add the menu item at the specified menu item path. + + + + Adds the asset at the specified menu item path and returns all menu items created in order to end up at the specified menu path. + + The tree. + The menu item path. + The asset path. + The type. + Returns all menu items created in order to add the menu item at the specified menu item path. + + + + Sorts the entire tree of menu items recursively by name with respects to numbers. + + + + + Sorts the collection of menu items recursively by name with respects to numbers. This is a stable sort, meaning that equivalently ordered items will remain in the same order as they start. + + + + + Sorts the collection of menu items recursively using a given custom comparison. This is a stable sort, meaning that equivalently ordered items will remain in the same order as they start. + + + + + Adds the specified object at the specified menu item path and returns all menu items created in order to end up at the specified menu path. + + The tree. + The menu path. + The object instance. + Set this to true if you want Odin serialzied members such as dictionaries and generics to be shown as well. + Returns all menu items created in order to add the menu item at the specified menu item path. + + + + Assigns the specified icon to all menu items in the collection with the specified ObjectInstanceType. + + + + + Assigns the specified icon to all menu items in the collection with the specified ObjectInstanceType. + + + + + Assigns the specified icon to all menu items in the collection. + + + + + Assigns the specified icon to all menu items in the collection. + + + + + Assigns the specified icon to the last menu item in the collection. + + + + + Assigns the specified icon to the last menu item in the collection. + + + + + Assigns the specified icon to the last menu item in the collection. + + + + + Assigns the specified icon to the last menu item in the collection. + + + + + Assigns the specified icon to the last menu item in the collection. + + + + + Assigns the specified icon to all menu items in the collection. + + + + + Assigns the specified icon to all menu items in the collection. + + + + + Assigns the specified icon to all menu items in the collection. + + + + + Assigns the asset mini thumbnail as an icon to all menu items in the collection. If the menu items object is null then a Unity folder icon is assigned. + + + + + Assigns the asset mini thumbnail as an icon to all menu items in the collection. If the menu items object is null then a Unity folder icon is assigned. + + + + + Constants which describe the type of change that was made to the OdinMenuTrees's Selection + + + + + + A menu item was removed. + + + + + A menu item was selected. + + + + + The selection was cleared. + + + + + Handles the selection of a Odin Menu Tree with support for multi selection. + + + + + + + + + + Initializes a new instance of the class. + + if set to true [supports multi select]. + + + + Occurs whenever the selection has changed. + + + + + Occurs whenever the selection has changed. + + + + + Usually occurs whenever the user hits return, or double click a menu item. + + + + + Gets the count. + + + + + Gets the first selected value, returns null if non is selected. + + + + + Gets all selected values. + + + + + Gets or sets a value indicating whether multi selection is supported. + + + + + Gets the at the specified index. + + + + + Adds a menu item to the selection. If the menu item is already selected, then the item is pushed to the bottom of the selection list. + If multi selection is off, then the previous selected menu item is removed first. + Adding a item to the selection triggers . + + The item. + + + + Clears the selection and triggers . + + + + + Determines whether an OdinMenuItem is selected. + + + + + Copies all the elements of the current array to the specified array starting at the specified destination array index. + + + + + Gets the enumerator. + + + + + Searches for the specified menu item and returns the index location. + + + + + Removes the specified menu item and triggers . + + + + + Removes the menu item at the specified index and triggers . + + + + + Triggers OnSelectionConfirmed. + + + + + A feature-rich enum selector with support for flag enums. + + + + KeyCode someEnumValue; + + [OnInspectorGUI] + void OnInspectorGUI() + { + // Use the selector manually. See the documentation for OdinSelector for more information. + if (GUILayout.Button("Open Enum Selector")) + { + EnumSelector<KeyCode> selector = new EnumSelector<KeyCode>(); + selector.SetSelection(this.someEnumValue); + selector.SelectionConfirmed += selection => this.someEnumValue = selection.FirstOrDefault(); + selector.ShowInPopup(); // Returns the Odin Editor Window instance, in case you want to mess around with that as well. + } + + // Draw an enum dropdown field which uses the EnumSelector popup: + this.someEnumValue = EnumSelector<KeyCode>.DrawEnumField(new GUIContent("My Label"), this.someEnumValue); + } + + // All Odin Selectors can be rendered anywhere with Odin. This includes the EnumSelector. + EnumSelector<KeyCode> inlineSelector; + + [ShowInInspector] + EnumSelector<KeyCode> InlineSelector + { + get { return this.inlineSelector ?? (this.inlineSelector = new EnumSelector<KeyCode>()); } + set { } + } + + + + + + + + + + + + By default, the enum type will be drawn as the title for the selector. No title will be drawn if the string is null or empty. + + + + + Gets a value indicating whether this instance is flag enum. + + + + + Initializes a new instance of the class. + + + + + Populates the tree with all enum values. + + + + + When ShowInPopup is called, without a specified window width, this method gets called. + Here you can calculate and give a good default width for the popup. + The default implementation returns 0, which will let the popup window determine the width itself. This is usually a fixed value. + + + + + Gets the currently selected enum value. + + + + + Selects an enum. + + + + + Draws an enum selector field using the enum selector. + + + + + Draws an enum selector field using the enum selector. + + + + + Draws an enum selector field using the enum selector. + + + + + Draws an enum selector field using the enum selector. + + + + + In simple one-off use cases, making a custom OdinSelector might not be needed, as the GenericSelecor + can be populated with anything and customized a great deal. + + + + SomeType someValue; + + [OnInspectorGUI] + void OnInspectorGUI() + { + if (GUILayout.Button("Open Generic Selector Popup")) + { + List<SomeType> source = ...; + GenericSelector<SomeType> selector = new GenericSelector<SomeType>("Title", false, x => x.Path, source); + selector.SetSelection(this.someValue); + selector.SelectionTree.Config.DrawSearchToolbar = false; + selector.SelectionTree.DefaultMenuStyle.Height = 22; + selector.SelectionConfirmed += selection => this.someValue = selection.FirstOrDefault() + var window = selector.ShowInPopup(); + window.OnEndGUI += () => { EditorGUILayout.HelpBox("A quick way of injecting custom GUI to the editor window popup instance.", MessageType.Info); }; + window.OnClose += selector.SelectionTree.Selection.ConfirmSelection; // Confirm selection when window clses. + } + } + + + + + + + + + + + + Gets or sets a value indicating whether [flattened tree]. + + + + + Gets or sets a value indicating whether [checkbox toggle]. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Gets the title. No title will be drawn if the string is null or empty. + + + + + Draws the selection tree. This gets drawn using the OnInspectorGUI attribute. + + + + + Builds the selection tree. + + + + + Used in to associate name to a value in the GenericSelector. + + + + + + The value. + + + + + The name. + + + + + Initializes a new instance of the struct. + + + + + If the + + + + + OdinSelectors is an abstract base class that combines OdinMenuTrees and OdinEditorWindows to help making feature-rich selectors and popup selectors. + + + + public class MySelector : OdinSelector<SomeType> + { + private readonly List<SomeType> source; + private readonly bool supportsMultiSelect; + + public MySelector(List<SomeType> source, bool supportsMultiSelect) + { + this.source = source; + this.supportsMultiSelect = supportsMultiSelect; + } + + protected override void BuildSelectionTree(OdinMenuTree tree) + { + tree.Config.DrawSearchToolbar = true; + tree.Selection.SupportsMultiSelect = this.supportsMultiSelect; + + tree.Add("Defaults/None", null); + tree.Add("Defaults/A", new SomeType()); + tree.Add("Defaults/B", new SomeType()); + + tree.AddRange(this.source, x => x.Path, x => x.SomeTexture); + } + + [OnInspectorGUI] + private void DrawInfoAboutSelectedItem() + { + SomeType selected = this.GetCurrentSelection().FirstOrDefault(); + + if (selected != null) + { + GUILayout.Label("Name: " + selected.Name); + GUILayout.Label("Data: " + selected.Data); + } + } + } + + Usage: + + void OnGUI() + { + if (GUILayout.Button("Open My Selector")) + { + List<SomeType> source = this.GetListOfThingsToSelectFrom(); + MySelector selector = new MySelector(source, false); + + selector.SetSelection(this.someValue); + + selector.SelectionCancelled += () => { }; // Occurs when the popup window is closed, and no slection was confirmed. + selector.SelectionChanged += col => { }; + selector.SelectionConfirmed += col => this.someValue = col.FirstOrDefault(); + + selector.ShowInPopup(); // Returns the Odin Editor Window instance, in case you want to mess around with that as well. + } + } + + // All Odin Selectors can be rendered anywhere with Odin. + [ShowInInspector] + MySelector inlineSelector; + + + + + + + + + + + + If true, a confirm selection button will be drawn in the title-bar. + + + + + Enables the single click to select. + + + + + Occurs when the window is closed, and no slection was confirmed. + + + + + Occurs when the menuTrees selection is changed and IsValidSelection returns true. + + + + + Occurs when the menuTrees selection is confirmed and IsValidSelection returns true. + + + + + Gets the selection menu tree. + + + + + Gets the title. No title will be drawn if the string is null or empty. + + + + + Gets the current selection from the menu tree whether it's valid or not. + + + + + Determines whether the specified collection is a valid collection. + If false, the SlectionChanged and SelectionConfirm events will not be called. + By default, this returns true if the collection contains one or more items. + + + + + Sets the selection. + + + + + Sets the selection. + + + + + Opens up the selector instance in a popup at the specified rect position. + The width of the popup is determined by DefaultWindowWidth, and the height is automatically calculated. + + + + + Opens up the selector instance in a popup at the specified rect position. + + + + + Opens up the selector instance in a popup at the specified rect position. + + + + + The mouse position is used as the position for the window. + Opens up the selector instance in a popup at the specified position. + + + + + Opens up the selector instance in a popup at the specified position. + + + + + Opens up the selector instance in a popup at the specified rect position. + + + + + Opens up the selector instance in a popup at the specified position. + The width of the popup is determined by DefaultWindowWidth, and the height is automatically calculated. + + + + + Opens up the selector instance in a popup with the specified width and height. + The mouse position is used as the position for the window. + + + + + Builds the selection tree. + + + + + When ShowInPopup is called, without a specifed window width, this methods gets called. + Here you can calculate and give a good default width for the popup. + The default implementation returns 0, which will let the popup window determain the width itself. This is usually a fixed value. + + + + + Triggers the selection changed event, but only if the current selection is valid. + + + + + Draw the selecotr manually. + + + + + Draws the selection tree. This gets drawn using the OnInspectorGUI attribute. + + + + + Draws dropwdown field, that creates and binds the selector to the dropdown field. + + + + + Draws dropwdown field, that creates and binds the selector to the dropdown field. + + + + + Draws dropwdown field, that creates and binds the selector to the dropdown field. + + + + + Draws dropwdown field, that creates and binds the selector to the dropdown field. + + + + + Draws dropwdown field, that creates and binds the selector to the dropdown field. + + + + + Draws dropwdown field, that creates and binds the selector to the dropdown field. + + + + + Draws dropwdown field, that creates and binds the selector to the dropdown field. + + + + + Draws dropwdown field, that creates and binds the selector to the dropdown field. + + + + + Builds the selection tree. + + + + + 450 + + + + + Sets the selected types. + + + + + The that was used in the last 'Show' call. + + + + + The key to identify who called the selector. + + + + + The id to identify who called the selector. + + + + + The current selected object. + + + + + True if is used; otherwise false. + + + + + The type of the value used in the last 'Show' call. + + + + + The base type of the value used in the last 'Show' call. + + + + + Shows a selector. + + The key used to identify who called the selector; this can be null. + The ID used to identify who called the selector; this can be 0. + The current value selected. + The base type of the 'value'. + Determines if scene objects are allowed. + Determines if null values are allowed. + The position where the selector should appear. + Thrown if the selector was opened for a case that it didn't expect. + + Either '' or '' must be set, but both can also be set for more consistent results. + + + + + Shows a selector. + + The key used to identify who called the selector; this can be null. + The ID used to identify who called the selector; this can be 0. + + Used to provide values for all parameters in the full declaration of this method. + It also allows for customization of various stages of the selector with attributes. + This also sets the . + + Determines if the default Unity Object Selector should be the one to appear. + Thrown if the selector was opened for a case that it didn't expect. + + Either '' or '' must be set, but both can also be set for more consistent results. + + + + + Shows a selector. + + The position where the selector should appear; can be . + The key used to identify who called the selector; this can be null. + The ID used to identify who called the selector; this can be 0. + + Used to provide values for all parameters in the full declaration of this method. + It also allows for customization of various stages of the selector with attributes. + This also sets the . + + Determines if the default Unity Object Selector should be the one to appear. + Thrown if the selector was opened for a case that it didn't expect. + + Either '' or '' must be set, but both can also be set for more consistent results. + + + + + Shows a selector. + + The key used to identify who called the selector; this can be null. + The ID used to identify who called the selector; this can be 0. + The current value selected. + The base type of the 'value'. + Determines if scene objects are allowed. + Determines if null values are allowed. + Used for various stages of the selector that can be customized with attributes. This also sets the . + Determines if the default Unity Object Selector should be the one to appear. + Thrown if the selector was opened for a case that it didn't expect. + + Either '' or '' must be set, but both can also be set for more consistent results. + + + + + Shows a selector. + + The key used to identify who called the selector; this can be null. + The ID used to identify who called the selector; this can be 0. + The current value selected. + The type of the 'value'. + The base type of the 'value'. + Determines if scene objects are allowed. + Determines if null values are allowed. + Used for various stages of the selector that can be customized with attributes. This also sets the . + Determines if the default Unity Object Selector should be the one to appear. + Thrown if the selector was opened for a case that it didn't expect. + + Either '' or '' must be set, but both can also be set for more consistent results. + + + + + Shows a selector. + + The position where the selector should appear; can be . + The key used to identify who called the selector; this can be null. + The ID used to identify who called the selector; this can be 0. + The current value selected. + The base type of the 'value'. + Determines if scene objects are allowed. + Determines if null values are allowed. + Used for various stages of the selector that can be customized with attributes. This also sets the . + Determines if the default Unity Object Selector should be the one to appear. + Thrown if the selector was opened for a case that it didn't expect. + + Either '' or '' must be set, but both can also be set for more consistent results. + + + + + Shows a selector. + + The position where the selector should appear; can be . + The key used to identify who called the selector; this can be null. + The ID used to identify who called the selector; this can be 0. + The current value selected. + The type of the 'value'. + The base type of the 'value'. + Determines if scene objects are allowed. + Determines if null values are allowed. + Used for various stages of the selector that can be customized with attributes. This also sets the . + Determines if the default Unity Object Selector should be the one to appear. + Thrown if the selector was opened for a case that it didn't expect. + + Either '' or '' must be set, but both can also be set for more consistent results. + + + + + If the object was changed since the last time this method was called, it returns the changed object (); otherwise, it returns the provided value. + + The current value; the value to return if no change has occurred. + The key to identify who showed the current selector. + The ID to identify who showed the current selector. + The type of object to expect as a return value. + if it was marked as changed, otherwise . + + + + Checks if the selector's object is ready to be claimed. + + The key to identify who showed the current selector. + The ID to identify who showed the current selector. + true if the selector's object () is ready to be claimed; otherwise, false. + + + + Determines whether the specified and combination match the currently open selectors. + + The key to match. + The ID to match. + true if the combination is a match; otherwise, false. + + + + Claims the current . + + The if it is ready to be claimed; otherwise, NULL with an accompanying error message. + + + + Claims the current and copies a specified amount () of instances of the . + + The number of instances to copy. + + An array of copies, where element 0 is always the original value, + if the is ready to be claimed; otherwise, NULL with an accompanying error message. + + + + + Claims the current and, if ready, assigns it to the specified . + If the is not ready to be claimed, an error message will be logged. + + The to assign the to. + Context that persists across reloading and restarting Unity. @@ -10439,17 +10479,6 @@ Updates the local value to the current global value. - - - OdinDrawer extensions. - - - - - Gets a persistent value that will survive past multiple Unity Editor Application sessions. - The value is stored in the PersistentContextCache, which has a customizable max cache size. - - Provides context objects that still persist when Unity reloads or is restarted. @@ -10770,9 +10799,356 @@ Delete the persistent cache file. + + + Put this attribute on a validator class to prevent the ValidatorDrawer from running that validator in the inspector. + Typically you would use this for a validation-related attribute that has its own, complex custom drawer that should + handle the validation and error/warning drawing while the inspector is being drawn, but still needs a validator to + run for the project validation scans. + + + + + Apply this to an assembly to register validators for the validation system. + This enables locating of all relevant validator types very quickly. + + + + + + Use to initialize an empty . + + + + + This attribute can be placed on an assembly to register a value resolver creator that should be queried when a value resolver is being created. + + + + + This attribute can be placed on an assembly to register a value resolver creator that should be queried when a value resolver is being created. + + The resolver + + + + + A ValueResolver resolves a string to a value of a given type, given an InspectorProperty instance to use as context. Call to get an instance of a ValueResolver. + Value resolvers are a globally extendable system that can be hooked into and modified or changed by creating and registering a . + See Odin's tutorials for details and examples of how to use ValueResolvers. + + + + + The context of this ValueResolver, containing all of its configurations and values it needs to function. For performance and simplicity reasons, this is a single very large struct that is passed around by ref to anything that needs it. + + + + + The current error message that the resolver has, or null if there is no error message. This is a shortcut for writing "resolver.Context.ErrorMessage". + + + + + Whether there is an error message at the moment. This is a shortcut for writing "resolver.Context.ErrorMessage != null". + + + + + The type of value that this resolver instance is supposed to get. + + + + + Gets a value from the value resolver in a weakly typed manner. + + The selection index at which to get the value, in the case of multi-selection. Defaults to 0. + The value that was gotten. + + + + Draws an error message box if there is an error, and does nothing if there is no error. + + + + + Creates a new value resolver instance from a pre-built context struct, in a weakly typed fashion, though the result + is the same as using a strongly typed generic overload. This is a more advanced use that requires you to + know how the context needs to be set up before value resolution happens. However, this allows you to do more advanced + things like adjust various context values before string resolution happens. + + The pre-built context that should be used to get a resolver. + + + + Creates a new value resolver instance from a pre-built context struct. This is a more advanced use that requires you to + know how the context needs to be set up before value resolution happens. However, this allows you to do more advanced + things like adjust various context values before string resolution happens. + + The pre-built context that should be used to get a resolver. + + + + Creates a new value resolver instance in a weakly typed fashion, though the result is the same as using a strongly typed generic overload. + This is useful when you don't know at compile time which type you want to resolve. + + The type of value that the new resolver should resolve. + The property that is the context for the resolution to happen in. + The string that should be resolved to a value. + + + + Creates a new value resolver instance in a weakly typed fashion, though the result is the same as using a strongly typed generic overload. + This is useful when you don't know at compile time which type you want to resolve. + + The type of value that the new resolver should resolve. + The property that is the context for the resolution to happen in. + The string that should be resolved to a value. + The extra named args that this resolver has access to. Passing in a named arg that already exists will silently override the pre-existing named arg. + + + + Creates a new value resolver instance. + + The type of value that the new resolver should resolve. + The property that is the context for the resolution to happen in. + The string that should be resolved to a value. + + + + Creates a new value resolver instance. + + The type of value that the new resolver should resolve. + The property that is the context for the resolution to happen in. + The string that should be resolved to a value. + The extra named args that this resolver has access to. Passing in a named arg that already exists will silently override the pre-existing named arg. + + + + Creates a new value resolver instance in a weakly typed fashion, though the result is the same as using a strongly typed generic overload. + This is useful when you don't know at compile time which type you want to resolve. + + The type of value that the new resolver should resolve. + The property that is the context for the resolution to happen in. + The string that should be resolved to a value. + The value that the resolver should return if the string cannot be resolved to anything, or if there is an error in creating a resolver, or if resolution itself throws an exception. + + + + Creates a new value resolver instance in a weakly typed fashion, though the result is the same as using a strongly typed generic overload. + This is useful when you don't know at compile time which type you want to resolve. + + The type of value that the new resolver should resolve. + The property that is the context for the resolution to happen in. + The string that should be resolved to a value. + The value that the resolver should return if the string cannot be resolved to anything, or if there is an error in creating a resolver, or if resolution itself throws an exception. + The extra named args that this resolver has access to. Passing in a named arg that already exists will silently override the pre-existing named arg. + + + + Creates a new value resolver instance meant to resolve a string value in particular. This is a shorthand for creating a string resolver that has the resolved string as a fallback value. + This special case will get you the behaviour where, if you pass in a string that is not meant to be resolved in a special way, the value resolver will just pass you that string back as the result value. + + The property that is the context for the resolution to happen in. + The string that should be resolved to a value. + + + + Creates a new value resolver instance meant to resolve a string value in particular. This is a shorthand for creating a string resolver that has the resolved string as a fallback value. + This special case will get you the behaviour where, if you pass in a string that is not meant to be resolved in a special way, the value resolver will just pass you that string back as the result value. + + The property that is the context for the resolution to happen in. + The string that should be resolved to a value. + The extra named args that this resolver has access to. Passing in a named arg that already exists will silently override the pre-existing named arg. + + + + Creates a new value resolver instance. + + The type of value that the new resolver should resolve. + The property that is the context for the resolution to happen in. + The string that should be resolved to a value. + The value that the resolver should return if the string cannot be resolved to anything, or if there is an error in creating a resolver, or if resolution itself throws an exception. + + + + Creates a new value resolver instance. + + The type of value that the new resolver should resolve. + The property that is the context for the resolution to happen in. + The string that should be resolved to a value. + The value that the resolver should return if the string cannot be resolved to anything, or if there is an error in creating a resolver, or if resolution itself throws an exception. + The extra named args that this resolver has access to. Passing in a named arg that already exists will silently override the pre-existing named arg. + + + + Gets a nicely formatted string that lists all the errors in the given set of value resolvers. The returned value is null if there are no errors. + + + + + Gets a nicely formatted string that lists all the errors in the given set of value resolvers. The returned value is null if there are no errors. + + + + + Draws error boxes for all errors in the given value resolvers, or does nothing if there are no errors. This is equivalent to calling DrawError() on all resolvers passed to this method. + + + + + Draws error boxes for all errors in the given value resolvers, or does nothing if there are no errors. This is equivalent to calling DrawError() on all resolvers passed to this method. + + + + + A ValueResolver resolves a string to a value of a given type, given an InspectorProperty instance to use as context. Call to get an instance of a ValueResolver. + Value resolvers are a globally extendable system that can be hooked into and modified or changed by creating and registering a . + See Odin's tutorials for details and examples of how to use ValueResolvers. + + + + + The delegate that does the actual value resolution. You should not call this manually, but instead call . + + + + + The type of value that this resolver instance is supposed to get. Always equal to typeof(). + + + + + Gets a value from the value resolver. + + The selection index at which to get the value, in the case of multi-selection. Defaults to 0. + The value that was gotten. + + + + Gets a value from the value resolver in a weakly typed manner. + + The selection index at which to get the value, in the case of multi-selection. Defaults to 0. + The value that was gotten. + + + + This struct contains all of a ValueResolver's configurations and values it needs to function. For performance and simplicity reasons, this is a single very large struct that lives on a ValueResolver instance and is passed around by ref to anything that needs it. + + + + + The property that *provides* the context for the value resolution. This is the instance that was passed to the resolver when it was created. Note that this is different from , which is based on this value, but almost always isn't the same InspectorProperty instance. + + + + + The error message, if a valid value resolution wasn't found, or if creation of the value resolver failed because was invalid, or if value resolution was run but threw an exception. (In this last case, will be true.) + + + + + The named values that are available to the value resolver. Use this field only to get and set named values - once the ValueResolver has been created, new named values will have no effect. + + + + + This is the fallback value that the value resolver will return if there is an error or failed resolution for any reason. + + + + + Whether there is a fallback value. This boolean exists because then null is also a valid fallback value. This boolean will always be true if an overload is used that takes a fallback value parameter. + + + + + This will be true if is not null and the message was caused by an exception thrown by code invoked during an actual value resolution. + + + + + Whether exceptions thrown during value resolution should be logged to the console. + + + + + The type of value that the resolver is resolving. + + + + + The string that is resolved to get a value. + + + + + Whether the value resolver should sync ref parameters of invoked methods with named values. If this is true, then if a ref or out parameter value is changed during value resolution, the named value associated with that parameter will also be changed to the same value. + + + + + Whether this context has been resolved. + + + + + The type that is the parent of the value resolution, ie, the type that is the context. This is the same as .ValueEntry.TypeOfValue. + + + + + The property that *is* the context for the value resolution. This is not the instance that was passed to the resolver when it was created, but this value is based on that instance. This is the property that provides the actual context - for example, if is for a member of a type - or for an element in a collection contained by a member - this value will be the parent property for the type that contains that member. Only if is the tree's root property is the same as . + + + + + Gets the parent value which provides the context of the resolver. + + The selection index of the parent value to get. + + + + Sets the parent value which provides the context of the resolver. + + The selection index of the parent value to set. + The value to set. + + + + Adds the default named values of "property" and "value" to the context's named values. + This method is usually automatically invoked when a resolver is created, so there + is no need to invoke it manually. + + + + + Opens a window which displays a list of all icons available from . + + + + + Opens a window which displays a list of all icons available from . + + + + + Builds the selection tree. + + + + + Gets a texture of an odin bg symbol. + + + + + Adds menu items to the Unity Editor, draws the About window, and the preference window found under Edit > Preferences > Odin Inspector. + + - Access the StaticInspectorWindow from Tools > Odin Inspector > Static Inspector. + Access the StaticInspectorWindow from Tools > Odin > Inspector > Static Inspector. @@ -10850,7 +11226,7 @@ Opens a new static inspector window for the given type. - + Draws the Odin Editor Window. @@ -10905,6 +11281,11 @@ Generates an AOT DLL, using the current configuration of the AOTGenerationConfig instance. + + + Defines the ODIN_INSPECTOR symbol. + + The Odin Inspector Serialization Debugger Window. diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.xml.meta b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.xml.meta index e3bec9d..9015656 100644 --- a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.xml.meta +++ b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.xml.meta @@ -1,7 +1,6 @@ fileFormatVersion: 2 guid: a4865f1ab4504ed8a368670db22f096f timeCreated: 1488828285 -licenseType: Store DefaultImporter: userData: assetBundleName: diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Reflection.Editor.dll b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Reflection.Editor.dll new file mode 100644 index 0000000..b6f735e Binary files /dev/null and b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Reflection.Editor.dll differ diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Reflection.Editor.dll.meta b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Reflection.Editor.dll.meta new file mode 100644 index 0000000..5c91f29 --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Reflection.Editor.dll.meta @@ -0,0 +1,46 @@ +fileFormatVersion: 2 +guid: 61824742f78323c439d83403f8272d41 +timeCreated: 1488828285 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Any: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 0 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude N3DS: 1 + Exclude OSXIntel: 1 + Exclude OSXIntel64: 1 + Exclude OSXUniversal: 1 + Exclude PS4: 1 + Exclude PSM: 1 + Exclude PSP2: 1 + Exclude SamsungTV: 1 + Exclude Tizen: 1 + Exclude WebGL: 1 + Exclude WiiU: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude WindowsStoreApps: 1 + Exclude XboxOne: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + Editor: + enabled: 1 + settings: + DefaultValueInitialized: true + WindowsStoreApps: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Reflection.Editor.pdb b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Reflection.Editor.pdb new file mode 100644 index 0000000..0eda2f7 Binary files /dev/null and b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Reflection.Editor.pdb differ diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Reflection.Editor.pdb.meta b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Reflection.Editor.pdb.meta new file mode 100644 index 0000000..d54f5d5 --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Reflection.Editor.pdb.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 61824742f78323c439d83403f8270e6f +timeCreated: 1488828285 +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.dll b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.dll index ac7a64e..ac74446 100644 Binary files a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.dll and b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.dll differ diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.dll.meta b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.dll.meta index c30d538..cc2b4d3 100644 --- a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.dll.meta +++ b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.dll.meta @@ -1,7 +1,6 @@ fileFormatVersion: 2 guid: 74721b9f0af448f5ae2e91102a1a5edd timeCreated: 1488828285 -licenseType: Store PluginImporter: serializedVersion: 1 iconMap: {} diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.pdb b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.pdb new file mode 100644 index 0000000..5111740 Binary files /dev/null and b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.pdb differ diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.pdb.meta b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.pdb.meta new file mode 100644 index 0000000..3c95ecb --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.pdb.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 74721b9f0af448f5ae2e91102a1a0a6f +timeCreated: 1488828285 +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.xml.meta b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.xml.meta index 0dff2fd..4334acc 100644 --- a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.xml.meta +++ b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.xml.meta @@ -1,7 +1,6 @@ fileFormatVersion: 2 guid: 74721b9f0af448f5ae2e91102a1a096f timeCreated: 1488828285 -licenseType: Store DefaultImporter: userData: assetBundleName: diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.dll b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.dll index 18956d0..9401293 100644 Binary files a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.dll and b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.dll differ diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.dll.meta b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.dll.meta index 0efe936..063427b 100644 --- a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.dll.meta +++ b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.dll.meta @@ -1,7 +1,6 @@ fileFormatVersion: 2 guid: 5f3147f7af4c49739579b966c458f5e4 timeCreated: 1488828285 -licenseType: Store PluginImporter: serializedVersion: 1 iconMap: {} diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.pdb b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.pdb new file mode 100644 index 0000000..ac6b862 Binary files /dev/null and b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.pdb differ diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.pdb.meta b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.pdb.meta new file mode 100644 index 0000000..c822c1e --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.pdb.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5f3147f7af4c49739579b966c4580a6f +timeCreated: 1488828285 +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.xml b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.xml index 491c5c9..84808d2 100644 --- a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.xml +++ b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.xml @@ -4,2378 +4,6 @@ Sirenix.Serialization - - - Custom formatter for MethodInfo, since Unity Mono's MethodInfo ISerializable implementation will often crash if the method no longer exists upon deserialization. - - - - - - Provides the actual implementation for deserializing a value of type . - - The uninitialized value to serialize into. This value will have been created earlier using . - The reader to deserialize with. - - - - Provides the actual implementation for serializing a value of type . - - The value to serialize. - The writer to serialize with. - - - - Get an uninitialized object of type . WARNING: If you override this and return null, the object's ID will not be automatically registered and its OnDeserializing callbacks will not be automatically called, before deserialization begins. - You will have to call and immediately after creating the object yourself during deserialization. - - - An uninitialized object of type . - - - - - Custom generic formatter for the generic type definition . - - The element type of the formatted queue. - - - - - Returns null. - - - A null value. - - - - - Provides the actual implementation for deserializing a value of type . - - The uninitialized value to serialize into. This value will have been created earlier using . - The reader to deserialize with. - - - - Provides the actual implementation for serializing a value of type . - - The value to serialize. - The writer to serialize with. - - - - Custom generic formatter for the generic type definition and types derived from it. - - The element type of the formatted stack. - - - - - Returns null. - - - A null value. - - - - - Provides the actual implementation for deserializing a value of type . - - The uninitialized value to serialize into. This value will have been created earlier using . - The reader to deserialize with. - - - - Provides the actual implementation for serializing a value of type . - - The value to serialize. - The writer to serialize with. - - - - Custom formatter for the type. - - - - - - Reads into the specified value using the specified reader. - - The value to read into. - The reader to use. - - - - Writes from the specified value using the specified writer. - - The value to write from. - The writer to use. - - - - - Applying this attribute to a type indicates that in the case where, when expecting to deserialize an instance of the type - or any of its derived types, but encountering an incompatible, uncastable type in the data being read, the serializer - should attempt to deserialize an instance of the expected type using the stored, possibly invalid data. - - - This is equivalent to the option, expect type-specific instead - of global. - - - - - - This class gathers info about the current architecture for the purpose of determinining - the unaligned read/write capabilities that we have to work with. - - - - - This will be false on some ARM architectures, such as ARMv7. - In these cases, we will have to perform slower but safer int-by-int read/writes of data. - - Since this value will never change at runtime, performance hits from checking this - everywhere should hopefully be negligible, since branch prediction from speculative - execution will always predict it correctly. - - - - - Scans the project's build scenes and resources, plus their dependencies, for serialized types to support. Progress bars are shown during the scan. - - The serialized types to support. - Whether to scan the project's build scenes. - Whether to scan all the project's asset bundles. - Whether to scan the project's preloaded assets. - Whether to scan the project's resources. - An optional list of the resource paths to scan. Only has an effect if the scanResources argument is true. All the resources will be scanned if null. - true if the scan succeeded, false if the scan failed or was cancelled - - - - Generates an AOT DLL, using the given parameters. - - - - - Indicates that an Odin-serialized Unity object provides its own serialization policy rather than using the default policy. - - Note that THE VALUES RETURNED BY THIS INTERFACE WILL OVERRIDE THE PARAMETERS PASSED TO and . - - - - - Defines how an assembly's import settings should be configured. - - - - - Include the assembly in the build, but not in the editor. - - - - - Include the assembly in the editor, but not in the build. - - - - - Include the assembly in both the build and in the editor. - - - - - Exclude the assembly from both the build and from the editor. - - - - - Utility for correctly setting import on OdinSerializer assemblies based on platform and scripting backend. - - - - - All valid Unity BuildTarget platforms. - - - - - All valid Unity BuildTarget platforms that support Just In Time compilation. - - - - - All scripting backends that support JIT. - - - - - All API compatibility levels that support JIT. - - - - - Set the import settings on the assembly. - - The path to the assembly to configure import settings from. - The import settings to configure for the assembly at the path. - - - - Set the import settings on the assembly. - - The path to the assembly to configure import settings from. - Indicates if the assembly should be included in the build. - Indicates if the assembly should be included in the Unity editor. - - - - Gets the current scripting backend for the build from the Unity editor. This method is Unity version independent. - - - - - - Gets the current API compatibility level from the Unity Editor. This method is Unity version independent. - - - - - - Gets a value that indicates if the specified platform supports JIT. - - The platform to test. - true if the platform supports JIT; otherwise false. - - - - Gets a value that indicates if the specified scripting backend supports JIT. - - The backend to test. - true if the backend supports JIT; otherwise false. - - - - Gets a value that indicates if the specified api level supports JIT. - - The api level to test. - true if the api level supports JIT; otherwise false. - - - - Gets a value that indicates if the specified build settings supports JIT. - - The platform build setting. - The scripting backend build settting. - The api level build setting. - true if the build settings supports JIT; otherwise false. - - - - FieldInfo method extensions. - - - - - Determines whether the specified field is an alias. - - The field to check. - - true if the specified field is an alias; otherwise, false. - - - - - Returns the original, backing field of an alias field if the field is an alias. - - The field to check. - /// if set to true an exception will be thrown if the field is not aliased. - - The field was not aliased; this only occurs if throwOnNotAliased is true. - - - - Garbage free enumerator methods. - - - - - Garbage free enumerator for lists. - - - - - Garbage free enumerator for dictionaries. - - - - - Garbage free enumator for dictionary values. - - - - - Garbage free enumerator for hashsets. - - - - - List iterator. - - - - - Creates a list iterator. - - - - - Gets the enumerator. - - - - - Gets the current value. - - - - - Moves to the next value. - - - - - Disposes the iterator. - - - - - Hashset iterator. - - - - - Creates a hashset iterator. - - - - - Gets the enumerator. - - - - - Gets the current value. - - - - - Moves to the next value. - - - - - Disposes the iterator. - - - - - Dictionary iterator. - - - - - Creates a dictionary iterator. - - - - - Gets the enumerator. - - - - - Gets the current value. - - - - - Moves to the next value. - - - - - Disposes the iterator. - - - - - Dictionary value iterator. - - - - - Creates a dictionary value iterator. - - - - - Gets the enumerator. - - - - - Gets the current value. - - - - - Moves to the next value. - - - - - Disposes the iterator. - - - - - Various LinQ extensions. - - - - - Perform an action on each item. - - The source. - The action to perform. - - - - Perform an action on each item. - - The source. - The action to perform. - - - - Add a collection to the end of another collection. - - The collection. - The collection to append. - - - - MemberInfo method extensions. - - - - - Returns true if the attribute whose type is specified by the generic argument is defined on this member - - - - - Returns true if the attribute whose type is specified by the generic argument is defined on this member - - - - - Returns the first found custom attribute of type T on this member - Returns null if none was found - - - - - Returns the first found non-inherited custom attribute of type T on this member - Returns null if none was found - - - - - Gets all attributes of the specified generic type. - - The member. - - - - Gets all attributes of the specified generic type. - - The member. - If true, specifies to also search the ancestors of element for custom attributes. - - - - Gets all attribute instances defined on a MemeberInfo. - - The member. - - - - Gets all attribute instances on a MemberInfo. - - The member. - If true, specifies to also search the ancestors of element for custom attributes. - - - - If this member is a method, returns the full method name (name + params) otherwise the member name paskal splitted - - - - - Determines whether a FieldInfo, PropertyInfo or MethodInfo is static. - - The member. - - true if the specified member is static; otherwise, false. - - - - - - Determines whether the specified member is an alias. - - The member to check. - - true if the specified member is an alias; otherwise, false. - - - - - Returns the original, backing member of an alias member if the member is an alias. - - The member to check. - /// if set to true an exception will be thrown if the member is not aliased. - - The member was not aliased; this only occurs if throwOnNotAliased is true. - - - - Various extensions for MethodInfo. - - - - - Returns the specified method's full name "methodName(argType1 arg1, argType2 arg2, etc)" - Uses the specified gauntlet to replaces type names, ex: "int" instead of "Int32" - - - - - Returns a string representing the passed method parameters names. Ex "int num, float damage, Transform target" - - - - - Returns the specified method's full name. - - - - - Tests if a method is an extension method. - - - - - Determines whether the specified method is an alias. - - The method to check. - - true if the specified method is an alias; otherwise, false. - - - - - Returns the original, backing method of an alias method if the method is an alias. - - The method to check. - /// if set to true an exception will be thrown if the method is not aliased. - - The method was not aliased; this only occurs if throwOnNotAliased is true. - - - - Determines the type of operator. - - - - - - The == operator. - - - - - The != operator. - - - - - The + operator. - - - - - The - operator. - - - - - The * operator. - - - - - The / operator. - - - - - The < operator. - - - - - The > operator. - - - - - The <= operator. - - - - - The >= operator. - - - - - The % operator. - - - - - The >> operator. - - - - - The << operator. - - - - - The & operator. - - - - - The | operator. - - - - - The ^ operator. - - - - - The ~ operator. - - - - - The && operator. - - - - - The || operator. - - - - - The ! operator. - - - - - DirectoryInfo method extensions. - - - - - Determines whether the directory has a given directory in its hierarchy of children. - - The parent directory. - The sub directory. - - - - PropertyInfo method extensions. - - - - - Determines whether a property is an auto property with a usable getter and setter. - - - - - Determines whether the specified property is an alias. - - The property to check. - - true if the specified property is an alias; otherwise, false. - - - - - Returns the original, backing property of an alias property if the property is an alias. - - The property to check. - /// if set to true an exception will be thrown if the property is not aliased. - - The property was not aliased; this only occurs if throwOnNotAliased is true. - - - - String method extensions. - - - - - Eg MY_INT_VALUE => MyIntValue - - - - - Returns true if this string is null, empty, or contains only whitespace. - - The string to check. - true if this string is null, empty, or contains only whitespace; otherwise, false. - - - - Type method extensions. - - - - - Type name alias lookup. - TypeNameAlternatives["Single"] will give you "float", "UInt16" will give you "ushort", "Boolean[]" will give you "bool[]" etc.. - - - - - Checks whether a given string is a valid CSharp identifier name. This also checks full type names including namespaces. - - The identifier to check. - - - - Determines whether a type can be casted to another type. - - From. - To. - if set to true an implicit or explicit operator must be defined on the given type. - - - - If a type can be casted to another type, this provides a function to manually convert the type. - - From. - To. - if set to true an implicit or explicit operator must be defined on the given type. - - - - If a type can be casted to another type, this provides a function to manually convert the type. - - if set to true an implicit or explicit operator must be defined on the given type. - - - - If a type can be casted to another type, this provides the method info of the method in charge of converting the type. - - From. - To. - if set to true an implicit or explicit operator must be defined on the given type. - - - - Gets an equality comparer delegate used to compare the equality of values of a given type. In order, this will be: - - 1. The == operator, if one is defined on the type. - 2. A delegate that uses , if the type implements that interface. - 3. .NET's own - - - Note that in the special case of the type , a special equality comparer is returned that only checks whether all the Quaternion components are equal. - This is because, by default, Quaternion's equality operator is broken when operating on invalid quaternions; "default(Quaternion) == default(Quaternion)" evaluates to false, and this causes a multitude of problems. - Special delegates are also returned for float and double, that consider float.NaN to be equal to float.NaN, and double.NaN to be equal to double.NaN. - - - - - Gets the first attribute of type T. Returns null in the no attribute of type T was found. - - The type. - If true, specifies to also search the ancestors of element for custom attributes. - - - - Determines whether a type implements or inherits from another type. - - The type. - To. - - - - Determines whether a type implements an open generic interface or class such as IList<> or List<>. - - Type of the candidate. - Type of the open generic type. - - - - - Determines whether a type implements an open generic interface such as IList<>. - - Type of the candidate. - Type of the open generic interface. - - Type " + openGenericInterfaceType.Name + " is not a generic type definition and an interface. - - - - Determines whether a type implements an open generic class such as List<>. - - Type of the candidate. - Type of the open generic interface. - - - - Gets the generic arguments of an inherited open generic class or interface. - - Type of the candidate. - The open generic type to get the arguments of. - - - - Gets the generic arguments of an inherited open generic class. - - Type of the candidate. - Type of the open generic class. - - - - Gets the generic arguments of an inherited open generic interface. - - Type of the candidate. - Type of the open generic interface. - - - - Gets the MethodInfo of a specific operator kind, with the given left and right operands. This overload is *far* faster than any of the other GetOperatorMethod implementations, and should be used whenever possible. - - - - - Gets the MethodInfo of a specific operator type. - - - - - Gets the MethodInfo of a specific operator type. - - - - - Gets all members from a given type, including members from all base types if the flag isn't set. - - - - - Gets all members from a given type, including members from all base types. - - - - - Gets all members of a specific type from a type, including members from all base types, if the flag isn't set. - - - - - Gets the generic type definition of an open generic base type. - - - - - Gets the generic type definition of an open generic base type. - - - - - Returns a lazy enumerable of all the base types of this type including interfaces and classes - - - - - Returns a lazy enumerable of all the base classes of this type - - - - - Used to filter out unwanted type names. Ex "int" instead of "Int32" - - - - - Returns a nicely formatted name of a type. - - - - - Returns a nicely formatted full name of a type. - - - - - Gets the name of the compilable nice. - - The type. - - - - Gets the full name of the compilable nice. - - The type. - - - - Returns the first found custom attribute of type T on this type - Returns null if none was found - - - - - Returns the first found non-inherited custom attribute of type T on this type - Returns null if none was found - - - - - Gets all attributes of type T. - - The type. - - - - Gets all attributes of type T. - - The type - If true, specifies to also search the ancestors of element for custom attributes. - - - - Returns true if the attribute whose type is specified by the generic argument is defined on this type - - - - - Returns true if the attribute whose type is specified by the generic argument is defined on this type - - - - - Determines whether a type inherits or implements another type. Also include support for open generic base types such as List<>. - - - - - - Determines whether a type inherits or implements another type. Also include support for open generic base types such as List<>. - - - - - - - Gets the number of base types between given type and baseType. - - - - - Determines whether a method has the specified parameter types. - - - - - FieldInfo will return the fieldType, propertyInfo the PropertyType, MethodInfo the return type and EventInfo will return the EventHandlerType. - - The MemberInfo. - - - - Gets the value contained in a given . Currently only and is supported. - - The to get the value of. - The instance to get the value from. - The value contained in the given . - Can't get the value of the given type. - - - - Sets the value of a given MemberInfo. Currently only and is supported. - - The to set the value of. - The object to set the value on. - The value to set. - - Property has no setter - or - Can't set the value of the given type. - - - - - Tries to infer a set of valid generic parameters for a generic type definition, given a subset of known parameters. - - The generic type definition to attempt to infer parameters for. - The inferred parameters, if inferral was successful. - The known parameters to infer from. - True if the parameters could be inferred, otherwise, false. - - genericTypeDefinition is null - or - knownParameters is null - - The genericTypeDefinition parameter must be a generic type definition. - - - - Checks whether an array of types satisfy the constraints of a given generic type definition. - If this method returns true, the given parameters can be safely used with with the given generic type definition. - - The generic type definition to check. - The parameters to check validity for. - - genericType is null - or - types is null - - The genericType parameter must be a generic type definition. - - - - Checks whether an array of types satisfy the constraints of a given generic method definition. - If this method returns true, the given parameters can be safely used with with the given generic method definition. - - The generic method definition to check. - The parameters to check validity for. - - genericType is null - or - types is null - - The genericMethod parameter must be a generic method definition. - - - - Before calling this method we must ALWAYS hold a lock on the GenericConstraintsSatisfaction_LOCK object, as that is an implicit assumption it works with. - - - - - Not yet documented. - - - - - Formats a string with the specified generic parameter constraints on any given type. Example output: where T : class - - - - - Determines whether a generic type contains the specified generic argument constraints. - - The type. - The generic argument types. - - - - Determines whether a type is a fully constructed generic type. - - - - - Determines whether a type is nullable by ensuring the type is neither a PrimitiveType, ValueType or an Enum. - - - - - Gets the enum bitmask in a ulong. - - enumType - - - - Extends various Unity classes. - - - - - Determines whether a Unity object is null or "fake null", - without ever calling Unity's own equality operators. - This method is useful for checking if a Unity object is - null, destroyed or missing at times when it is not allowed - to call Unity's own equality operators, for example when - not running on the main thread. - - The Unity object to check. - True if the object is null, missing or destroyed; otherwise false. - - - - Provides an easy way of claiming and freeing cached values of any non-abstract reference type with a public parameterless constructor. - - Cached types which implement the interface will receive notifications when they are claimed and freed. - - Only one thread should be holding a given cache instance at a time if is implemented, since the invocation of - is not thread safe, IE, weird stuff might happen if multiple different threads are trying to free - the same cache instance at the same time. This will practically never happen unless you're doing really strange stuff, but the case is documented here. - - The type which is cached. - - - - - Gets or sets the maximum size of the cache. This value can never go beneath 1. - - - The maximum size of the cache. - - - - - The cached value. - - - - - Gets a value indicating whether this cached value is free. - - - true if this cached value is free; otherwise, false. - - - - - Claims a cached value of type . - - A cached value of type . - - - - Releases a cached value. - - The cached value to release. - The cached value to release is null. - - - - Performs an implicit conversion from to . - - The cache to convert. - - The result of the conversion. - - - - - Releases this cached value. - - - - - Releases this cached value. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Provides utilities for using the namespace. - - This class is due for refactoring. Use at your own peril. - - - - - Gets a value indicating whether emitting is supported on the current platform. - - - true if the current platform can emit; otherwise, false. - - - - - Creates a delegate which gets the value of a field. If emitting is not supported on the current platform, the delegate will use reflection to get the value. - - The type of the field to get a value from. - The instance describing the field to create a getter for. - A delegate which gets the value of the given field. - The fieldInfo parameter is null. - - - - Creates a delegate which gets the value of a field. If emitting is not supported on the current platform, the delegate will use reflection to get the value. - - The instance describing the field to create a getter for. - A delegate which gets the value of the given field. - The fieldInfo parameter is null. - - - - Creates a delegate which sets the value of a field. If emitting is not supported on the current platform, the delegate will use reflection to set the value. - - The type of the field to set a value to. - The instance describing the field to create a setter for. - A delegate which sets the value of the given field. - The fieldInfo parameter is null. - - - - Creates a delegate which sets the value of a field. If emitting is not supported on the current platform, the delegate will use reflection to set the value. - - The instance describing the field to create a setter for. - A delegate which sets the value of the given field. - The fieldInfo parameter is null. - - - - Creates a delegate which gets the value of a field. If emitting is not supported on the current platform, the delegate will use reflection to get the value. - - The type of the instance to get a value from. - The type of the field to get a value from. - The instance describing the field to create a getter for. - A delegate which gets the value of the given field. - The fieldInfo parameter is null. - - - - Creates a delegate which gets the value of a field from a weakly typed instance of a given type. If emitting is not supported on the current platform, the delegate will use reflection to get the value. - - The type of the field to get a value from. - The of the instance to get a value from. - The instance describing the field to create a getter for. - A delegate which gets the value of the given field. - The fieldInfo parameter is null. - - - - Creates a delegate which gets the weakly typed value of a field from a weakly typed instance of a given type. If emitting is not supported on the current platform, the delegate will use reflection to get the value. - - The of the instance to get a value from. - The instance describing the field to create a getter for. - A delegate which gets the value of the given field. - The fieldInfo parameter is null. - - - - Creates a delegate which sets the value of a field. If emitting is not supported on the current platform, the delegate will use reflection to set the value. - - The type of the instance to set a value on. - The type of the field to set a value to. - The instance describing the field to create a setter for. - A delegate which sets the value of the given field. - The fieldInfo parameter is null. - - - - Creates a delegate which sets the value of a field on a weakly typed instance of a given type. If emitting is not supported on the current platform, the delegate will use reflection to set the value. - - The type of the field to set a value to. - Type of the instance. - The instance describing the field to create a setter for. - - A delegate which sets the value of the given field. - - The fieldInfo parameter is null. - Field cannot be static. - - - - Creates a delegate which sets the weakly typed value of a field on a weakly typed instance of a given type. If emitting is not supported on the current platform, the delegate will use reflection to set the value. - - Type of the instance. - The instance describing the field to create a setter for. - - A delegate which sets the value of the given field. - - The fieldInfo parameter is null. - Field cannot be static. - - - - Creates a delegate which gets the weakly typed value of a field from a weakly typed instance of a given type. If emitting is not supported on the current platform, the delegate will use reflection to get the value. - - The of the instance to get a value from. - The instance describing the field to create a getter for. - A delegate which gets the value of the given field. - The fieldInfo parameter is null. - - - - Creates a delegate which sets the weakly typed value of a property on a weakly typed instance of a given type. If emitting is not supported on the current platform, the delegate will use reflection to set the value. - - Type of the instance. - The instance describing the property to create a setter for. - - A delegate which sets the value of the given field. - - The fieldInfo parameter is null. - Property cannot be static. - - - - Creates a delegate which sets the value of a property. If emitting is not supported on the current platform, the delegate will use reflection to set the value. - - The type of the property to set a value to. - The instance describing the property to create a setter for. - A delegate which sets the value of the given property. - The propertyInfo parameter is null. - - - - Creates a delegate which gets the value of a property. If emitting is not supported on the current platform, the delegate will use reflection to get the value. - - The type of the property to get a value from. - The instance describing the property to create a getter for. - A delegate which gets the value of the given property. - The propertyInfo parameter is null. - - - - Creates a delegate which sets the value of a property. If emitting is not supported on the current platform, the delegate will use reflection to set the value. - - The type of the instance to set a value on. - The type of the property to set a value to. - The instance describing the property to create a setter for. - A delegate which sets the value of the given property. - The propertyInfo parameter is null. - - - - Creates a delegate which gets the value of a property. If emitting is not supported on the current platform, the delegate will use reflection to get the value. - - The type of the instance to get a value from. - The type of the property to get a value from. - The instance describing the property to create a getter for. - A delegate which gets the value of the given property. - The propertyInfo parameter is null. - - - - Creates a fast delegate method which calls a given parameterless instance method and returns the result. - - The type of the class which the method is on. - The type which is returned by the given method info. - The method info instance which is used. - A delegate which calls the method and returns the result, except it's hundreds of times faster than MethodInfo.Invoke. - - - - Creates a fast delegate method which calls a given parameterless static method. - - The method info instance which is used. - A delegate which calls the method and returns the result, except it's hundreds of times faster than MethodInfo.Invoke. - - - - Creates a fast delegate method which calls a given parameterless weakly typed instance method. - - The method info instance which is used. - A delegate which calls the method and returns the result, except it's hundreds of times faster than MethodInfo.Invoke. - - - - Not yet documented. - - - - - Creates a fast delegate method which calls a given weakly typed instance method with one argument and returns a value. - - The type of the result. - The type of the first argument. - The method info instance which is used. - - A delegate which calls the method and returns the result, except it's hundreds of times faster than MethodInfo.Invoke. - - methodInfo - - Given method ' + methodInfo.Name + ' is static when it has to be an instance method. - or - Given method ' + methodInfo.Name + ' must return type + typeof(TResult) + . - or - Given method ' + methodInfo.Name + ' must have exactly one parameter. - or - The first parameter of the method ' + methodInfo.Name + ' must be of type + typeof(TArg1) + . - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Creates a fast delegate method which calls a given parameterless instance method on a reference type. - - The type of the class which the method is on. - The method info instance which is used. - A delegate which calls the method and returns the result, except it's hundreds of times faster than MethodInfo.Invoke. - - - - Creates a fast delegate method which calls a given instance method with a given argument on a reference type. - - The type of the class which the method is on. - The type of the argument with which to call the method. - The method info instance which is used. - A delegate which calls the method and returns the result, except it's hundreds of times faster than MethodInfo.Invoke. - - - - Creates a fast delegate method which calls a given parameterless instance method. - - The type of the class which the method is on. - The method info instance which is used. - A delegate which calls the method and returns the result, except it's hundreds of times faster than MethodInfo.Invoke. - - - - Creates a fast delegate method which calls a given instance method with a given argument on a struct type. - - The type of the class which the method is on. - The type of the argument with which to call the method. - The method info instance which is used. - A delegate which calls the method and returns the result, except it's hundreds of times faster than MethodInfo.Invoke. - - - - Compares types by reference before comparing them using the default type equality operator. - This can constitute a *significant* speedup when used as the comparer for dictionaries. - - - - - - This class encapsulates common combinations. - - - - - Search criteria encompassing all public and non-public members, including base members. - Note that you also need to specify either the Instance or Static flag. - - - - - Search criteria encompassing all public instance members, including base members. - - - - - Search criteria encompassing all non-public instance members, including base members. - - - - - Search criteria encompassing all public and non-public instance members, including base members. - - - - - Search criteria encompassing all public static members, including base members. - - - - - Search criteria encompassing all non-public static members, including base members. - - - - - Search criteria encompassing all public and non-public static members, including base members. - - - - - Search criteria encompassing all public instance members, excluding base members. - - - - - Search criteria encompassing all non-public instance members, excluding base members. - - - - - Search criteria encompassing all public and non-public instance members, excluding base members. - - - - - Search criteria encompassing all public static members, excluding base members. - - - - - Search criteria encompassing all non-public static members, excluding base members. - - - - - Search criteria encompassing all public and non-public static members, excluding base members. - - - - - Search criteria encompassing all members, including base and static members. - - - - - Search criteria encompassing all members (public and non-public, instance and static), including base members. - - - - - Provides notification callbacks for values that are cached using the class. - - - - - Called when the cached value is freed. - - - - - Called when the cached value is claimed. - - - - - Interface for immutable list. - - - - - Interface for generic immutable list. - - - - - Index accessor. - - - - - Immutable list wraps another list, and allows for reading the inner list, without the ability to change it. - - - - - Creates an immutable list around another list. - - - - - Number of items in the list. - - - - - Immutable list cannot be changed directly, so it's size is always fixed. - - - - - Immutable list are always readonly. - - - - - Returns true if the inner list is synchronized. - - - - - Gets the sync root object. - - - - - Index accessor. - - Index. - - - - Returns true if the item is contained in the list. - - The item's value. - - - - Copy the list to an array, - - Target array. - Index. - - - - Copy the list to an array, - - Target array. - Index. - - - - Gets an enumerator. - - - - - Get the index of a value. - - The item's value. - - - - Immutable list cannot be edited. - - Index. - - - - Immutable list cannot be edited. - - Index. - Item. - - - - Immutable list cannot be edited. - - Item. - - - - Immutable list cannot be edited. - - - - - Immutable list cannot be edited. - - Item. - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Immutable list wraps another list, and allows for reading the inner list, without the ability to change it. - - - - - Creates an immutable list around another list. - - - - - Number of items in the list. - - - - - Immutable list are always readonly. - - - - - Index accessor. - - Index. - - - - Returns true if the item is contained in the list. - - - - - Copies the list to an array. - - - - - Gets an enumerator. - - - - - Gets the index of an item. - - - - - Provides a methods of representing imaginary fields which are unique to serialization. - - We aggregate the FieldInfo associated with this member and return a mangled form of the name. - - - - - - The default fake name separator string. - - - - - Initializes a new instance of the class. - - The field to alias. - The name prefix to use. - - - - Initializes a new instance of the class. - - The field to alias. - The name prefix to use. - The separator string to use. - - - - Gets the aliased field. - - - The aliased field. - - - - - Gets the module in which the type that declares the member represented by the current is defined. - - - - - Gets a value that identifies a metadata element. - - - - - Gets the name of the current member. - - - - - Gets the class that declares this member. - - - - - Gets the class object that was used to obtain this instance of MemberInfo. - - - - - Gets the type of the field. - - - The type of the field. - - - - - Gets a RuntimeFieldHandle, which is a handle to the internal metadata representation of a field. - - - - - Gets the attributes. - - - The attributes. - - - - - When overridden in a derived class, returns an array of all custom attributes applied to this member. - - True to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks. - - An array that contains all the custom attributes applied to this member, or an array with zero elements if no attributes are defined. - - - - - When overridden in a derived class, returns an array of custom attributes applied to this member and identified by . - - The type of attribute to search for. Only attributes that are assignable to this type are returned. - True to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks. - - An array of custom attributes applied to this member, or an array with zero elements if no attributes assignable to have been applied. - - - - - When overridden in a derived class, indicates whether one or more attributes of the specified type or of its derived types is applied to this member. - - The type of custom attribute to search for. The search includes derived types. - True to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks. - - True if one or more instances of or any of its derived types is applied to this member; otherwise, false. - - - - - Gets the value of the field. - - The object instance to get the value from. - The value of the field. - - - - When overridden in a derived class, sets the value of the field supported by the given object. - - The object whose field value will be set. - The value to assign to the field. - A field of Binder that specifies the type of binding that is desired (for example, Binder.CreateInstance or Binder.ExactBinding). - A set of properties that enables the binding, coercion of argument types, and invocation of members through reflection. If is null, then Binder.DefaultBinding is used. - The software preferences of a particular culture. - - - - Provides a methods of representing aliased methods. - - In this case, what we're representing is a method on a parent class with the same name. - - We aggregate the MethodInfo associated with this member and return a mangled form of the name. - The name that we return is "parentname+methodName". - - - - - - The default fake name separator string. - - - - - Initializes a new instance of the class. - - The method to alias. - The name prefix to use. - - - - Initializes a new instance of the class. - - The method to alias. - The name prefix to use. - The separator string to use. - - - - Gets the aliased method. - - - The aliased method. - - - - - Gets the custom attributes for the return type. - - - - - Gets a handle to the internal metadata representation of a method. - - - - - Gets the attributes associated with this method. - - - - - Gets the class that declares this member. - - - - - Gets the name of the current member. - - - - - Gets the class object that was used to obtain this instance of MemberInfo. - - - - - When overridden in a derived class, returns the MethodInfo object for the method on the direct or indirect base class in which the method represented by this instance was first declared. - - - A MethodInfo object for the first implementation of this method. - - - - - When overridden in a derived class, returns an array of all custom attributes applied to this member. - - true to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks. - - An array that contains all the custom attributes applied to this member, or an array with zero elements if no attributes are defined. - - - - - When overridden in a derived class, returns an array of custom attributes applied to this member and identified by . - - The type of attribute to search for. Only attributes that are assignable to this type are returned. - true to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks. - - An array of custom attributes applied to this member, or an array with zero elements if no attributes assignable to have been applied. - - - - - When overridden in a derived class, returns the flags. - - - The MethodImplAttributes flags. - - - - - When overridden in a derived class, gets the parameters of the specified method or constructor. - - - An array of type ParameterInfo containing information that matches the signature of the method (or constructor) reflected by this MethodBase instance. - - - - - When overridden in a derived class, invokes the reflected method or constructor with the given parameters. - - The object on which to invoke the method or constructor. If a method is static, this argument is ignored. If a constructor is static, this argument must be null or an instance of the class that defines the constructor. - A bitmask that is a combination of 0 or more bit flags from . If is null, this parameter is assigned the value ; thus, whatever you pass in is ignored. - An object that enables the binding, coercion of argument types, invocation of members, and retrieval of MemberInfo objects via reflection. If is null, the default binder is used. - An argument list for the invoked method or constructor. This is an array of objects with the same number, order, and type as the parameters of the method or constructor to be invoked. If there are no parameters, this should be null.If the method or constructor represented by this instance takes a ByRef parameter, there is no special attribute required for that parameter in order to invoke the method or constructor using this function. Any object in this array that is not explicitly initialized with a value will contain the default value for that object type. For reference-type elements, this value is null. For value-type elements, this value is 0, 0.0, or false, depending on the specific element type. - An instance of CultureInfo used to govern the coercion of types. If this is null, the CultureInfo for the current thread is used. (This is necessary to convert a String that represents 1000 to a Double value, for example, since 1000 is represented differently by different cultures.) - - An Object containing the return value of the invoked method, or null in the case of a constructor, or null if the method's return type is void. Before calling the method or constructor, Invoke checks to see if the user has access permission and verifies that the parameters are valid.CautionElements of the array that represent parameters declared with the ref or out keyword may also be modified. - - - - - When overridden in a derived class, indicates whether one or more attributes of the specified type or of its derived types is applied to this member. - - The type of custom attribute to search for. The search includes derived types. - true to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks. - - true if one or more instances of or any of its derived types is applied to this member; otherwise, false. - - - - - Provides a methods of representing imaginary properties which are unique to serialization. - - We aggregate the PropertyInfo associated with this member and return a mangled form of the name. - - - - - - The default fake name separator string. - - - - - Initializes a new instance of the class. - - The property to alias. - The name prefix to use. - - - - Initializes a new instance of the class. - - The property to alias. - The name prefix to use. - The separator string to use. - - - - The backing PropertyInfo that is being aliased. - - - - - Gets the module in which the type that declares the member represented by the current is defined. - - - - - Gets a value that identifies a metadata element. - - - - - Gets the name of the current member. - - - - - Gets the class that declares this member. - - - - - Gets the class object that was used to obtain this instance of MemberInfo. - - - - - Gets the type of the property. - - - The type of the property. - - - - - Gets the attributes. - - - The attributes. - - - - - Gets a value indicating whether this instance can read. - - - true if this instance can read; otherwise, false. - - - - - Gets a value indicating whether this instance can write. - - - true if this instance can write; otherwise, false. - - - - - When overridden in a derived class, returns an array of all custom attributes applied to this member. - - True to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks. - - An array that contains all the custom attributes applied to this member, or an array with zero elements if no attributes are defined. - - - - - When overridden in a derived class, returns an array of custom attributes applied to this member and identified by . - - The type of attribute to search for. Only attributes that are assignable to this type are returned. - True to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks. - - An array of custom attributes applied to this member, or an array with zero elements if no attributes assignable to have been applied. - - - - - When overridden in a derived class, indicates whether one or more attributes of the specified type or of its derived types is applied to this member. - - The type of custom attribute to search for. The search includes derived types. - True to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks. - - True if one or more instances of or any of its derived types is applied to this member; otherwise, false. - - - - - Returns an array whose elements reflect the public and, if specified, non-public get, set, and other accessors of the property reflected by the current instance. - - Indicates whether non-public methods should be returned in the MethodInfo array. true if non-public methods are to be included; otherwise, false. - - An array of objects whose elements reflect the get, set, and other accessors of the property reflected by the current instance. If is true, this array contains public and non-public get, set, and other accessors. If is false, this array contains only public get, set, and other accessors. If no accessors with the specified visibility are found, this method returns an array with zero (0) elements. - - - - - When overridden in a derived class, returns the public or non-public get accessor for this property. - - Indicates whether a non-public get accessor should be returned. true if a non-public accessor is to be returned; otherwise, false. - - A MethodInfo object representing the get accessor for this property, if is true. Returns null if is false and the get accessor is non-public, or if is true but no get accessors exist. - - - - - Gets the index parameters of the property. - - The index parameters of the property. - - - - When overridden in a derived class, returns the set accessor for this property. - - Indicates whether the accessor should be returned if it is non-public. true if a non-public accessor is to be returned; otherwise, false. - - Value Condition A object representing the Set method for this property. The set accessor is public.-or- is true and the set accessor is non-public. null is true, but the property is read-only.-or- is false and the set accessor is non-public.-or- There is no set accessor. - - - - - Gets the value of the property on the given instance. - - The object to invoke the getter on. - The to invoke with. - The binder to use. - The indices to use. - The culture to use. - The value of the property on the given instance. - - - - Sets the value of the property on the given instance. - - The object to set the value on. - The value to set. - The to invoke with. - The binder to use. - The indices to use. - The culture to use. - - - - Compares objects by reference only, ignoring equality operators completely. This is used by the property tree reference dictionaries to keep track of references. - - - - - A default, cached instance of this generic variant of the reference equality comparer. - - - - - Returns true if the object references are equal. - - - - - Returns the result of the object's own GetHashCode method. - - - - - Utility class indicating current Unity version. - - - - - Tests current Unity version is equal or greater. - - Minimum major version. - Minimum minor version. - true if the current Unity version is greater. Otherwise false. - - - - The current Unity version major. - - - - - The current Unity version minor. - - - - - Contains utilities for performing common unsafe operations. - - - - - Blindly creates an array of structs from an array of bytes via direct memory copy/blit. - - - - - Blindly creates an array of structs from an array of bytes via direct memory copy/blit. - - - - - Blindly copies an array of structs into an array of bytes via direct memory copy/blit. - - - - - Blindly copies an array of structs into an array of bytes via direct memory copy/blit. - - - - - Creates a new string from the contents of a given byte buffer. - - - - - Writes the contents of a string into a given byte buffer. - - - - - Blindly mem-copies a given number of bytes from the memory location of one object to another. WARNING: This method is ridiculously dangerous. Only use if you know what you're doing. - - Provides basic functionality and overridable abstract methods for implementing a data reader. @@ -2762,6 +390,14 @@ The current node depth. + + + Gets the current nodes array. The amount of nodes contained in it is stored in the property. The remainder of the array's length is buffer space. + + + The current node array. + + Gets the current node, or if there is no current node. @@ -4499,9 +2135,14 @@ The beginning of the content of an external reference by guid entry. - + - The beginning of the content of an external reference by string entry. + The beginning of the content of an external reference by string entry. This is an old entry using an invalid data format where the ref string is dumped inline without escaping. + + + + + The beginning of the content of an external reference by string entry. This is a new entry using the valid format where the ref string is written as an escaped string. @@ -5515,6 +3156,62 @@ Not yet documented. + + + Utility class for locating and caching formatters for all non-primitive types. + + + + + Editor-only event that fires whenever an emittable formatter has been located. + This event is used by the AOT formatter pre-emitter to locate types that need to have formatters pre-emitted. + + + + + Editor-only event that fires whenever a formatter has been located. + + + + + This event is invoked before everything else when a formatter is being resolved for a given type. If any invoked delegate returns a valid formatter, that formatter is used and the resolve process stops there. + + This can be used to hook into and extend the serialization system's formatter resolution logic. + + + + + Gets a formatter for the type . + + The type to get a formatter for. + The serialization policy to use if a formatter has to be emitted. If null, is used. + + A formatter for the type . + + + + + Gets a formatter for a given type. + + The type to get a formatter for. + The serialization policy to use if a formatter has to be emitted. If null, is used. + + A formatter for the given type. + + The type argument is null. + + + + Gets a formatter for a given type. + + The type to get a formatter for. + The serialization policy to use if a formatter has to be emitted. If null, is used. + Whether to allow the use of weak fallback formatters which do not implement the strongly typed , but which conversely do not need to have had AOT support generated. + + A formatter for the given type. + + The type argument is null. + Formatter for all non-primitive one-dimensional arrays. @@ -5694,6 +3391,62 @@ The value to serialize. The writer to serialize with. + + + Provides common functionality for serializing and deserializing weakly typed values of a given type, and provides automatic support for the following common serialization conventions: + + , , , , and . + + + + + + Serializes a value using a specified . + + The value to serialize. + The writer to use. + + + + Deserializes a value using a specified . + + The reader to use. + + The deserialized value. + + + + + Registers the given object reference in the deserialization context. + + NOTE that this method only does anything if is not a value type. + + The value to register. + The reader which is currently being used. + + + + Invokes all methods on the object with the [OnDeserializing] attribute. + + WARNING: This method will not be called automatically if you override GetUninitializedObject and return null! You will have to call it manually after having created the object instance during deserialization. + + The value to invoke the callbacks on. + The deserialization context. + + + + Provides the actual implementation for deserializing a value of type . + + The uninitialized value to serialize into. This value will have been created earlier using . + The reader to deserialize with. + + + + Provides the actual implementation for serializing a value of type . + + The value to serialize. + The writer to serialize with. + Custom formatter for the type. @@ -5923,6 +3676,11 @@ NOTE: Some platforms do not support emitting. Check whether you can emit on the current platform using . + + + Used for generating unique formatter helper type names. + + The name of the pre-generated assembly that contains pre-emitted formatters for use on AOT platforms where emitting is not supported. Note that this assembly is not always present. @@ -6025,6 +3783,28 @@ The value to serialize. The writer to serialize with. + + + Gets a new object of type . + + + A new object of type . + + + + + Provides the actual implementation for deserializing a value of type . + + The uninitialized value to serialize into. This value will have been created earlier using . + The reader to deserialize with. + + + + Provides the actual implementation for serializing a value of type . + + The value to serialize. + The writer to serialize with. + Custom generic formatter for the generic type definition . @@ -6054,6 +3834,28 @@ The value to serialize. The writer to serialize with. + + + Returns null. + + + A null value. + + + + + Provides the actual implementation for deserializing a value of type . + + The uninitialized value to serialize into. This value will have been created earlier using . + The reader to deserialize with. + + + + Provides the actual implementation for serializing a value of type . + + The value to serialize. + The writer to serialize with. + Serializes and deserializes a given type. @@ -6158,6 +3960,35 @@ The value to serialize. The writer to serialize with. + + + Custom formatter for MethodInfo, since Unity Mono's MethodInfo ISerializable implementation will often crash if the method no longer exists upon deserialization. + + + + + + Provides the actual implementation for deserializing a value of type . + + The uninitialized value to serialize into. This value will have been created earlier using . + The reader to deserialize with. + + + + Provides the actual implementation for serializing a value of type . + + The value to serialize. + The writer to serialize with. + + + + Get an uninitialized object of type . WARNING: If you override this and return null, the object's ID will not be automatically registered and its OnDeserializing callbacks will not be automatically called, before deserialization begins. + You will have to call and immediately after creating the object yourself during deserialization. + + + An uninitialized object of type . + + Minimal baseline formatter. Doesn't come with all the bells and whistles of any of the other BaseFormatter classes. @@ -6240,6 +4071,49 @@ The value to register. The reader which is currently being used. + + + Whether the serialized value is a value type. + + + + + Gets the type that the formatter can serialize. + + + The type that the formatter can serialize. + + + + + Get an uninitialized object of type . WARNING: If you override this and return null, the object's ID will not be automatically registered. + You will have to call immediately after creating the object yourself during deserialization. + + An uninitialized object of type . + + + + Reads into the specified value using the specified reader. + + The value to read into. + The reader to use. + + + + Writes from the specified value using the specified writer. + + The value to write from. + The writer to use. + + + + Registers the given object reference in the deserialization context. + + NOTE that this method only does anything if the serialized type is not a value type. + + The value to register. + The reader which is currently being used. + Formatter for all arrays with more than one dimension. @@ -6270,6 +4144,28 @@ The value to serialize. The writer to serialize with. + + + Returns null. + + + A null value. + + + + + Provides the actual implementation for deserializing a value of type . + + The uninitialized value to serialize into. This value will have been created earlier using . + The reader to deserialize with. + + + + Provides the actual implementation for serializing a value of type . + + The value to serialize. + The writer to serialize with. + Formatter for all types. @@ -6325,6 +4221,57 @@ The value to write from. The writer to use. + + + Returns null. + + + A null value. + + + + + Reads into the specified value using the specified reader. + + The value to read into. + The reader to use. + + + + Writes from the specified value using the specified writer. + + The value to write from. + The writer to use. + + + + Custom generic formatter for the generic type definition . + + The element type of the formatted queue. + + + + + Returns null. + + + A null value. + + + + + Provides the actual implementation for deserializing a value of type . + + The uninitialized value to serialize into. This value will have been created earlier using . + The reader to deserialize with. + + + + Provides the actual implementation for serializing a value of type . + + The value to serialize. + The writer to serialize with. + Final fallback formatter for all types which have no other formatters. This formatter relies on reflection to work, and is thus comparatively slow and creates more garbage than a custom formatter. @@ -6363,6 +4310,16 @@ Calls on the value to deserialize. + + + Calls on the value to deserialize. + + + + + Calls on the value to deserialize. + + Formatter for all types that implement the ISerializable interface. @@ -6409,6 +4366,65 @@ The to write. The writer to use. + + + Get an uninitialized object of type . WARNING: If you override this and return null, the object's ID will not be automatically registered and its OnDeserializing callbacks will not be automatically called, before deserialization begins. + You will have to call and immediately after creating the object yourself during deserialization. + + + An uninitialized object of type . + + + + + Provides the actual implementation for deserializing a value of type . + + The uninitialized value to serialize into. This value will have been created earlier using . + The reader to deserialize with. + + + + Provides the actual implementation for serializing a value of type . + + The value to serialize. + The writer to serialize with. + + + + Custom generic formatter for the generic type definition and types derived from it. + + The element type of the formatted stack. + + + + + Returns null. + + + A null value. + + + + + Provides the actual implementation for deserializing a value of type . + + The uninitialized value to serialize into. This value will have been created earlier using . + The reader to deserialize with. + + + + Provides the actual implementation for serializing a value of type . + + The value to serialize. + The writer to serialize with. + + + + Provides the actual implementation for serializing a value of type . + + The value to serialize. + The writer to serialize with. + Custom formatter for the type. @@ -6455,46 +4471,38 @@ null. - + - Helper class for quickly and easily implementing the interface. + Custom formatter for the type. + - + - Initializes a new instance of the class. + Reads into the specified value using the specified reader. - The policy ID. - if set to true non serializable types will be allowed. - The delegate to use for determining whether members should be serialized. - - The id argument or the shouldSerializeFunc argument was null. - + The value to read into. + The reader to use. - + - Gets the identifier of the policy. This can be stored in the serialization metadata, so the policy used to serialize it can be recovered without knowing the policy at runtime. This ID should preferably be unique. + Writes from the specified value using the specified writer. - - The identifier of the policy. - + The value to write from. + The writer to use. - + - Gets a value indicating whether to allow non serializable types. (Types which are not decorated with .) + + Applying this attribute to a type indicates that in the case where, when expecting to deserialize an instance of the type + or any of its derived types, but encountering an incompatible, uncastable type in the data being read, the serializer + should attempt to deserialize an instance of the expected type using the stored, possibly invalid data. + + + This is equivalent to the option, expect type-specific instead + of global. + - - true if serializable types are allowed; otherwise, false. - - - - - Gets a value indicating whether a given should be serialized or not. - - The member to check. - - true if the given member should be serialized, otherwise, false. - @@ -6506,6 +4514,80 @@ + + + This class gathers info about the current architecture for the purpose of determinining + the unaligned read/write capabilities that we have to work with. + + + + + This will be false on some ARM architectures, such as ARMv7. + In these cases, we will have to perform slower but safer int-by-int read/writes of data. + + Since this value will never change at runtime, performance hits from checking this + everywhere should hopefully be negligible, since branch prediction from speculative + execution will always predict it correctly. + + + + + Provides a way of claiming and releasing cached array buffers. + + The element type of the array to buffer. + + + + + Gets the total element count of the buffered array. This will always be a power of two. + + + The total element count of the buffered array. + + Cannot access a buffer while it is freed. + + + + Gets the buffered array. + + + The buffered array. + + Cannot access a buffer while it is freed. + + + + Gets a value indicating whether this buffer is free. + + + true if this buffer is free; otherwise, false. + + + + + Claims a buffer with the specified minimum capacity. Note: buffers always have a capacity equal to or larger than 256. + + The minimum capacity. + A buffer which has a capacity equal to or larger than the specified minimum capacity. + Requested size of buffer must be larger than 0. + + + + Frees the specified buffer. + + The buffer to free. + The buffer argument is null. + + + + Frees this buffer. + + + + + Frees this buffer. + + Attribute indicating that a class which implements the interface somewhere in its hierarchy is a custom formatter for the type T. @@ -6552,6 +4634,47 @@ was null. The type given in is not a generic type definition. + + + Helper class for quickly and easily implementing the interface. + + + + + Initializes a new instance of the class. + + The policy ID. + if set to true non serializable types will be allowed. + The delegate to use for determining whether members should be serialized. + + The id argument or the shouldSerializeFunc argument was null. + + + + + Gets the identifier of the policy. This can be stored in the serialization metadata, so the policy used to serialize it can be recovered without knowing the policy at runtime. This ID should preferably be unique. + + + The identifier of the policy. + + + + + Gets a value indicating whether to allow non serializable types. (Types which are not decorated with .) + + + true if serializable types are allowed; otherwise, false. + + + + + Gets a value indicating whether a given should be serialized or not. + + The member to check. + + true if the given member should be serialized, otherwise, false. + + An attribute that lets you help the DefaultSerializationBinder bind type names to types. This is useful if you're renaming a type, @@ -6847,6 +4970,100 @@ Note that Odin can still serialize an excluded member - it is merely ignored in the inspector itself. + + + Provides an array of utility methods which are commonly used by serialization formatters. + + + + + Gets a map of all serializable members on the given type. This will also properly map names extracted from and to their corresponding members. + + The type to get a map for. + The serialization policy to use. If null, is used. + A map of all serializable members on the given type. + + + + Gets an array of all serializable members on the given type. + + The type to get serializable members for. + The serialization policy to use. If null, is used. + An array of all serializable members on the given type. + + + + Creates a fake Unity null value of a given type, for the given -derived owning type. + + Unity uses these kinds of values to indicate missing object references. + + Type of the null value. + Type of the owning value. This is the value which changes the which you get. + A fake Unity null value of a given type. + The nullType or owningType parameter is null. + + The type given in the nullType parameter is not a Unity object. + or + The type given in the owningType parameter is not a Unity object. + + + + + Determines whether a given type is a primitive type to the serialization system. + + The following criteria are checked: type.IsPrimitive or type.IsEnum, or type is a , or . + + The type to check. + true if the given type is a primitive type; otherwise, false. + + + + Determines whether a given type is a primitive array type. Namely, arrays with primitive array types as elements are primitive arrays. + + The following types are primitive array types: , , , , , , , , , , , , and . + + The type to check. + true if the given type is a primitive array type; otherwise, false. + + + + Gets the type contained in the given . Currently only and is supported. + + The to get the contained type of. + The type contained in the given . + Can't get the contained type of the given type. + + + + Gets the value contained in a given . Currently only and is supported. + + The to get the value of. + The instance to get the value from. + The value contained in the given . + Can't get the value of the given type. + + + + Sets the value of a given MemberInfo. Currently only and is supported. + + The to set the value of. + The object to set the value on. + The value to set. + + Property has no setter + or + Can't set the value of the given type. + + + + + Gets an aliased version of a member, with the declaring type name included in the member name, so that there are no conflicts with private fields and properties with the same name in different classes in the same inheritance hierarchy. + + Marked internal in Odin because this method MUST NOT BE CALLED FROM ODIN'S INSPECTOR CODE. + Odin has its own version of this, and there must be no conflict. These aliases must not be + mixed into Odin's own. Use InspectorPropertyInfoUtility.GetPrivateMemberAlias instead. + + Resolves external guid references to reference objects during serialization and deserialization. @@ -7059,6 +5276,77 @@ A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + Indicates that an instance field or auto-property should be serialized by Odin. + + + + + + An Odin-serialized prefab modification, containing all the information necessary to apply the modification. + + + + + The type of modification to be made. + + + + + The deep reflection path at which to make the modification. + + + + + A list of all deep reflection paths in the target object where the value referenced by this modification was also located. + + + + + The modified value to set. + + + + + The new list length to set. + + + + + The dictionary keys to add. + + + + + The dictionary keys to remove. + + + + + Applies the modification to the given Object. + + + + + Types of prefab modification that can be applied. + + + + + A value has been changed at a given path. + + + + + A list length has been changed at a given path. + + + + + A dictionary has been changed at a given path. + + Indicates that an instance field or auto-property was previously serialized with a different name, so that values serialized with the old name will be properly deserialized into this member. @@ -7078,6 +5366,183 @@ The former name. + + + Corresponds to the .NET class, but works only with buffers and so never allocates garbage. + + This class always writes and reads bytes in a little endian format, regardless of system architecture. + + + + + Converts a byte array into a hexadecimal string. + + + + + Converts a hexadecimal string into a byte array. + + + + + Reads two bytes from a buffer and converts them into a value. + + The buffer to read from. + The index to start reading at. + The converted value. + + + + Reads two bytes from a buffer and converts them into a value. + + The buffer to read from. + The index to start reading at. + The converted value. + + + + Reads four bytes from a buffer and converts them into an value. + + The buffer to read from. + The index to start reading at. + The converted value. + + + + Reads four bytes from a buffer and converts them into an value. + + The buffer to read from. + The index to start reading at. + The converted value. + + + + Reads eight bytes from a buffer and converts them into a value. + + The buffer to read from. + The index to start reading at. + The converted value. + + + + Reads eight bytes from a buffer and converts them into an value. + + The buffer to read from. + The index to start reading at. + The converted value. + + + + Reads four bytes from a buffer and converts them into an value. + + The buffer to read from. + The index to start reading at. + The converted value. + + + + Reads eight bytes from a buffer and converts them into an value. + + The buffer to read from. + The index to start reading at. + The converted value. + + + + Reads sixteen bytes from a buffer and converts them into a value. + + The buffer to read from. + The index to start reading at. + The converted value. + + + + Reads sixteen bytes from a buffer and converts them into a value. + + The buffer to read from. + The index to start reading at. + The converted value. + + + + Turns a value into two bytes and writes those bytes to a given buffer. + + The buffer to write to. + The index to start writing at. + The value to write. + + + + Turns an value into two bytes and writes those bytes to a given buffer. + + The buffer to write to. + The index to start writing at. + The value to write. + + + + Turns an value into four bytes and writes those bytes to a given buffer. + + The buffer to write to. + The index to start writing at. + The value to write. + + + + Turns an value into four bytes and writes those bytes to a given buffer. + + The buffer to write to. + The index to start writing at. + The value to write. + + + + Turns a value into eight bytes and writes those bytes to a given buffer. + + The buffer to write to. + The index to start writing at. + The value to write. + + + + Turns an value into eight bytes and writes those bytes to a given buffer. + + The buffer to write to. + The index to start writing at. + The value to write. + + + + Turns a value into four bytes and writes those bytes to a given buffer. + + The buffer to write to. + The index to start writing at. + The value to write. + + + + Turns a value into eight bytes and writes those bytes to a given buffer. + + The buffer to write to. + The index to start writing at. + The value to write. + + + + Turns a value into sixteen bytes and writes those bytes to a given buffer. + + The buffer to write to. + The index to start writing at. + The value to write. + + + + Turns a value into sixteen bytes and writes those bytes to a given buffer. + + The buffer to write to. + The index to start writing at. + The value to write. + An exception thrown when the serialization system has encountered an issue so severe that serialization is being aborted. If this exception is caught in the serialization system somewhere, it should be rethrown. @@ -7314,43 +5779,6 @@ This allows complete reuse of a serialization context, with all of its internal reference buffers. - - - Indicates that an instance field or auto-property should be serialized by Odin. - - - - - - Binds types to strings during serialization, and strings to types during deserialization. - - - - - Provides a default, catch-all implementation. This binder only includes assembly names, without versions and tokens, in order to increase compatibility. - - - - - Bind a type to a name. - - The type to bind. - The debug context to log to. - The name that the type has been bound to. - - - - Binds a name to a type. - - The name of the type to bind. - The debug context to log to. - The type that the name has been bound to, or null if the type could not be resolved. - - - - Determines whether the specified type name is mapped. - - Contains a set of default implementations of the interface. @@ -7392,6 +5820,315 @@ 2) Virtual auto-properties are never serialized. Note that properties specified by an implemented interface are automatically marked virtual by the compiler. + + + Provides an array of utility wrapper methods for easy serialization and deserialization of objects of any type. + + + + + Creates an for a given format. + + The stream to write to. + The serialization context to use. + The format to write. + + An for a given format. + + + + + + Creates an for a given format. + + The stream to read from. + The deserialization context to use. + The format to read. + + An for a given format. + + + + + + Serializes the given value using the given writer. + + The value to serialize. + The writer to use. + + + + Serializes the given value, using the given writer. + + The value to serialize. + The writer to use. + A list of the Unity objects which were referenced during serialization. + + + + Serializes the given value using the given writer. + + The type of the value to serialize. + The value to serialize. + The writer to use. + + + + Serializes the given value, using the given writer. + + The type of the value to serialize. + The value to serialize. + The writer to use. + A list of the Unity objects which were referenced during serialization. + + + + Serializes the given value to a given stream in the specified format. + + The value to serialize. + The stream to serialize to. + The format to serialize in. + The context. + + + + Serializes the given value to a given stream in the specified format. + + The value to serialize. + The stream to serialize to. + The format to serialize in. + A list of the Unity objects which were referenced during serialization. + The context. + + + + Serializes the given value to a given stream in the specified format. + + The type of the value to serialize. + The value to serialize. + The stream to serialize to. + The format to serialize in. + The context. + + + + Serializes the given value to a given stream in the specified format. + + The type of the value to serialize. + The value to serialize. + The stream to serialize to. + The format to serialize in. + A list of the Unity objects which were referenced during serialization. + The context. + + + + Serializes the given value using the specified format, and returns the result as a byte array. + + The value to serialize. + The format to use. + The context. + A byte array containing the serialized value. + + + + Serializes the given value using the specified format, and returns the result as a byte array. + + The value to serialize. + The format to use. + A list of the Unity objects which were referenced during serialization. + A byte array containing the serialized value. + + + + Serializes the given value using the specified format, and returns the result as a byte array. + + The type of the value to serialize. + The value to serialize. + The format to use. + The context to use. + A byte array containing the serialized value. + + + + Serializes the given value using the specified format and returns the result as a byte array. + + The type of the value to serialize. + The value to serialize. + The format to use. + A list of the Unity objects which were referenced during serialization. + The context to use. + A byte array containing the serialized value. + + + + Deserializes a value from the given reader. This might fail with primitive values, as they don't come with metadata. + + The reader to use. + The deserialized value. + + + + Deserializes a value from the given reader, using the given list of Unity objects for external index reference resolution. This might fail with primitive values, as they don't come with type metadata. + + The reader to use. + The list of Unity objects to use for external index reference resolution. + + The deserialized value. + + + + + Deserializes a value from the given reader. + + The type to deserialize. + The reader to use. + The deserialized value. + + + + Deserializes a value of a given type from the given reader, using the given list of Unity objects for external index reference resolution. + + The type to deserialize. + The reader to use. + The list of Unity objects to use for external index reference resolution. + + The deserialized value. + + + + + Deserializes a value from the given stream in the given format. This might fail with primitive values, as they don't come with type metadata. + + The reader to use. + The format to read. + The context. + + The deserialized value. + + + + + Deserializes a value from the given stream in the given format, using the given list of Unity objects for external index reference resolution. This might fail with primitive values, as they don't come with type metadata. + + The stream to read from. + The format to read. + The list of Unity objects to use for external index reference resolution. + The context. + + The deserialized value. + + + + + Deserializes a value of a given type from the given stream in the given format. + + The type to deserialize. + The stream to read from. + The format to read. + The context. + + The deserialized value. + + + + + Deserializes a value of a given type from the given stream in the given format, using the given list of Unity objects for external index reference resolution. + + The type to deserialize. + The stream to read from. + The format to read. + The list of Unity objects to use for external index reference resolution. + The context. + + The deserialized value. + + + + + Deserializes a value from the given byte array in the given format. This might fail with primitive values, as they don't come with type metadata. + + The bytes to deserialize from. + The format to read. + The context. + + The deserialized value. + + + + + Deserializes a value from the given byte array in the given format, using the given list of Unity objects for external index reference resolution. This might fail with primitive values, as they don't come with type metadata. + + The bytes to deserialize from. + The format to read. + The list of Unity objects to use for external index reference resolution. + + The deserialized value. + + + + + Deserializes a value of a given type from the given byte array in the given format. + + The type to deserialize. + The bytes to deserialize from. + The format to read. + The context to use. + + The deserialized value. + + + + + Deserializes a value of a given type from the given byte array in the given format, using the given list of Unity objects for external index reference resolution. + + The type to deserialize. + The bytes to deserialize from. + The format to read. + The list of Unity objects to use for external index reference resolution. + The context to use. + + The deserialized value. + + + + + Creates a deep copy of an object. Returns null if null. All Unity objects references will remain the same - they will not get copied. + Similarly, strings are not copied, nor are reflection types such as System.Type, or types derived from System.Reflection.MemberInfo, + System.Reflection.Assembly or System.Reflection.Module. + + + + + Binds types to strings during serialization, and strings to types during deserialization. + + + + + Provides a default, catch-all implementation. This binder only includes assembly names, without versions and tokens, in order to increase compatibility. + + + + + Bind a type to a name. + + The type to bind. + The debug context to log to. + The name that the type has been bound to. + + + + Binds a name to a type. + + The name of the type to bind. + The debug context to log to. + The type that the name has been bound to, or null if the type could not be resolved. + + + + Determines whether the specified type name is mapped. + + Serializer for the type. @@ -7954,6 +6691,177 @@ The value to write. The writer to use. + + + Scans the project's build scenes and resources, plus their dependencies, for serialized types to support. Progress bars are shown during the scan. + + The serialized types to support. + Whether to scan the project's build scenes. + Whether to scan all the project's asset bundles. + Whether to scan the project's preloaded assets. + Whether to scan the project's resources. + An optional list of the resource paths to scan. Only has an effect if the scanResources argument is true. All the resources will be scanned if null. + true if the scan succeeded, false if the scan failed or was cancelled + + + + Generates an AOT DLL, using the given parameters. + + + + + Not yet documented. + + Not yet documented. + + + + Not yet documented. + + + + + Not yet documented. + + Not yet documented. + Not yet documented. + + + + Not yet documented. + + Not yet documented. + Not yet documented. + + + + Not yet documented. + + Not yet documented. + Not yet documented. + Not yet documented. + + + + Provides utility methods for handling dictionary keys in the prefab modification system. + + + + + A smart comparer for dictionary keys, that uses the most appropriate available comparison method for the given key types. + + + + + Not yet documented. + + Not yet documented. + Not yet documented. + Not yet documented. + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Gets the provider identifier. + + + + + Gets the path string from key. + + The key. + + + + Gets the key from path string. + + The path string. + + + + Compares the specified x. + + The x. + The y. + + + + Not yet documented. + + + + + Gets the path string from key. + + The key. + + + + Gets the key from path string. + + The path string. + + + + Compares the specified x. + + The x. + The y. + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Dictionary key path provider for + + Custom formatter for the type. @@ -8105,122 +7013,6 @@ Does nothing. - - - Not yet documented. - - Not yet documented. - - - - Not yet documented. - - - - - Not yet documented. - - Not yet documented. - Not yet documented. - - - - Not yet documented. - - Not yet documented. - Not yet documented. - - - - Not yet documented. - - Not yet documented. - Not yet documented. - Not yet documented. - - - - Not yet documented. - - - - - Gets the provider identifier. - - - - - Gets the path string from key. - - The key. - - - - Gets the key from path string. - - The path string. - - - - Compares the specified x. - - The x. - The y. - - - - Not yet documented. - - - - - Gets the path string from key. - - The key. - - - - Gets the key from path string. - - The path string. - - - - Compares the specified x. - - The x. - The y. - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Dictionary key path provider for - - Custom formatter for the type. @@ -8281,26 +7073,6 @@ The value to write from. The writer to use. - - - Indicates that an Odin-serialized Unity object controls its own serialization format. Every time it is serialized, it will be asked which format to use. - - - - - Gets the format to use for serialization. - - - - - Indicates that an Odin-serialized Unity object supports prefab serialization. - - - - - Gets or sets the serialization data of the object. - - Custom formatter for the type. @@ -8381,6 +7153,148 @@ The value to write from. The writer to use. + + + Custom generic formatter for the , , and types. + + The type of UnityEvent that this formatter can serialize and deserialize. + + + + + Get an uninitialized object of type . + + + An uninitialized object of type . + + + + + Custom formatter for the type. + + + + + + Reads into the specified value using the specified reader. + + The value to read into. + The reader to use. + + + + Writes from the specified value using the specified writer. + + The value to write from. + The writer to use. + + + + Custom formatter for the type. + + + + + + Reads into the specified value using the specified reader. + + The value to read into. + The reader to use. + + + + Writes from the specified value using the specified writer. + + The value to write from. + The writer to use. + + + + Custom formatter for the type. + + + + + + Reads into the specified value using the specified reader. + + The value to read into. + The reader to use. + + + + Writes from the specified value using the specified writer. + + The value to write from. + The writer to use. + + + + Custom formatter for the type. + + + + + + Reads into the specified value using the specified reader. + + The value to read into. + The reader to use. + + + + Writes from the specified value using the specified writer. + + The value to write from. + The writer to use. + + + + Custom formatter for the type. + + + + + + Reads into the specified value using the specified reader. + + The value to read into. + The reader to use. + + + + Writes from the specified value using the specified writer. + + The value to write from. + The writer to use. + + + + Indicates that an Odin-serialized Unity object controls its own serialization format. Every time it is serialized, it will be asked which format to use. + + + + + Gets the format to use for serialization. + + + + + Indicates that an Odin-serialized Unity object provides its own serialization policy rather than using the default policy. + + Note that THE VALUES RETURNED BY THIS INTERFACE WILL OVERRIDE THE PARAMETERS PASSED TO and . + + + + + Indicates that an Odin-serialized Unity object supports prefab serialization. + + + + + Gets or sets the serialization data of the object. + + Unity serialized data struct that contains all data needed by Odin serialization. @@ -8458,21 +7372,6 @@ Resets all data. - - - Custom generic formatter for the , , and types. - - The type of UnityEvent that this formatter can serialize and deserialize. - - - - - Get an uninitialized object of type . - - - An uninitialized object of type . - - Resolves external index references to Unity objects. @@ -8538,818 +7437,6 @@ Initializes the Sirenix serialization system to be compatible with Unity. - - - Custom formatter for the type. - - - - - - Reads into the specified value using the specified reader. - - The value to read into. - The reader to use. - - - - Writes from the specified value using the specified writer. - - The value to write from. - The writer to use. - - - - Custom formatter for the type. - - - - - - Reads into the specified value using the specified reader. - - The value to read into. - The reader to use. - - - - Writes from the specified value using the specified writer. - - The value to write from. - The writer to use. - - - - Custom formatter for the type. - - - - - - Reads into the specified value using the specified reader. - - The value to read into. - The reader to use. - - - - Writes from the specified value using the specified writer. - - The value to write from. - The writer to use. - - - - Provides a way of claiming and releasing cached array buffers. - - The element type of the array to buffer. - - - - - Gets the total element count of the buffered array. This will always be a power of two. - - - The total element count of the buffered array. - - Cannot access a buffer while it is freed. - - - - Gets the buffered array. - - - The buffered array. - - Cannot access a buffer while it is freed. - - - - Gets a value indicating whether this buffer is free. - - - true if this buffer is free; otherwise, false. - - - - - Claims a buffer with the specified minimum capacity. Note: buffers always have a capacity equal to or larger than 256. - - The minimum capacity. - A buffer which has a capacity equal to or larger than the specified minimum capacity. - Requested size of buffer must be larger than 0. - - - - Frees the specified buffer. - - The buffer to free. - The buffer argument is null. - - - - Frees this buffer. - - - - - Frees this buffer. - - - - - Utility class for locating and caching formatters for all non-primitive types. - - - - - Editor-only event that fires whenever an emittable formatter has been located. - This event is used by the AOT formatter pre-emitter to locate types that need to have formatters pre-emitted. - - - - - Editor-only event that fires whenever a formatter has been located. - - - - - This event is invoked before everything else when a formatter is being resolved for a given type. If any invoked delegate returns a valid formatter, that formatter is used and the resolve process stops there. - - This can be used to hook into and extend the serialization system's formatter resolution logic. - - - - - Gets a formatter for the type . - - The type to get a formatter for. - The serialization policy to use if a formatter has to be emitted. If null, is used. - - A formatter for the type . - - - - - Gets a formatter for a given type. - - The type to get a formatter for. - The serialization policy to use if a formatter has to be emitted. If null, is used. - - A formatter for the given type. - - The type argument is null. - - - - Provides an array of utility methods which are commonly used by serialization formatters. - - - - - Gets a map of all serializable members on the given type. This will also properly map names extracted from and to their corresponding members. - - The type to get a map for. - The serialization policy to use. If null, is used. - A map of all serializable members on the given type. - - - - Gets an array of all serializable members on the given type. - - The type to get serializable members for. - The serialization policy to use. If null, is used. - An array of all serializable members on the given type. - - - - Creates a fake Unity null value of a given type, for the given -derived owning type. - - Unity uses these kinds of values to indicate missing object references. - - Type of the null value. - Type of the owning value. This is the value which changes the which you get. - A fake Unity null value of a given type. - The nullType or owningType parameter is null. - - The type given in the nullType parameter is not a Unity object. - or - The type given in the owningType parameter is not a Unity object. - - - - - Determines whether a given type is a primitive type to the serialization system. - - The following criteria are checked: type.IsPrimitive or type.IsEnum, or type is a , or . - - The type to check. - true if the given type is a primitive type; otherwise, false. - - - - Determines whether a given type is a primitive array type. Namely, arrays with primitive array types as elements are primitive arrays. - - The following types are primitive array types: , , , , , , , , , , , , and . - - The type to check. - true if the given type is a primitive array type; otherwise, false. - - - - Gets the type contained in the given . Currently only and is supported. - - The to get the contained type of. - The type contained in the given . - Can't get the contained type of the given type. - - - - Gets the value contained in a given . Currently only and is supported. - - The to get the value of. - The instance to get the value from. - The value contained in the given . - Can't get the value of the given type. - - - - Sets the value of a given MemberInfo. Currently only and is supported. - - The to set the value of. - The object to set the value on. - The value to set. - - Property has no setter - or - Can't set the value of the given type. - - - - - Gets an aliased version of a member, with the declaring type name included in the member name, so that there are no conflicts with private fields and properties with the same name in different classes in the same inheritance hierarchy. - - Marked internal in Odin because this method MUST NOT BE CALLED FROM ODIN'S INSPECTOR CODE. - Odin has its own version of this, and there must be no conflict. These aliases must not be - mixed into Odin's own. Use InspectorPropertyInfoUtility.GetPrivateMemberAlias instead. - - - - - Provides utility methods for handling dictionary keys in the prefab modification system. - - - - - A smart comparer for dictionary keys, that uses the most appropriate available comparison method for the given key types. - - - - - Not yet documented. - - Not yet documented. - Not yet documented. - Not yet documented. - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - An Odin-serialized prefab modification, containing all the information necessary to apply the modification. - - - - - The type of modification to be made. - - - - - The deep reflection path at which to make the modification. - - - - - A list of all deep reflection paths in the target object where the value referenced by this modification was also located. - - - - - The modified value to set. - - - - - The new list length to set. - - - - - The dictionary keys to add. - - - - - The dictionary keys to remove. - - - - - Applies the modification to the given Object. - - - - - Types of prefab modification that can be applied. - - - - - A value has been changed at a given path. - - - - - A list length has been changed at a given path. - - - - - A dictionary has been changed at a given path. - - - - - Corresponds to the .NET class, but works only with buffers and so never allocates garbage. - - This class always writes and reads bytes in a little endian format, regardless of system architecture. - - - - - Converts a byte array into a hexadecimal string. - - - - - Converts a hexadecimal string into a byte array. - - - - - Reads two bytes from a buffer and converts them into a value. - - The buffer to read from. - The index to start reading at. - The converted value. - - - - Reads two bytes from a buffer and converts them into a value. - - The buffer to read from. - The index to start reading at. - The converted value. - - - - Reads four bytes from a buffer and converts them into an value. - - The buffer to read from. - The index to start reading at. - The converted value. - - - - Reads four bytes from a buffer and converts them into an value. - - The buffer to read from. - The index to start reading at. - The converted value. - - - - Reads eight bytes from a buffer and converts them into a value. - - The buffer to read from. - The index to start reading at. - The converted value. - - - - Reads eight bytes from a buffer and converts them into an value. - - The buffer to read from. - The index to start reading at. - The converted value. - - - - Reads four bytes from a buffer and converts them into an value. - - The buffer to read from. - The index to start reading at. - The converted value. - - - - Reads eight bytes from a buffer and converts them into an value. - - The buffer to read from. - The index to start reading at. - The converted value. - - - - Reads sixteen bytes from a buffer and converts them into a value. - - The buffer to read from. - The index to start reading at. - The converted value. - - - - Reads sixteen bytes from a buffer and converts them into a value. - - The buffer to read from. - The index to start reading at. - The converted value. - - - - Turns a value into two bytes and writes those bytes to a given buffer. - - The buffer to write to. - The index to start writing at. - The value to write. - - - - Turns an value into two bytes and writes those bytes to a given buffer. - - The buffer to write to. - The index to start writing at. - The value to write. - - - - Turns an value into four bytes and writes those bytes to a given buffer. - - The buffer to write to. - The index to start writing at. - The value to write. - - - - Turns an value into four bytes and writes those bytes to a given buffer. - - The buffer to write to. - The index to start writing at. - The value to write. - - - - Turns a value into eight bytes and writes those bytes to a given buffer. - - The buffer to write to. - The index to start writing at. - The value to write. - - - - Turns an value into eight bytes and writes those bytes to a given buffer. - - The buffer to write to. - The index to start writing at. - The value to write. - - - - Turns a value into four bytes and writes those bytes to a given buffer. - - The buffer to write to. - The index to start writing at. - The value to write. - - - - Turns a value into eight bytes and writes those bytes to a given buffer. - - The buffer to write to. - The index to start writing at. - The value to write. - - - - Turns a value into sixteen bytes and writes those bytes to a given buffer. - - The buffer to write to. - The index to start writing at. - The value to write. - - - - Turns a value into sixteen bytes and writes those bytes to a given buffer. - - The buffer to write to. - The index to start writing at. - The value to write. - - - - Provides an array of utility wrapper methods for easy serialization and deserialization of objects of any type. - - - - - Creates an for a given format. - - The stream to write to. - The serialization context to use. - The format to write. - - An for a given format. - - - - - - Creates an for a given format. - - The stream to read from. - The deserialization context to use. - The format to read. - - An for a given format. - - - - - - Serializes the given value using the given writer. - - The value to serialize. - The writer to use. - - - - Serializes the given value, using the given writer. - - The value to serialize. - The writer to use. - A list of the Unity objects which were referenced during serialization. - - - - Serializes the given value using the given writer. - - The type of the value to serialize. - The value to serialize. - The writer to use. - - - - Serializes the given value, using the given writer. - - The type of the value to serialize. - The value to serialize. - The writer to use. - A list of the Unity objects which were referenced during serialization. - - - - Serializes the given value to a given stream in the specified format. - - The value to serialize. - The stream to serialize to. - The format to serialize in. - The context. - - - - Serializes the given value to a given stream in the specified format. - - The value to serialize. - The stream to serialize to. - The format to serialize in. - A list of the Unity objects which were referenced during serialization. - The context. - - - - Serializes the given value to a given stream in the specified format. - - The type of the value to serialize. - The value to serialize. - The stream to serialize to. - The format to serialize in. - The context. - - - - Serializes the given value to a given stream in the specified format. - - The type of the value to serialize. - The value to serialize. - The stream to serialize to. - The format to serialize in. - A list of the Unity objects which were referenced during serialization. - The context. - - - - Serializes the given value using the specified format, and returns the result as a byte array. - - The value to serialize. - The format to use. - The context. - A byte array containing the serialized value. - - - - Serializes the given value using the specified format, and returns the result as a byte array. - - The value to serialize. - The format to use. - A list of the Unity objects which were referenced during serialization. - A byte array containing the serialized value. - - - - Serializes the given value using the specified format, and returns the result as a byte array. - - The type of the value to serialize. - The value to serialize. - The format to use. - The context to use. - A byte array containing the serialized value. - - - - Serializes the given value using the specified format and returns the result as a byte array. - - The type of the value to serialize. - The value to serialize. - The format to use. - A list of the Unity objects which were referenced during serialization. - The context to use. - A byte array containing the serialized value. - - - - Deserializes a value from the given reader. This might fail with primitive values, as they don't come with metadata. - - The reader to use. - The deserialized value. - - - - Deserializes a value from the given reader, using the given list of Unity objects for external index reference resolution. This might fail with primitive values, as they don't come with type metadata. - - The reader to use. - The list of Unity objects to use for external index reference resolution. - - The deserialized value. - - - - - Deserializes a value from the given reader. - - The type to deserialize. - The reader to use. - The deserialized value. - - - - Deserializes a value of a given type from the given reader, using the given list of Unity objects for external index reference resolution. - - The type to deserialize. - The reader to use. - The list of Unity objects to use for external index reference resolution. - - The deserialized value. - - - - - Deserializes a value from the given stream in the given format. This might fail with primitive values, as they don't come with type metadata. - - The reader to use. - The format to read. - The context. - - The deserialized value. - - - - - Deserializes a value from the given stream in the given format, using the given list of Unity objects for external index reference resolution. This might fail with primitive values, as they don't come with type metadata. - - The stream to read from. - The format to read. - The list of Unity objects to use for external index reference resolution. - The context. - - The deserialized value. - - - - - Deserializes a value of a given type from the given stream in the given format. - - The type to deserialize. - The stream to read from. - The format to read. - The context. - - The deserialized value. - - - - - Deserializes a value of a given type from the given stream in the given format, using the given list of Unity objects for external index reference resolution. - - The type to deserialize. - The stream to read from. - The format to read. - The list of Unity objects to use for external index reference resolution. - The context. - - The deserialized value. - - - - - Deserializes a value from the given byte array in the given format. This might fail with primitive values, as they don't come with type metadata. - - The bytes to deserialize from. - The format to read. - The context. - - The deserialized value. - - - - - Deserializes a value from the given byte array in the given format, using the given list of Unity objects for external index reference resolution. This might fail with primitive values, as they don't come with type metadata. - - The bytes to deserialize from. - The format to read. - The list of Unity objects to use for external index reference resolution. - - The deserialized value. - - - - - Deserializes a value of a given type from the given byte array in the given format. - - The type to deserialize. - The bytes to deserialize from. - The format to read. - The context to use. - - The deserialized value. - - - - - Deserializes a value of a given type from the given byte array in the given format, using the given list of Unity objects for external index reference resolution. - - The type to deserialize. - The bytes to deserialize from. - The format to read. - The list of Unity objects to use for external index reference resolution. - The context to use. - - The deserialized value. - - - - - Creates a deep copy of an object. Returns null if null. All Unity objects references will remain the same - they will not get copied. - - Provides an array of utility wrapper methods for easy serialization and deserialization of Unity objects of any type. @@ -9471,6 +7558,2218 @@ we now have to use reflection to access it consistently across all versions of Unity. + + + FieldInfo method extensions. + + + + + Determines whether the specified field is an alias. + + The field to check. + + true if the specified field is an alias; otherwise, false. + + + + + Returns the original, backing field of an alias field if the field is an alias. + + The field to check. + /// if set to true an exception will be thrown if the field is not aliased. + + The field was not aliased; this only occurs if throwOnNotAliased is true. + + + + Garbage free enumerator methods. + + + + + Garbage free enumerator for lists. + + + + + Garbage free enumerator for dictionaries. + + + + + Garbage free enumator for dictionary values. + + + + + Garbage free enumerator for hashsets. + + + + + List iterator. + + + + + Creates a list iterator. + + + + + Gets the enumerator. + + + + + Gets the current value. + + + + + Moves to the next value. + + + + + Disposes the iterator. + + + + + Hashset iterator. + + + + + Creates a hashset iterator. + + + + + Gets the enumerator. + + + + + Gets the current value. + + + + + Moves to the next value. + + + + + Disposes the iterator. + + + + + Dictionary iterator. + + + + + Creates a dictionary iterator. + + + + + Gets the enumerator. + + + + + Gets the current value. + + + + + Moves to the next value. + + + + + Disposes the iterator. + + + + + Dictionary value iterator. + + + + + Creates a dictionary value iterator. + + + + + Gets the enumerator. + + + + + Gets the current value. + + + + + Moves to the next value. + + + + + Disposes the iterator. + + + + + Various LinQ extensions. + + + + + Perform an action on each item. + + The source. + The action to perform. + + + + Perform an action on each item. + + The source. + The action to perform. + + + + Add a collection to the end of another collection. + + The collection. + The collection to append. + + + + MemberInfo method extensions. + + + + + Returns true if the attribute whose type is specified by the generic argument is defined on this member + + + + + Returns true if the attribute whose type is specified by the generic argument is defined on this member + + + + + Returns the first found custom attribute of type T on this member + Returns null if none was found + + + + + Returns the first found non-inherited custom attribute of type T on this member + Returns null if none was found + + + + + Gets all attributes of the specified generic type. + + The member. + + + + Gets all attributes of the specified generic type. + + The member. + If true, specifies to also search the ancestors of element for custom attributes. + + + + Gets all attribute instances defined on a MemeberInfo. + + The member. + + + + Gets all attribute instances on a MemberInfo. + + The member. + If true, specifies to also search the ancestors of element for custom attributes. + + + + If this member is a method, returns the full method name (name + params) otherwise the member name paskal splitted + + + + + Determines whether a FieldInfo, PropertyInfo or MethodInfo is static. + + The member. + + true if the specified member is static; otherwise, false. + + + + + + Determines whether the specified member is an alias. + + The member to check. + + true if the specified member is an alias; otherwise, false. + + + + + Returns the original, backing member of an alias member if the member is an alias. + + The member to check. + /// if set to true an exception will be thrown if the member is not aliased. + + The member was not aliased; this only occurs if throwOnNotAliased is true. + + + + Various extensions for MethodInfo. + + + + + Returns the specified method's full name "methodName(argType1 arg1, argType2 arg2, etc)" + Uses the specified gauntlet to replaces type names, ex: "int" instead of "Int32" + + + + + Returns a string representing the passed method parameters names. Ex "int num, float damage, Transform target" + + + + + Returns the specified method's full name. + + + + + Tests if a method is an extension method. + + + + + Determines whether the specified method is an alias. + + The method to check. + + true if the specified method is an alias; otherwise, false. + + + + + Returns the original, backing method of an alias method if the method is an alias. + + The method to check. + /// if set to true an exception will be thrown if the method is not aliased. + + The method was not aliased; this only occurs if throwOnNotAliased is true. + + + + Determines the type of operator. + + + + + + The == operator. + + + + + The != operator. + + + + + The + operator. + + + + + The - operator. + + + + + The * operator. + + + + + The / operator. + + + + + The < operator. + + + + + The > operator. + + + + + The <= operator. + + + + + The >= operator. + + + + + The % operator. + + + + + The >> operator. + + + + + The << operator. + + + + + The & operator. + + + + + The | operator. + + + + + The ^ operator. + + + + + The ~ operator. + + + + + The && operator. + + + + + The || operator. + + + + + The ! operator. + + + + + DirectoryInfo method extensions. + + + + + Determines whether the directory has a given directory in its hierarchy of children. + + The parent directory. + The sub directory. + + + + PropertyInfo method extensions. + + + + + Determines whether a property is an auto property with a usable getter and setter. + + + + + Determines whether the specified property is an alias. + + The property to check. + + true if the specified property is an alias; otherwise, false. + + + + + Returns the original, backing property of an alias property if the property is an alias. + + The property to check. + /// if set to true an exception will be thrown if the property is not aliased. + + The property was not aliased; this only occurs if throwOnNotAliased is true. + + + + String method extensions. + + + + + Eg MY_INT_VALUE => MyIntValue + + + + + Returns true if this string is null, empty, or contains only whitespace. + + The string to check. + true if this string is null, empty, or contains only whitespace; otherwise, false. + + + + Type method extensions. + + + + + Type name alias lookup. + TypeNameAlternatives["Single"] will give you "float", "UInt16" will give you "ushort", "Boolean[]" will give you "bool[]" etc.. + + + + + Checks whether a given string is a valid CSharp identifier name. This also checks full type names including namespaces. + + The identifier to check. + + + + Determines whether a type can be casted to another type. + + From. + To. + if set to true an implicit or explicit operator must be defined on the given type. + + + + If a type can be casted to another type, this provides a function to manually convert the type. + + From. + To. + if set to true an implicit or explicit operator must be defined on the given type. + + + + If a type can be casted to another type, this provides a function to manually convert the type. + + if set to true an implicit or explicit operator must be defined on the given type. + + + + If a type can be casted to another type, this provides the method info of the method in charge of converting the type. + + From. + To. + if set to true an implicit or explicit operator must be defined on the given type. + + + + Gets an equality comparer delegate used to compare the equality of values of a given type. In order, this will be: + + 1. The == operator, if one is defined on the type. + 2. A delegate that uses , if the type implements that interface. + 3. .NET's own + + + Note that in the special case of the type , a special equality comparer is returned that only checks whether all the Quaternion components are equal. + This is because, by default, Quaternion's equality operator is broken when operating on invalid quaternions; "default(Quaternion) == default(Quaternion)" evaluates to false, and this causes a multitude of problems. + Special delegates are also returned for float and double, that consider float.NaN to be equal to float.NaN, and double.NaN to be equal to double.NaN. + + + + + Gets the first attribute of type T. Returns null in the no attribute of type T was found. + + The type. + If true, specifies to also search the ancestors of element for custom attributes. + + + + Determines whether a type implements or inherits from another type. + + The type. + To. + + + + Determines whether a type implements an open generic interface or class such as IList<> or List<>. + + Type of the candidate. + Type of the open generic type. + + + + + Determines whether a type implements an open generic interface such as IList<>. + + Type of the candidate. + Type of the open generic interface. + + Type " + openGenericInterfaceType.Name + " is not a generic type definition and an interface. + + + + Determines whether a type implements an open generic class such as List<>. + + Type of the candidate. + Type of the open generic interface. + + + + Gets the generic arguments of an inherited open generic class or interface. + + Type of the candidate. + The open generic type to get the arguments of. + + + + Gets the generic arguments of an inherited open generic class. + + Type of the candidate. + Type of the open generic class. + + + + Gets the generic arguments of an inherited open generic interface. + + Type of the candidate. + Type of the open generic interface. + + + + Gets the MethodInfo of a specific operator kind, with the given left and right operands. This overload is *far* faster than any of the other GetOperatorMethod implementations, and should be used whenever possible. + + + + + Gets the MethodInfo of a specific operator type. + + + + + Gets the MethodInfo of a specific operator type. + + + + + Gets all members from a given type, including members from all base types if the flag isn't set. + + + + + Gets all members from a given type, including members from all base types. + + + + + Gets all members of a specific type from a type, including members from all base types, if the flag isn't set. + + + + + Gets the generic type definition of an open generic base type. + + + + + Gets the generic type definition of an open generic base type. + + + + + Returns a lazy enumerable of all the base types of this type including interfaces and classes + + + + + Returns a lazy enumerable of all the base classes of this type + + + + + Used to filter out unwanted type names. Ex "int" instead of "Int32" + + + + + Returns a nicely formatted name of a type. + + + + + Returns a nicely formatted full name of a type. + + + + + Gets the name of the compilable nice. + + The type. + + + + Gets the full name of the compilable nice. + + The type. + + + + Returns the first found custom attribute of type T on this type + Returns null if none was found + + + + + Returns the first found non-inherited custom attribute of type T on this type + Returns null if none was found + + + + + Gets all attributes of type T. + + The type. + + + + Gets all attributes of type T. + + The type + If true, specifies to also search the ancestors of element for custom attributes. + + + + Returns true if the attribute whose type is specified by the generic argument is defined on this type + + + + + Returns true if the attribute whose type is specified by the generic argument is defined on this type + + + + + Determines whether a type inherits or implements another type. Also include support for open generic base types such as List<>. + + + + + + Determines whether a type inherits or implements another type. Also include support for open generic base types such as List<>. + + + + + + + Gets the number of base types between given type and baseType. + + + + + Determines whether a method has the specified parameter types. + + + + + FieldInfo will return the fieldType, propertyInfo the PropertyType, MethodInfo the return type and EventInfo will return the EventHandlerType. + + The MemberInfo. + + + + Gets the value contained in a given . Currently only and is supported. + + The to get the value of. + The instance to get the value from. + The value contained in the given . + Can't get the value of the given type. + + + + Sets the value of a given MemberInfo. Currently only and is supported. + + The to set the value of. + The object to set the value on. + The value to set. + + Property has no setter + or + Can't set the value of the given type. + + + + + Tries to infer a set of valid generic parameters for a generic type definition, given a subset of known parameters. + + The generic type definition to attempt to infer parameters for. + The inferred parameters, if inferral was successful. + The known parameters to infer from. + True if the parameters could be inferred, otherwise, false. + + genericTypeDefinition is null + or + knownParameters is null + + The genericTypeDefinition parameter must be a generic type definition. + + + + Checks whether an array of types satisfy the constraints of a given generic type definition. + If this method returns true, the given parameters can be safely used with with the given generic type definition. + + The generic type definition to check. + The parameters to check validity for. + + genericType is null + or + types is null + + The genericType parameter must be a generic type definition. + + + + Checks whether an array of types satisfy the constraints of a given generic method definition. + If this method returns true, the given parameters can be safely used with with the given generic method definition. + + The generic method definition to check. + The parameters to check validity for. + + genericType is null + or + types is null + + The genericMethod parameter must be a generic method definition. + + + + Before calling this method we must ALWAYS hold a lock on the GenericConstraintsSatisfaction_LOCK object, as that is an implicit assumption it works with. + + + + + Not yet documented. + + + + + Formats a string with the specified generic parameter constraints on any given type. Example output: where T : class + + + + + Determines whether a generic type contains the specified generic argument constraints. + + The type. + The generic argument types. + + + + Determines whether a type is a fully constructed generic type. + + + + + Determines whether a type is nullable by ensuring the type is neither a PrimitiveType, ValueType or an Enum. + + + + + Gets the enum bitmask in a ulong. + + enumType + + + + Extends various Unity classes. + + + + + Determines whether a Unity object is null or "fake null", + without ever calling Unity's own equality operators. + This method is useful for checking if a Unity object is + null, destroyed or missing at times when it is not allowed + to call Unity's own equality operators, for example when + not running on the main thread. + + The Unity object to check. + True if the object is null, missing or destroyed; otherwise false. + + + + Defines how an assembly's import settings should be configured. + + + + + Include the assembly in the build, but not in the editor. + + + + + Include the assembly in the editor, but not in the build. + + + + + Include the assembly in both the build and in the editor. + + + + + Exclude the assembly from both the build and from the editor. + + + + + Utility for correctly setting import on OdinSerializer assemblies based on platform and scripting backend. + + + + + All valid Unity BuildTarget platforms. + + + + + All valid Unity BuildTarget platforms that support Just In Time compilation. + + + + + All scripting backends that support JIT. + + + + + All API compatibility levels that support JIT. + + + + + Set the import settings on the assembly. + + The path to the assembly to configure import settings from. + The import settings to configure for the assembly at the path. + + + + Set the import settings on the assembly. + + The path to the assembly to configure import settings from. + Indicates if the assembly should be included in the build. + Indicates if the assembly should be included in the Unity editor. + + + + Gets the current scripting backend for the build from the Unity editor. This method is Unity version independent. + + + + + + Gets the current API compatibility level from the Unity Editor. This method is Unity version independent. + + + + + + Gets a value that indicates if the specified platform supports JIT. + + The platform to test. + true if the platform supports JIT; otherwise false. + + + + Gets a value that indicates if the specified scripting backend supports JIT. + + The backend to test. + true if the backend supports JIT; otherwise false. + + + + Gets a value that indicates if the specified api level supports JIT. + + The api level to test. + true if the api level supports JIT; otherwise false. + + + + Gets a value that indicates if the specified build settings supports JIT. + + The platform build setting. + The scripting backend build settting. + The api level build setting. + true if the build settings supports JIT; otherwise false. + + + + Provides an easy way of claiming and freeing cached values of any non-abstract reference type with a public parameterless constructor. + + Cached types which implement the interface will receive notifications when they are claimed and freed. + + Only one thread should be holding a given cache instance at a time if is implemented, since the invocation of + is not thread safe, IE, weird stuff might happen if multiple different threads are trying to free + the same cache instance at the same time. This will practically never happen unless you're doing really strange stuff, but the case is documented here. + + The type which is cached. + + + + + Gets or sets the maximum size of the cache. This value can never go beneath 1. + + + The maximum size of the cache. + + + + + The cached value. + + + + + Gets a value indicating whether this cached value is free. + + + true if this cached value is free; otherwise, false. + + + + + Claims a cached value of type . + + A cached value of type . + + + + Releases a cached value. + + The cached value to release. + The cached value to release is null. + + + + Performs an implicit conversion from to . + + The cache to convert. + + The result of the conversion. + + + + + Releases this cached value. + + + + + Releases this cached value. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Provides utilities for using the namespace. + + This class is due for refactoring. Use at your own peril. + + + + + Gets a value indicating whether emitting is supported on the current platform. + + + true if the current platform can emit; otherwise, false. + + + + + Creates a delegate which gets the value of a field. If emitting is not supported on the current platform, the delegate will use reflection to get the value. + + The type of the field to get a value from. + The instance describing the field to create a getter for. + A delegate which gets the value of the given field. + The fieldInfo parameter is null. + + + + Creates a delegate which gets the value of a field. If emitting is not supported on the current platform, the delegate will use reflection to get the value. + + The instance describing the field to create a getter for. + A delegate which gets the value of the given field. + The fieldInfo parameter is null. + + + + Creates a delegate which sets the value of a field. If emitting is not supported on the current platform, the delegate will use reflection to set the value. + + The type of the field to set a value to. + The instance describing the field to create a setter for. + A delegate which sets the value of the given field. + The fieldInfo parameter is null. + + + + Creates a delegate which sets the value of a field. If emitting is not supported on the current platform, the delegate will use reflection to set the value. + + The instance describing the field to create a setter for. + A delegate which sets the value of the given field. + The fieldInfo parameter is null. + + + + Creates a delegate which gets the value of a field. If emitting is not supported on the current platform, the delegate will use reflection to get the value. + + The type of the instance to get a value from. + The type of the field to get a value from. + The instance describing the field to create a getter for. + A delegate which gets the value of the given field. + The fieldInfo parameter is null. + + + + Creates a delegate which gets the value of a field from a weakly typed instance of a given type. If emitting is not supported on the current platform, the delegate will use reflection to get the value. + + The type of the field to get a value from. + The of the instance to get a value from. + The instance describing the field to create a getter for. + A delegate which gets the value of the given field. + The fieldInfo parameter is null. + + + + Creates a delegate which gets the weakly typed value of a field from a weakly typed instance of a given type. If emitting is not supported on the current platform, the delegate will use reflection to get the value. + + The of the instance to get a value from. + The instance describing the field to create a getter for. + A delegate which gets the value of the given field. + The fieldInfo parameter is null. + + + + Creates a delegate which sets the value of a field. If emitting is not supported on the current platform, the delegate will use reflection to set the value. + + The type of the instance to set a value on. + The type of the field to set a value to. + The instance describing the field to create a setter for. + A delegate which sets the value of the given field. + The fieldInfo parameter is null. + + + + Creates a delegate which sets the value of a field on a weakly typed instance of a given type. If emitting is not supported on the current platform, the delegate will use reflection to set the value. + + The type of the field to set a value to. + Type of the instance. + The instance describing the field to create a setter for. + + A delegate which sets the value of the given field. + + The fieldInfo parameter is null. + Field cannot be static. + + + + Creates a delegate which sets the weakly typed value of a field on a weakly typed instance of a given type. If emitting is not supported on the current platform, the delegate will use reflection to set the value. + + Type of the instance. + The instance describing the field to create a setter for. + + A delegate which sets the value of the given field. + + The fieldInfo parameter is null. + Field cannot be static. + + + + Creates a delegate which gets the weakly typed value of a field from a weakly typed instance of a given type. If emitting is not supported on the current platform, the delegate will use reflection to get the value. + + The of the instance to get a value from. + The instance describing the field to create a getter for. + A delegate which gets the value of the given field. + The fieldInfo parameter is null. + + + + Creates a delegate which sets the weakly typed value of a property on a weakly typed instance of a given type. If emitting is not supported on the current platform, the delegate will use reflection to set the value. + + Type of the instance. + The instance describing the property to create a setter for. + + A delegate which sets the value of the given field. + + The fieldInfo parameter is null. + Property cannot be static. + + + + Creates a delegate which sets the value of a property. If emitting is not supported on the current platform, the delegate will use reflection to set the value. + + The type of the property to set a value to. + The instance describing the property to create a setter for. + A delegate which sets the value of the given property. + The propertyInfo parameter is null. + + + + Creates a delegate which gets the value of a property. If emitting is not supported on the current platform, the delegate will use reflection to get the value. + + The type of the property to get a value from. + The instance describing the property to create a getter for. + A delegate which gets the value of the given property. + The propertyInfo parameter is null. + + + + Creates a delegate which sets the value of a property. If emitting is not supported on the current platform, the delegate will use reflection to set the value. + + The type of the instance to set a value on. + The type of the property to set a value to. + The instance describing the property to create a setter for. + A delegate which sets the value of the given property. + The propertyInfo parameter is null. + + + + Creates a delegate which gets the value of a property. If emitting is not supported on the current platform, the delegate will use reflection to get the value. + + The type of the instance to get a value from. + The type of the property to get a value from. + The instance describing the property to create a getter for. + A delegate which gets the value of the given property. + The propertyInfo parameter is null. + + + + Creates a fast delegate method which calls a given parameterless instance method and returns the result. + + The type of the class which the method is on. + The type which is returned by the given method info. + The method info instance which is used. + A delegate which calls the method and returns the result, except it's hundreds of times faster than MethodInfo.Invoke. + + + + Creates a fast delegate method which calls a given parameterless static method. + + The method info instance which is used. + A delegate which calls the method and returns the result, except it's hundreds of times faster than MethodInfo.Invoke. + + + + Creates a fast delegate method which calls a given parameterless weakly typed instance method. + + The method info instance which is used. + A delegate which calls the method and returns the result, except it's hundreds of times faster than MethodInfo.Invoke. + + + + Not yet documented. + + + + + Creates a fast delegate method which calls a given weakly typed instance method with one argument and returns a value. + + The type of the result. + The type of the first argument. + The method info instance which is used. + + A delegate which calls the method and returns the result, except it's hundreds of times faster than MethodInfo.Invoke. + + methodInfo + + Given method ' + methodInfo.Name + ' is static when it has to be an instance method. + or + Given method ' + methodInfo.Name + ' must return type + typeof(TResult) + . + or + Given method ' + methodInfo.Name + ' must have exactly one parameter. + or + The first parameter of the method ' + methodInfo.Name + ' must be of type + typeof(TArg1) + . + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Creates a fast delegate method which calls a given parameterless instance method on a reference type. + + The type of the class which the method is on. + The method info instance which is used. + A delegate which calls the method and returns the result, except it's hundreds of times faster than MethodInfo.Invoke. + + + + Creates a fast delegate method which calls a given instance method with a given argument on a reference type. + + The type of the class which the method is on. + The type of the argument with which to call the method. + The method info instance which is used. + A delegate which calls the method and returns the result, except it's hundreds of times faster than MethodInfo.Invoke. + + + + Creates a fast delegate method which calls a given parameterless instance method. + + The type of the class which the method is on. + The method info instance which is used. + A delegate which calls the method and returns the result, except it's hundreds of times faster than MethodInfo.Invoke. + + + + Creates a fast delegate method which calls a given instance method with a given argument on a struct type. + + The type of the class which the method is on. + The type of the argument with which to call the method. + The method info instance which is used. + A delegate which calls the method and returns the result, except it's hundreds of times faster than MethodInfo.Invoke. + + + + Compares types by reference before comparing them using the default type equality operator. + This can constitute a *significant* speedup when used as the comparer for dictionaries. + + + + + + This class encapsulates common combinations. + + + + + Search criteria encompassing all public and non-public members, including base members. + Note that you also need to specify either the Instance or Static flag. + + + + + Search criteria encompassing all public instance members, including base members. + + + + + Search criteria encompassing all non-public instance members, including base members. + + + + + Search criteria encompassing all public and non-public instance members, including base members. + + + + + Search criteria encompassing all public static members, including base members. + + + + + Search criteria encompassing all non-public static members, including base members. + + + + + Search criteria encompassing all public and non-public static members, including base members. + + + + + Search criteria encompassing all public instance members, excluding base members. + + + + + Search criteria encompassing all non-public instance members, excluding base members. + + + + + Search criteria encompassing all public and non-public instance members, excluding base members. + + + + + Search criteria encompassing all public static members, excluding base members. + + + + + Search criteria encompassing all non-public static members, excluding base members. + + + + + Search criteria encompassing all public and non-public static members, excluding base members. + + + + + Search criteria encompassing all members, including base and static members. + + + + + Search criteria encompassing all members (public and non-public, instance and static), including base members. + + + + + Provides notification callbacks for values that are cached using the class. + + + + + Called when the cached value is freed. + + + + + Called when the cached value is claimed. + + + + + Interface for immutable list. + + + + + Interface for generic immutable list. + + + + + Index accessor. + + + + + Immutable list wraps another list, and allows for reading the inner list, without the ability to change it. + + + + + Creates an immutable list around another list. + + + + + Number of items in the list. + + + + + Immutable list cannot be changed directly, so it's size is always fixed. + + + + + Immutable list are always readonly. + + + + + Returns true if the inner list is synchronized. + + + + + Gets the sync root object. + + + + + Index accessor. + + Index. + + + + Returns true if the item is contained in the list. + + The item's value. + + + + Copy the list to an array, + + Target array. + Index. + + + + Copy the list to an array, + + Target array. + Index. + + + + Gets an enumerator. + + + + + Get the index of a value. + + The item's value. + + + + Immutable list cannot be edited. + + Index. + + + + Immutable list cannot be edited. + + Index. + Item. + + + + Immutable list cannot be edited. + + Item. + + + + Immutable list cannot be edited. + + + + + Immutable list cannot be edited. + + Item. + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Immutable list wraps another list, and allows for reading the inner list, without the ability to change it. + + + + + Creates an immutable list around another list. + + + + + Number of items in the list. + + + + + Immutable list are always readonly. + + + + + Index accessor. + + Index. + + + + Returns true if the item is contained in the list. + + + + + Copies the list to an array. + + + + + Gets an enumerator. + + + + + Gets the index of an item. + + + + + Provides a methods of representing imaginary fields which are unique to serialization. + + We aggregate the FieldInfo associated with this member and return a mangled form of the name. + + + + + + The default fake name separator string. + + + + + Initializes a new instance of the class. + + The field to alias. + The name prefix to use. + + + + Initializes a new instance of the class. + + The field to alias. + The name prefix to use. + The separator string to use. + + + + Gets the aliased field. + + + The aliased field. + + + + + Gets the module in which the type that declares the member represented by the current is defined. + + + + + Gets a value that identifies a metadata element. + + + + + Gets the name of the current member. + + + + + Gets the class that declares this member. + + + + + Gets the class object that was used to obtain this instance of MemberInfo. + + + + + Gets the type of the field. + + + The type of the field. + + + + + Gets a RuntimeFieldHandle, which is a handle to the internal metadata representation of a field. + + + + + Gets the attributes. + + + The attributes. + + + + + When overridden in a derived class, returns an array of all custom attributes applied to this member. + + True to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks. + + An array that contains all the custom attributes applied to this member, or an array with zero elements if no attributes are defined. + + + + + When overridden in a derived class, returns an array of custom attributes applied to this member and identified by . + + The type of attribute to search for. Only attributes that are assignable to this type are returned. + True to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks. + + An array of custom attributes applied to this member, or an array with zero elements if no attributes assignable to have been applied. + + + + + When overridden in a derived class, indicates whether one or more attributes of the specified type or of its derived types is applied to this member. + + The type of custom attribute to search for. The search includes derived types. + True to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks. + + True if one or more instances of or any of its derived types is applied to this member; otherwise, false. + + + + + Gets the value of the field. + + The object instance to get the value from. + The value of the field. + + + + When overridden in a derived class, sets the value of the field supported by the given object. + + The object whose field value will be set. + The value to assign to the field. + A field of Binder that specifies the type of binding that is desired (for example, Binder.CreateInstance or Binder.ExactBinding). + A set of properties that enables the binding, coercion of argument types, and invocation of members through reflection. If is null, then Binder.DefaultBinding is used. + The software preferences of a particular culture. + + + + Provides a methods of representing aliased methods. + + In this case, what we're representing is a method on a parent class with the same name. + + We aggregate the MethodInfo associated with this member and return a mangled form of the name. + The name that we return is "parentname+methodName". + + + + + + The default fake name separator string. + + + + + Initializes a new instance of the class. + + The method to alias. + The name prefix to use. + + + + Initializes a new instance of the class. + + The method to alias. + The name prefix to use. + The separator string to use. + + + + Gets the aliased method. + + + The aliased method. + + + + + Gets the custom attributes for the return type. + + + + + Gets a handle to the internal metadata representation of a method. + + + + + Gets the attributes associated with this method. + + + + + Gets the class that declares this member. + + + + + Gets the name of the current member. + + + + + Gets the class object that was used to obtain this instance of MemberInfo. + + + + + When overridden in a derived class, returns the MethodInfo object for the method on the direct or indirect base class in which the method represented by this instance was first declared. + + + A MethodInfo object for the first implementation of this method. + + + + + When overridden in a derived class, returns an array of all custom attributes applied to this member. + + true to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks. + + An array that contains all the custom attributes applied to this member, or an array with zero elements if no attributes are defined. + + + + + When overridden in a derived class, returns an array of custom attributes applied to this member and identified by . + + The type of attribute to search for. Only attributes that are assignable to this type are returned. + true to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks. + + An array of custom attributes applied to this member, or an array with zero elements if no attributes assignable to have been applied. + + + + + When overridden in a derived class, returns the flags. + + + The MethodImplAttributes flags. + + + + + When overridden in a derived class, gets the parameters of the specified method or constructor. + + + An array of type ParameterInfo containing information that matches the signature of the method (or constructor) reflected by this MethodBase instance. + + + + + When overridden in a derived class, invokes the reflected method or constructor with the given parameters. + + The object on which to invoke the method or constructor. If a method is static, this argument is ignored. If a constructor is static, this argument must be null or an instance of the class that defines the constructor. + A bitmask that is a combination of 0 or more bit flags from . If is null, this parameter is assigned the value ; thus, whatever you pass in is ignored. + An object that enables the binding, coercion of argument types, invocation of members, and retrieval of MemberInfo objects via reflection. If is null, the default binder is used. + An argument list for the invoked method or constructor. This is an array of objects with the same number, order, and type as the parameters of the method or constructor to be invoked. If there are no parameters, this should be null.If the method or constructor represented by this instance takes a ByRef parameter, there is no special attribute required for that parameter in order to invoke the method or constructor using this function. Any object in this array that is not explicitly initialized with a value will contain the default value for that object type. For reference-type elements, this value is null. For value-type elements, this value is 0, 0.0, or false, depending on the specific element type. + An instance of CultureInfo used to govern the coercion of types. If this is null, the CultureInfo for the current thread is used. (This is necessary to convert a String that represents 1000 to a Double value, for example, since 1000 is represented differently by different cultures.) + + An Object containing the return value of the invoked method, or null in the case of a constructor, or null if the method's return type is void. Before calling the method or constructor, Invoke checks to see if the user has access permission and verifies that the parameters are valid.CautionElements of the array that represent parameters declared with the ref or out keyword may also be modified. + + + + + When overridden in a derived class, indicates whether one or more attributes of the specified type or of its derived types is applied to this member. + + The type of custom attribute to search for. The search includes derived types. + true to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks. + + true if one or more instances of or any of its derived types is applied to this member; otherwise, false. + + + + + Provides a methods of representing imaginary properties which are unique to serialization. + + We aggregate the PropertyInfo associated with this member and return a mangled form of the name. + + + + + + The default fake name separator string. + + + + + Initializes a new instance of the class. + + The property to alias. + The name prefix to use. + + + + Initializes a new instance of the class. + + The property to alias. + The name prefix to use. + The separator string to use. + + + + The backing PropertyInfo that is being aliased. + + + + + Gets the module in which the type that declares the member represented by the current is defined. + + + + + Gets a value that identifies a metadata element. + + + + + Gets the name of the current member. + + + + + Gets the class that declares this member. + + + + + Gets the class object that was used to obtain this instance of MemberInfo. + + + + + Gets the type of the property. + + + The type of the property. + + + + + Gets the attributes. + + + The attributes. + + + + + Gets a value indicating whether this instance can read. + + + true if this instance can read; otherwise, false. + + + + + Gets a value indicating whether this instance can write. + + + true if this instance can write; otherwise, false. + + + + + When overridden in a derived class, returns an array of all custom attributes applied to this member. + + True to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks. + + An array that contains all the custom attributes applied to this member, or an array with zero elements if no attributes are defined. + + + + + When overridden in a derived class, returns an array of custom attributes applied to this member and identified by . + + The type of attribute to search for. Only attributes that are assignable to this type are returned. + True to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks. + + An array of custom attributes applied to this member, or an array with zero elements if no attributes assignable to have been applied. + + + + + When overridden in a derived class, indicates whether one or more attributes of the specified type or of its derived types is applied to this member. + + The type of custom attribute to search for. The search includes derived types. + True to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks. + + True if one or more instances of or any of its derived types is applied to this member; otherwise, false. + + + + + Returns an array whose elements reflect the public and, if specified, non-public get, set, and other accessors of the property reflected by the current instance. + + Indicates whether non-public methods should be returned in the MethodInfo array. true if non-public methods are to be included; otherwise, false. + + An array of objects whose elements reflect the get, set, and other accessors of the property reflected by the current instance. If is true, this array contains public and non-public get, set, and other accessors. If is false, this array contains only public get, set, and other accessors. If no accessors with the specified visibility are found, this method returns an array with zero (0) elements. + + + + + When overridden in a derived class, returns the public or non-public get accessor for this property. + + Indicates whether a non-public get accessor should be returned. true if a non-public accessor is to be returned; otherwise, false. + + A MethodInfo object representing the get accessor for this property, if is true. Returns null if is false and the get accessor is non-public, or if is true but no get accessors exist. + + + + + Gets the index parameters of the property. + + The index parameters of the property. + + + + When overridden in a derived class, returns the set accessor for this property. + + Indicates whether the accessor should be returned if it is non-public. true if a non-public accessor is to be returned; otherwise, false. + + Value Condition A object representing the Set method for this property. The set accessor is public.-or- is true and the set accessor is non-public. null is true, but the property is read-only.-or- is false and the set accessor is non-public.-or- There is no set accessor. + + + + + Gets the value of the property on the given instance. + + The object to invoke the getter on. + The to invoke with. + The binder to use. + The indices to use. + The culture to use. + The value of the property on the given instance. + + + + Sets the value of the property on the given instance. + + The object to set the value on. + The value to set. + The to invoke with. + The binder to use. + The indices to use. + The culture to use. + + + + Compares objects by reference only, ignoring equality operators completely. This is used by the property tree reference dictionaries to keep track of references. + + + + + A default, cached instance of this generic variant of the reference equality comparer. + + + + + Returns true if the object references are equal. + + + + + Returns the result of the object's own GetHashCode method. + + + + + Utility class indicating current Unity version. + + + + + Tests current Unity version is equal or greater. + + Minimum major version. + Minimum minor version. + true if the current Unity version is greater. Otherwise false. + + + + The current Unity version major. + + + + + The current Unity version minor. + + + + + Contains utilities for performing common unsafe operations. + + + + + Blindly creates an array of structs from an array of bytes via direct memory copy/blit. + + + + + Blindly creates an array of structs from an array of bytes via direct memory copy/blit. + + + + + Blindly copies an array of structs into an array of bytes via direct memory copy/blit. + + + + + Blindly copies an array of structs into an array of bytes via direct memory copy/blit. + + + + + Creates a new string from the contents of a given byte buffer. + + + + + Writes the contents of a string into a given byte buffer. + + + + + Blindly mem-copies a given number of bytes from the memory location of one object to another. WARNING: This method is ridiculously dangerous. Only use if you know what you're doing. + + A Unity Behaviour which is serialized by the Sirenix serialization system. diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.xml.meta b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.xml.meta index 4e778e1..dc046e8 100644 --- a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.xml.meta +++ b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.xml.meta @@ -1,7 +1,6 @@ fileFormatVersion: 2 guid: 5f3147f7af4c49739579b966c458096f timeCreated: 1488828285 -licenseType: Store DefaultImporter: userData: assetBundleName: diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.dll b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.dll index 678f945..954d4e2 100644 Binary files a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.dll and b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.dll differ diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.dll.meta b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.dll.meta index 8da6aa3..66668bb 100644 --- a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.dll.meta +++ b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.dll.meta @@ -1,7 +1,6 @@ fileFormatVersion: 2 guid: 5c65184932ff4fd48a343e2360256baf timeCreated: 1488828285 -licenseType: Store PluginImporter: serializedVersion: 1 iconMap: {} diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.pdb b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.pdb new file mode 100644 index 0000000..ae7fe7c Binary files /dev/null and b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.pdb differ diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.pdb.meta b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.pdb.meta new file mode 100644 index 0000000..ea26291 --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.pdb.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5c65184932ff4fd48a343e2360250a6f +timeCreated: 1488828285 +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.xml b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.xml index e186c0c..970a2b1 100644 --- a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.xml +++ b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.xml @@ -329,7 +329,7 @@ - Gets an icon of a lock unloacked symbol. + Gets an icon of a lock unlocked symbol. Obsolete; use the correctly spelled LockUnlocked instead. @@ -682,6 +682,21 @@ Gets an icon of a unity folder. + + + Gets the dark mode version of the ObjectFieldButton texture. + + + + + Gets the light mode version of the ObjectFieldButton texture. + + + + + Gets the ObjectFieldButton texture based on the current active theme. + + Lazy loading Editor Icon. @@ -712,11 +727,42 @@ Not yet documented. + + + Gets a texture of an odin logo symbol. + + + + + Gets a texture of an odin inspector logo symbol. + + + + + Gets a texture of an odin serializer logo symbol. + + + + + Gets a texture of an odin validator logo symbol. + + + + + Gets a texture of an odin validator black symbol. + + Utility for parsing and emitting expression delegates. + + + The time that the expression cache waits to clear expressions + since the last time they have been used. + + Parses an expression and tries to emit a delegate method. The expression to parse. @@ -972,6 +1018,32 @@ Not yet documented. + + + This class is due to undergo refactoring. Use the new DragAndDropUtilities instead. + + + + + + This class is due to undergo refactoring. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + Drag and drop utilities for both Unity and non-unity objects. @@ -1027,14 +1099,24 @@ Draws the graphics for a DropZone. + + + Draws the graphics for a DropZone. + + A draggable zone for both Unity and non-unity objects. + + + A draggable zone for both Unity and non-unity objects. + + - A drop zone area for bot Unity and non-unity objects. + A drop zone area for both Unity and non-unity objects. @@ -1097,11 +1179,64 @@ A draggable zone for both Unity and non-unity objects. + + + This class is due to undergo refactoring. + + + + + This class is due to undergo refactoring. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + This class is due to undergo refactoring. + + + + + This class is due to undergo refactoring. + + Collection of extension methods for . + + + Returns true when the users mouse is hovering over the specified + + The . + The to check. + true if the mouse is over the specified otherwise false. + Returns true when the user presses the specified mouse button. @@ -1250,303 +1385,6 @@ True if an item was replaced, otherwise false. - - - This class is due to undergo refactoring. - - - - - The value. - - - - - Performs an implicit conversion from to . - - - - - How the square object field should be aligned. - - - - - - Left aligned. - - - - - Centered. - - - - - Right aligned. - - - - - This class is due to undergo refactoring. Use the new DragAndDropUtilities instead. - - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - This class is due to undergo refactoring. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - This class is due to undergo refactoring. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - This class is due to undergo refactoring. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - This class is due to undergo refactoring. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - Not yet documented. - - - - - This class is due to undergo refactoring. - - Emitted wrapper for the internal "UnityEngine.GUIClip" class. @@ -1586,483 +1424,19 @@ The rect. - + - A helper class to control paging of n number of elements in various situations. + This class is due to undergo refactoring. - + - Disables the paging, and show all elements. + The value. - + - Initializes a new instance of the class. - - - - - Updates all values based on and . - - - Call update right before using and in your for loop. - - The total number of elements to apply paging for. - - - - Gets or sets a value indicating whether this instance is enabled. - - - true if this instance is enabled; otherwise, false. - - - - - Gets a value indicating whether this instance is on the frist page. - - - true if this instance is on frist page; otherwise, false. - - - - - Gets a value indicating whether this instance is on the last page. - - - true if this instance is on last page; otherwise, false. - - - - - Gets or sets the number of items per page. - - - The number of items pr page. - - - - - Gets or sets the current page. - - - The current page. - - - - - Gets the start index. - - - The start index. - - - - - Gets the end index. - - - The end index. - - - - - Gets or sets the page count. - - - The page count. - - - - - Gets the total number of elements. - Use to change the value. - - - - - Draws right-aligned toolbar paging buttons. - - - - - A Utility class for creating tables in Unity's editor GUI. - A table can either be created from scratch using new GUITable(xCount,yCount), or created using one of the static GUITable.Create overloads. - See the online documentation, for examples and more information. - - - Creating a matrix table for a two-dimentional array. - - private GUITable table; - - private void Init() - { - bool[,] boolArr = new bool[20,20]; - - this.table = GUITable.Create( - twoDimArray: boolArr, - drawElement: (rect, x, y) => boolArr[x, y] = EditorGUI.Toggle(rect, boolArr[x, y]), - horizontalLabel: "Optional Horizontal Label", // horizontalLabel is optional and can be null. - columnLabels: (rect, x) => GUI.Label(rect, x.ToString()), // columnLabels is optional and can be null. - verticalLabel: "Optional Vertical Label", // verticalLabel is optional and can be null. - rowLabels: (rect, x) => GUI.Label(rect, x.ToString()) // rowLabels is optional and can be null. - ); - } - - private void OnGUI() - { - this.table.DrawTable(); - } - - - - Creating a table for a list. - - private GUITable table; - - private void Init() - { - Listt<SomeClasst> someList = new List<SomeClass>() { new SomeClass(), new SomeClass(), new SomeClass() }; - - this.table = GUITable.Create(someList, "Optional Title", - new GUITableColumn() - { - ColumnTitle = "A", - OnGUI = (rect, i) => someList[i].A = EditorGUI.TextField(rect, someList[i].A), - Width = 200, - MinWidth = 100, - }, - new GUITableColumn() - { - ColumnTitle = "B", - OnGUI = (rect, i) => someList[i].B = EditorGUI.IntField(rect, someList[i].B), - Resizable = false, - }, - new GUITableColumn() - { - ColumnTitle = "C", - OnGUI = (rect, i) => someList[i].C = EditorGUI.IntField(rect, someList[i].C), - SpanColumnTitle = true, - } - ); - } - - private void OnGUI() - { - this.table.DrawTable(); - } - - private class SomeClass - { - public string A; - public int B; - public int C; - public int D; - } - - - - Styling a cell. - Each has two events, OnGUI and OnGUIStyle. OnGUIStyle is called right before OnGUI, but only in repaint events. - - guiTable[x,y].GUIStyle += rect => EditorGUI.DrawRect(rect, Color.red); - - - - Row and column span. - A cell will span and cover all neighbour cells that are null. - - // Span horizontally: - guiTable[x - 2,y] = null; - guiTable[x - 1,y] = null; - guiTable[x,y].SpanX = true; - guiTable[x + 1,y] = null; - - // Span vertically: - guiTable[x,y - 2] = null; - guiTable[x,y - 1] = null; - guiTable[x,y].SpanY = true; - guiTable[x,y + 1] = null; - - - - - - - - The row count. - - - - - The column count. - - - - - The Table Rect. - - - - - Whether to respect the current GUI indent level. - - - - - Gets or sets a from the . - - - - - Initializes a new instance of the class. - - - - - Draws the table. - - - - - Recaluclates cell and column sizes in the next frame. - - - - - Recalculates the layout for the entire table. - This method gets called whenever the table is initialized, resized or adjusted. If you are manipulating - the width or height of individual table cells, remember to call this method when you're done. - - - - - Creates a table. - - - - - Creates a table. - - - - - Creates a table. - - - - - Creates a table. - - - - - A cell of a - - - - - The minimum width. - - - - - The width of the cell. Default is width is 0. - The width the column is determained by the widest cell in the column. - Width = 0 = auto. - - - - - The height of the cell. Default is height is 22. - The height the column is determained by the tallest cell in the row. - - - - - If true, the cell will expand vertically, covering all neighbour null cells. - - - - - If true, the cell will expand horizontally, covering all neighbour null cells. - - - - - The table column index. - - - - - The table row index. - - - - - The GUI style - - - - - Gets the rect. - - - - - GUITableColumns used creating a table list using GUITable.Create(). - - - - - - - Draws a cell at the given row index for this column. - - - - - The column title text. If there are is columns with a title, there we not be rendered an additional table row for column titles. - - - - - The minimum with of the column. - - - - - The width of the Column. - 0 = auto, and is also the default. - - - - - If true, the column becomes resiziable. - Default is true. - - - - - If true, the column title cell, will span horizontally to neighbour columns, which column titles are null. - Default is false. - - - - - The GUITabGroup is a utility class to draw animated tab groups. - - - - var tabGroup = SirenixEditorGUI.CreateAnimatedTabGroup(someKey); - // Register your tabs before starting BeginGroup. - var tab1 = tabGroup.RegisterTab("tab 1"); - var tab2 = tabGroup.RegisterTab("tab 2"); - - tabGroup.BeginGroup(drawToolbar: true); - { - if (tab1.BeginPage()) - { - // Draw GUI for the first tab page; - } - tab1.EndPage(); - - if (tab2.BeginPage()) - { - // Draw GUI for the second tab page; - } - tab2.EndPage(); - } - tabGroup.EndGroup(); - - // Control the animation speed. - tabGroup.AnimationSpeed = 0.2f; - - // If true, the tab group will have the height equal to the biggest page. Otherwise the tab group will animate in height as well when changing page. - tabGroup.FixedHeight = true; - - // You can change page by calling: - tabGroup.GoToNextPage(); - tabGroup.GoToPreviousPage(); - - - - - - - The animation speed (1 / s) - - - - - The animation speed - - - - - Gets the outer rect of the entire tab group. - - - - - The inner rect of the current tab page. - - - - - If true, the tab group will have the height equal to the biggest page. Otherwise the tab group will animate in height as well when changing page. - - - Sets the current page. - - The page to switch to. - - - - Gets the current page. - - - - - Gets the t. - - - - - The height of the tab buttons. - - - - - Registers the tab. - - - - - Begins the group. - - if set to true a tool-bar for changing pages is drawn. - The style. - - - - Ends the group. - - - - - Goes to page. - - - - - Goes to next page. - - - - - Goes to previous page. + Performs an implicit conversion from to . @@ -2153,7 +1527,7 @@ Odin will set this for you whenever an Odin property tree is drawn. - But if you're using BetterLabelWidth and BetterContextWidth without Odin, then + But if you're using BetterLabelWidth and BetterContextWidth without Odin, then you need to set BetterContextWidth in the beginning of each GUIEvent. @@ -2197,7 +1571,7 @@ The ID of the current editor window. - + Gets a value indicating whether a repaint has been requested. @@ -2215,6 +1589,11 @@ Requests a repaint. + + + Calls , if the is not NULL. + + Requests a repaint. @@ -2222,12 +1601,23 @@ - Begins the layout measuring. Remember to end with . + Begins the layout measuring. Remember to end with . + + + Begins the layout measuring. Remember to end with . + + + + + Ends the layout measuring started by + + The measured rect. + - Ends the layout measuring started by + Ends the layout measuring started by The measured rect. @@ -2607,6 +1997,651 @@ + + + Gets a preview texture for the provided object. + + + + + + + Measures the size of a given , if it would be presented with this . + + The to present the as. + The to measure. + A consisting of the width () & height (), as the size of the in GUI-space. + + + + Measures the height of a given , if it would be presented with this . + + The to present the as. + The to measure. + The width of the area the is being presented in. + The height of the . + + + + Measures the width of a given , if it would be presented with this . + + The to present the as. + The to measure. + The width of the . + + + + Measures the width of a given , if it would be presented with this . + + The to present the as. + The to measure. + The width of the . + + + + Measures the min- & max width of a given , if it would be presented with this . + + The to present the as. + The to measure. + The minimum width of the . + The maximum width of the . + The min- & max width of the , as out parameters. + + + + A helper class to control paging of n number of elements in various situations. + + + + + Disables the paging, and show all elements. + + + + + Initializes a new instance of the class. + + + + + Updates all values based on and . + + + Call update right before using and in your for loop. + + The total number of elements to apply paging for. + + + + Gets or sets a value indicating whether this instance is enabled. + + + true if this instance is enabled; otherwise, false. + + + + + Gets a value indicating whether this instance is on the frist page. + + + true if this instance is on frist page; otherwise, false. + + + + + Gets a value indicating whether this instance is on the last page. + + + true if this instance is on last page; otherwise, false. + + + + + Gets or sets the number of items per page. + + + The number of items pr page. + + + + + Gets or sets the current page. + + + The current page. + + + + + Gets the start index. + + + The start index. + + + + + Gets the end index. + + + The end index. + + + + + Gets or sets the page count. + + + The page count. + + + + + Gets the total number of elements. + Use to change the value. + + + + + Draws right-aligned toolbar paging buttons. + + + + + The GUITabGroup is a utility class to draw animated tab groups. + + + + var tabGroup = SirenixEditorGUI.CreateAnimatedTabGroup(someKey); + // Register your tabs before starting BeginGroup. + var tab1 = tabGroup.RegisterTab("tab 1"); + var tab2 = tabGroup.RegisterTab("tab 2"); + + tabGroup.BeginGroup(drawToolbar: true); + { + if (tab1.BeginPage()) + { + // Draw GUI for the first tab page; + } + tab1.EndPage(); + + if (tab2.BeginPage()) + { + // Draw GUI for the second tab page; + } + tab2.EndPage(); + } + tabGroup.EndGroup(); + + // Control the animation speed. + tabGroup.AnimationSpeed = 0.2f; + + // If true, the tab group will have the height equal to the biggest page. Otherwise the tab group will animate in height as well when changing page. + tabGroup.FixedHeight = true; + + // You can change page by calling: + tabGroup.GoToNextPage(); + tabGroup.GoToPreviousPage(); + + + + + + + The animation speed + + + + + Gets the outer rect of the entire tab group. + + + + + The inner rect of the current tab page. + + + + + If true, the tab group will have the height equal to the biggest page. Otherwise the tab group will animate in height as well when changing page. + + + Sets the current page. + + The page to switch to. + + + + Gets the current page. + + + + + Gets the t. + + + + + The height of the tab buttons. + + + + + Registers the tab. + + + + + Begins the group. + + if set to true a tool-bar for changing pages is drawn. + The style. + + + + Ends the group. + + + + + Goes to page. + + + + + Goes to next page. + + + + + Goes to previous page. + + + + + A Utility class for creating tables in Unity's editor GUI. + A table can either be created from scratch using new GUITable(xCount,yCount), or created using one of the static GUITable.Create overloads. + See the online documentation, for examples and more information. + + + Creating a matrix table for a two-dimentional array. + + private GUITable table; + + private void Init() + { + bool[,] boolArr = new bool[20,20]; + + this.table = GUITable.Create( + twoDimArray: boolArr, + drawElement: (rect, x, y) => boolArr[x, y] = EditorGUI.Toggle(rect, boolArr[x, y]), + horizontalLabel: "Optional Horizontal Label", // horizontalLabel is optional and can be null. + columnLabels: (rect, x) => GUI.Label(rect, x.ToString()), // columnLabels is optional and can be null. + verticalLabel: "Optional Vertical Label", // verticalLabel is optional and can be null. + rowLabels: (rect, x) => GUI.Label(rect, x.ToString()) // rowLabels is optional and can be null. + ); + } + + private void OnGUI() + { + this.table.DrawTable(); + } + + + + Creating a table for a list. + + private GUITable table; + + private void Init() + { + Listt<SomeClasst> someList = new List<SomeClass>() { new SomeClass(), new SomeClass(), new SomeClass() }; + + this.table = GUITable.Create(someList, "Optional Title", + new GUITableColumn() + { + ColumnTitle = "A", + OnGUI = (rect, i) => someList[i].A = EditorGUI.TextField(rect, someList[i].A), + Width = 200, + MinWidth = 100, + }, + new GUITableColumn() + { + ColumnTitle = "B", + OnGUI = (rect, i) => someList[i].B = EditorGUI.IntField(rect, someList[i].B), + Resizable = false, + }, + new GUITableColumn() + { + ColumnTitle = "C", + OnGUI = (rect, i) => someList[i].C = EditorGUI.IntField(rect, someList[i].C), + SpanColumnTitle = true, + } + ); + } + + private void OnGUI() + { + this.table.DrawTable(); + } + + private class SomeClass + { + public string A; + public int B; + public int C; + public int D; + } + + + + Styling a cell. + Each has two events, OnGUI and OnGUIStyle. OnGUIStyle is called right before OnGUI, but only in repaint events. + + guiTable[x,y].GUIStyle += rect => EditorGUI.DrawRect(rect, Color.red); + + + + Row and column span. + A cell will span and cover all neighbour cells that are null. + + // Span horizontally: + guiTable[x - 2,y] = null; + guiTable[x - 1,y] = null; + guiTable[x,y].SpanX = true; + guiTable[x + 1,y] = null; + + // Span vertically: + guiTable[x,y - 2] = null; + guiTable[x,y - 1] = null; + guiTable[x,y].SpanY = true; + guiTable[x,y + 1] = null; + + + + + + + + The row count. + + + + + The column count. + + + + + The Table Rect. + + + + + Whether to respect the current GUI indent level. + + + + + Gets or sets a from the . + + + + + Initializes a new instance of the class. + + + + + Draws the table. + + + + + Recaluclates cell and column sizes in the next frame. + + + + + Recalculates the layout for the entire table. + This method gets called whenever the table is initialized, resized or adjusted. If you are manipulating + the width or height of individual table cells, remember to call this method when you're done. + + + + + Creates a table. + + + + + Creates a table. + + + + + Creates a table. + + + + + Creates a table. + + + + + A cell of a + + + + + The minimum width. + + + + + The width of the cell. Default is width is 0. + The width the column is determained by the widest cell in the column. + Width = 0 = auto. + + + + + The height of the cell. Default is height is 22. + The height the column is determained by the tallest cell in the row. + + + + + If true, the cell will expand vertically, covering all neighbour null cells. + + + + + If true, the cell will expand horizontally, covering all neighbour null cells. + + + + + The table column index. + + + + + The table row index. + + + + + The GUI style + + + + + Gets the rect. + + + + + GUITableColumns used creating a table list using GUITable.Create(). + + + + + + + Draws a cell at the given row index for this column. + + + + + The column title text. If there are is columns with a title, there we not be rendered an additional table row for column titles. + + + + + The minimum with of the column. + + + + + The width of the Column. + 0 = auto, and is also the default. + + + + + If true, the column becomes resiziable. + Default is true. + + + + + If true, the column title cell, will span horizontally to neighbour columns, which column titles are null. + Default is false. + + + + + Whether to draw a draw scroll view. + + + + + The number of pixels before a scroll view appears. + + + + + The maximum scroll view height. + + + + + The scroll position + + + + + The cell style + + + + + Gets the rect containing all rows. + + + + + Gets the first visible row index. + + + + + Gets the last visible row index. + + + + + Gets the outer rect. The height of this <= .height. + + + + + Gets the row rect. + + + + + Begins the table. + + + + + Begins the column. + + + + + Begins the cell. + + + + + Ends the cell. + + + + + Ends the column. + + + + + Ends the table. + + + + + A tab page created by . + + + + + + Begins the page. + + + + + Ends the page. + + + + Temporary. + This implementation will get refactored. + + + + How the square object field should be aligned. + + + + + + Left aligned. + + + + + Centered. + + + + + Right aligned. + + Configuration for progress bar fields. @@ -2680,6 +2715,11 @@ Draw the quaternion as raw x, y, z and w values. + + Initializes the and creates a permanent ID for the Control. + If you create this on a such as , + make sure to initialize this during OnEnable to ensure it gets initialized correctly. + Field drawing functions for various types. @@ -2774,6 +2814,13 @@ If you hold down control while letting go it will replace the value, And you can control + click the object field to quickly delete the value it holds. + + + Draws a square ObjectField which renders a preview for UnityEngine.Object types. + This object field also adds support for drag and drop, dragging an object to another square object field, swaps the values. + If you hold down control while letting go it will replace the value, And you can control + click the object field to quickly delete the value it holds. + + Draws a square ObjectField which renders a preview for UnityEngine.Object types. @@ -2794,6 +2841,20 @@ Wheather or not to allow scene objects. How the square object field should be aligned. + + + Draws a square ObjectField which renders a preview for UnityEngine.Object types. + This object field also adds support for drag and drop, dragging an object to another square object field, swaps the values. + If you hold down control while letting go it will replace the value, And you can control + click the object field to quickly delete the value it holds. + + Position and size of the field. + The label to use, or null if no label should be used. + The Unity object. + The Texture to be used as the preview. + The Unity object type. This supports inheritance. + Wheather or not to allow scene objects. + How the square object field should be aligned. + Draws a square ObjectField which renders a preview for UnityEngine.Object types. @@ -2832,6 +2893,20 @@ The height or size of the square object field. How the square object field should be aligned. + + + Draws a square ObjectField which renders a preview for UnityEngine.Object types. + This object field also adds support for drag and drop, dragging an object to another square object field, swaps the values. + If you hold down control while letting go it will replace the value, And you can control + click the object field to quickly delete the value it holds. + + The label to use, or null if no label should be used. + The Unity object. + The texture to be used as the preview. + The Unity object type. This supports inheritance. + Wheather or not to allow scene objects. + The height or size of the square object field. + How the square object field should be aligned. + Draws a square ObjectField which renders a preview for UnityEngine.Object types. @@ -2867,6 +2942,17 @@ Wheather or not to allow scene objects. Layout options. + + + Draws a polymorphic ObjectField. + + The label to use, or null if no label should be used. + The value. + The object type. This supports inheritance. + The title to be shown in the object picker. + Wheather or not to allow scene objects. + Layout options. + Draws a polymorphic ObjectField. @@ -2896,6 +2982,16 @@ Wheather or not to allow scene objects. Layout options. + + + Draws a polymorphic ObjectField. + + The value. + The object type. This supports inheritance. + The title to be shown in the object picker. + Wheather or not to allow scene objects. + Layout options. + Draws a field for a layer mask. @@ -4250,7 +4346,7 @@ Layout options. Value assigned to the field. - + Draws a field that lets the user select a path to a file. @@ -4261,9 +4357,10 @@ Comma separated list of allowed file extensions. Use null to allow any file extension. If true the path will be absolute. Otherwise the path will be relative to parentPath or to the Unity project directory. If true the path will be enforced to use backslashes. Otherwise the path will be enforced to use forward slashes. + If true the file path will include the file's extension. A path to a file. - + Draws a field that lets the user select a path to a file. @@ -4273,6 +4370,7 @@ Comma separated list of allowed file extensions. Use null to allow any file extension. If true the path will be absolute. Otherwise the path will be relative to parentPath or to the Unity project directory. If true the path will be enforced to use backslashes. Otherwise the path will be enforced to use forward slashes. + If true the file path will include the file's extension. A path to a file. @@ -4288,6 +4386,33 @@ Layout options. A path to a file. + + + Draws a field that lets the user select a path to a file. + + Label of field. Set to null for no label. + The current value. + A parent path the path needs to be relative to. Use null for Unity project directory. + Comma separated list of allowed file extensions. Use null to allow any file extension. + If true the path will be absolute. Otherwise the path will be relative to parentPath or to the Unity project directory. + If true the path will be enforced to use backslashes. Otherwise the path will be enforced to use forward slashes. + Layout options. + If true the file path will include the file's extension. + A path to a file. + + + + Draws a field that lets the user select a path to a file. + + The current value. + A parent path the path needs to be relative to. Use null for Unity project directory. + Comma separated list of allowed file extensions. Use null to allow any file extension. + If true the path will be absolute. Otherwise the path will be relative to parentPath or to the Unity project directory. + If true the path will be enforced to use backslashes. Otherwise the path will be enforced to use forward slashes. + Layout options. + If true the file path will include the file's extension. + A path to a file. + Draws a field that lets the user select a path to a file. @@ -5280,6 +5405,1209 @@ Layout options. true when the user has changed the selection. Otherwise false. + + + Draws a decimal field that supports Odin expressions. + + Context for expression support. + Position and size of the field. + Label of field. Set to null for no label. + Current value. + GUIStyle for drawing the field. Set to null for default. + Value assigned to the field. + + + + Draws a decimal field that supports Odin expressions. + + Context for expression support. + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a decimal field that supports Odin expressions. + + Context for expression support. + Position and size of the field. + Current value. + Value assigned to the field. + + + + Draws a decimal field that supports Odin expressions. + + Context for expression support. + Label of field. Set to null for no label. + Current value. + GUIStyle for drawing the field. Set to null for default. + Layout options. + Value assigned to the field. + + + + Draws a decimal field that supports Odin expressions. + + Context for expression support. + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a decimal field that supports Odin expressions. + + Context for expression support. + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a decimal field that supports Odin expressions. + + Context for expression support. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a double field that supports Odin expressions. + + Context for expression support. + Position and size of the field. + Label of field. Set to null for no label. + Current value. + GUIStyle for drawing the field. Set to null for default. + Value assigned to the field. + + + + Draws a double field that supports Odin expressions. + + Context for expression support. + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a double field that supports Odin expressions. + + Context for expression support. + Current value. + Value assigned to the field. + + + + Draws a double field that supports Odin expressions. + + Context for expression support. + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a double field that supports Odin expressions. + + Context for expression support. + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a double field that supports Odin expressions. + + Context for expression support. + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a double field that supports Odin expressions. + + Context for expression support. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a float field that supports Odin expressions. + + Context for expression support. + Position and size of the field. + Label of field. Set to null for no label. + Current value. + GUIStyle for drawing the field. Set to null for default. + Value assigned to the field. + + + + Draws a float field that supports Odin expressions. + + Context for expression support. + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a float field that supports Odin expressions. + + Context for expression support. + Current value. + Value assigned to the field. + + + + Draws a float field that supports Odin expressions. + + Context for expression support. + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a float field that supports Odin expressions. + + Context for expression support. + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a float field that supports Odin expressions. + + Context for expression support. + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a float field that supports Odin expressions. + + Context for expression support. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a long field that supports Odin expressions. + + Context for expression support. + Position and size of the field. + Label of field. Set to null for no label. + Current value. + GUIStyle for drawing the field. Set to null for default. + Value assigned to the field. + + + + Draws a long field that supports Odin expressions. + + Context for expression support. + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a long field that supports Odin expressions. + + Context for expression support. + Current value. + Value assigned to the field. + + + + Draws a long field that supports Odin expressions. + + Context for expression support. + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a long field that supports Odin expressions. + + Context for expression support. + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a long field that supports Odin expressions. + + Context for expression support. + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a long field that supports Odin expressions. + + Context for expression support. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a int field that supports Odin expressions. + + Context for expression support. + Position and size of the field. + Label of field. Set to null for no label. + Current value. + GUIStyle for drawing the field. Set to null for default. + Value assigned to the field. + + + + Draws a int field that supports Odin expressions. + + Context for expression support. + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a int field that supports Odin expressions. + + Context for expression support. + Current value. + Value assigned to the field. + + + + Draws a int field that supports Odin expressions. + + Context for expression support. + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a int field that supports Odin expressions. + + Context for expression support. + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a int field that supports Odin expressions. + + Context for expression support. + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a int field that supports Odin expressions. + + Context for expression support. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a decimal field that supports unit conversions and Odin expressions. + + Context for expression support. + Position and size of the field. + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + GUIStyle for drawing the field. Set to null for default. + Value assigned to the field. + + + + Draws a decimal field that supports unit conversions and Odin expressions. + + Context for expression support. + Position and size of the field. + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Value assigned to the field. + + + + Draws a decimal field that supports unit conversions and Odin expressions. + + Context for expression support. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Value assigned to the field. + + + + Draws a decimal field that supports unit conversions and Odin expressions. + + Context for expression support. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Value assigned to the field. + + + + Draws a decimal field that supports unit conversions and Odin expressions. + + Context for expression support. + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Layout options. + Value assigned to the field. + + + + Draws a decimal field that supports unit conversions and Odin expressions. + + Context for expression support. + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Layout options. + Value assigned to the field. + + + + Draws a decimal field that supports unit conversions and Odin expressions. + + Context for expression support. + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Layout options. + Value assigned to the field. + + + + Draws a decimal field that supports unit conversions and Odin expressions. + + Context for expression support. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Layout options. + Value assigned to the field. + + + + Draws a decimal field that supports unit conversions. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + GUIStyle for drawing the field. Set to null for default. + Value assigned to the field. + + + + Draws a decimal field that supports unit conversions. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Value assigned to the field. + + + + Draws a decimal field that supports unit conversions. + + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Value assigned to the field. + + + + Draws a decimal field that supports unit conversions. + + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Value assigned to the field. + + + + Draws a decimal field that supports unit conversions. + + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Layout options. + Value assigned to the field. + + + + Draws a decimal field that supports unit conversions. + + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Layout options. + Value assigned to the field. + + + + Draws a decimal field that supports unit conversions. + + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Layout options. + Value assigned to the field. + + + + Draws a decimal field that supports unit conversions. + + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Layout options. + Value assigned to the field. + + + + Draws a double field that supports unit conversions and Odin expressions. + + Context for expression support. + Position and size of the field. + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + GUIStyle for drawing the field. Set to null for default. + Value assigned to the field. + + + + Draws a double field that supports unit conversions and Odin expressions. + + Context for expression support. + Position and size of the field. + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Value assigned to the field. + + + + Draws a double field that supports unit conversions and Odin expressions. + + Context for expression support. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Value assigned to the field. + + + + Draws a double field that supports unit conversions and Odin expressions. + + Context for expression support. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Value assigned to the field. + + + + Draws a double field that supports unit conversions and Odin expressions. + + Context for expression support. + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Layout options. + Value assigned to the field. + + + + Draws a double field that supports unit conversions and Odin expressions. + + Context for expression support. + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Layout options. + Value assigned to the field. + + + + Draws a double field that supports unit conversions and Odin expressions. + + Context for expression support. + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Layout options. + Value assigned to the field. + + + + Draws a double field that supports unit conversions and Odin expressions. + + Context for expression support. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Layout options. + Value assigned to the field. + + + + Draws a float field that supports unit conversions and Odin expressions. + + Context for expression support. + Position and size of the field. + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + GUIStyle for drawing the field. Set to null for default. + Value assigned to the field. + + + + Draws a float field that supports unit conversions and Odin expressions. + + Context for expression support. + Position and size of the field. + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Value assigned to the field. + + + + Draws a float field that supports unit conversions and Odin expressions. + + Context for expression support. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Value assigned to the field. + + + + Draws a float field that supports unit conversions and Odin expressions. + + Context for expression support. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Value assigned to the field. + + + + Draws a float field that supports unit conversions and Odin expressions. + + Context for expression support. + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Layout options. + Value assigned to the field. + + + + Draws a float field that supports unit conversions and Odin expressions. + + Context for expression support. + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Layout options. + Value assigned to the field. + + + + Draws a float field that supports unit conversions and Odin expressions. + + Context for expression support. + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Layout options. + Value assigned to the field. + + + + Draws a float field that supports unit conversions and Odin expressions. + + Context for expression support. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Layout options. + Value assigned to the field. + + + + Draws a float field that supports unit conversions. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + GUIStyle for drawing the field. Set to null for default. + Value assigned to the field. + + + + Draws a float field that supports unit conversions. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Value assigned to the field. + + + + Draws a float field that supports unit conversions. + + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Value assigned to the field. + + + + Draws a float field that supports unit conversions. + + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Value assigned to the field. + + + + Draws a float field that supports unit conversions. + + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Layout options. + Value assigned to the field. + + + + Draws a float field that supports unit conversions. + + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Layout options. + Value assigned to the field. + + + + Draws a float field that supports unit conversions. + + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Layout options. + Value assigned to the field. + + + + Draws a float field that supports unit conversions. + + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Layout options. + Value assigned to the field. + + + + Draws a double field that supports unit conversions. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + GUIStyle for drawing the field. Set to null for default. + Value assigned to the field. + + + + Draws a double field that supports unit conversions. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Value assigned to the field. + + + + Draws a double field that supports unit conversions. + + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Value assigned to the field. + + + + Draws a double field that supports unit conversions. + + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Value assigned to the field. + + + + Draws a double field that supports unit conversions. + + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Layout options. + Value assigned to the field. + + + + Draws a double field that supports unit conversions. + + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Layout options. + Value assigned to the field. + + + + Draws a double field that supports unit conversions. + + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Layout options. + Value assigned to the field. + + + + Draws a double field that supports unit conversions. + + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Layout options. + Value assigned to the field. + + + + Draws a long field that supports unit conversions and Odin expressions. + + Context for expression support. + Position and size of the field. + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + GUIStyle for drawing the field. Set to null for default. + Value assigned to the field. + + + + Draws a long field that supports unit conversions and Odin expressions. + + Context for expression support. + Position and size of the field. + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Value assigned to the field. + + + + Draws a long field that supports unit conversions and Odin expressions. + + Context for expression support. + Position and size of the field. + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Value assigned to the field. + + + + Draws a long field that supports unit conversions and Odin expressions. + + Context for expression support. + Position and size of the field. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Value assigned to the field. + + + + Draws a long field that supports unit conversions and Odin expressions. + + Context for expression support. + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Layout options. + Value assigned to the field. + + + + Draws a long field that supports unit conversions and Odin expressions. + + Context for expression support. + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Layout options. + Value assigned to the field. + + + + Draws a long field that supports unit conversions and Odin expressions. + + Context for expression support. + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Layout options. + Value assigned to the field. + + + + + Draws a long field that supports unit conversions. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + GUIStyle for drawing the field. Set to null for default. + Value assigned to the field. + + + + Draws a long field that supports unit conversions. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Value assigned to the field. + + + + Draws a long field that supports unit conversions. + + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Value assigned to the field. + + + + Draws a long field that supports unit conversions. + + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Value assigned to the field. + + + + Draws a long field that supports unit conversions. + + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Layout options. + Value assigned to the field. + + + + Draws a long field that supports unit conversions. + + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Layout options. + Value assigned to the field. + + + + Draws a long field that supports unit conversions. + + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Layout options. + Value assigned to the field. + + + + Draws a long field that supports unit conversions. + + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Layout options. + Value assigned to the field. + + + + Draws a int field that supports unit conversions and Odin expressions. + + Context for expression support. + Position and size of the field. + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + GUIStyle for drawing the field. Set to null for default. + Value assigned to the field. + + + + Draws a int field that supports unit conversions and Odin expressions. + + Context for expression support. + Position and size of the field. + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Value assigned to the field. + + + + Draws a int field that supports unit conversions and Odin expressions. + + Context for expression support. + Position and size of the field. + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Value assigned to the field. + + + + Draws a int field that supports unit conversions and Odin expressions. + + Context for expression support. + Position and size of the field. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Value assigned to the field. + + + + Draws a int field that supports unit conversions and Odin expressions. + + Context for expression support. + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Layout options. + Value assigned to the field. + + + + Draws a int field that supports unit conversions and Odin expressions. + + Context for expression support. + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Layout options. + Value assigned to the field. + + + + Draws a int field that supports unit conversions and Odin expressions. + + Context for expression support. + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Layout options. + Value assigned to the field. + + + + + Draws a int field that supports unit conversions. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + GUIStyle for drawing the field. Set to null for default. + Value assigned to the field. + + + + Draws a int field that supports unit conversions. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Value assigned to the field. + + + + Draws a int field that supports unit conversions. + + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Value assigned to the field. + + + + Draws a int field that supports unit conversions. + + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Value assigned to the field. + + + + Draws a int field that supports unit conversions. + + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Layout options. + Value assigned to the field. + + + + Draws a int field that supports unit conversions. + + Label of field. Set to null for no label. + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Layout options. + Value assigned to the field. + + + + Draws a int field that supports unit conversions. + + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Layout options. + Value assigned to the field. + + + + Draws a int field that supports unit conversions. + + Current value. + UnitInfo of the value and return value. Must have same UnitCategory as displayUnitInfo. + UnitInfo of the displayed value in the field, converted from baseUnitInfo. Must have same UnitCategory as baseUnitInfo. + Layout options. + Value assigned to the field. + Draws a dropdown field for enum masks. @@ -5352,6 +6680,72 @@ Layout options. Value assigned to the field. + + + Wrapper for Unity's ExpressionEvaluator. It was moved from UnityEditor to UnityEngine in version 2023 and + that *should* have been automatically fixed by the AssemblyUpdater, but that broke for one reason or another. + + + + + Type containing the necessary components to use C# expressions in fields. + + + // Creating and using a context with for a static type. + FieldExpressionContext context = FieldExpressionContext.StaticExpression(typeof(MyStaticType)); + + SirenixEditorFields.SmartIntField(context, ...); + + + // Creating and using a context with an instanced type. + FieldExpressionContext context = FieldExpressionContext.InstanceContext(myInstance); + + SirenixEditorFields.SmartIntField(context, ...); + + + // Creating and using context with an InspectorProperty, for example, in a custom Odin drawer. + FieldExpressionContext context = property.ToFieldExpressionContext(); + + SirenixEditorFields.SmartIntField(context, ...); + + + + + Target instance for field expressions. + + + + + Target type for expressions. + + + + + Indicates if the expressions targets a static type or not. + + + + + Creates an expression context that targets nothing. Expressions are still possible, but no members can be accessed, and only static method can be called. + + FieldExpresionContext target targets nothing. + + + + Creates an expression context that targets the provided instance. Expression can access members of the instance. + + The instance for the context to target. + FieldExpressionContext that targets an instance. + Throws if instance is null. + + + + Creates an expression context that targets the provided type. Only static members can be accessed. + + The type to target. + FieldExpressionContext that targets a static type. + Throws if type is null. + Collection of various editor GUI functions. @@ -5510,7 +6904,25 @@ Type of the message. If set to true the message box will be wide. - + + + Draws a message box. + + The message. + Type of the message. + The style. + If set to true the message box will be wide. + + + + Draws a message box. + + The message. + Type of the message. + The style. + If set to true the message box will be wide. + + Draws a message box. @@ -5530,6 +6942,16 @@ If set to true the message box will be wide. State of isFolded. + + + Draws a message box with the specified icon. + + The message to be displayed. + The icon to be displayed. + The color of the icon. + The style of the message box. + The action to be invoked if the message box is right-clicked. + Draws a horizontal line separator. @@ -5668,6 +7090,147 @@ The height of the button. true while the button is active. Otherwise false. + + + Draws a SDF icon button. + + The button's label. + The button's height. + The button's icon. + The button's icon alignment. ButtonIconAlignment.LeftOfText by default. + The button's style. + + + + + Draws a SDF icon button. + + The button's label. + The button's height. + The button's icon. + The button's icon alignment. ButtonIconAlignment.LeftOfText by default. + The button's style. + + + + + Draws a SDF icon button. + + The button's label. + The button's height. + The button's icon. + The button's icon alignment. ButtonIconAlignment.LeftOfText by default. + The button's style. + + + + + Draws a SDF icon button. + + The button's label. + The button's height. + The button's icon. + The button's icon alignment. ButtonIconAlignment.LeftOfText by default. + The button's style. + + + + + Draws a SDF icon button. + + The button's rect. + The button's label. + The button's icon. + The button's icon alignment. ButtonIconAlignment.LeftOfText by default. + The button's style. + + + + + Draws a SDF icon button. + + The button's rect. + The button's icon. + The button's icon alignment. ButtonIconAlignment.LeftOfText by default. + The button's style. + + + + + Draws a SDF icon button. + + The button's rect. + The button's icon. + The button's style. + + + + + Draws a SDF icon button. + + The button's rect. + The button's label. + The button's icon. + The button's icon alignment. ButtonIconAlignment.LeftOfText by default. + The button's style. + + + + + Draws a SDF icon button. + + The button's rect. + The button's label. + The button's icon. + The button's icon alignment. ButtonIconAlignment.LeftOfText by default. + The button's style. + + + + + Draws a SDF icon button. + + The button's rect. + The button's label. + The button's icon. + The button's icon alignment. ButtonIconAlignment.LeftOfText by default. + The button's style. + + + + + Draws a colored SDF icon button. + + The button's rect. + The button's label. + The button's background color. + The button's text color. + The button's icon. + The button's icon alignment. ButtonIconAlignment.LeftOfText by default. + The button's style. + + + + + Draws a colored SDF icon button. + + The button's rect. + The button's label. + The button's background color. + The button's text color. + The button's icon. + The button's icon alignment. ButtonIconAlignment.LeftOfText by default. + The button's style. + + + + + Calculates the minimum needed space for a SDF icon button where the label is still visible. + + The label of the SDF icon button. + The height of the SDF icon button. + The minimum width of the SDF icon button. + Draws a toolbar icon button. @@ -5678,6 +7241,16 @@ true if the button was pressed. Otherwise false. + + + Draws a toolbar icon button. + + The icon for the button. + If true, the button clickable while GUI.enabled == false. + + true if the button was pressed. Otherwise false. + + Draws a toolbar icon button. @@ -5994,6 +7567,15 @@ The value rect. The GUI style. + + + Draws a foldout field where clicking on the label toggles to the foldout too. + + The rect to draw the foldout field in. + The current state of the foldout. + The label of the foldout. + The style. + Draws a foldout field where clicking on the label toggles to the foldout too. @@ -6144,6 +7726,26 @@ Ends the shakeable group. + + + Begins a shakeable group. + + + + + Begins a shakeable group. + + + + + Starts the shaking animation of a shaking group. + + + + + Ends the shakeable group. + + Begins drawing a vertical menu list. @@ -6263,7 +7865,7 @@ The grabbable rect. The control ID for the sliding. - The current value. + The current value. The current value. @@ -6366,11 +7968,190 @@ The created control ID. A value indicating whether or not the control has keyboard focus. + + + Draws a with support for slicing the Texture. + + The to draw the in. + The to draw. + The amount of slicing applied to the texture on all sides. + + + + Draws a with support for slicing the Texture. + + The to draw the in. + The to draw. + The amount of slicing applied to the left and right sides. + The amount of slicing applied to the top and bottom sides. + + + + Draws a with support for slicing the Texture. + + The to draw the in. + The to draw. + The amount of slicing applied to the left side. + The amount of slicing applied to the right side. + The amount of slicing applied to the top side. + The amount of slicing applied to the bottom side. + + + + Draws a with support for slicing the Texture. + + The to draw the in. + The to draw. + The UV-coordinates to use. + The amount of slicing applied to the texture on all sides. + + + + Draws a with support for slicing the Texture. + + The to draw the in. + The to draw. + The UV-coordinates to use. + The amount of slicing applied to the left and right sides. + The amount of slicing applied to the top and bottom sides. + + + + Draws a with support for slicing the Texture. + + The to draw the in. + The to draw. + The UV-coordinates to use. + The amount of slicing applied to the left side. + The amount of slicing applied to the right side. + The amount of slicing applied to the top side. + The amount of slicing applied to the bottom side. + + + + Draws a with support for slicing the Texture. + + The to draw the in. + The to draw. + The that modulates the output. + The amount of slicing applied to the texture on all sides. + + + + Draws a with support for slicing the Texture. + + The to draw the in. + The to draw. + The that modulates the output. + The amount of slicing applied to the left and right sides. + The amount of slicing applied to the top and bottom sides. + + + + Draws a with support for slicing the Texture. + + The to draw the in. + The to draw. + The that modulates the output. + The amount of slicing applied to the left side. + The amount of slicing applied to the right side. + The amount of slicing applied to the top side. + The amount of slicing applied to the bottom side. + + + + Draws a with support for slicing the Texture. + + The to draw the in. + The to draw. + The that modulates the output. + The UV-coordinates to use. + The amount of slicing applied to the texture on all sides. + + + + Draws a with support for slicing the Texture. + + The to draw the in. + The to draw. + The that modulates the output. + The UV-coordinates to use. + The amount of slicing applied to the left and right sides. + The amount of slicing applied to the top and bottom sides. + + + + Draws a with support for slicing the Texture. + + The to draw the in. + The to draw. + The that modulates the output. + The UV-coordinates to use. + The amount of slicing applied to the left side. + The amount of slicing applied to the right side. + The amount of slicing applied to the top side. + The amount of slicing applied to the bottom side. + + + + Draws a repeating in a given . + + The to draw the in. + The to draw. + Amount of scaling applied to the output. + + + + Draws a repeating in a given . + + The to draw the in. + The to draw. + The that modulates the output. + Amount of scaling applied to the output. + + + + Draws a button with a given Size. + + Text to display on the button. + The size of the button. + true when the button is pressed; otherwise false. + Collection of GUIStyles used by Sirenix. + + + Validator Green + + + + + Inspector Orange + + + + + Serializer Yellow + + + + + Green valid color + + + + + Red error color + + + + + Yellow warning color + + Border color. @@ -6441,6 +8222,41 @@ Column title background colors. + + + The default background color for when a menu item is selected. + + + + + The default background color for when a menu item is selected. + + + + + The default background color for when a menu item is selected. + + + + + The default background color for when a menu item is selected. + + + + + A mouse over background overlay color. + + + + + The default background color for when a menu item is selected. + + + + + The default background color for when a menu item is selected. + + List item background color for every other item. OBSOLETE: Use ListItemColorEven instead. @@ -6523,12 +8339,12 @@ - Left button style. + Button style. - Left button selected style. + Button selected style. @@ -6626,6 +8442,11 @@ Label style. + + + Highlighted label style. + + White label style. @@ -6641,6 +8462,26 @@ Centered label style. + + + Centered label style. + + + + + White centered label style. + + + + + Black centered label style. + + + + + Centered mini label style. + + Left Aligned Centered Label @@ -6651,6 +8492,11 @@ Left aligned grey mini label style. + + + Left aligned grey label style. + + Centered grey mini label @@ -6841,6 +8687,11 @@ Detailed Message box style. + + + Multiline white label style. + + Multiline Label @@ -6886,115 +8737,9 @@ Draw this one manually with: new Color(1, 1, 1, EditorGUIUtility.isProSkin ? 0.25f : 0.45f) - + - A tab page created by . - - - - - - Gets the title of the tab. - - - - - Gets the title of the tab. - - - - - Gets the rect of the page. - - - - - Begins the page. - - - - - Ends the page. - - - - - Whether to draw a draw scroll view. - - - - - The number of pixels before a scroll view appears. - - - - - The maximum scroll view height. - - - - - The scroll position - - - - - The cell style - - - - - Gets the rect containing all rows. - - - - - Gets the first visible row index. - - - - - Gets the last visible row index. - - - - - Gets the outer rect. The height of this <= .height. - - - - - Gets the row rect. - - - - - Begins the table. - - - - - Begins the column. - - - - - Begins the cell. - - - - - Ends the cell. - - - - - Ends the column. - - - - - Ends the table. + SDFIconButton Label. @@ -7259,29 +9004,14 @@ Reference Copy. - + A utility class for getting delta time for the GUI editor. - + - Gets an EditorTimeHelper instance for the current drawing window. - - - - - Initializes a new instance of the class. - - - - - Gets the delta time. - - - - - Updates the delta time. + A utility class for getting delta time for the GUI editor. @@ -7362,6 +9092,9 @@ + Creates a new texture with no mimapping, linier colors, and calls texture.LoadImage(bytes), DontDestroyOnLoad(tex) and sets hideFlags = DontUnloadUnusedAsset | DontSaveInEditor. + + Old description no longer relevant as we've moved past version 2017. Loads an image from bytes with the specified width and height. Use this instead of someTexture.LoadImage() if you're compiling to an assembly. Unity has moved the method in 2017, and Unity's assembly updater is not able to fix it for you. This searches for a proper LoadImage method in multiple locations, and also handles type name conflicts. @@ -7371,6 +9104,11 @@ Crops a Texture2D into a new Texture2D. + + + Resizes a texture by blitting, this allows you to resize unreadable textures. + + Converts a Sprite to a Texture2D. @@ -7378,6 +9116,271 @@ + + + Categories of units. A unit value can only be converted to another of the same category. + + + + + Tools for converting between units, for example, converting from inches to meters. + + + + + + + Gets all UnitInfo registered, both built-in and custom. + + Enumerable of both built-in and custom units. + + + + Gets the UnitInfo for the given Units enum value. + + Units enum value. + UnitInfo for the unit. + Throws for invalid unit input. + + + + Gets the UnitInfo with the corrosponding name. + + The name of the unit. + UnitInfo for the name. + Throws when no unit with the given name is found. + + + + Finds the UnitInfo that best fits the given symbol within the given category. + + The symbol to find a unit for. + The category to look for units within. + The UnitInfo that best matches the given symbol. + Throws when no match was found. + + + + Gets the UnitInfo for the given Units enum value. + + Units enum value. + The UnitInfo matching the given unit value. + true when a UnitInfo was found. Otherwise false. + + + + Gets the UnitInfo with the given name. + + The name of the unit. + The UnitInfo matching the given name. + true when a UnitInfo was found. Otherwise false. + + + + Finds the UnitInfo that best fits the given symbol within the given category. + + The symbol to find a unit for. + The category to look for units within. + The UnitInfo that best matches the given symbol. + true when a UnitInfo was found. Otherwise false. + + + + Converts between two units. The units must be of the same category. + + The value to convert. Should be in the from units. + The unit to convert the value from. value should be in this unit. + To unit to convert the value to. Must be the same category as from. + The value converted to to units. + Throws when either 'from' or 'to' units are invalid, or when the units are of different categories. + + + decimal meters = 5m; + decimal centimeters = ConvertUnitsFromTo(meters, Units.Meter, Units.Centimeter); + // centimeters = 500 + + + + + + Converts between two units. The units must be of the same category. + + The value to convert. Should be in the fromUnitInfo units. + The unit to convert the value from. value should be in this unit. + To unit to convert the value to. Must be the same category as fromUnitInfo. + The value converted to toUnitInfo units. + Throws when either 'fromUnitInfo' or 'toUnitInfo' units are invalid, or when the units are of different categories. + + + decimal meters = 5m; + decimal centimeters = ConvertUnitsFromTo(meters, meterUnitInfo, centimeterUnitInfo); + // centimeters = 500 + + + + + + Converts between two units. The units must be of the same category. + + The value to convert. Should be in the from units. + The unit to convert the value from. value should be in this unit. + To unit to convert the value to. Must be the same category as from. + The value converted to to units. + true when the unit was successfully converted. Otherwise false. + + + decimal meters = 5m; + if (TryConvertUnitsFromTo(meters, Units.Meter, Units.Centimeter, out decimal centimeters) + { + // centimeters = 500 + } + + + + + + Converts between two units. The units must be of the same category. + + The value to convert. Should be in the fromUnitInfo units. + The unit to convert the value from. value should be in this unit. + To unit to convert the value to. Must be the same category as fromUnitInfo. + The value converted to toUnitInfo units. + true when the unit was successfully converted. Otherwise false. + + + decimal meters = 5m; + if (TryConvertUnitsFromTo(meters, meterUnitInfo, centimeterUnitInfo, out decimal centimeters)) + { + // centimeters = 500 + } + + + Throws if either fromUnitInfo or toUnitInfo is null. + + + + Indicates whether or not a value can be converted between the given a and b units. + + Unit a. + Unit b. + true if both units have the same category. Otherwise false. + + + + Indicates whether or not a value can be converted between the given a and b units. + + Unit a. + Unit b. + true if both units have the same category. Otherwise false. + + + + Adds a custom unit to the UnitNumberUtility, that can also be used with the . + Call this using InitializeOnLoad or InitializeOnLoadMethod. + + The name of the unit. Duplicate names are not allowed. + Symbols used for the unit. First value in the array will be used as the primary symbol. Atleast 1 value required. Duplicate symbols are not allowed within the same category. + The category of the unit. Units can only be converted to another of the same category. Custom categories are allowed. + The multiplier to convert the unit from the base value. For example, meters are the base unit of the distance category, therefore centimeters have a multipler of 100. + + Example of adding centimeters as a custom unit. + + UnitNumberUtility.AddCustomUnit("Centimeter", new string[]{ "cm" }, "Distance", 100m); + + + + + + Adds a custom unit to the UnitNumberUtility, that can also be used with the . + Call this using InitializeOnLoad or InitializeOnLoadMethod. + + The name of the unit. Duplicate names are not allowed. + Symbols used for the unit. First value in the array will be used as the primary symbol. Atleast 1 value required. Duplicate symbols are not allowed within the same category. + The category of the unit. Units can only be converted to another of the same category. Custom categories are allowed. + The multiplier to convert the unit from the base value. For example, meters are the base unit of the distance category, therefore centimeters have a multipler of 100. + + Example of adding centimeters as a custom unit. + + UnitNumberUtility.AddCustomUnit("Centimeter", new string[]{ "cm" }, UnitCategory.Distance, 100m); + + + + + + Adds a custom unit to the UnitNumberUtility, that can also be used with the . + This overload allows for custom conversion methods but, if possible, the multiplier overloads should be prefered. + Call this using InitializeOnLoad or InitializeOnLoadMethod. + + The name of the unit. Duplicate names are not allowed. + Symbols used for the unit. First value in the array will be used as the primary symbol. Atleast 1 value required. Duplicate symbols are not allowed within the same category. + The category of the unit. Units can only be converted to another of the same category. Custom categories are allowed. + Method for converting a given value of the custom unit to the base unit. For example, for centimeter, use: x => x / 100m;. + Method for converting a given value of the base unit to the custom unit. For example, for centimeter, use: x => x * 100m;. + + Example of adding centimeters as a custom unit. + + UnitNumberUtility.AddCustomUnit("Centimeter", new string[]{ "cm" }, "Distance", x => x / 100m, x = > x * 100m); + + + + + + Adds a custom unit to the UnitNumberUtility, that can also be used with the . + This overload allows for custom conversion methods but, if possible, the multiplier overloads should be prefered. + Call this using InitializeOnLoad or InitializeOnLoadMethod. + + The name of the unit. Duplicate names are not allowed. + Symbols used for the unit. First value in the array will be used as the primary symbol. Atleast 1 value required. Duplicate symbols are not allowed within the same category. + The category of the unit. Units can only be converted to another of the same category. Custom categories are allowed. + Method for converting a given value of the custom unit to the base unit. For example, for centimeter, use: x => x / 100m;. + Method for converting a given value of the base unit to the custom unit. For example, for centimeter, use: x => x * 100m;. + /// + Example of adding centimeters as a custom unit. + + UnitNumberUtility.AddCustomUnit("Centimeter", new string[]{ "cm" }, UnitCategory.Distance, x => x / 100m, x = > x * 100m); + + + + + + Object describing units, including name, symbols and how to convert it to other units. + + + + + Name of the unit. + + + + + Symbols of the unit. First symbol is considered the primary symbol. + + + + + The category of the unit. Units can only be converted within the same category. + + + + + Multiplier for converting from the base unit. + + + + + Custom method for converting from the base unit. + + + + + Custom method for converting to the base unit. + + + + + Indicates whether the UnitInfo should use the multiplier or the ConvertFromBase and ConvertToBase methods. + + AssemblyTypeFlags is a bitmask used to filter types and assemblies related to Unity. @@ -7451,16 +9454,6 @@ A utility class for finding types in various asssembly. - - - Initializes the class. - - - - - Re-scans the entire AppDomain. - - Gets an of all assemblies in the current . @@ -7475,17 +9468,6 @@ The for a given assembly. is null. - - - Gets the type. - - The full name of the type without any assembly information. - - - - Gets the type. - - Determines whether an assembly is depended on another assembly. @@ -7510,10 +9492,10 @@ - Gets the full file path to a given assembly. + Gets the full file path to a given assembly's containing directory. The assembly. - The full file path to a given assembly, or Null if no file path was found. + The full file path to a given assembly's containing directory, or Null if no file path was found. is Null. @@ -7523,6 +9505,19 @@ The assembly. The full directory path in which a given assembly is located, or Null if no file path was found. + + + Gets the type. + + The full name of the type, with or without any assembly information. + + + + Get types from the current AppDomain with a specified filter. + + The filters. + Types from the current AppDomain with the specified filters. + Get types from the current AppDomain with a specified filter. @@ -7773,6 +9768,18 @@ This method subscribes to a lot of different callbacks, in the hopes of catching at least one. + + + Sometimes, an idiot overrides a delay action subscription to , + which can be done because the people at Unity didn't know what events were once upon a time. + This method subscribes to a lot of different callbacks, in the hopes of catching at least one. + + + + + In 2019.1+, this event subscribes to SceneView.duringSceneGui. In 2018.4 and lower, it subscribes to SceneView.onSceneGUIDelegate. + + In 2020.1, Unity changed EditorApplication.delayCall from a field to an event, meaning diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.xml.meta b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.xml.meta index 0d59bcc..03f29c1 100644 --- a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.xml.meta +++ b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.xml.meta @@ -1,7 +1,6 @@ fileFormatVersion: 2 guid: 5c65184932ff4fd48a343e236025096f timeCreated: 1488828285 -licenseType: Store DefaultImporter: userData: assetBundleName: diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.dll b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.dll index 8f8146a..fe2f2bc 100644 Binary files a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.dll and b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.dll differ diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.dll.meta b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.dll.meta index 2dacfd7..44c2d22 100644 --- a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.dll.meta +++ b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.dll.meta @@ -1,7 +1,6 @@ fileFormatVersion: 2 guid: 4873f2a8bdae42baa0406e8a61366ca1 timeCreated: 1488828285 -licenseType: Store PluginImporter: serializedVersion: 1 iconMap: {} diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.pdb b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.pdb new file mode 100644 index 0000000..14c6cbc Binary files /dev/null and b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.pdb differ diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.pdb.meta b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.pdb.meta new file mode 100644 index 0000000..250145a --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.pdb.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4873f2a8bdae42baa0406e8a61360a6f +timeCreated: 1488828285 +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.xml b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.xml index b665fac..84cb6c5 100644 --- a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.xml +++ b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.xml @@ -54,6 +54,14 @@ The color. + + + Gets the perceived luminosity of a given . + + The current . + Determines if the Color.a value should impact the result. + The float value representing the luminosity. + Delegate method extensions. @@ -270,16 +278,6 @@ The collection. Func to convert the items. - - - Convert a colletion to a HashSet. - - - - - Convert a colletion to a HashSet. - - Convert a collection to an immutable list. @@ -489,6 +487,41 @@ Sorts an IList + + + Various list extension methods. + + + + + Increases or decrease the number of items in the list to the specified count. + + The list. + The new length. + + + + Increases or decrease the number of items in the list to the specified count. + + The list. + The new length. + Value of new elements. + + + + Increases or decrease the number of items in the list to the specified count. + + The list. + The new length. + + + + Increases or decrease the number of items in the list to the specified count. + + The list. + The new length. + Value of new elements. + MemberInfo method extensions. @@ -808,7 +841,7 @@ Defines a collection of handy Rect transformation methods, that can chained together for complex behaviour. - Note that no method defined here changes the original Rect, but instead returns a new transformed Rect. + Note that only the TakeX method defined here actually change the original Rect; the rest instead return a new transformed Rect. @@ -833,6 +866,13 @@ The desired width of the new Rect. The desired height of the new Rect. + + + Returns a Rect with the specified size. + + The original Rect. + The desired width and height of the new Rect. + Returns a Rect with the specified size. @@ -1296,6 +1336,13 @@ The original Rect. The position to expand the rect towards. + + + Determines if an is a placeholder; usually (0, 0, 1, 1) in Layout. + + The original . + true if the is equal to (0, 0, 0, 0) or (0, 0, 1, 1); otherwise false. + String method extensions. @@ -1323,6 +1370,11 @@ The string to check. true if this string is null, empty, or contains only whitespace; otherwise, false. + + + O(n*m) - Use with care. + + Type method extensions. @@ -1331,7 +1383,6 @@ Type name alias lookup. - TypeNameAlternatives["Single"] will give you "float", "UInt16" will give you "ushort", "Boolean[]" will give you "bool[]" etc.. @@ -1493,11 +1544,6 @@ Returns a lazy enumerable of all the base classes of this type - - - Used to filter out unwanted type names. Ex "int" instead of "Int32" - - Returns a nicely formatted name of a type. @@ -1694,6 +1740,40 @@ The identifier to check. true if the string is a C# keyword. Otherwise false. + + + Determines if a given has a default constructor. + A type is considered to have a default constructor if: It is a string, if it is an array, if it is a value type or if it has a public parameterless constructor. + + The to investigate. + true if a default constructor has been found; otherwise false. + + + + Attempts to instantiate an object of a given with it's default constructor. If no default constructor is found then it attempts to find the most suitable alternative constructor and instantiate the with default parameters. + + The to instantiate. + Determines if the use of is preferred over a non-default constructor call. + The instantiated object or null if no suitable alternative constructor is found. + + + + Weighs multiple constructors for a given type, and attempts to find the most ideal constructor. This will ignore any unmanaged constructors. + + The to weigh the constructors of. + The to search for the constructors; means only find the public ones. + The most ideal based on the scoring system. + The scoring system prefers value types over reference types (adjusted for default values), + it provides bonuses for empty constructors or constructors solely consisting of default values. + Lastly it considers the amount of parameters present in the constructor in the overall score. + + + + Checks if a given is unmanaged, by checking if it contains any , or parameters. + + The to validate. + true if the is unmanaged; otherwise false. + Extends various Unity classes. @@ -2245,6 +2325,16 @@ Opens the config in a editor window. This is currently only used internally by the Sirenix.OdinInspector.Editor assembly. + + + Gets a value indicating whether this instance has instance loaded. + + + + + Gets the singleton instance. + + This attribute is used by classes deriving from GlobalConfig and specifies the asset path for the generated config file. @@ -2648,41 +2738,6 @@ Gets the index of an item. - - - Various list extension methods. - - - - - Increases or decrease the number of items in the list to the specified count. - - The list. - The new length. - - - - Increases or decrease the number of items in the list to the specified count. - - The list. - The new length. - Value of new elements. - - - - Increases or decrease the number of items in the list to the specified count. - - The list. - The new length. - - - - Increases or decrease the number of items in the list to the specified count. - - The list. - The new length. - Value of new elements. - Collection of math function. @@ -2953,98 +3008,6 @@ Clamps and wraps an angle between two values. - - - Contains utilities for operating on arrays multi-dimentional arrays. - - - - - Inserts one column left of the specified column index. - - The type of the element. - Index of the column. - The array. - - - - Inserts one column right of the specified column index. - - The type of the element. - Index of the column. - The arr. - - - - Inserts one row above the specified row index. - - The type of the element. - The array. - The row index. - - - - Inserts one row below the specified row index. - - The type of the element. - The array. - Index of the row. - - - - Duplicates the column. - - The type of the element. - Index of the column. - The array. - - - - Duplicates the row. - - The type of the element. - The array. - Index of the row. - - - - Moves a column. - - The type of the element. - The array. - From column. - To column. - - - - Moves a row. - - The type of the element. - The array. - From row. - To row. - - - - Deletes a column. - - The type of the element. - The array. - Index of the column. - - - - Deletes the row. - - The type of the element. - The array. - Index of the row. - - - - Indicates a persistent assembly. - - Provides a methods of representing imaginary fields which are unique to serialization. @@ -3482,6 +3445,118 @@ The indices to use. The culture to use. + + + Contains utilities for operating on arrays multi-dimentional arrays. + + + + + Inserts one column left of the specified column index. + + The type of the element. + Index of the column. + The array. + + + + Inserts one column right of the specified column index. + + The type of the element. + Index of the column. + The arr. + + + + Inserts one row above the specified row index. + + The type of the element. + The array. + The row index. + + + + Inserts one row below the specified row index. + + The type of the element. + The array. + Index of the row. + + + + Duplicates the column. + + The type of the element. + Index of the column. + The array. + + + + Duplicates the row. + + The type of the element. + The array. + Index of the row. + + + + Moves a column. + + The type of the element. + The array. + From column. + To column. + + + + Moves a row. + + The type of the element. + The array. + From row. + To row. + + + + Deletes a column. + + The type of the element. + The array. + Index of the column. + + + + Deletes the row. + + The type of the element. + The array. + Index of the row. + + + + Indicates a persistent assembly. + + + + + Compares objects by reference only, ignoring equality operators completely. This is used by the property tree reference dictionaries to keep track of references. + + + + + A default, cached instance of this generic variant of the reference equality comparer. + + + + + Returns true if the object references are equal. + + + + + Returns the result of the object's own GetHashCode method. + + Paths to Sirenix assets. @@ -3634,25 +3709,5 @@ Not yet documented. - - - Compares objects by reference only, ignoring equality operators completely. This is used by the property tree reference dictionaries to keep track of references. - - - - - A default, cached instance of this generic variant of the reference equality comparer. - - - - - Returns true if the object references are equal. - - - - - Returns the result of the object's own GetHashCode method. - - diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.xml.meta b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.xml.meta index 63d3480..cc14132 100644 --- a/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.xml.meta +++ b/proj/unity/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.xml.meta @@ -1,7 +1,6 @@ fileFormatVersion: 2 guid: 4873f2a8bdae42baa0406e8a6136096f timeCreated: 1488828285 -licenseType: Store DefaultImporter: userData: assetBundleName: diff --git a/proj/unity/Assets/Plugins/Sirenix/Assemblies/link.xml.meta b/proj/unity/Assets/Plugins/Sirenix/Assemblies/link.xml.meta index 4dfefc6..27e066d 100644 --- a/proj/unity/Assets/Plugins/Sirenix/Assemblies/link.xml.meta +++ b/proj/unity/Assets/Plugins/Sirenix/Assemblies/link.xml.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 2373d9909155cae468605be57f69461c +guid: 1bec01331befdea4d9ed9033eabd68f8 timeCreated: 1613046886 TextScriptImporter: userData: diff --git a/proj/unity/Assets/Plugins/Sirenix/Demos/Custom Attribute Processors.unitypackage b/proj/unity/Assets/Plugins/Sirenix/Demos/Custom Attribute Processors.unitypackage index 0165a29..fe27885 100644 Binary files a/proj/unity/Assets/Plugins/Sirenix/Demos/Custom Attribute Processors.unitypackage and b/proj/unity/Assets/Plugins/Sirenix/Demos/Custom Attribute Processors.unitypackage differ diff --git a/proj/unity/Assets/Plugins/Sirenix/Demos/Custom Attribute Processors.unitypackage.meta b/proj/unity/Assets/Plugins/Sirenix/Demos/Custom Attribute Processors.unitypackage.meta index 8dd2946..92a6ac5 100644 --- a/proj/unity/Assets/Plugins/Sirenix/Demos/Custom Attribute Processors.unitypackage.meta +++ b/proj/unity/Assets/Plugins/Sirenix/Demos/Custom Attribute Processors.unitypackage.meta @@ -1,7 +1,6 @@ fileFormatVersion: 2 guid: f597f19f656ba56eae4f6a3a7cc528f4 timeCreated: 1488828285 -licenseType: Store DefaultImporter: userData: assetBundleName: diff --git a/proj/unity/Assets/Plugins/Sirenix/Demos/Custom Drawers.unitypackage b/proj/unity/Assets/Plugins/Sirenix/Demos/Custom Drawers.unitypackage index 238bf7e..da44160 100644 Binary files a/proj/unity/Assets/Plugins/Sirenix/Demos/Custom Drawers.unitypackage and b/proj/unity/Assets/Plugins/Sirenix/Demos/Custom Drawers.unitypackage differ diff --git a/proj/unity/Assets/Plugins/Sirenix/Demos/Custom Drawers.unitypackage.meta b/proj/unity/Assets/Plugins/Sirenix/Demos/Custom Drawers.unitypackage.meta index 35418d0..71af8df 100644 --- a/proj/unity/Assets/Plugins/Sirenix/Demos/Custom Drawers.unitypackage.meta +++ b/proj/unity/Assets/Plugins/Sirenix/Demos/Custom Drawers.unitypackage.meta @@ -1,7 +1,6 @@ fileFormatVersion: 2 guid: 48e08dc33330d11e9d4a1b246c52e4f6 timeCreated: 1488828285 -licenseType: Store DefaultImporter: userData: assetBundleName: diff --git a/proj/unity/Assets/Plugins/Sirenix/Demos/Editor Windows.unitypackage b/proj/unity/Assets/Plugins/Sirenix/Demos/Editor Windows.unitypackage index df10d49..688572f 100644 Binary files a/proj/unity/Assets/Plugins/Sirenix/Demos/Editor Windows.unitypackage and b/proj/unity/Assets/Plugins/Sirenix/Demos/Editor Windows.unitypackage differ diff --git a/proj/unity/Assets/Plugins/Sirenix/Demos/Editor Windows.unitypackage.meta b/proj/unity/Assets/Plugins/Sirenix/Demos/Editor Windows.unitypackage.meta index cb0b40f..cc5570c 100644 --- a/proj/unity/Assets/Plugins/Sirenix/Demos/Editor Windows.unitypackage.meta +++ b/proj/unity/Assets/Plugins/Sirenix/Demos/Editor Windows.unitypackage.meta @@ -1,7 +1,6 @@ fileFormatVersion: 2 guid: ed09910c0094cb27be8f3ca264680da3 timeCreated: 1488828285 -licenseType: Store DefaultImporter: userData: assetBundleName: diff --git a/proj/unity/Assets/Plugins/Sirenix/Demos/Sample - RPG Editor.unitypackage b/proj/unity/Assets/Plugins/Sirenix/Demos/Sample - RPG Editor.unitypackage index 3d43980..a269257 100644 Binary files a/proj/unity/Assets/Plugins/Sirenix/Demos/Sample - RPG Editor.unitypackage and b/proj/unity/Assets/Plugins/Sirenix/Demos/Sample - RPG Editor.unitypackage differ diff --git a/proj/unity/Assets/Plugins/Sirenix/Demos/Sample - RPG Editor.unitypackage.meta b/proj/unity/Assets/Plugins/Sirenix/Demos/Sample - RPG Editor.unitypackage.meta index 8a58328..26bd5b8 100644 --- a/proj/unity/Assets/Plugins/Sirenix/Demos/Sample - RPG Editor.unitypackage.meta +++ b/proj/unity/Assets/Plugins/Sirenix/Demos/Sample - RPG Editor.unitypackage.meta @@ -1,7 +1,6 @@ fileFormatVersion: 2 guid: cc355dd4cf1e6173beaeb22c2858cbe1 timeCreated: 1488828285 -licenseType: Store DefaultImporter: userData: assetBundleName: diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Bootstrap License.txt b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Bootstrap License.txt new file mode 100644 index 0000000..2b637b2 --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Bootstrap License.txt @@ -0,0 +1,30 @@ +Odin Inspector makes use of the Bootstrap icon library. +The library has been packed into the SdfIconAtlas.png +file as SDF data. + +Bootstrap is released under the following license: + +--- + +The MIT License (MIT) + +Copyright (c) 2011-2018 Twitter, Inc. +Copyright (c) 2011-2018 The Bootstrap Authors + +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/proj/unity/Assets/AddressableAssetsData/link.xml.meta b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Bootstrap License.txt.meta similarity index 75% rename from proj/unity/Assets/AddressableAssetsData/link.xml.meta rename to proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Bootstrap License.txt.meta index 5ef7d7c..e3864a0 100644 --- a/proj/unity/Assets/AddressableAssetsData/link.xml.meta +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Bootstrap License.txt.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ed0596395c5e2994b8e285d080341c5e +guid: 3fdc67fad3e362e47b5dd365a0bbdd7f TextScriptImporter: externalObjects: {} userData: diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/ConfigData.bytes b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/ConfigData.bytes new file mode 100644 index 0000000..1a63707 Binary files /dev/null and b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/ConfigData.bytes differ diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/ConfigData.bytes.meta b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/ConfigData.bytes.meta new file mode 100644 index 0000000..6ad740b --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/ConfigData.bytes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 90eaa0dc28c1934408dc1c02e13a507f +timeCreated: 1628274352 +licenseType: Store +TextScriptImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden.meta b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden.meta new file mode 100644 index 0000000..70c7c0b --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e22dad2728c77344f8da0d2789866a0e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/ExtractSpriteShader.shader b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/ExtractSpriteShader.shader new file mode 100644 index 0000000..85ad00d --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/ExtractSpriteShader.shader @@ -0,0 +1,51 @@ +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +Shader "Hidden/Sirenix/Editor/ExtractSprite" +{ + Properties + { + _MainTex("Texture", 2D) = "white" {} + _Color("Color", Color) = (1,1,1,1) + _Rect("Rect", Vector) = (0,0,0,0) + _TexelSize("TexelSize", Vector) = (0,0,0,0) + } + SubShader + { + Blend SrcAlpha OneMinusSrcAlpha + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + #include "UnityCG.cginc" + + struct appdata { + float4 vertex : POSITION; + float2 uv : TEXCOORD0; + }; + + struct v2f { + float2 uv : TEXCOORD0; + float4 vertex : SV_POSITION; + }; + + sampler2D _MainTex; + float4 _Rect; + + v2f vert(appdata v) { + v2f o; + o.vertex = UnityObjectToClipPos(v.vertex); + o.uv = v.uv; + return o; + } + + fixed4 frag(v2f i) : SV_Target { + float2 uv = i.uv; + uv *= _Rect.zw; + uv += _Rect.xy; + return tex2D(_MainTex, uv); + } + ENDCG + } + } +} \ No newline at end of file diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/ExtractSpriteShader.shader.meta b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/ExtractSpriteShader.shader.meta new file mode 100644 index 0000000..4ce11e9 --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/ExtractSpriteShader.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 0675e2791073a4147b190e55f1da7ac2 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/GUIUtilShader.shader b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/GUIUtilShader.shader new file mode 100644 index 0000000..ff3f843 --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/GUIUtilShader.shader @@ -0,0 +1,98 @@ +Shader "Hidden/Sirenix/OdinGUIShader" +{ + SubShader + { + Lighting Off + Cull Off + ZWrite Off + ZTest Always + Blend SrcAlpha OneMinusSrcAlpha + + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + #include "UnityCG.cginc" + + struct appdata { + float4 vertex : POSITION; + float2 uv : TEXCOORD0; + }; + + struct v2f { + float2 uv : TEXCOORD0; + float4 vertex : SV_POSITION; + }; + + sampler2D _MainTex; + float _SirenixOdin_GreyScale; + float4 _SirenixOdin_GUIColor; + float4 _SirenixOdin_GUIUv; + float4 _SirenixOdin_HueColor; + + v2f vert(appdata v) { + v2f o; + o.vertex = UnityObjectToClipPos(v.vertex); + o.uv = v.uv; + return o; + } + + float test1(float x, float y) { + if (x >= y) { + return 0; + } else { + return 1; + } + } + + float test2(float x, float y) { + return step(x, y); + } + + float3 rgb2hsv(float3 c) { + float4 K = float4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); + float4 p = lerp(float4(c.bg, K.wz), float4(c.gb, K.xy), step(c.b, c.g)); + float4 q = lerp(float4(p.xyw, c.r), float4(c.r, p.yzx), step(p.x, c.r)); + + float d = q.x - min(q.w, q.y); + float e = 1.0e-10; + return float3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x); + } + + float3 hsv2rgb(float3 c) { + c = float3(c.x, clamp(c.yz, 0.0, 1.0)); + float4 K = float4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); + float3 p = abs(frac(c.xxx + K.xyz) * 6.0 - K.www); + return c.z * lerp(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); + } + + float4 frag(v2f i) : SV_Target { + float2 uv = i.uv; + uv.y = 1 - uv.y; + uv.x = _SirenixOdin_GUIUv.x + uv.x * _SirenixOdin_GUIUv.z; + uv.y = _SirenixOdin_GUIUv.y + uv.y * _SirenixOdin_GUIUv.w; + uv.y = 1 - uv.y; + + // Greyscale + float4 col = tex2D(_MainTex, uv); + float3 greyScale = (0.3 * col.r) + (0.59 * col.g) + (0.11 * col.b); + col.rgb = lerp(col.rgb, greyScale, _SirenixOdin_GreyScale); + + // Change hue + float3 h = col.rgb; + h = rgb2hsv(h); + float hue = rgb2hsv(_SirenixOdin_HueColor.rgb).x; + h.x = hue; + h = hsv2rgb(h); + col.rgb = lerp(col.rgb, h, _SirenixOdin_HueColor.a); + + // Blend color + col *= _SirenixOdin_GUIColor; + + return col; + } + ENDCG + } + } +} \ No newline at end of file diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/GUIUtilShader.shader.meta b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/GUIUtilShader.shader.meta new file mode 100644 index 0000000..977b302 --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/GUIUtilShader.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 7619c1ca61a5ef94ca78ddfa69941dad +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/LazyEditorIconShader.shader b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/LazyEditorIconShader.shader new file mode 100644 index 0000000..9ea2f1b --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/LazyEditorIconShader.shader @@ -0,0 +1,57 @@ +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +Shader "Hidden/Sirenix/Editor/GUIIcon" +{ + Properties + { + _MainTex("Texture", 2D) = "white" {} + _Color("Color", Color) = (1,1,1,1) + } + SubShader + { + Blend SrcAlpha Zero + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + #include "UnityCG.cginc" + + struct appdata { + float4 vertex : POSITION; + float2 uv : TEXCOORD0; + }; + + struct v2f { + float2 uv : TEXCOORD0; + float4 vertex : SV_POSITION; + }; + + sampler2D _MainTex; + float4 _Color; + + v2f vert(appdata v) { + v2f o; + o.vertex = UnityObjectToClipPos(v.vertex); + o.uv = v.uv; + return o; + } + + fixed4 frag(v2f i) : SV_Target { + // drop shadow: + // float texelSize = 1.0 / 34.0; + // float2 shadowUv = clamp(i.uv + float2(-texelSize, texelSize * 2), float2(0, 0), float2(1, 1)); + // fixed4 shadow = fixed4(0, 0, 0, tex2D(_MainTex, shadowUv).a); + + fixed4 col = _Color; + col.a *= tex2D(_MainTex, i.uv).a; + + // drop shadow: + // col = lerp(shadow, col, col.a); + + return col; + } + ENDCG + } + } +} \ No newline at end of file diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/LazyEditorIconShader.shader.meta b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/LazyEditorIconShader.shader.meta new file mode 100644 index 0000000..eb145b5 --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/LazyEditorIconShader.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 2ad0a53eacb91bd4fbe0dc668bf25e6f +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/SdfIconShader.shader b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/SdfIconShader.shader new file mode 100644 index 0000000..206d73d --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/SdfIconShader.shader @@ -0,0 +1,95 @@ +Shader "Hidden/Sirenix/SdfIconShader" +{ + SubShader + { + Blend SrcAlpha OneMinusSrcAlpha + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + #include "UnityCG.cginc" + + struct appdata { + float4 vertex : POSITION; + float2 uv : TEXCOORD0; + }; + + struct v2f { + float2 uv : TEXCOORD0; + float4 vertex : SV_POSITION; + }; + + sampler2D _MainTex; + sampler2D _SirenixOdin_SdfTex; + float _SirenixOdin_EdgeOffset; + float4 _SirenixOdin_Color; + float4 _SirenixOdin_BgColor; + float4 _SirenixOdin_Uv; + + v2f vert(appdata v) { + v2f o; + o.vertex = UnityObjectToClipPos(v.vertex); + o.uv = v.uv; + return o; + } + + float samplePixel(float2 uv) { + return tex2D(_SirenixOdin_SdfTex, uv).a; + } + + float linearstep(float lo, float hi, float input) { + float diff = hi - lo; + float offset = input - lo; + return min(1.0, max(0.0, offset / diff)); + } + + float sampleDist(float2 uv, float dx, float edge, float padding) { + float dist = samplePixel(uv); + float p = -abs((dx * 3072.0) / -padding); + float a = min(1, max(0, edge - p * 0.33333)); + float b = max(0, min(1, edge + p * 0.33333)); + return smoothstep(b, a, dist); + } + + float4 frag(v2f i) : SV_Target { + float2 uv = i.uv; + uv.y = 1 - uv.y; + uv.x = _SirenixOdin_Uv.x + uv.x * _SirenixOdin_Uv.z; + uv.y = _SirenixOdin_Uv.y + uv.y * _SirenixOdin_Uv.w; + uv.y = 1 - uv.y; + + float alpha = 0.0; + float edge = 0.5019608 + _SirenixOdin_EdgeOffset; + + if (_SirenixOdin_BgColor.a > 0.01) { + float3 colorBg = _SirenixOdin_BgColor.rgb; + float3 colorFg = _SirenixOdin_Color.rgb; + + float padding = 8; + float dx = ddx(uv.x); + float2 t = float2(dx * 0.333333, 0); + float3 subDist = float3( + sampleDist(uv.xy - t, dx, edge, padding), + sampleDist(uv.xy, dx, edge, padding), + sampleDist(uv.xy + t, dx, edge, padding)); + float3 color = lerp(colorBg, colorFg, clamp(subDist, 0.0, 1.0)); + + float alpha = min(1, subDist.r + subDist.g + subDist.b); + float4 col = float4(color, alpha * _SirenixOdin_Color.a); + + return col; + } else { + float padding = 8; + float dx = ddx(uv.x); + float alpha = sampleDist(uv, dx, edge, padding); + float4 col = _SirenixOdin_Color; + col.a *= alpha; + + return col; + } + } + ENDCG + } + } +} \ No newline at end of file diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/SdfIconShader.shader.meta b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/SdfIconShader.shader.meta new file mode 100644 index 0000000..7634f12 --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/SdfIconShader.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 99e0f263ae4ed2d4d962a2e995dff6df +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/OdinPathLookup.asset b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/OdinPathLookup.asset index 5cbffd2..3a82383 100644 --- a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/OdinPathLookup.asset +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/OdinPathLookup.asset @@ -10,4 +10,4 @@ MonoBehaviour: m_EditorHideFlags: 0 m_Script: {fileID: -262940062, guid: a4865f1ab4504ed8a368670db22f409c, type: 3} m_Name: OdinPathLookup - m_EditorClassIdentifier: + m_EditorClassIdentifier: \ No newline at end of file diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/SdfIconAtlas.png b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/SdfIconAtlas.png new file mode 100644 index 0000000..6d255d5 Binary files /dev/null and b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/SdfIconAtlas.png differ diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/SdfIconAtlas.png.meta b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/SdfIconAtlas.png.meta new file mode 100644 index 0000000..0c03933 --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/SdfIconAtlas.png.meta @@ -0,0 +1,128 @@ +fileFormatVersion: 2 +guid: 2a0112a98875dfd488b5d10bdb8a4903 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 0 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 10 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 16384 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 16384 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: WebGL + maxTextureSize: 16384 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/OdinModuleConfig.asset b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/OdinModuleConfig.asset index 96b7a4b..c22bb20 100644 Binary files a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/OdinModuleConfig.asset and b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/OdinModuleConfig.asset differ diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/TypeRegistryUserConfig.asset b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/TypeRegistryUserConfig.asset new file mode 100644 index 0000000..97db8ec Binary files /dev/null and b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/TypeRegistryUserConfig.asset differ diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/TypeRegistryUserConfig.asset.meta b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/TypeRegistryUserConfig.asset.meta new file mode 100644 index 0000000..c58f37b --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/TypeRegistryUserConfig.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 07fe6cf8c594af0429550fde55ed7107 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables.data b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables.data new file mode 100644 index 0000000..f0a1366 Binary files /dev/null and b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables.data differ diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables.data.meta b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables.data.meta new file mode 100644 index 0000000..38859a1 --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables.data.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d92d0eb8b980c6d44b5f0e64a620355b +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables.meta b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables.meta new file mode 100644 index 0000000..b5f4586 --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ac4fbcd30f01bda43b2c34f378a77a8b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/AddressablesInspectors.cs b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/AddressablesInspectors.cs new file mode 100644 index 0000000..e5aceac --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/AddressablesInspectors.cs @@ -0,0 +1,1934 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- + +#if !SIRENIX_INTERNAL +#pragma warning disable +#endif + +using System; +using Sirenix.OdinInspector; + +[assembly: RegisterAssetReferenceAttributeForwardToChild(typeof(InlineEditorAttribute))] +[assembly: RegisterAssetReferenceAttributeForwardToChild(typeof(PreviewFieldAttribute))] + +namespace Sirenix.OdinInspector +{ + using System.Diagnostics; + + /// + /// DisallowAddressableSubAssetField is used on AssetReference properties, and disallows and prevents assigned sub-assets to the asset reference. + /// + /// + /// + /// [DisallowAddressableSubAssetField] + /// public AssetReference Reference; + /// + /// + /// + /// + [Conditional("UNITY_EDITOR")] + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.ReturnValue | AttributeTargets.Parameter)] + public class DisallowAddressableSubAssetFieldAttribute : Attribute + { + } + + /// + /// Registers an attribute to be applied to an AssetRefenece property, to be forwarded and applied to the AssetReference's child instead. + /// This allows attributes designed for use on UnityEngine.Objects to be used on AssetReference properties as well. + /// By default, InlineEditorAttribute and PreviewFieldAttribute are registered for forwarding. + /// + /// + /// + /// [assembly: Sirenix.OdinInspector.Modules.RegisterAssetReferenceAttributeForwardToChild(typeof(InlineEditorAttribute))] + /// [assembly: Sirenix.OdinInspector.Modules.RegisterAssetReferenceAttributeForwardToChild(typeof(PreviewFieldAttribute))] + /// + /// + /// + [Conditional("UNITY_EDITOR")] + [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] + public class RegisterAssetReferenceAttributeForwardToChildAttribute : Attribute // TODO: Should this be a global attribute? + { + /// + /// The type of the attribute to forward. + /// + public readonly Type AttributeType; + + /// + /// Registers the specified attribute to be copied and applied to the AssetReference's UnityEngine.Object child instead. + /// + /// The attribute type to forward. + public RegisterAssetReferenceAttributeForwardToChildAttribute(Type attributeType) + { + this.AttributeType = attributeType; + } + } +} + +#if UNITY_EDITOR +namespace Sirenix.OdinInspector.Modules.Addressables.Editor +{ + using Sirenix.OdinInspector.Editor; + using Sirenix.Serialization; + using Sirenix.Utilities; + using Sirenix.Utilities.Editor; + using Sirenix.OdinInspector.Modules.Addressables.Editor.Internal; + using Sirenix.Reflection.Editor; + using System.Collections.Generic; + using System.Linq; + using System.Reflection; + using UnityEditor; + using UnityEditor.AddressableAssets; + using UnityEditor.AddressableAssets.Settings; + using UnityEditor.AddressableAssets.GUI; + using UnityEngine; + using UnityEngine.AddressableAssets; + using System.Runtime.Serialization; + using UnityEngine.U2D; + using UnityEditor.U2D; + using System.IO; + + /// + /// Draws an AssetReference property. + /// + /// The concrete type of AssetReference to be drawn. For example, AssetReferenceTexture. + [DrawerPriority(0, 1, 0)] + public class AssetReferenceDrawer : OdinValueDrawer, IDefinesGenericMenuItems + where T : AssetReference + { + private bool hideAssetReferenceField; + private Type[] validMainAssetTypes; + private Type targetType; + private bool targetTypeIsNotValidMainAsset; + private string NoneSelectedLabel; + //private string[] labelRestrictions; + private bool showSubAssetField; + + private bool updateShowSubAssetField; + + private bool disallowSubAssets_Backing; + + private bool ActuallyDisallowSubAssets => this.disallowSubAssets_Backing && !this.targetTypeIsNotValidMainAsset; + + private List restrictions; + + private bool isSpriteAtlas; + + protected override bool CanDrawValueProperty(InspectorProperty property) + { + return property.GetAttribute() == null; + } + + protected override void Initialize() + { + // If a child exists, we draw that child instead of the AssetReference field. + if (this.Property.Children.Count > 0) + { + this.hideAssetReferenceField = true; + return; + } + + this.EnsureNotRealNull(); + + this.validMainAssetTypes = OdinAddressableUtility.GetAssetReferenceValidMainAssetTypes(typeof(T)); + this.targetType = OdinAddressableUtility.GetAssetReferenceTargetType(typeof(T)); + this.targetTypeIsNotValidMainAsset = this.validMainAssetTypes.Contains(this.targetType) == false; + + this.isSpriteAtlas = this.validMainAssetTypes.Length > 0 && this.validMainAssetTypes[0] == typeof(SpriteAtlas); + + if (this.targetType == typeof(UnityEngine.Object)) + { + this.NoneSelectedLabel = "None (Addressable Asset)"; + } + else if (this.validMainAssetTypes.Length > 1 || this.validMainAssetTypes[0] != this.targetType) + { + this.NoneSelectedLabel = $"None (Addressable [{string.Join("/", this.validMainAssetTypes.Select(n => n.GetNiceName()))}]>{this.targetType.GetNiceName()})"; + } + else + { + this.NoneSelectedLabel = $"None (Addressable {this.targetType.GetNiceName()})"; + } + + this.restrictions = new List(); + foreach (var attr in this.Property.Attributes) + { + if (attr is AssetReferenceUIRestriction r) + { + this.restrictions.Add(r); + } + } + + this.disallowSubAssets_Backing = Property.GetAttribute() != null; + + this.updateShowSubAssetField = true; + } + + private string lastGuid; + + protected override void DrawPropertyLayout(GUIContent label) + { + if (this.disallowSubAssets_Backing && this.targetTypeIsNotValidMainAsset) + { + SirenixEditorGUI.WarningMessageBox($"This {typeof(T).GetNiceName()} field has been marked as not allowing sub assets, but the target type '{this.targetType.GetNiceName()}' is not a valid main asset for {typeof(T).GetNiceName()}, so the target value *must* be a sub asset. Therefore sub assets have been enabled. (Valid main asset types for {typeof(T).GetNiceName()} are: {string.Join(", ", this.validMainAssetTypes.Select(t => t.GetNiceName()))})"); + } + + if (this.hideAssetReferenceField == false) + { + var value = ValueEntry.SmartValue; + + if (this.lastGuid != this.ValueEntry.SmartValue?.AssetGUID) + { + this.updateShowSubAssetField = true; + } + + this.lastGuid = this.ValueEntry.SmartValue?.AssetGUID; + + // Update showSubAssetField. + if (this.updateShowSubAssetField && Event.current.type == EventType.Layout) + { + if (value == null || value.AssetGUID == null || value.editorAsset == null) + { + this.showSubAssetField = false; + } + else if (string.IsNullOrEmpty(value.SubObjectName) == false) + { + this.showSubAssetField = true; + } + else if (this.ActuallyDisallowSubAssets) + { + this.showSubAssetField = false; + } + else + { + var path = AssetDatabase.GUIDToAssetPath(value.AssetGUID); + + if (path == null) + { + this.showSubAssetField = false; + } + else + { + var mainAsset = AssetDatabase.LoadMainAssetAtPath(path); + this.showSubAssetField = OdinAddressableUtility.EnumerateAllActualAndVirtualSubAssets(mainAsset, path).Any(); + } + } + + this.updateShowSubAssetField = false; + } + + var rect = SirenixEditorGUI.GetFeatureRichControlRect(label, out var controlId, out var _, out var valueRect); + + Rect mainRect = valueRect; + Rect subRect = default, subPickerRect = default; + + if (this.showSubAssetField) + { + subRect = mainRect.Split(1, 2).AddX(1); + mainRect = mainRect.Split(0, 2).SubXMax(1); + subPickerRect = subRect.AlignRight(16); + } + + var mainPickerRect = mainRect.AlignRight(16); + + // Cursor + EditorGUIUtility.AddCursorRect(mainPickerRect, MouseCursor.Link); + if (showSubAssetField) + { + EditorGUIUtility.AddCursorRect(subPickerRect, MouseCursor.Link); + } + + // Selector + if (GUI.Button(mainPickerRect, "", SirenixGUIStyles.None)) + { + OpenMainAssetSelector(valueRect); + } + if (showSubAssetField && GUI.Button(subPickerRect, "", SirenixGUIStyles.None)) + { + OpenSubAssetSelector(valueRect); + } + + // Ping + if (Event.current.type == EventType.MouseDown && Event.current.button == 0 && mainRect.Contains(Event.current.mousePosition) && value != null && value.editorAsset != null) + { + EditorGUIUtility.PingObject(value.editorAsset); + } + + // Drag and drop + EditorGUI.BeginChangeCheck(); + var drop = DragAndDropUtilities.DropZone(rect, null, typeof(object), false, controlId); + if (EditorGUI.EndChangeCheck()) + { + this.EnsureNotRealNull(); + + if (this.ConvertToValidAssignment(drop, out Object obj, out bool isSubAssetAssignment)) + { + if (this.isSpriteAtlas && obj is Sprite sprite) + { + foreach (SpriteAtlas spriteAtlas in AssetDatabase_Internals.FindAssets(String.Empty, false, AssetDatabaseSearchArea.AllAssets)) + { + if (!spriteAtlas.CanBindTo(sprite)) + { + continue; + } + + this.SetMainAndSubAsset(spriteAtlas, sprite); + + break; + } + } + else + { + if (isSubAssetAssignment) + { + string path = AssetDatabase.GetAssetPath(obj); + + UnityEngine.Object mainAsset = AssetDatabase.LoadMainAssetAtPath(path); + + if (mainAsset != null) + { + if (mainAsset is Sprite mainAssetSprite) + { + this.SetMainAndSubAsset(mainAssetSprite, obj); + } + else + { + this.SetMainAndSubAsset(mainAsset, obj); + } + } + + this.updateShowSubAssetField = true; + } + else + { + var isSet = false; + + if (string.IsNullOrEmpty(this.ValueEntry.SmartValue.SubObjectName)) + { + if (obj is Sprite) + { + Object[] subAssets = AssetDatabase.LoadAllAssetRepresentationsAtPath(AssetDatabase.GetAssetPath(obj)); + + if (subAssets.Length > 0) + { + this.SetMainAndSubAsset(obj, subAssets[0]); + + isSet = true; + } + } + } + + if (!isSet) + { + this.SetMainAsset(obj); + } + } + } + + if (this.ActuallyDisallowSubAssets && + !this.targetTypeIsNotValidMainAsset && + !string.IsNullOrEmpty(this.ValueEntry.SmartValue.SubObjectName)) + { + this.SetSubAsset(null); + } + } + else if (drop == null) + { + this.SetMainAsset(null); + } + } + + // Drawing + if (Event.current.type == EventType.Repaint) + { + GUIContent valueLabel; + if (value == null || string.IsNullOrEmpty(value.AssetGUID) || value.editorAsset == null) + { + valueLabel = GUIHelper.TempContent(NoneSelectedLabel); + } + else if (showSubAssetField) + { + var path = AssetDatabase.GUIDToAssetPath(value.AssetGUID); + var assetName = System.IO.Path.GetFileNameWithoutExtension(path); + + + valueLabel = GUIHelper.TempContent(assetName, GetTheDamnPreview(value.editorAsset)); + } + else + { + valueLabel = GUIHelper.TempContent(value.editorAsset.name, GetTheDamnPreview(value.editorAsset)); + } + + GUI.Label(mainRect, valueLabel, EditorStyles.objectField); + SdfIcons.DrawIcon(mainPickerRect.SetWidth(12), SdfIconType.Record2); + + if (this.showSubAssetField) + { + if (string.IsNullOrEmpty(value.SubObjectName) || value.editorAsset == null) + { + valueLabel = GUIHelper.TempContent(""); + } + else + { + valueLabel = GUIHelper.TempContent(value.SubObjectName); + } + + GUI.Label(subRect, valueLabel, EditorStyles.objectField); + SdfIcons.DrawIcon(subPickerRect.SetWidth(12), SdfIconType.Record2); + } + } + } + else + { + this.Property.Children[0].Draw(label); + } + } + + private static Texture2D GetTheDamnPreview(UnityEngine.Object obj) + { + Texture2D img = obj as Texture2D; + + if (img == null) + { + img = (obj as Sprite)?.texture; + } + + if (img == null) + { + img = AssetPreview.GetMiniThumbnail(obj); + } + + return img; + } + + private bool ConvertToValidAssignment(object drop, out UnityEngine.Object converted, out bool isSubAssetAssignment) + { + converted = null; + isSubAssetAssignment = false; + + bool isDefinitelyMainAssetAssignment = false; + + if (object.ReferenceEquals(drop, null)) return false; + + if (!ConvertUtility.TryWeakConvert(drop, this.targetType, out object convertedObj)) + { + for (int i = 0; i < this.validMainAssetTypes.Length; i++) + { + if (ConvertUtility.TryWeakConvert(drop, this.validMainAssetTypes[i], out convertedObj)) + { + isDefinitelyMainAssetAssignment = true; + break; + } + } + } + + if (convertedObj == null || !(convertedObj is UnityEngine.Object unityObj) || unityObj == null) return false; + + converted = unityObj; + + if (isDefinitelyMainAssetAssignment) + { + isSubAssetAssignment = false; + return true; + } + else if (AssetDatabase.IsSubAsset(converted)) + { + if (this.ActuallyDisallowSubAssets) + { + return false; + } + + isSubAssetAssignment = true; + return true; + } + + return true; + } + + private void OpenMainAssetSelector(Rect rect) + { + this.EnsureNotRealNull(); + + var selector = new AddressableSelector("Select", this.validMainAssetTypes, this.restrictions, typeof(T)); + + bool isUnityRoot = this.Property.SerializationRoot?.ValueEntry.WeakSmartValue is UnityEngine.Object; + + if (isUnityRoot) + { + Undo.IncrementCurrentGroup(); + int undoIndex = Undo.GetCurrentGroup(); + + selector.SelectionCancelled += () => { Undo.RevertAllDownToGroup(undoIndex); }; + + selector.SelectionConfirmed += entries => + { + Undo.RevertAllDownToGroup(undoIndex); + + this.OnMainAssetSelect(entries.FirstOrDefault()); + }; + } + else + { + selector.SelectionConfirmed += entries => { this.OnMainAssetSelect(entries.FirstOrDefault()); }; + } + + selector.SelectionChangedWithType += (type, entries) => + { + if (type == SelectionChangedType.SelectionCleared) + { + return; + } + + AddressableAssetEntry entry = entries.FirstOrDefault(); + + this.OnMainAssetSelect(entry); + }; + + selector.ShowInPopup(rect); + } + + private void OpenSubAssetSelector(Rect rect) + { + this.EnsureNotRealNull(); + + if (this.ValueEntry.SmartValue == null || this.ValueEntry.SmartValue.AssetGUID == null) + return; + + var path = AssetDatabase.GUIDToAssetPath(this.ValueEntry.SmartValue.AssetGUID); + if (path == null) + return; + + var mainAsset = AssetDatabase.LoadMainAssetAtPath(path); + + List subAssets; + + if (mainAsset != null && mainAsset is SpriteAtlas) + { + subAssets = OdinAddressableUtility.EnumerateAllActualAndVirtualSubAssets(mainAsset, path) + .Where(val => val != null && (val is Sprite || val is Texture2D)) + .ToList(); + } + else + { + subAssets = OdinAddressableUtility.EnumerateAllActualAndVirtualSubAssets(mainAsset, path) + .Where(val => val != null && this.targetType.IsInstanceOfType(val)) + .ToList(); + } + + var items = new GenericSelectorItem[subAssets.Count + 1]; + + items[0] = new GenericSelectorItem("", null); + for (int i = 0; i < subAssets.Count; i++) + { + var item = new GenericSelectorItem(subAssets[i].name, subAssets[i]); + items[i + 1] = item; + } + + var selector = new GenericSelector("Select Sub Asset", false, items); + + selector.SelectionChanged += OnSubAssetSelect; + selector.SelectionConfirmed += OnSubAssetSelect; + + selector.ShowInPopup(rect); + } + + private void OnMainAssetSelect(AddressableAssetEntry entry) => this.UpdateAssetReference(entry); + + private void OnSubAssetSelect(IEnumerable selection) + { + if (this.ValueEntry == null || this.ValueEntry.SmartValue.AssetGUID == null) + { + return; + } + + UnityEngine.Object selected = selection.FirstOrDefault(); + + this.SetSubAsset(selected); + } + + private void UpdateAssetReference(AddressableAssetEntry entry) + { + if (entry == null) + { + this.SetMainAsset(null); + + return; + } + + if (typeof(T).InheritsFrom()) + { + this.SetMainAsset(entry.MainAsset); + + return; + } + + + if (typeof(T).InheritsFrom()) + { + UnityEngine.Object subObject = null; + + string path = AssetDatabase.GetAssetPath(entry.TargetAsset); + + if (AssetDatabase.GetMainAssetTypeAtPath(path) == typeof(SpriteAtlas)) + { + if (!(entry.TargetAsset is SpriteAtlas)) + { + subObject = entry.TargetAsset; + } + } + + this.SetMainAndSubAsset(entry.MainAsset, subObject); + } + else if (!this.ActuallyDisallowSubAssets && AssetDatabase.IsSubAsset(entry.TargetAsset)) + { + this.SetMainAndSubAsset(entry.MainAsset, entry.TargetAsset); + } + else + { + this.SetMainAsset(entry.MainAsset); + } + } + + private T CreateAssetReferenceFrom(AddressableAssetEntry entry) + { + if (entry != null) + { + return CreateAssetReferenceFrom(entry.TargetAsset); + } + else + { + return null; + } + } + + private T CreateAssetReferenceFrom(UnityEngine.Object mainAsset, UnityEngine.Object subAsset) + { + var path = AssetDatabase.GetAssetPath(mainAsset); + var guid = AssetDatabase.AssetPathToGUID(path); + + if (guid == null) return null; + + var instance = (T)Activator.CreateInstance(typeof(T), guid); + instance.SetEditorSubObject(subAsset); + return instance; + } + + private T CreateAssetReferenceFrom(UnityEngine.Object obj) + { + var path = AssetDatabase.GetAssetPath(obj); + var guid = AssetDatabase.AssetPathToGUID(path); + + if (guid == null) return null; + + var instance = (T)Activator.CreateInstance(typeof(T), guid); + + if (typeof(T).InheritsFrom()) + { + if (AssetDatabase.GetMainAssetTypeAtPath(path) == typeof(SpriteAtlas)) + { + if (!(obj is SpriteAtlas)) + { + instance.SetEditorSubObject(obj); + } + } + } + else if (typeof(T).InheritsFrom()) + { + // No need to do anything here. + // The user will need to choose a sprite + // "sub asset" from the atlas. + } + else if (this.ActuallyDisallowSubAssets == false && AssetDatabase.IsSubAsset(obj)) + { + instance.SetEditorSubObject(obj); + } + + return instance; + } + + public void PopulateGenericMenu(InspectorProperty property, GenericMenu genericMenu) + { + genericMenu.AddItem(new GUIContent("Set To Null"), false, () => + { + this.EnsureNotRealNull(); + + this.SetMainAsset(null); + }); + + if (this.ValueEntry.SmartValue != null && string.IsNullOrEmpty(this.ValueEntry.SmartValue.SubObjectName) == false) + { + genericMenu.AddItem(new GUIContent("Remove Sub Asset"), false, () => + { + this.EnsureNotRealNull(); + + this.SetSubAsset(null); + }); + } + else + { + genericMenu.AddDisabledItem(new GUIContent("Remove Sub Asset")); + } + + genericMenu.AddItem(new GUIContent("Open Groups Window"), false, OdinAddressableUtility.OpenGroupsWindow); + } + + private void SetMainAndSubAsset(UnityEngine.Object mainAsset, UnityEngine.Object subAsset, bool setDirtyIfChanged = true) + { + string subAssetName = subAsset == null ? null : subAsset.name; + + bool isDifferent = this.ValueEntry.SmartValue.editorAsset != mainAsset || + this.ValueEntry.SmartValue.SubObjectName != subAssetName; + + if (!isDifferent) + { + return; + } + + if (this.Property.SerializationRoot?.ValueEntry.WeakSmartValue is UnityEngine.Object) + { + Undo.IncrementCurrentGroup(); + + Undo.SetCurrentGroupName("Main- and Sub Asset Changed"); + + int index = Undo.GetCurrentGroup(); + + this.SetMainAsset(mainAsset, false); + this.SetSubAsset(subAsset, false); + + Undo.CollapseUndoOperations(index); + + if (setDirtyIfChanged) + { + this.Property.MarkSerializationRootDirty(); + } + } + else + { + this.SetMainAsset(mainAsset, false); + this.SetSubAsset(subAsset, false); + } + } + + private void SetMainAsset(UnityEngine.Object asset, bool setDirtyIfChanged = true) + { + if (this.ValueEntry.SmartValue.editorAsset == asset) + { + return; + } + + this.Property.RecordForUndo("Main Asset Changed"); + + this.ValueEntry.SmartValue.SetEditorAsset(asset); + + this.updateShowSubAssetField = true; + + if (setDirtyIfChanged) + { + this.Property.MarkSerializationRootDirty(); + } + } + + private void SetSubAsset(UnityEngine.Object asset, bool setDirtyIfChanged = true) + { +#if SIRENIX_INTERNAL + if (this.ValueEntry.SmartValue.editorAsset == null) + { + Debug.LogError("[SIRENIX INTERNAL] Attempted to assign the Sub Asset on an AssetReference without the Main Asset being assigned first."); + return; + } +#endif + + string assetName = asset == null ? null : asset.name; + + if (this.ValueEntry.SmartValue.SubObjectName == assetName) + { + return; + } + + this.Property.RecordForUndo("Sub Asset Changed"); + + this.ValueEntry.SmartValue.SetEditorSubObject(asset); + + this.updateShowSubAssetField = true; + + if (setDirtyIfChanged) + { + this.Property.MarkSerializationRootDirty(); + } + } + + private void EnsureNotRealNull() + { + if (this.ValueEntry.WeakSmartValue == null) + { + this.ValueEntry.SmartValue = OdinAddressableUtility.CreateAssetReferenceGuid(null); + } + } + } + + /// + /// Draws an AssetLabelReference field. + /// + [DrawerPriority(0, 1, 0)] + public class AssetLabelReferenceDrawer : OdinValueDrawer, IDefinesGenericMenuItems + { + protected override bool CanDrawValueProperty(InspectorProperty property) + { + return property.GetAttribute() == null; + } + + protected override void DrawPropertyLayout(GUIContent label) + { + var rect = SirenixEditorGUI.GetFeatureRichControlRect(label, out var controlId, out var hasKeyboardFocus, out var valueRect); + + string valueLabel; + if (this.ValueEntry.SmartValue == null || string.IsNullOrEmpty(this.ValueEntry.SmartValue.labelString)) + { + valueLabel = ""; + } + else + { + valueLabel = this.ValueEntry.SmartValue.labelString; + } + + if (GUI.Button(valueRect, valueLabel, EditorStyles.popup)) + { + var selector = new AddressableLabelSelector(); + + selector.SelectionChanged += SetLabel; + selector.SelectionConfirmed += SetLabel; + + selector.ShowInPopup(valueRect); + } + } + + private void SetLabel(IEnumerable selection) + { + var selected = selection.FirstOrDefault(); + this.ValueEntry.SmartValue = new AssetLabelReference() + { + labelString = selected, + }; + } + + public void PopulateGenericMenu(InspectorProperty property, GenericMenu genericMenu) + { + genericMenu.AddItem(new GUIContent("Set To Null"), false, () => property.ValueEntry.WeakSmartValue = null); + genericMenu.AddItem(new GUIContent("Open Label Window"), false, () => OdinAddressableUtility.OpenLabelsWindow()); + } + } + + /// + /// Odin Selector for Addressables. + /// + public class AddressableSelector : OdinSelector + { + //private static EditorPrefBool flatten = new EditorPrefBool("AddressablesSelector.Flatten", false); + public event Action> SelectionChangedWithType; + + private static EditorPrefEnum listMode = new EditorPrefEnum("AddressablesSelector.ListMode", SelectorListMode.Group); + + private readonly string title; + private readonly Type[] filterTypes; + private readonly List restrictions; + + internal bool ShowNonAddressables; + + public override string Title => this.title; + + /// + /// Initializes a AddressableSelector. + /// + /// The title of the selector. Set to null for no title. + /// The type of UnityEngine.Object to be selectable. For example, UnityEngine.Texture. For no restriction, pass in UnityEngine.Object. + /// The Addressable labels to restrict the selector to. Set to null for no label restrictions. + /// Throws if the filter type is null. + public AddressableSelector(string title, Type filterType, List restrictions, Type assetReferenceType) + : this(title, new Type[] { filterType }, restrictions, assetReferenceType) + { + } + + /// + /// Initializes a AddressableSelector. + /// + /// The title of the selector. Set to null for no title. + /// The types of UnityEngine.Object to be selectable. For example, UnityEngine.Texture. For no restriction, pass in an array containing UnityEngine.Object. + /// The Addressable labels to restrict the selector to. Set to null for no label restrictions. + /// Throws if the filter type is null. + public AddressableSelector(string title, Type[] filterTypes, List restrictions, Type assetReferenceType) + { + this.title = title; + this.filterTypes = filterTypes ?? throw new ArgumentNullException(nameof(filterTypes)); + this.restrictions = restrictions; + + if (assetReferenceType != null) + { + if (assetReferenceType.InheritsFrom() == false) + { + throw new ArgumentException("Must inherit AssetReference", nameof(assetReferenceType)); + } + else if (assetReferenceType.IsAbstract) + { + throw new ArgumentException("Cannot be abstract type.", nameof(assetReferenceType)); + } + } + } + + protected override void DrawToolbar() + { + bool drawTitle = !string.IsNullOrEmpty(this.Title); + bool drawSearchToolbar = this.SelectionTree.Config.DrawSearchToolbar; + bool drawButton = this.DrawConfirmSelectionButton; + + if (drawTitle || drawSearchToolbar || drawButton) + { + SirenixEditorGUI.BeginHorizontalToolbar(this.SelectionTree.Config.SearchToolbarHeight); + { + DrawToolbarTitle(); + DrawToolbarSearch(); + EditorGUI.DrawRect(GUILayoutUtility.GetLastRect().AlignLeft(1), SirenixGUIStyles.BorderColor); + + SdfIconType icon; + if (listMode.Value == SelectorListMode.Path) + icon = SdfIconType.ListNested; + else if (listMode.Value == SelectorListMode.Group) + icon = SdfIconType.ListStars; + else if (listMode.Value == SelectorListMode.Flat) + icon = SdfIconType.List; + else + icon = SdfIconType.X; + + if (SirenixEditorGUI.ToolbarButton(icon, true)) + { + int m = (int)listMode.Value + 1; + + if (m >= (int)SelectorListMode.Max) + { + m = 0; + } + + listMode.Value = (SelectorListMode)m; + + this.RebuildMenuTree(); + } + + EditorGUI.BeginChangeCheck(); + this.ShowNonAddressables = SirenixEditorGUI.ToolbarToggle(this.ShowNonAddressables, EditorIcons.UnityLogo); + if (EditorGUI.EndChangeCheck()) + { + this.RebuildMenuTree(); + } + + if (SirenixEditorGUI.ToolbarButton(SdfIconType.GearFill, true)) + { + OdinAddressableUtility.OpenGroupsWindow(); + } + + DrawToolbarConfirmButton(); + } + SirenixEditorGUI.EndHorizontalToolbar(); + } + } + + protected override void BuildSelectionTree(OdinMenuTree tree) + { + if (this.SelectionChangedWithType != null) + { + tree.Selection.SelectionChanged += type => + { + IEnumerable selection = this.GetCurrentSelection(); + + if (this.IsValidSelection(selection)) + { + this.SelectionChangedWithType(type, selection); + } + }; + } + + tree.Config.EXPERIMENTAL_INTERNAL_SparseFixedLayouting = true; + + tree.Config.SelectMenuItemsOnMouseDown = true; + + if (AddressableAssetSettingsDefaultObject.SettingsExists) + { + AddressableAssetSettings settings = AddressableAssetSettingsDefaultObject.Settings; + + foreach (AddressableAssetGroup group in settings.groups) + { + if (group == null || group.name == "Built In Data") + { + continue; + } + + foreach (AddressableAssetEntry entry in group.entries) + { + this.AddEntriesToTree(tree, group.name, entry); + } + } + } + + foreach (OdinMenuItem item in tree.EnumerateTree()) + { + if (item.Value == null) + { + item.SdfIcon = SdfIconType.Folder; + } + } + + if (this.ShowNonAddressables) + { + var searchFilter = ""; + + foreach (Type filterType in this.filterTypes) + { + searchFilter += $"t:{filterType.Name} "; + } + + IEnumerator enumerator = AssetDatabase_Internals.EnumerateAllAssets(searchFilter, false, AssetDatabaseSearchArea.InAssetsOnly); + + if (enumerator.MoveNext()) + { + var addedGuids = new HashSet(); + + foreach (OdinMenuItem item in tree.EnumerateTree()) + { + if (item.Value != null) + { + addedGuids.Add((item.Value as AddressableAssetEntry).guid); + } + } + + const string NON_ADDRESSABLES_ITEM_NAME = "Non Addressables"; + + var nonAddressablesItem = new OdinMenuItem(tree, NON_ADDRESSABLES_ITEM_NAME, null) {Icon = EditorIcons.UnityLogo}; + + tree.MenuItems.Add(nonAddressablesItem); + + do + { + HierarchyProperty current = enumerator.Current; + + if (addedGuids.Contains(current.guid) || !current.isMainRepresentation) + { + continue; + } + + AddressableAssetEntry entry = OdinAddressableUtility.CreateFakeAddressableAssetEntry(current.guid); + + if (listMode == SelectorListMode.Flat) + { + var item = new OdinMenuItem(tree, current.name, entry) {Icon = current.icon}; + + nonAddressablesItem.ChildMenuItems.Add(item); + } + else + { + string path = AssetDatabase.GetAssetPath(current.instanceID); + + if (!current.isFolder) + { + int extensionEndingIndex = GetExtensionsEndingIndex(path); + + if (extensionEndingIndex != -1) + { + path = path.Substring(0, extensionEndingIndex); + } + } + + path = RemoveBaseDirectoryFromAssetPath(path); + + tree.Add($"{NON_ADDRESSABLES_ITEM_NAME}/{path}", entry, current.icon); + } + } while (enumerator.MoveNext()); + + nonAddressablesItem.ChildMenuItems.SortMenuItemsByName(); + } + } + + OdinMenuItem noneItem; + + if (this.filterTypes.Contains(typeof(UnityEngine.Object))) + { + noneItem = new OdinMenuItem(tree, " (Addressable Asset)", null); + } + else + { + string filterTypesJoined; + + if (this.filterTypes.Length == 1) + { + filterTypesJoined = this.filterTypes[0].GetNiceName(); + } + else + { + filterTypesJoined = string.Join("/", this.filterTypes.Select(t => t.GetNiceName())); + } + + noneItem = new OdinMenuItem(tree, $" (Addressable {filterTypesJoined})", null); + } + + noneItem.SdfIcon = SdfIconType.X; + tree.MenuItems.Insert(0, noneItem); + } + + private static int GetExtensionsEndingIndex(string path) + { + for (var i = path.Length - 1; i >= 0; i--) + { + if (path[i] == '\\' || path[i] == '/') + { + return -1; + } + + if (path[i] == '.') + { + return i; + } + } + + return -1; + } + + private static string RemoveBaseDirectoryFromAssetPath(string path) + { + if (path.StartsWith("Assets/")) + { + return path.Remove(0, "Assets/".Length); + } + + return path; + } + + private void AddEntriesToTree(OdinMenuTree tree, string groupName, AddressableAssetEntry entry) + { + if (entry == null) + { + return; + } + + bool isFolder = entry.IsFolder || AssetDatabase.IsValidFolder(entry.AssetPath); + + if (isFolder) + { + entry.GatherAllAssets(null, false, false, true, null); + + if (entry.SubAssets != null) + { + foreach (AddressableAssetEntry e in entry.SubAssets) + { + this.AddEntriesToTree(tree, groupName, e); + } + } + } + else + { + UnityEngine.Object asset = entry.TargetAsset; + + if (asset == null) + { + return; + } + + Type assetType = asset.GetType(); + var inheritsFromFilterType = false; + + for (var i = 0; i < this.filterTypes.Length; i++) + { + if (this.filterTypes[i].IsAssignableFrom(assetType)) + { + inheritsFromFilterType = true; + break; + } + } + + if (inheritsFromFilterType && this.PassesRestrictions(entry)) + { + string name; + if (listMode.Value == SelectorListMode.Group) + { + name = entry.address; + } + else if (listMode.Value == SelectorListMode.Path) + { + name = System.IO.Path.GetFileNameWithoutExtension(entry.AssetPath); + } + else if (listMode.Value == SelectorListMode.Flat) + { + name = entry.address; + } + else + { + throw new Exception("Unsupported list mode: " + listMode.Value); + } + + var item = new OdinMenuItem(tree, name, entry) + { + Icon = AssetPreview.GetMiniThumbnail(asset) + }; + + if (listMode.Value == SelectorListMode.Group) + { + OdinMenuItem groupItem = tree.GetMenuItem(groupName); + + if (groupItem == null) + { + groupItem = new OdinMenuItem(tree, groupName, null); + tree.MenuItems.Add(groupItem); + } + + if (entry.ParentEntry != null && entry.ParentEntry.IsFolder) + { + OdinMenuItem folderItem = null; + + for (int i = 0; i < groupItem.ChildMenuItems.Count; i++) + { + if (groupItem.ChildMenuItems[i].Name == entry.ParentEntry.address) + { + folderItem = groupItem.ChildMenuItems[i]; + break; + } + } + + if (folderItem == null) + { + folderItem = new OdinMenuItem(tree, entry.ParentEntry.address, null); + groupItem.ChildMenuItems.Add(folderItem); + } + + folderItem.ChildMenuItems.Add(item); + } + else + { + groupItem.ChildMenuItems.Add(item); + } + } + else if (listMode.Value == SelectorListMode.Path) + { + tree.AddMenuItemAtPath(System.IO.Path.GetDirectoryName(entry.AssetPath), item); + } + else if (listMode.Value == SelectorListMode.Flat) + { + tree.MenuItems.Add(item); + } + } + } + } + + private bool PassesRestrictions(AddressableAssetEntry entry) + { + if (restrictions == null) return true; + + return OdinAddressableUtility.ValidateAssetReferenceRestrictions(restrictions, entry.MainAsset); + + //for (int i = 0; i < this.restrictions.Count; i++) + //{ + // if (this.restrictions[i].ValidateAsset(entry.AssetPath) == false) + // { + // return false; + // } + //} + + //return true; + + /* If for whatever reason Unity haven't actually implemented their restriction methods, then we can use this code to atleast implement label restriction. */ + //if (this.labelRestrictions == null) return true; + + //for (int i = 0; i < labelRestrictions.Length; i++) + //{ + // if (entry.labels.Contains(labelRestrictions[i])) return true; + //} + + //return false; + } + + private enum SelectorListMode + { + Group, + Path, + Flat, + + Max, + } + } + + public class AddressableLabelSelector : OdinSelector + { + protected override void DrawToolbar() + { + bool drawTitle = !string.IsNullOrEmpty(this.Title); + bool drawSearchToolbar = this.SelectionTree.Config.DrawSearchToolbar; + bool drawButton = this.DrawConfirmSelectionButton; + + if (drawTitle || drawSearchToolbar || drawButton) + { + SirenixEditorGUI.BeginHorizontalToolbar(this.SelectionTree.Config.SearchToolbarHeight); + { + DrawToolbarTitle(); + DrawToolbarSearch(); + EditorGUI.DrawRect(GUILayoutUtility.GetLastRect().AlignLeft(1), SirenixGUIStyles.BorderColor); + + if (SirenixEditorGUI.ToolbarButton(SdfIconType.GearFill, true)) + { + OdinAddressableUtility.OpenLabelsWindow(); + } + + DrawToolbarConfirmButton(); + } + SirenixEditorGUI.EndHorizontalToolbar(); + } + } + protected override void BuildSelectionTree(OdinMenuTree tree) + { + IList labels = null; + + if (AddressableAssetSettingsDefaultObject.SettingsExists) + { + var settings = AddressableAssetSettingsDefaultObject.Settings; + labels = settings.GetLabels(); + } + + if (labels == null) labels = Array.Empty(); + + tree.MenuItems.Add(new OdinMenuItem(tree, "", null)); + + for (int i = 0; i < labels.Count; i++) + { + tree.MenuItems.Add(new OdinMenuItem(tree, labels[i], labels[i])); + } + } + } + + /// + /// Resolves children for AssetReference properties, and implements the RegisterAssetReferenceAttributeForwardToChild behaviour. + /// + /// The concrete type of AssetReference to be drawn. For example, AssetReferenceTexture. + public class AssetReferencePropertyResolver : OdinPropertyResolver + where T : AssetReference + { + private static readonly Type[] attributesToForward; + + static AssetReferencePropertyResolver() + { + attributesToForward = AppDomain.CurrentDomain.GetAssemblies() + .SelectMany(x => x.GetCustomAttributes()) + .Cast() + .Select(x => x.AttributeType) + .ToArray(); + } + + public override int ChildNameToIndex(string name) + { + return 0; + } + + public override int ChildNameToIndex(ref StringSlice name) + { + return 0; + } + + public override InspectorPropertyInfo GetChildInfo(int childIndex) + { + var targetType = OdinAddressableUtility.GetAssetReferenceTargetType(typeof(T)); + var getterSetterType = typeof(AssetReferenceValueGetterSetter<>).MakeGenericType(typeof(T), targetType); + + var getterSetter = Activator.CreateInstance(getterSetterType) as IValueGetterSetter; + + List attributes = new List + { + new ShowInInspectorAttribute(), + }; + + foreach (var type in attributesToForward) + { + var attr = this.Property.Attributes.FirstOrDefault(x => x.GetType() == type); + if (attr != null) + { + attributes.Add(attr); + } + } + + string label = "Asset"; + + return InspectorPropertyInfo.CreateValue(label, 0, SerializationBackend.None, getterSetter, attributes); + } + + protected override int GetChildCount(T value) + { + foreach (var attr in attributesToForward) + { + if (this.Property.Attributes.Any(x => x.GetType() == attr)) + { + return 1; + } + } + + return 0; + } + + private class AssetReferenceValueGetterSetter : IValueGetterSetter + where TTarget : UnityEngine.Object + { + public bool IsReadonly => false; + + public Type OwnerType => typeof(T); + + public Type ValueType => typeof(TTarget); + + public TTarget GetValue(ref T owner) + { + var v = owner.editorAsset; + return v as TTarget; + } + + public object GetValue(object owner) + { + var v = (owner as T)?.editorAsset; + return v as TTarget; + } + + public void SetValue(ref T owner, TTarget value) + { + owner.SetEditorAsset(value); + } + + public void SetValue(object owner, object value) + { + (owner as T).SetEditorAsset(value as TTarget); + } + } + } + + /// + /// Processes attributes for AssetReference properties. + /// + /// The concrete type of AssetReference to be drawn. For example, AssetReferenceTexture. + public class AssetReferenceAttributeProcessor : OdinAttributeProcessor + where T : AssetReference + { + public override void ProcessSelfAttributes(InspectorProperty property, List attributes) + { + attributes.Add(new DoNotDrawAsReferenceAttribute()); + attributes.Add(new HideReferenceObjectPickerAttribute()); + attributes.Add(new SuppressInvalidAttributeErrorAttribute()); // TODO: Remove this with proper attribute forwarding support. + } + } + + /// + /// Processes attributes for AssetLabelReference properties. + /// + public class AssetLabelReferenceAttributeProcessor : OdinAttributeProcessor + { + public override void ProcessSelfAttributes(InspectorProperty property, List attributes) + { + attributes.Add(new DoNotDrawAsReferenceAttribute()); + attributes.Add(new HideReferenceObjectPickerAttribute()); + } + } + + /// + /// Implements conversion behaviour for addressables. + /// + [InitializeOnLoad] + internal class AssetReferenceConverter : ConvertUtility.ICustomConverter + { + private readonly Type type_AssetEntryTreeViewItem; + private WeakValueGetter get_AssetEntryTreeViewItem_entry; + + static AssetReferenceConverter() + { + ConvertUtility.AddCustomConverter(new AssetReferenceConverter()); + } + + public AssetReferenceConverter() + { + this.type_AssetEntryTreeViewItem = TwoWaySerializationBinder.Default.BindToType("UnityEditor.AddressableAssets.GUI.AssetEntryTreeViewItem") ?? throw new Exception("Failed to find UnityEditor.AddressableAssets.GUI.AddressableAssetEntryTreeViewItem type."); + var field_AssetEntryTreeViewItem_entry = type_AssetEntryTreeViewItem.GetField("entry", Flags.AllMembers) ?? throw new Exception("Failed to find entry field in UnityEditor.AddressableAssets.GUI.AddressableAssetEntryTreeViewItem type."); + this.get_AssetEntryTreeViewItem_entry = EmitUtilities.CreateWeakInstanceFieldGetter(type_AssetEntryTreeViewItem, field_AssetEntryTreeViewItem_entry); + } + + // UnityEngine.Object > AssetReference/T + // AddressableAssetEntry > AssetReference + // AssetReference/T > UnityEngine.Object + // AssetReference/T > AssetReference/T + // AddressableAssetEntry > UnityEngine.Object + + public bool CanConvert(Type from, Type to) + { + var comparer = FastTypeComparer.Instance; + + if (to.InheritsFrom(typeof(AssetReference))) + { + if (comparer.Equals(from, typeof(AddressableAssetEntry)) || comparer.Equals(from, type_AssetEntryTreeViewItem)) + { + return true; + } + else if (from.InheritsFrom()) + { + if (to.InheritsFrom(typeof(AssetReferenceT<>))) + { + var baseType = to.GetGenericBaseType(typeof(AssetReferenceT<>)); + + var targetType = baseType.GetGenericArguments()[0]; + + return from.InheritsFrom(targetType); + } + else + { + return true; + } + } + else if (from.InheritsFrom(typeof(AssetReference))) + { + return to.InheritsFrom(from); + } + else + { + return false; + } + } + else if (from.InheritsFrom(typeof(AssetReference)) && to.InheritsFrom()) + { + return false; + } + else + { + return false; + } + } + + public bool TryConvert(object obj, Type to, out object result) + { + if (obj == null) + { + result = null; + return false; + } + + var comparer = FastTypeComparer.Instance; + + // AssetEntryTreeViewItems is a UI element container for AddressableAssetEntry. + // With this we can just treat AssetEntryTreeViewItems as an AddressableAssetEntry. + if (comparer.Equals(obj.GetType(), type_AssetEntryTreeViewItem)) + { + obj = get_AssetEntryTreeViewItem_entry(ref obj); + } + + if (to.InheritsFrom(typeof(AssetReference))) + { + Type assetType; + if (to.InheritsFrom(typeof(AssetReferenceT<>))) + { + var baseType = to.GetGenericBaseType(typeof(AssetReferenceT<>)); + assetType = baseType.GetGenericArguments()[0]; + } + else + { + assetType = typeof(UnityEngine.Object); + } + + if (obj is UnityEngine.Object uObj) + { + if (obj.GetType().InheritsFrom(assetType)) + { + string guid = AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(uObj)); + + if (string.IsNullOrEmpty(guid) == false) + { + + result = CreateReference(to, uObj); + return true; + } + else + { + result = null; + return false; + } + } + else + { + result = null; + return false; + } + } + else if (obj is AddressableAssetEntry entry) + { + if (entry.TargetAsset.GetType().InheritsFrom(assetType)) + { + result = CreateReference(to, entry.TargetAsset); + return true; + + } + else + { + result = null; + return false; + } + } + else if (obj is AssetReference reference) + { + if (TryGetReferencedAsset(reference, assetType, out var asset)) + { + result = CreateReference(to, asset); + return true; + } + else + { + result = null; + return false; + } + } + else + { + result = null; + return false; + } + } + else if (to.InheritsFrom(typeof(UnityEngine.Object)) && obj is AssetReference reference) + { + if (TryGetReferencedAsset(reference, to, out var asset)) + { + result = asset; + return true; + } + else + { + result = null; + return false; + } + } + else if (to.InheritsFrom(typeof(UnityEngine.Object)) && obj is AddressableAssetEntry entry) + { + var target = entry.TargetAsset; + if (target == null) + { + result = null; + return false; + } + else if (target.GetType().InheritsFrom(to)) + { + result = target; + return true; + } + else if (ConvertUtility.TryWeakConvert(target, to, out var converted)) + { + result = converted; + return true; + } + else + { + result = null; + return false; + } + } + else + { + result = null; + return false; + } + } + + private bool TryGetReferencedAsset(AssetReference reference, Type to, out UnityEngine.Object asset) + { + if (reference.AssetGUID == null) + { + asset = null; + return false; + } + + var path = AssetDatabase.GUIDToAssetPath(reference.AssetGUID); + + if (reference.SubObjectName != null) + { + asset = null; + + foreach (var subAsset in OdinAddressableUtility.EnumerateAllActualAndVirtualSubAssets(reference.editorAsset, path)) + { + if (subAsset.name == reference.SubObjectName) + { + asset = subAsset; + break; + } + } + } + else + { + asset = AssetDatabase.LoadAssetAtPath(path); + } + + if (asset != null) + { + if (asset.GetType().InheritsFrom(to)) + { + return true; + } + else if (ConvertUtility.TryWeakConvert(asset, to, out var converted)) + { + asset = (UnityEngine.Object)converted; + return true; + } + else + { + asset = null; + return false; + } + } + else + { + return false; + } + } + + private AssetReference CreateReference(Type type, UnityEngine.Object obj) + { + var reference = (AssetReference)Activator.CreateInstance(type, new string[] { AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(obj)) }); + if (AssetDatabase.IsSubAsset(obj)) + { + reference.SetEditorAsset(obj); + } + + return reference; + } + } + + /// + /// Odin Inspector utility methods for working with addressables. + /// + public static class OdinAddressableUtility + { + private readonly static Action openAddressableWindowAction; + + static OdinAddressableUtility() + { + var type = TwoWaySerializationBinder.Default.BindToType("UnityEditor.AddressableAssets.GUI.AddressableAssetsWindow") ?? throw new Exception(""); + var method = type.GetMethod("Init", Flags.AllMembers) ?? throw new Exception(""); + openAddressableWindowAction = (Action)Delegate.CreateDelegate(typeof(Action), method); + } + + public static IEnumerable EnumerateAllActualAndVirtualSubAssets(UnityEngine.Object mainAsset, string mainAssetPath) + { + if (mainAsset == null) + { + yield break; + } + + Object[] subAssets = AssetDatabase.LoadAllAssetRepresentationsAtPath(mainAssetPath); + + foreach (Object subAsset in subAssets) + { + yield return subAsset; + } + + // The sprites/textures in a sprite atlas are not sub assets of the atlas, but they are apparently + // still part of the atlas in a way that the addressables system considers a sub asset. + if (mainAsset is UnityEngine.U2D.SpriteAtlas atlas) + { + Object[] packables = atlas.GetPackables(); + + foreach (Object packable in packables) + { + if (packable == null) + { + continue; + } + + if (!(packable is DefaultAsset packableFolder)) + { + yield return packable; + continue; + } + + string packablePath = AssetDatabase.GetAssetPath(packableFolder); + + if (!AssetDatabase.IsValidFolder(packablePath)) + { + continue; + } + + string[] files = Directory.GetFiles(packablePath, "*.*", SearchOption.AllDirectories); + + foreach (string file in files) + { + if (file.EndsWith(".meta")) + { + continue; + } + + Type assetType = AssetDatabase.GetMainAssetTypeAtPath(file); + + if (assetType != typeof(Sprite) && assetType != typeof(Texture2D)) + { + continue; + } + + yield return AssetDatabase.LoadMainAssetAtPath(file); + } + } + } + } + + /// + /// Opens the addressables group settings window. + /// + public static void OpenGroupsWindow() + { + openAddressableWindowAction(); + } + + /// + /// Opens the addressables labels settings window. + /// + public static void OpenLabelsWindow() + { + if (!AddressableAssetSettingsDefaultObject.SettingsExists) return; + EditorWindow.GetWindow().Intialize(AddressableAssetSettingsDefaultObject.Settings); + } + + /// + /// Converts the specified object into an addressable. + /// + /// The object to make addressable. + /// The addressable group to add the object to. + public static void MakeAddressable(UnityEngine.Object obj, AddressableAssetGroup group) + { + if (!AddressableAssetSettingsDefaultObject.SettingsExists) return; + + var settings = AddressableAssetSettingsDefaultObject.Settings; + var guid = AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(obj)); + var entry = settings.CreateOrMoveEntry(guid, group, false, false); + entry.address = AssetDatabase.GUIDToAssetPath(guid); + settings.SetDirty(AddressableAssetSettings.ModificationEvent.EntryCreated, entry, false, true); + } + + /// + /// Gets the type targeted by an AssetReference type. For example, returns Texture for AssetReferenceTexture. + /// Returns UnityEngine.Object for AssetReference type. + /// + /// A type of AssetReference, for example, AssetReferenceTexture. + /// + /// If the given type inherits AssetRefernceT<T>, then the method returns the generic T argument. + /// If the given type is AssetReference, then the method returns UnityEngine.Object. + /// + /// Throws if given parameter is null. + /// Throws if the given type does not inherit or is AssetReference. + public static Type GetAssetReferenceTargetType(Type assetReferenceType) + { + if (assetReferenceType == null) throw new ArgumentNullException(nameof(assetReferenceType)); + + if (assetReferenceType.InheritsFrom(typeof(AssetReferenceT<>))) + { + var genericBase = assetReferenceType.GetGenericBaseType(typeof(AssetReferenceT<>)); + return genericBase.GetGenericArguments()[0]; + } + else + { + return typeof(UnityEngine.Object); + } + } + + public static Type[] GetAssetReferenceValidMainAssetTypes(Type assetReferenceType) + { + if (assetReferenceType == null) throw new ArgumentNullException(nameof(assetReferenceType)); + + if (assetReferenceType.InheritsFrom(typeof(AssetReferenceSprite))) + { + return new Type[] + { + typeof(Sprite), + typeof(SpriteAtlas), + typeof(Texture2D) + }; + } + else if (assetReferenceType.InheritsFrom(typeof(AssetReferenceAtlasedSprite))) + { + return new Type[] { typeof(SpriteAtlas) }; + } + + return new Type[] { GetAssetReferenceTargetType(assetReferenceType) }; + } + + /// + /// Validate an asset against a list of AssetReferenceUIRestrictions. + /// + /// The restrictions to apply. + /// The asset to validate. + /// Returns true if the asset passes all restrictions. Otherwise false. + /// Throws if Addressable Settings have not been created. + /// Throws if restrictions or asset is null. + public static bool ValidateAssetReferenceRestrictions(List restrictions, UnityEngine.Object asset) + { + return ValidateAssetReferenceRestrictions(restrictions, asset, out _); + } + + /// + /// Validate an asset against a list of AssetReferenceUIRestrictions. + /// + /// The restrictions to apply. + /// The asset to validate. + /// The first failed restriction. null if no restrictions failed. + /// Returns true if the asset passes all restrictions. Otherwise false. + /// Throws if Addressable Settings have not been created. + /// Throws if restrictions or asset is null. + public static bool ValidateAssetReferenceRestrictions(List restrictions, UnityEngine.Object asset, out AssetReferenceUIRestriction failedRestriction) + { + if (AddressableAssetSettingsDefaultObject.SettingsExists == false) throw new Exception("Addressable Settings have not been created."); + + _ = restrictions ?? throw new ArgumentNullException(nameof(restrictions)); + _ = asset ?? throw new ArgumentNullException(nameof(asset)); + + for (int i = 0; i < restrictions.Count; i++) + { + if (restrictions[i] is AssetReferenceUILabelRestriction labels) + { + /* Unity, in all its wisdom, have apparently decided not to implement their AssetReferenceRestriction attributes in some versions(?) + * So, to compensate, we're going to manually validate the label restriction attribute, so atleast that works. */ + + var guid = AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(asset)); + + var entry = AddressableAssetSettingsDefaultObject.Settings.FindAssetEntry(guid, true); + + if (entry.labels.Any(x => labels.m_AllowedLabels.Contains(x)) == false) + { + failedRestriction = labels; + return false; + } + } + else if (restrictions[i].ValidateAsset(asset) == false) + { + failedRestriction = restrictions[i]; + return false; + } + } + + failedRestriction = null; + return true; + } + + internal static TAssetReference CreateAssetReferenceGuid(string guid) where TAssetReference : AssetReference + { + return (TAssetReference) Activator.CreateInstance(typeof(TAssetReference), guid); + } + + internal static TAssetReference CreateAssetReference(UnityEngine.Object obj) where TAssetReference : AssetReference + { + if (obj == null) + { + return CreateAssetReferenceGuid(null); + } + + string guid = AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(obj)); + + return CreateAssetReferenceGuid(guid); + } + + internal static AddressableAssetEntry CreateFakeAddressableAssetEntry(string guid) + { + var entry = (AddressableAssetEntry) FormatterServices.GetUninitializedObject(typeof(AddressableAssetEntry)); + + OdinAddressableReflection.AddressableAssetEntry_mGUID_Field.SetValue(entry, guid); + + return entry; + } + } +} +#endif \ No newline at end of file diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/AddressablesInspectors.cs.meta b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/AddressablesInspectors.cs.meta new file mode 100644 index 0000000..66d12ee --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/AddressablesInspectors.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ba1664ec1a0467641a742eaadae146d4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Internal.meta b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Internal.meta new file mode 100644 index 0000000..b945d11 --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Internal.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 6384593779a7421881db64cdb25db4c5 +timeCreated: 1718984862 \ No newline at end of file diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Internal/OdinAddressableReflection.cs b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Internal/OdinAddressableReflection.cs new file mode 100644 index 0000000..2df8f79 --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Internal/OdinAddressableReflection.cs @@ -0,0 +1,30 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- + +#if UNITY_EDITOR + +#if !SIRENIX_INTERNAL +#pragma warning disable +#endif + +using System.Reflection; +using UnityEditor.AddressableAssets.Settings; + +namespace Sirenix.OdinInspector.Modules.Addressables.Editor.Internal +{ + internal static class OdinAddressableReflection + { + public static FieldInfo AddressableAssetEntry_mGUID_Field; + + static OdinAddressableReflection() + { + AddressableAssetEntry_mGUID_Field = typeof(AddressableAssetEntry).GetField("m_GUID", BindingFlags.Instance | BindingFlags.NonPublic); + } + + internal static void EnsureConstructed() { } + } +} +#endif \ No newline at end of file diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Internal/OdinAddressableReflection.cs.meta b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Internal/OdinAddressableReflection.cs.meta new file mode 100644 index 0000000..55c0373 --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Internal/OdinAddressableReflection.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: c1a8e9ae60bf4edebd0ec6052eb9064e +timeCreated: 1718984883 \ No newline at end of file diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Internal/OdinAddressableReflectionValidator.cs b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Internal/OdinAddressableReflectionValidator.cs new file mode 100644 index 0000000..4a287ea --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Internal/OdinAddressableReflectionValidator.cs @@ -0,0 +1,46 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- + +#if UNITY_EDITOR +#if SIRENIX_INTERNAL +using System.Collections; +using System.Reflection; +using Sirenix.OdinInspector.Editor.Validation; +using Sirenix.OdinInspector.Modules.Addressables.Editor.Internal; + +[assembly: RegisterValidator(typeof(OdinAddressableReflectionValidator))] + +namespace Sirenix.OdinInspector.Modules.Addressables.Editor.Internal +{ + public class OdinAddressableReflectionValidator : GlobalValidator + { + public override IEnumerable RunValidation(ValidationResult result) + { + OdinAddressableReflection.EnsureConstructed(); + + FieldInfo[] fields = typeof(OdinAddressableReflection).GetFields(BindingFlags.Static | BindingFlags.Public); + + for (var i = 0; i < fields.Length; i++) + { + if (fields[i].IsLiteral) + { + continue; + } + + if (fields[i].GetValue(null) != null) + { + continue; + } + + result.AddError($"[Odin Addressable Module]: {fields[i].Name} was not found."); + } + + return null; + } + } +} +#endif +#endif \ No newline at end of file diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Internal/OdinAddressableReflectionValidator.cs.meta b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Internal/OdinAddressableReflectionValidator.cs.meta new file mode 100644 index 0000000..e662bfb --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Internal/OdinAddressableReflectionValidator.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 97bf306f5a4249b192921db9152934f6 +timeCreated: 1718984873 \ No newline at end of file diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Sirenix.OdinInspector.Modules.Unity.Addressables.asmdef b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Sirenix.OdinInspector.Modules.Unity.Addressables.asmdef new file mode 100644 index 0000000..7be66dc --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Sirenix.OdinInspector.Modules.Unity.Addressables.asmdef @@ -0,0 +1,29 @@ +{ + "name": "Sirenix.OdinInspector.Modules.Unity.Addressables", + "references": [ + "Unity.Addressables", + "Unity.Addressables.Editor", + "Sirenix.Serialization", + "Sirenix.OdinInspector.Attributes", + "Sirenix.OdinInspector.Editor", + "Sirenix.Utilities.Editor", + "Sirenix.Utilities", + "Sirenix.OdinValidator.Editor" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": true, + "overrideReferences": false, + "precompiledReferences": [ + "Sirenix.Serialization.dll", + "Sirenix.OdinInspector.Attributes.dll", + "Sirenix.OdinInspector.Editor.dll", + "Sirenix.Utilities.Editor.dll", + "Sirenix.Utilities.dll", + "Sirenix.OdinValidator.Editor.dll" + ], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Sirenix.OdinInspector.Modules.Unity.Addressables.asmdef.meta b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Sirenix.OdinInspector.Modules.Unity.Addressables.asmdef.meta new file mode 100644 index 0000000..f7deb1d --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Sirenix.OdinInspector.Modules.Unity.Addressables.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3b4d8e09c665bfa47849130d8695171e +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators.meta b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators.meta new file mode 100644 index 0000000..05862c2 --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b568c1d508ce0b74eb0025b8501d1c1e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/AssetLabelReferenceValidator.cs b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/AssetLabelReferenceValidator.cs new file mode 100644 index 0000000..39c1d1f --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/AssetLabelReferenceValidator.cs @@ -0,0 +1,98 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- + +#if UNITY_EDITOR + +#if !SIRENIX_INTERNAL +#pragma warning disable +#endif + +using UnityEngine; +using UnityEditor.AddressableAssets; +using Sirenix.OdinInspector.Editor.Validation; +using UnityEngine.AddressableAssets; +using Sirenix.OdinInspector.Modules.Addressables.Editor; + +#if ODIN_VALIDATOR_3_1 +[assembly: RegisterValidationRule(typeof(AssetLabelReferenceValidator), Description = + "This validator ensures that AssetLabelReferences marked with the Required attribute display an error " + + "message if they are not set. It can also be configured to require that all AssetLabelReferences be set " + + "by default; the Optional attribute can then be used to exclude specific AssetLabelReferences from " + + "validation.")] +#else +[assembly: RegisterValidator(typeof(AssetLabelReferenceValidator))] +#endif + +namespace Sirenix.OdinInspector.Modules.Addressables.Editor +{ + /// + /// Validator for AssetLabelReference values. + /// + public class AssetLabelReferenceValidator : ValueValidator + { + [Tooltip("If enabled, the validator will display an error message if the AssetLabelReference is not set. " + + "If disabled, the validator will only display an error message if the AssetLabelReference is set, but the " + + "assigned label does not exist.")] + [ToggleLeft] + public bool RequiredByDefault; + + private bool required; + private bool optional; + private string requiredMessage; + + protected override void Initialize() + { + var requiredAttr = this.Property.GetAttribute(); + + this.requiredMessage = requiredAttr?.ErrorMessage ?? $"{this.Property.NiceName} is required."; + + if (this.RequiredByDefault) + { + required = true; + optional = Property.GetAttribute() != null; + } + else + { + required = requiredAttr != null; + optional = false; + } + } + + protected override void Validate(ValidationResult result) + { + // If the Addressables settings have not been created, nothing else is really valid. + if (AddressableAssetSettingsDefaultObject.SettingsExists == false) + { + result.AddError("Addressables Settings have not been created.") + .WithButton("Open Settings Window", () => OdinAddressableUtility.OpenGroupsWindow()); + return; + } + + var value = Value?.labelString; + + if (string.IsNullOrEmpty(value)) + { + if (optional == false && required) // Optional == false & required? Nice. + { + result.AddError(requiredMessage).EnableRichText(); + } + } + else + { + var labels = AddressableAssetSettingsDefaultObject.Settings.GetLabels(); + + if (labels.Contains(value) == false) + { + result.AddError($"Label {value} has not been created as a label.") + .WithButton("Open Label Settings", () => OdinAddressableUtility.OpenLabelsWindow()); + } + } + } + } + +} + +#endif \ No newline at end of file diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/AssetLabelReferenceValidator.cs.meta b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/AssetLabelReferenceValidator.cs.meta new file mode 100644 index 0000000..c9b6cfc --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/AssetLabelReferenceValidator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fcaf7dc3b9a98a545b301a1ea175055b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/AssetReferenceValidator.cs b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/AssetReferenceValidator.cs new file mode 100644 index 0000000..bc75583 --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/AssetReferenceValidator.cs @@ -0,0 +1,284 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- + +#if UNITY_EDITOR + +#if !SIRENIX_INTERNAL +#pragma warning disable +#endif + +using System.Collections.Generic; +using System.Linq; +using UnityEngine; +using UnityEditor; +using UnityEditor.AddressableAssets; +using Sirenix.OdinInspector.Editor.Validation; +using Sirenix.Utilities; +using Sirenix.Utilities.Editor; +using UnityEditor.AddressableAssets.Settings; +using UnityEngine.AddressableAssets; +using Sirenix.OdinInspector.Modules.Addressables.Editor; + +#if ODIN_VALIDATOR_3_1 +[assembly: RegisterValidationRule(typeof(AssetReferenceValidator), Description = + "This validator provides robust integrity checks for your asset references within Unity. " + + "It validates whether an asset reference has been assigned, and if it's missing, raises an error. " + + "It further checks the existence of the main asset at the assigned path, ensuring it hasn't been " + + "inadvertently deleted or moved. The validator also verifies if the assigned asset is addressable " + + "and, if not, offers a fix to make it addressable. Moreover, it ensures the asset adheres to " + + "specific label restrictions set through the AssetReferenceUILabelRestriction attribute. " + + "Lastly, it performs checks on any sub-object linked to the asset, making sure it hasn't gone missing. " + + "This comprehensive validation system prevents hard-to-spot bugs and errors, " + + "fostering a more robust and efficient development workflow.")] +#else +[assembly: RegisterValidator(typeof(AssetReferenceValidator))] +#endif + +namespace Sirenix.OdinInspector.Modules.Addressables.Editor +{ + public class AssetReferenceValidator : ValueValidator + { + [Tooltip("If true and the AssetReference is not marked with the Optional attribute, " + + "the validator will display an error message if the AssetReference is not set. " + + "If false, the validator will only display an error message if the AssetReference is set, " + + "but the assigned asset does not exist.")] + [ToggleLeft] + public bool RequiredByDefault; + + private bool required; + private bool optional; + private string requiredMessage; + + private List restrictions; + + protected override void Initialize() + { + var requiredAttr = this.Property.GetAttribute(); + + this.requiredMessage = requiredAttr?.ErrorMessage ?? $"{this.Property.NiceName} is required."; + + if (this.RequiredByDefault) + { + this.required = true; + this.optional = this.Property.GetAttribute() != null; + } + else + { + this.required = requiredAttr != null; + this.optional = false; + } + + this.restrictions = new List(); + foreach (var attr in this.Property.Attributes) + { + if (attr is AssetReferenceUIRestriction r) + { + this.restrictions.Add(r); + } + } + } + + protected override void Validate(ValidationResult result) + { + // If the Addressables settings have not been created, nothing else is really valid. + if (AddressableAssetSettingsDefaultObject.SettingsExists == false) + { + result.AddError("Addressables Settings have not been created.") + .WithButton("Open Settings Window", () => OdinAddressableUtility.OpenGroupsWindow()); + return; + } + + var assetReference = this.Value; + var assetReferenceHasBeenAssigned = !string.IsNullOrEmpty(assetReference?.AssetGUID); + + // No item has been assigned. + if (!assetReferenceHasBeenAssigned) + { + if (optional == false && required) // Optional == false & required? Nice. + { + result.AddError(this.requiredMessage).EnableRichText(); + } + + return; + } + + var assetPath = AssetDatabase.GUIDToAssetPath(assetReference.AssetGUID); + var mainAsset = AssetDatabase.LoadMainAssetAtPath(assetPath); + + // The item has been assigned, but is now missing. + if (mainAsset == null) + { + result.AddError($"The previously assigned main asset with path '{assetPath}' is missing. GUID '{assetReference.AssetGUID}'"); + return; + } + + var addressableAssetEntry = AddressableAssetSettingsDefaultObject.Settings.FindAssetEntry(assetReference.AssetGUID, true); + var isAddressable = addressableAssetEntry != null; + + // Somehow an item sneaked through all of unity's validation measures and ended up not being addressable + // while still ending up in the asset reference object field. + if (!isAddressable) + { + result.AddError("Assigned item is not addressable.") + .WithFix("Make Addressable", args => OdinAddressableUtility.MakeAddressable(mainAsset, args.Group)); + } + // Check the assigned item against any and all label restrictions. + else + { + if (OdinAddressableUtility.ValidateAssetReferenceRestrictions(restrictions, mainAsset, out var failedRestriction) == false) + { + if (failedRestriction is AssetReferenceUILabelRestriction labelRestriction) + { + result.AddError($"Asset reference is restricted to items with these specific labels '{string.Join(", ", labelRestriction.m_AllowedLabels)}'. The currently assigned item has none of them.") + .WithFix("Add Labels", args => SetLabels(mainAsset, args.AssetLabels)); + } + else + { + result.AddError("Restriction failed: " + failedRestriction.ToString()); + } + } + } + + // The assigned item had a sub object, but it's missing. + if (!string.IsNullOrEmpty(assetReference.SubObjectName)) + { + var subObjects = OdinAddressableUtility.EnumerateAllActualAndVirtualSubAssets(mainAsset, assetPath); + + var hasMissingSubObject = true; + + foreach (var subObject in subObjects) + { + if (subObject.name == assetReference.SubObjectName) + { + hasMissingSubObject = false; + break; + } + } + + if (hasMissingSubObject) + { + result.AddError($"The previously assigned sub asset with name '{assetReference.SubObjectName}' is missing.").EnableRichText(); + } + } + + if (assetReference.ValidateAsset(mainAsset) || assetReference.ValidateAsset(assetPath)) + return; + + if (assetReference is AssetReferenceSprite && assetReference.editorAsset is Sprite) + return; + + result.AddError($"{assetReference.GetType().GetNiceFullName()}.ValidateAsset failed to validate assigned asset."); + } + + private static void SetLabels(UnityEngine.Object obj, List assetLabels) + { + if (!AddressableAssetSettingsDefaultObject.SettingsExists) return; + + var settings = AddressableAssetSettingsDefaultObject.Settings; + var guid = AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(obj)); + var entry = settings.FindAssetEntry(guid, false); + + foreach (var assetLabel in assetLabels.Where(a => a.Toggled)) + { + entry.SetLabel(assetLabel.Label, true, false, false); + } + + settings.SetDirty(AddressableAssetSettings.ModificationEvent.LabelAdded, entry, false, true); + } + + private class MakeAddressableFixArgs + { + [ValueDropdown(nameof(GetGroups))] + [OnInspectorInit(nameof(SelectDefault))] + public AddressableAssetGroup Group; + + private void SelectDefault() + { + this.Group = AddressableAssetSettingsDefaultObject.SettingsExists + ? AddressableAssetSettingsDefaultObject.Settings.DefaultGroup + : null; + } + + private static IEnumerable GetGroups() + { + return !AddressableAssetSettingsDefaultObject.SettingsExists + ? Enumerable.Empty() + : AddressableAssetSettingsDefaultObject.Settings.groups + .Where(group => !group.ReadOnly) + .Select(group => new ValueDropdownItem(group.Name, group)); + } + + [Button(SdfIconType.ListNested), PropertySpace(8f)] + private void OpenAddressablesGroups() => OdinAddressableUtility.OpenGroupsWindow(); + } + + private class AddLabelsFixArgs + { + [HideIf("@true")] + public List AssetLabels + { + get + { + if (!AddressableAssetSettingsDefaultObject.SettingsExists) return this.assetLabels; + + var settings = AddressableAssetSettingsDefaultObject.Settings; + var labels = settings + .GetLabels() + .Select(l => new AssetLabel { Label = l, Toggled = false }) + .ToList(); + + foreach (var assetLabel in this.assetLabels) + { + var label = labels.FirstOrDefault(l => l.Label == assetLabel.Label); + + if (label != null) + { + label.Toggled = assetLabel.Toggled; + } + } + + this.assetLabels = labels; + return this.assetLabels; + } + } + + private List assetLabels = new List(); + + [OnInspectorGUI] + private void Draw() + { + var togglesRect = EditorGUILayout.GetControlRect(false, Mathf.CeilToInt(this.AssetLabels.Count / 2f) * 20f); + + for (var i = 0; i < this.AssetLabels.Count; i++) + { + var assetLabel = this.AssetLabels[i]; + var toggleRect = togglesRect.SplitGrid(togglesRect.width / 2f, 20, i); + assetLabel.Toggled = GUI.Toggle(toggleRect, assetLabel.Toggled, assetLabel.Label); + } + + if (!AddressableAssetSettingsDefaultObject.SettingsExists) return; + + GUILayout.Space(8f); + + var buttonsRect = EditorGUILayout.GetControlRect(false, 20f); + + if (SirenixEditorGUI.SDFIconButton(buttonsRect, "Open Addressables Labels", SdfIconType.TagsFill)) + { + OdinAddressableUtility.OpenLabelsWindow(); + } + } + } + + private class AssetLabel + { + public bool Toggled; + public string Label; + } + } + +} + +#endif \ No newline at end of file diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/AssetReferenceValidator.cs.meta b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/AssetReferenceValidator.cs.meta new file mode 100644 index 0000000..4442178 --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/AssetReferenceValidator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b44b08a1f58a83149988fde5ac600fe4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/CheckDuplicateBundleDependenciesValidator.cs b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/CheckDuplicateBundleDependenciesValidator.cs new file mode 100644 index 0000000..3a9b839 --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/CheckDuplicateBundleDependenciesValidator.cs @@ -0,0 +1,205 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- + +#if UNITY_EDITOR && ODIN_VALIDATOR_3_1 + +#if !SIRENIX_INTERNAL +#pragma warning disable +#endif + +using System.Collections.Generic; +using System.Linq; +using UnityEngine; +using UnityEditor; +using UnityEditor.AddressableAssets; +using Sirenix.OdinInspector.Editor.Validation; +using Sirenix.Utilities; +using Sirenix.Utilities.Editor; +using UnityEditor.AddressableAssets.Settings; +using System.Collections; +using System; +using Sirenix.OdinValidator.Editor; +using Sirenix.OdinInspector.Modules.Addressables.Editor; + +[assembly: RegisterValidationRule(typeof(CheckDuplicateBundleDependenciesValidator), + Description = "This validator detects potential duplicate asset dependencies in an addressable group, without the need for a build. " + + "For instance, imagine two prefabs in separate groups, both referencing the same material. Each group would then include the material " + + "and all its associated dependencies. " + + "To address this, the material should be marked as Addressable, either with one of the prefabs or in a distinct group.\n\n" + + "Fixes: Executing the fix will make the dependency addressable and move it to the specified group.\n\n" + + "Exceptions: It's important to note that duplicate assets aren't inherently problematic. For example, if certain assets are " + + "never accessed by the same user group, such as region-specific assets, these duplications might be desired or at least inconsequential. " + + "As every project is unique, decisions concerning duplicate asset dependencies should be considered on a case-by-case basis.")] + +namespace Sirenix.OdinInspector.Modules.Addressables.Editor +{ + public class CheckDuplicateBundleDependenciesValidator : GlobalValidator + { + private static Dictionary> dependencyGroupMap = new Dictionary>(); + + [Tooltip("The severity of the validation result.")] + public ValidatorSeverity ValidatorSeverity = ValidatorSeverity.Warning; + + [Tooltip("Assets to ignore when validating.")] + [LabelText("Ignored GUIDs"), CustomValueDrawer(nameof(DrawGUIDEntry))] + public List IgnoredGUIDs = new List(); + + public override IEnumerable RunValidation(ValidationResult result) + { + dependencyGroupMap.Clear(); + + var addressableAssetSettings = AddressableAssetSettingsDefaultObject.Settings; + + if (addressableAssetSettings == null) yield break; + + foreach (var addressableAssetGroup in addressableAssetSettings.groups) + { + if (addressableAssetGroup == null) continue; + + foreach (var addressableAssetEntry in addressableAssetGroup.entries) + { + var dependencyAssetPaths = AssetDatabase.GetDependencies(addressableAssetEntry.AssetPath) + .Where(assetPath => !assetPath.EndsWith(".cs", StringComparison.OrdinalIgnoreCase) && + !assetPath.EndsWith(".dll", StringComparison.OrdinalIgnoreCase)); + + foreach (var dependencyAssetPath in dependencyAssetPaths) + { + var dependencyGUID = new GUID(AssetDatabase.AssetPathToGUID(dependencyAssetPath)); + + if (this.IgnoredGUIDs.Contains(dependencyGUID.ToString())) continue; + + var dependencyAddressableAssetEntry = addressableAssetSettings.FindAssetEntry(dependencyGUID.ToString()); + + var isAddressable = dependencyAddressableAssetEntry != null; + if (isAddressable) continue; + + if (!dependencyGroupMap.ContainsKey(dependencyGUID)) + { + dependencyGroupMap.Add(dependencyGUID, new List()); + } + + if (!dependencyGroupMap[dependencyGUID].Contains(addressableAssetGroup.Name)) + { + dependencyGroupMap[dependencyGUID].Add(addressableAssetGroup.Name); + } + } + } + } + + foreach (var kvp in dependencyGroupMap) + { + var dependencyGUID = kvp.Key; + var groups = kvp.Value; + + if (groups.Count > 1) + { + var assetPath = AssetDatabase.GUIDToAssetPath(dependencyGUID.ToString()); + var message = $"{assetPath} is duplicated in these groups: {string.Join(", ", groups)}"; + + result.Add(this.ValidatorSeverity, message).WithFix(args => + { + if (args.FixChoice == FixChoice.Ignore) + { + var sourceType = args.IgnoreForEveryone ? ConfigSourceType.Project : ConfigSourceType.Local; + var data = RuleConfig.Instance.GetRuleData(sourceType); + data.IgnoredGUIDs.Add(dependencyGUID.ToString()); + RuleConfig.Instance.SetAndSaveRuleData(data, sourceType); + return; + } + + var obj = AssetDatabase.LoadAssetAtPath(assetPath, typeof(UnityEngine.Object)); + AddressableAssetGroup group; + + if (args.Group == "Create New Group") + { + if (args.GroupName.IsNullOrWhitespace()) return; + + group = addressableAssetSettings.FindGroup(args.GroupName); + + if (group == null) + { + group = addressableAssetSettings.CreateGroup(args.GroupName, false, false, false, null); + } + } + else + { + group = addressableAssetSettings.FindGroup(args.Group); + + if (group == null) + { + group = addressableAssetSettings.CreateGroup(args.Group, false, false, false, null); + } + } + + OdinAddressableUtility.MakeAddressable(obj, group); + }, false).WithModifyRuleDataContextClick("Ignore", data => + { + data.IgnoredGUIDs.Add(dependencyGUID.ToString()); + }).SetSelectionObject(AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(dependencyGUID.ToString()))); + } + } + } + + private string DrawGUIDEntry(string guid) + { + var assetPath = AssetDatabase.GUIDToAssetPath(guid); + EditorGUILayout.TextArea(assetPath, SirenixGUIStyles.MultiLineLabel); + EditorGUILayout.TextField(guid); + return guid; + } + + private enum FixChoice + { + AddToGroup, + Ignore, + } + + private class FixArgs + { + [EnumToggleButtons, HideLabel] + public FixChoice FixChoice; + + [PropertySpace(10)] + [ValueDropdown("Groups")] + //[Title("Group To Add To", TitleAlignment = TitleAlignments.Centered)] + [ShowIf(nameof(FixChoice), FixChoice.AddToGroup, Animate = false)] + public string Group = "Duplicate Asset Isolation"; + + [ValidateInput(nameof(ValidateGroupName), "The group name cannot be empty")] + [ShowIf(nameof(ShowNewGroupName), Animate = false)] + public string GroupName; + + [LabelWidth(120f)] + [PropertySpace(10)] + [ShowIf("FixChoice", FixChoice.Ignore, Animate = false)] + public bool IgnoreForEveryone = true; + + [OnInspectorGUI] + [PropertySpace(10)] + [DetailedInfoBox("Note that duplicate assets may not always be an issue", "Note that duplicate assets may not always be an issue. If assets will never be requested by the same set of users (for example, region-specific assets), then duplicate dependencies may be desired, or at least inconsequential. Each Project is unique, so fixing duplicate asset dependencies should be evaluated on a case by case basis")] + private void Dummy() { } + + private bool ShowNewGroupName => this.FixChoice != FixChoice.Ignore && this.Group == "Create New Group"; + + private bool ValidateGroupName() => !this.GroupName.IsNullOrWhitespace(); + + private IEnumerable Groups() + { + var addressableAssetSettings = AddressableAssetSettingsDefaultObject.Settings; + + return addressableAssetSettings == null + ? Enumerable.Empty() + : addressableAssetSettings.groups + .Where(group => group != null && group.Name != "Built In Data") + .Select(group => group.Name) + .Append("Duplicate Asset Isolation") + .Prepend("Create New Group"); + } + } + } +} + +#endif \ No newline at end of file diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/CheckDuplicateBundleDependenciesValidator.cs.meta b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/CheckDuplicateBundleDependenciesValidator.cs.meta new file mode 100644 index 0000000..f7d4e44 --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/CheckDuplicateBundleDependenciesValidator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bdc8ee2cf75a17644a0bd81a965cc2e0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/CheckResourcesToAddressableDuplicateDependenciesValidator.cs b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/CheckResourcesToAddressableDuplicateDependenciesValidator.cs new file mode 100644 index 0000000..bb21a1e --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/CheckResourcesToAddressableDuplicateDependenciesValidator.cs @@ -0,0 +1,175 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- + +#if UNITY_EDITOR && ODIN_VALIDATOR_3_1 + +#if !SIRENIX_INTERNAL +#pragma warning disable +#endif + +using System.Collections.Generic; +using System.Linq; +using UnityEngine; +using UnityEditor; +using UnityEditor.AddressableAssets; +using Sirenix.OdinInspector.Editor.Validation; +using Sirenix.Utilities.Editor; +using System.Collections; +using System; +using System.IO; +using Sirenix.OdinValidator.Editor; +using Sirenix.OdinInspector.Modules.Addressables.Editor; + +[assembly: RegisterValidationRule(typeof(CheckResourcesToAddressableDuplicateDependenciesValidator), + Description = "This validator identifies dependencies that are duplicated in both addressable groups and the \"Resources\" folder.\n\n" + + "These duplications mean that data will be included in both the application build and the addressables build.\n\n" + + "You can decide to simply ignore these duplicated dependencies if this behavior is desired, or use the provided fix " + + "to move the asset outside of the \"Resources\" folder.")] + +namespace Sirenix.OdinInspector.Modules.Addressables.Editor +{ + public class CheckResourcesToAddressableDuplicateDependenciesValidator : GlobalValidator + { + [Tooltip("The severity of the validation result.")] + public ValidatorSeverity ValidatorSeverity = ValidatorSeverity.Warning; + + [Tooltip("Assets to ignore when validating.")] + [LabelText("Ignored GUIDs"), CustomValueDrawer(nameof(DrawGUIDEntry))] + public List IgnoredGUIDs = new List(); + + public override IEnumerable RunValidation(ValidationResult result) + { + var addressableAssetSettings = AddressableAssetSettingsDefaultObject.Settings; + + if (addressableAssetSettings == null) yield break; + + foreach (var addressableAssetGroup in addressableAssetSettings.groups) + { + if (addressableAssetGroup == null) continue; + + foreach (var addressableAssetEntry in addressableAssetGroup.entries) + { + var dependencyAssetPaths = AssetDatabase.GetDependencies(addressableAssetEntry.AssetPath) + .Where(assetPath => !assetPath.EndsWith(".cs", StringComparison.OrdinalIgnoreCase) && + !assetPath.EndsWith(".dll", StringComparison.OrdinalIgnoreCase)); + + foreach (var dependencyAssetPath in dependencyAssetPaths) + { + var dependencyGUID = new GUID(AssetDatabase.AssetPathToGUID(dependencyAssetPath)); + + if (this.IgnoredGUIDs.Contains(dependencyGUID.ToString())) continue; + + var dependencyAddressableAssetEntry = addressableAssetSettings.FindAssetEntry(dependencyGUID.ToString()); + + var isAddressable = dependencyAddressableAssetEntry != null; + if (isAddressable) continue; + if (!IsInsideResourcesFolder(dependencyAssetPath)) continue; + + result.Add(this.ValidatorSeverity, $"{dependencyAssetPath} is duplicated in addressable data and resource folders.") + .WithFix(args => + { + if (args.FixChoice == FixChoice.Ignore) + { + var sourceType = args.IgnoreForEveryone ? ConfigSourceType.Project : ConfigSourceType.Local; + var data = RuleConfig.Instance.GetRuleData(sourceType); + data.IgnoredGUIDs.Add(dependencyGUID.ToString()); + RuleConfig.Instance.SetAndSaveRuleData(data, sourceType); + return; + } + + if (!ValidNewFolder(args.NewFolder, out _)) return; + + if (!AssetDatabase.IsValidFolder(args.NewFolder)) + { + Directory.CreateDirectory(new DirectoryInfo(args.NewFolder).FullName); + AssetDatabase.Refresh(); + } + + var newPath = $"{args.NewFolder}/{Path.GetFileName(dependencyAssetPath)}"; + AssetDatabase.MoveAsset(dependencyAssetPath, newPath); + }, false).WithModifyRuleDataContextClick("Ignore", data => + { + data.IgnoredGUIDs.Add(dependencyGUID.ToString()); + }).SetSelectionObject(AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(dependencyGUID.ToString()))); + + yield break; + } + } + } + } + + private string DrawGUIDEntry(string guid) + { + var assetPath = AssetDatabase.GUIDToAssetPath(guid); + EditorGUILayout.TextArea(assetPath, SirenixGUIStyles.MultiLineLabel); + EditorGUILayout.TextField(guid); + return guid; + } + + private static bool IsInsideResourcesFolder(string path) + { + var pathElements = path.Split('/'); + + foreach (var pathElement in pathElements) + { + if (pathElement.Equals("Resources", StringComparison.OrdinalIgnoreCase)) + { + return true; + } + } + + return false; + } + + private static bool ValidNewFolder(string path, out string message) + { + if (IsInsideResourcesFolder(path)) + { + message = "The asset cannot be moved into a 'Resources' folder"; + return false; + } + + if (!path.StartsWith("Assets/")) + { + message = "The asset must be inside the 'Assets' folder"; + return false; + } + + message = "The folder is valid"; + return true; + } + + private enum FixChoice + { + MoveAsset, + Ignore, + } + private class FixArgs + { + [HideLabel] + [EnumToggleButtons] + public FixChoice FixChoice; + + [FolderPath] + [PropertySpace(10)] + [ValidateInput(nameof(ValidateFolderPath))] + [ShowIf("FixChoice", FixChoice.MoveAsset, Animate = false)] + public string NewFolder = "Assets/Resources_moved"; + + [LabelWidth(120f)] + [PropertySpace(10)] + [ShowIf("FixChoice", FixChoice.Ignore, Animate = false)] + public bool IgnoreForEveryone = true; + + private bool ValidateFolderPath(string path, ref string message) + { + return ValidNewFolder(path, out message); + } + } + } +} + +#endif \ No newline at end of file diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/CheckResourcesToAddressableDuplicateDependenciesValidator.cs.meta b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/CheckResourcesToAddressableDuplicateDependenciesValidator.cs.meta new file mode 100644 index 0000000..a2bc61e --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/CheckResourcesToAddressableDuplicateDependenciesValidator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f75aebe03a9aa4a4b82d2b54dcc34de5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/DisallowAddressableSubAssetFieldAttributeValidator.cs b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/DisallowAddressableSubAssetFieldAttributeValidator.cs new file mode 100644 index 0000000..38c8dec --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/DisallowAddressableSubAssetFieldAttributeValidator.cs @@ -0,0 +1,38 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- + +#if UNITY_EDITOR + +#if !SIRENIX_INTERNAL +#pragma warning disable +#endif + +using Sirenix.OdinInspector.Editor.Validation; +using Sirenix.OdinInspector.Modules.Addressables.Editor; +using UnityEngine.AddressableAssets; + +[assembly: RegisterValidator(typeof(DisallowAddressableSubAssetFieldAttributeValidator))] + +namespace Sirenix.OdinInspector.Modules.Addressables.Editor +{ + /// + /// Validator for the DisallowAddressableSubAssetFieldAttribute. + /// + public class DisallowAddressableSubAssetFieldAttributeValidator : AttributeValidator + { + protected override void Validate(ValidationResult result) + { + if (this.Value != null && string.IsNullOrEmpty(this.Value.SubObjectName) == false) + { + result.AddError("Sub-asset references is not allowed on this field.") + .WithFix("Remove Sub-Asset", () => this.Value.SubObjectName = null, true); + } + } + } + +} + +#endif \ No newline at end of file diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/DisallowAddressableSubAssetFieldAttributeValidator.cs.meta b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/DisallowAddressableSubAssetFieldAttributeValidator.cs.meta new file mode 100644 index 0000000..7a7fd44 --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/DisallowAddressableSubAssetFieldAttributeValidator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5775d33ffc1143149c4f425f693b04b6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/MissingAddressableGroupReferenceValidator.cs b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/MissingAddressableGroupReferenceValidator.cs new file mode 100644 index 0000000..033335b --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/MissingAddressableGroupReferenceValidator.cs @@ -0,0 +1,59 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- + +#if UNITY_EDITOR && ODIN_VALIDATOR_3_1 + +#if !SIRENIX_INTERNAL +#pragma warning disable +#endif + +using System.Collections.Generic; +using UnityEditor.AddressableAssets; +using Sirenix.OdinInspector.Editor.Validation; +using UnityEditor.AddressableAssets.Settings; +using System.Collections; +using Sirenix.OdinInspector.Modules.Addressables.Editor; + +[assembly: RegisterValidator(typeof(MissingAddressableGroupReferenceValidator))] + +namespace Sirenix.OdinInspector.Modules.Addressables.Editor +{ + public class MissingAddressableGroupReferenceValidator : GlobalValidator + { + public override IEnumerable RunValidation(ValidationResult result) + { + var addressableAssetSettings = AddressableAssetSettingsDefaultObject.Settings; + + if (addressableAssetSettings == null) yield break; + + var missingGroupIndices = new List(); + + for (var i = 0; i < addressableAssetSettings.groups.Count; i++) + { + var group = addressableAssetSettings.groups[i]; + + if (group == null) + { + missingGroupIndices.Add(i); + } + } + + if (missingGroupIndices.Count > 0) + { + result.Add(ValidatorSeverity.Error, "Addressable groups contains missing references").WithFix("Delete missing reference", () => + { + for (var i = missingGroupIndices.Count - 1; i >= 0; i--) + { + addressableAssetSettings.groups.RemoveAt(missingGroupIndices[i]); + addressableAssetSettings.SetDirty(AddressableAssetSettings.ModificationEvent.GroupRemoved, null, true, true); + } + }); + } + } + } +} + +#endif \ No newline at end of file diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/MissingAddressableGroupReferenceValidator.cs.meta b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/MissingAddressableGroupReferenceValidator.cs.meta new file mode 100644 index 0000000..0f3914f --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/MissingAddressableGroupReferenceValidator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4ae55abdaf19ef4498d1a2fbe1bd9f9b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/manifest.txt b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/manifest.txt new file mode 100644 index 0000000..e3fcfc8 --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/manifest.txt @@ -0,0 +1,26 @@ +ManifestVersion: 1 +ModuleID: Unity.Addressables +ModuleVersion: 1.1.0.11 +ModuleFiles: + AddressablesInspectors.cs + AddressablesInspectors.cs.meta + Internal.meta + Sirenix.OdinInspector.Modules.Unity.Addressables.asmdef + Sirenix.OdinInspector.Modules.Unity.Addressables.asmdef.meta + Validators.meta + Internal/OdinAddressableReflection.cs + Internal/OdinAddressableReflection.cs.meta + Internal/OdinAddressableReflectionValidator.cs + Internal/OdinAddressableReflectionValidator.cs.meta + Validators/AssetLabelReferenceValidator.cs + Validators/AssetLabelReferenceValidator.cs.meta + Validators/AssetReferenceValidator.cs + Validators/AssetReferenceValidator.cs.meta + Validators/CheckDuplicateBundleDependenciesValidator.cs + Validators/CheckDuplicateBundleDependenciesValidator.cs.meta + Validators/CheckResourcesToAddressableDuplicateDependenciesValidator.cs + Validators/CheckResourcesToAddressableDuplicateDependenciesValidator.cs.meta + Validators/DisallowAddressableSubAssetFieldAttributeValidator.cs + Validators/DisallowAddressableSubAssetFieldAttributeValidator.cs.meta + Validators/MissingAddressableGroupReferenceValidator.cs + Validators/MissingAddressableGroupReferenceValidator.cs.meta diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/manifest.txt.meta b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/manifest.txt.meta new file mode 100644 index 0000000..01781c4 --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/manifest.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 697186be36a5cb94bb2343ae4658137b +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Entities.data b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Entities.data index abe322d..d86c063 100644 Binary files a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Entities.data and b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Entities.data differ diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization.data b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization.data new file mode 100644 index 0000000..551ada8 Binary files /dev/null and b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization.data differ diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization.data.meta b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization.data.meta new file mode 100644 index 0000000..8b4ef82 --- /dev/null +++ b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization.data.meta @@ -0,0 +1,6 @@ +fileFormatVersion: 2 +guid: 5a1693d73a4f6e34d955789129c71e11 +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Mathematics.data b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Mathematics.data index 03629ac..f3de456 100644 Binary files a/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Mathematics.data and b/proj/unity/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Mathematics.data differ diff --git a/proj/unity/Assets/Plugins/Sirenix/Readme.txt b/proj/unity/Assets/Plugins/Sirenix/Readme.txt index c39dd1c..bd8b1f8 100644 --- a/proj/unity/Assets/Plugins/Sirenix/Readme.txt +++ b/proj/unity/Assets/Plugins/Sirenix/Readme.txt @@ -6,7 +6,7 @@ Open up the Getting Started guide from "Tools > Odin Inspector > Getting Started ------------------------------------- Helpful Links ------------------------------------- Tutorials: https://odininspector.com/tutorials -API Documentaion: https://odininspector.com/documentation +API Documentation: https://odininspector.com/documentation Roadmap: https://odininspector.com/roadmap Release Notes: https://odininspector.com/patch-notes Issue Tracker: https://bitbucket.org/sirenix/odin-inspector diff --git a/proj/unity/Assets/Prefabs/PHome/CartPushing/RouteChildNode.prefab b/proj/unity/Assets/Prefabs/PHome/CartPushing/RouteChildNode.prefab index 208e78f..602341a 100644 Binary files a/proj/unity/Assets/Prefabs/PHome/CartPushing/RouteChildNode.prefab and b/proj/unity/Assets/Prefabs/PHome/CartPushing/RouteChildNode.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/CartPushing/RouteNodeSprite.prefab b/proj/unity/Assets/Prefabs/PHome/CartPushing/RouteNodeSprite.prefab index 8239a11..58d3c5a 100644 Binary files a/proj/unity/Assets/Prefabs/PHome/CartPushing/RouteNodeSprite.prefab and b/proj/unity/Assets/Prefabs/PHome/CartPushing/RouteNodeSprite.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Game/CartPushGameMode.prefab b/proj/unity/Assets/Prefabs/PHome/Game/CartPushGameMode.prefab index d25f393..59a1c01 100644 Binary files a/proj/unity/Assets/Prefabs/PHome/Game/CartPushGameMode.prefab and b/proj/unity/Assets/Prefabs/PHome/Game/CartPushGameMode.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/GrantPool/FirstPool.asset b/proj/unity/Assets/Prefabs/PHome/GrantPool/FirstPool.asset index c793158..16406ea 100644 Binary files a/proj/unity/Assets/Prefabs/PHome/GrantPool/FirstPool.asset and b/proj/unity/Assets/Prefabs/PHome/GrantPool/FirstPool.asset differ diff --git a/proj/unity/Assets/Prefabs/PHome/PHomePlayer.prefab b/proj/unity/Assets/Prefabs/PHome/PHomePlayer.prefab index ff4fa4d..9266afe 100644 Binary files a/proj/unity/Assets/Prefabs/PHome/PHomePlayer.prefab and b/proj/unity/Assets/Prefabs/PHome/PHomePlayer.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Pet/BlackCyclone.prefab b/proj/unity/Assets/Prefabs/PHome/Pet/BlackCyclone.prefab index b2a23c6..9ad70c4 100644 Binary files a/proj/unity/Assets/Prefabs/PHome/Pet/BlackCyclone.prefab and b/proj/unity/Assets/Prefabs/PHome/Pet/BlackCyclone.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Pet/Driller.prefab b/proj/unity/Assets/Prefabs/PHome/Pet/Driller.prefab new file mode 100644 index 0000000..c421db1 Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Pet/Driller.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Pet/Driller.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Pet/Driller.prefab.meta new file mode 100644 index 0000000..d9f9b02 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Pet/Driller.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 24d4c97eac254694f89674d5ff1b488a +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Pet/ForceMan.prefab b/proj/unity/Assets/Prefabs/PHome/Pet/ForceMan.prefab new file mode 100644 index 0000000..be6bc7d Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Pet/ForceMan.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Pet/ForceMan.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Pet/ForceMan.prefab.meta new file mode 100644 index 0000000..b5247cb --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Pet/ForceMan.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 66d6042b0e4d2f847a62710733094665 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Pet/Rocketer.prefab b/proj/unity/Assets/Prefabs/PHome/Pet/Rocketer.prefab new file mode 100644 index 0000000..9c8ab0c Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Pet/Rocketer.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Pet/Rocketer.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Pet/Rocketer.prefab.meta new file mode 100644 index 0000000..d7cb3cf --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Pet/Rocketer.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 7b3d0e75ab7bee14aa451c5926df6cf9 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Pet/SoccerMan.prefab b/proj/unity/Assets/Prefabs/PHome/Pet/SoccerMan.prefab new file mode 100644 index 0000000..24f77aa Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Pet/SoccerMan.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Pet/SoccerMan.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Pet/SoccerMan.prefab.meta new file mode 100644 index 0000000..3014809 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Pet/SoccerMan.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: acea67218844dde408ba48c0822d4f68 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Singletons/Inventory.prefab b/proj/unity/Assets/Prefabs/PHome/Singletons/Inventory.prefab index a2cc9ec..dc0b875 100644 Binary files a/proj/unity/Assets/Prefabs/PHome/Singletons/Inventory.prefab and b/proj/unity/Assets/Prefabs/PHome/Singletons/Inventory.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/StateTracks.meta b/proj/unity/Assets/Prefabs/PHome/StateTracks.meta new file mode 100644 index 0000000..30a80bd --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/StateTracks.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9c5f1fb697bfdae42b448ba090655541 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/StateTracks/EasyWave.meta b/proj/unity/Assets/Prefabs/PHome/StateTracks/EasyWave.meta new file mode 100644 index 0000000..d8a6e98 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/StateTracks/EasyWave.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8f1f2c306b5e5d247bc4655dbd48a108 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/StateTracks/EasyWave/EasyWave.prefab b/proj/unity/Assets/Prefabs/PHome/StateTracks/EasyWave/EasyWave.prefab new file mode 100644 index 0000000..60e0843 Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/StateTracks/EasyWave/EasyWave.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/StateTracks/EasyWave/EasyWave.prefab.meta b/proj/unity/Assets/Prefabs/PHome/StateTracks/EasyWave/EasyWave.prefab.meta new file mode 100644 index 0000000..186e092 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/StateTracks/EasyWave/EasyWave.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 13eb4de98a79f0e42a05113b3ae9c29a +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon.meta b/proj/unity/Assets/Prefabs/PHome/Weapon.meta index 2ad09e8..536c015 100644 --- a/proj/unity/Assets/Prefabs/PHome/Weapon.meta +++ b/proj/unity/Assets/Prefabs/PHome/Weapon.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ff8a22b45f3c22840bbe2ebb7b3f05fa +guid: ea16a60bea9f7004dbc8986c6cad09ce folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Boomerang.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/Boomerang.meta new file mode 100644 index 0000000..17e24b4 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/Boomerang.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2051ee6d80d0724429c9cb28fd09a4f8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Boomerang/HitEvent.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/Boomerang/HitEvent.prefab new file mode 100644 index 0000000..1f45207 Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/Boomerang/HitEvent.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Boomerang/HitEvent.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/Boomerang/HitEvent.prefab.meta new file mode 100644 index 0000000..f1ecc19 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/Boomerang/HitEvent.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2206947e8cdd54e4c833cb312dfd678c +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Boomerang/ProjectileBoomerang6.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/Boomerang/ProjectileBoomerang6.prefab new file mode 100644 index 0000000..88eca1b Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/Boomerang/ProjectileBoomerang6.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Boomerang/ProjectileBoomerang6.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/Boomerang/ProjectileBoomerang6.prefab.meta new file mode 100644 index 0000000..8ad8ea9 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/Boomerang/ProjectileBoomerang6.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 71944faebb777480bb28eb6b022ac74b +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Boomerang/Weapon_Boomerang6.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/Boomerang/Weapon_Boomerang6.prefab new file mode 100644 index 0000000..ee31694 Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/Boomerang/Weapon_Boomerang6.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Boomerang/Weapon_Boomerang6.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/Boomerang/Weapon_Boomerang6.prefab.meta new file mode 100644 index 0000000..ca90072 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/Boomerang/Weapon_Boomerang6.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8a841f5dde9ec4b1c8a2b703f707e634 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Brick.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/Brick.meta new file mode 100644 index 0000000..91be3fb --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/Brick.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9ec672b6cb6bd6b4cbc690b90a2e0f1a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Brick/HitEvent.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/Brick/HitEvent.prefab new file mode 100644 index 0000000..1f45207 Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/Brick/HitEvent.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Brick/HitEvent.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/Brick/HitEvent.prefab.meta new file mode 100644 index 0000000..93132ee --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/Brick/HitEvent.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 498df7e54f3bc3e4fab3c37d794a48a0 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Brick/ProjectileBrick5.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/Brick/ProjectileBrick5.prefab new file mode 100644 index 0000000..6951b15 Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/Brick/ProjectileBrick5.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Brick/ProjectileBrick5.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/Brick/ProjectileBrick5.prefab.meta new file mode 100644 index 0000000..1913a41 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/Brick/ProjectileBrick5.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 194e3adc66b4042f48aad3ce59b8a8f3 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Brick/Weapon_Brick5.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/Brick/Weapon_Brick5.prefab new file mode 100644 index 0000000..743f013 Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/Brick/Weapon_Brick5.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Brick/Weapon_Brick5.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/Brick/Weapon_Brick5.prefab.meta new file mode 100644 index 0000000..b3dc510 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/Brick/Weapon_Brick5.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: db98d17942cca4f87a0120f54ab76ee5 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/BurnBottle.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/BurnBottle.meta new file mode 100644 index 0000000..47d8832 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/BurnBottle.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dc57bbfda0bbf26449e9587d27474956 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/BurnBottle/BurnBottle.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/BurnBottle/BurnBottle.prefab new file mode 100644 index 0000000..720f23e Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/BurnBottle/BurnBottle.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/BurnBottle/BurnBottle.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/BurnBottle/BurnBottle.prefab.meta new file mode 100644 index 0000000..4383753 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/BurnBottle/BurnBottle.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3472c2cbac0b130448e245b4339ebe31 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/BurnBottle/BurnBottleFire.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/BurnBottle/BurnBottleFire.prefab new file mode 100644 index 0000000..83f351c Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/BurnBottle/BurnBottleFire.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/BurnBottle/BurnBottleFire.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/BurnBottle/BurnBottleFire.prefab.meta new file mode 100644 index 0000000..f390942 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/BurnBottle/BurnBottleFire.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 891070afdb6c1e9428fa8fe5978f9339 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/BurnBottle/Effect_ClearFireList.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/BurnBottle/Effect_ClearFireList.prefab new file mode 100644 index 0000000..1454889 Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/BurnBottle/Effect_ClearFireList.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/BurnBottle/Effect_ClearFireList.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/BurnBottle/Effect_ClearFireList.prefab.meta new file mode 100644 index 0000000..b301fd9 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/BurnBottle/Effect_ClearFireList.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 49f45962939ce1942b19df479449cf96 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/BurnBottle/Effect_FireHit.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/BurnBottle/Effect_FireHit.prefab new file mode 100644 index 0000000..f6e1257 Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/BurnBottle/Effect_FireHit.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/BurnBottle/Effect_FireHit.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/BurnBottle/Effect_FireHit.prefab.meta new file mode 100644 index 0000000..99566df --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/BurnBottle/Effect_FireHit.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0b942d2afc26a2545b4980730ccbe57f +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/BurnBottle/Effect_SpawnFire.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/BurnBottle/Effect_SpawnFire.prefab new file mode 100644 index 0000000..6f7e738 Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/BurnBottle/Effect_SpawnFire.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/BurnBottle/Effect_SpawnFire.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/BurnBottle/Effect_SpawnFire.prefab.meta new file mode 100644 index 0000000..aba86f8 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/BurnBottle/Effect_SpawnFire.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3f290b2f814ee284abbedac478288fac +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/BurnBottle/Weapon_BurnBottle.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/BurnBottle/Weapon_BurnBottle.prefab new file mode 100644 index 0000000..7824927 Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/BurnBottle/Weapon_BurnBottle.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/BurnBottle/Weapon_BurnBottle.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/BurnBottle/Weapon_BurnBottle.prefab.meta new file mode 100644 index 0000000..3b92fb2 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/BurnBottle/Weapon_BurnBottle.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 6061c3e24e0b3a54e980001d05877564 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/DrillLauncher.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/DrillLauncher.meta new file mode 100644 index 0000000..18441ed --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/DrillLauncher.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ee612ca3bd2d5314689938772d1423e3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/DrillLauncher/HitEvent.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/DrillLauncher/HitEvent.prefab new file mode 100644 index 0000000..1f45207 Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/DrillLauncher/HitEvent.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/DrillLauncher/HitEvent.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/DrillLauncher/HitEvent.prefab.meta new file mode 100644 index 0000000..26a6ec6 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/DrillLauncher/HitEvent.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3a194c5aa78061b45b204c7adc68a353 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/DrillLauncher/ProjectileDrill.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/DrillLauncher/ProjectileDrill.prefab new file mode 100644 index 0000000..1081578 Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/DrillLauncher/ProjectileDrill.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/DrillLauncher/ProjectileDrill.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/DrillLauncher/ProjectileDrill.prefab.meta new file mode 100644 index 0000000..5047744 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/DrillLauncher/ProjectileDrill.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 869fb37dd085d1d4f90e0f4fc2fbf373 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/DrillLauncher/TrailMaterial.mat b/proj/unity/Assets/Prefabs/PHome/Weapon/DrillLauncher/TrailMaterial.mat new file mode 100644 index 0000000..583a461 Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/DrillLauncher/TrailMaterial.mat differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/DrillLauncher/TrailMaterial.mat.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/DrillLauncher/TrailMaterial.mat.meta new file mode 100644 index 0000000..1641b17 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/DrillLauncher/TrailMaterial.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 022c1c358eb88f1439db4b5eeef272ea +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/DrillLauncher/Weapon_DrillLauncher.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/DrillLauncher/Weapon_DrillLauncher.prefab new file mode 100644 index 0000000..2b15630 Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/DrillLauncher/Weapon_DrillLauncher.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/DrillLauncher/Weapon_DrillLauncher.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/DrillLauncher/Weapon_DrillLauncher.prefab.meta new file mode 100644 index 0000000..e65e267 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/DrillLauncher/Weapon_DrillLauncher.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f264ca4d41b929643a7ae31814e7ffed +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/ForceField.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/ForceField.meta new file mode 100644 index 0000000..e88457a --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/ForceField.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1ef038590f6869b4a9ce66dae27fa705 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/ForceField/Effect_ClearFireList.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/ForceField/Effect_ClearFireList.prefab new file mode 100644 index 0000000..1454889 Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/ForceField/Effect_ClearFireList.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/ForceField/Effect_ClearFireList.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/ForceField/Effect_ClearFireList.prefab.meta new file mode 100644 index 0000000..73648b7 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/ForceField/Effect_ClearFireList.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 172bb6925d2ce44479b1e0dc7c1007cb +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/ForceField/ForceFieldProjectile.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/ForceField/ForceFieldProjectile.prefab new file mode 100644 index 0000000..6fbdc77 Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/ForceField/ForceFieldProjectile.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/ForceField/ForceFieldProjectile.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/ForceField/ForceFieldProjectile.prefab.meta new file mode 100644 index 0000000..23aa9a3 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/ForceField/ForceFieldProjectile.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 64a754cf3123f754b89e7c4b4604eefe +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/ForceField/ForceFieldProjectileLevel2.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/ForceField/ForceFieldProjectileLevel2.prefab new file mode 100644 index 0000000..3690ed8 Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/ForceField/ForceFieldProjectileLevel2.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/ForceField/ForceFieldProjectileLevel2.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/ForceField/ForceFieldProjectileLevel2.prefab.meta new file mode 100644 index 0000000..06b57e0 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/ForceField/ForceFieldProjectileLevel2.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 67c477dd6f3168141a927770480d37a2 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/ForceField/HitEvent.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/ForceField/HitEvent.prefab new file mode 100644 index 0000000..1f45207 Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/ForceField/HitEvent.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/ForceField/HitEvent.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/ForceField/HitEvent.prefab.meta new file mode 100644 index 0000000..18c980e --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/ForceField/HitEvent.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 427b0c6ba54684e4b9ce615e5fc59bf1 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/ForceField/Weapon_ForceField.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/ForceField/Weapon_ForceField.prefab new file mode 100644 index 0000000..18e137c Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/ForceField/Weapon_ForceField.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/ForceField/Weapon_ForceField.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/ForceField/Weapon_ForceField.prefab.meta new file mode 100644 index 0000000..c9351d3 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/ForceField/Weapon_ForceField.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 49902703b7b594b40b647bc76dea8d5b +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated.meta new file mode 100644 index 0000000..fc8bb13 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 848c16499d91c2c4a9337843f8df1fb9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon.meta new file mode 100644 index 0000000..2ad09e8 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ff8a22b45f3c22840bbe2ebb7b3f05fa +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/Fireball.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/Fireball.prefab new file mode 100644 index 0000000..0e6ca88 Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/Fireball.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/Fireball.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/Fireball.prefab.meta new file mode 100644 index 0000000..e1656b8 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/Fireball.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3d41c5a20b616b142a99929f5208dde3 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/FireballOne.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/FireballOne.prefab new file mode 100644 index 0000000..7beea69 Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/FireballOne.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/FireballOne.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/FireballOne.prefab.meta new file mode 100644 index 0000000..6fcebd8 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/FireballOne.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3f14d84c78ba6ed43bf2af41dcacc30d +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/FireballTwo.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/FireballTwo.prefab new file mode 100644 index 0000000..9377988 Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/FireballTwo.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/FireballTwo.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/FireballTwo.prefab.meta new file mode 100644 index 0000000..4aff5f9 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/FireballTwo.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8d222ec2c22765942b3ae44c2be9306d +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/Rocket.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/Rocket.prefab new file mode 100644 index 0000000..676f842 Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/Rocket.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/Rocket.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/Rocket.prefab.meta new file mode 100644 index 0000000..ac844b2 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/Rocket.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a460dc7dd5d4d44049638877c1595736 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/Weapon_DrillLauncher.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/Weapon_DrillLauncher.prefab new file mode 100644 index 0000000..2a0b945 Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/Weapon_DrillLauncher.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/Weapon_DrillLauncher.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/Weapon_DrillLauncher.prefab.meta new file mode 100644 index 0000000..33fcecf --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/Weapon_DrillLauncher.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 822efb71af61a4cbc878e90218b13e39 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/Weapon_ForceField.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/Weapon_ForceField.prefab new file mode 100644 index 0000000..6c9daee Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/Weapon_ForceField.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/Weapon_ForceField.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/Weapon_ForceField.prefab.meta new file mode 100644 index 0000000..d448d1e --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/Weapon_ForceField.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9eb1ffb3e22dd4546bc38d1caf552a31 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/Weapon_MineLauncher.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/Weapon_MineLauncher.prefab new file mode 100644 index 0000000..cfd6e5d Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/Weapon_MineLauncher.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/Weapon_MineLauncher.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/Weapon_MineLauncher.prefab.meta new file mode 100644 index 0000000..a92ee0f --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/Weapon_MineLauncher.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d2b18e296d22c4ac9b18628afccf3a7d +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/Weapon_Rocket.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/Weapon_Rocket.prefab new file mode 100644 index 0000000..e5613c0 Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/Weapon_Rocket.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/Weapon_Rocket.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/Weapon_Rocket.prefab.meta new file mode 100644 index 0000000..06dcf2b --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon/Weapon_Rocket.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 71b5f333cdfd4c1479635acf34d87544 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon_DrillLauncher3.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon_DrillLauncher3.prefab new file mode 100644 index 0000000..122a069 Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon_DrillLauncher3.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon_DrillLauncher3.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon_DrillLauncher3.prefab.meta new file mode 100644 index 0000000..c203077 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon_DrillLauncher3.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: fc095a0c6252e5e4492fe28bc0a4ba4b +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon_ForceField10.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon_ForceField10.prefab new file mode 100644 index 0000000..5f0fc4a Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon_ForceField10.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon_ForceField10.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon_ForceField10.prefab.meta new file mode 100644 index 0000000..d6b056b --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon_ForceField10.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4a309a830848d4838ae748d6b1e1a6eb +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon_Rocket2.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon_Rocket2.prefab new file mode 100644 index 0000000..e433a99 Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon_Rocket2.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon_Rocket2.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon_Rocket2.prefab.meta new file mode 100644 index 0000000..45ec318 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon_Rocket2.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 185f800d9f6d44841bcc34538e016457 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon_Soccer4.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon_Soccer4.prefab new file mode 100644 index 0000000..1fd8c4c Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon_Soccer4.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon_Soccer4.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon_Soccer4.prefab.meta new file mode 100644 index 0000000..3d969f0 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/Outdated/Weapon_Soccer4.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 016f9f6249b82495aacc11c165544c7c +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/ProjectileBase.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/ProjectileBase.prefab new file mode 100644 index 0000000..0f2c67c Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/ProjectileBase.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/ProjectileBase.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/ProjectileBase.prefab.meta new file mode 100644 index 0000000..00894c1 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/ProjectileBase.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8614dae7438a9bc43b5ffc0c3295bd93 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Rocket.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/Rocket.meta new file mode 100644 index 0000000..bd01307 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/Rocket.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 11df3eb6fbaec6945bdb509e83e2f872 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Rocket/CollideExplode.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/Rocket/CollideExplode.prefab new file mode 100644 index 0000000..138cc09 Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/Rocket/CollideExplode.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Rocket/CollideExplode.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/Rocket/CollideExplode.prefab.meta new file mode 100644 index 0000000..192702f --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/Rocket/CollideExplode.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f4b3c33f552d6584eb752d3ccd4aa39a +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Rocket/RocketExplodeEffect.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/Rocket/RocketExplodeEffect.prefab new file mode 100644 index 0000000..2f66b7e Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/Rocket/RocketExplodeEffect.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Rocket/RocketExplodeEffect.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/Rocket/RocketExplodeEffect.prefab.meta new file mode 100644 index 0000000..1d9eae3 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/Rocket/RocketExplodeEffect.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d918c3459c3a76f4d8856d8ac07dcdf6 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Rocket/RocketProjectile.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/Rocket/RocketProjectile.prefab new file mode 100644 index 0000000..a03281d Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/Rocket/RocketProjectile.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Rocket/RocketProjectile.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/Rocket/RocketProjectile.prefab.meta new file mode 100644 index 0000000..40c3550 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/Rocket/RocketProjectile.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e93b32828757be148bea715dcd0c0e11 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Rocket/Weapon_Rocket.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/Rocket/Weapon_Rocket.prefab new file mode 100644 index 0000000..b2d586a Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/Rocket/Weapon_Rocket.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Rocket/Weapon_Rocket.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/Rocket/Weapon_Rocket.prefab.meta new file mode 100644 index 0000000..e5e9dba --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/Rocket/Weapon_Rocket.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c0d0d1ca23c41fc43823e3adf031ac02 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Soccer.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/Soccer.meta new file mode 100644 index 0000000..b79529a --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/Soccer.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e834cae280c7c3b4481632aaf8e1d22f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Soccer/HitEvent.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/Soccer/HitEvent.prefab new file mode 100644 index 0000000..1f45207 Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/Soccer/HitEvent.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Soccer/HitEvent.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/Soccer/HitEvent.prefab.meta new file mode 100644 index 0000000..d13a4ee --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/Soccer/HitEvent.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4bb939c44bf1fee4c8eae2a54f23f0bf +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Soccer/SoccerProjectile.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/Soccer/SoccerProjectile.prefab new file mode 100644 index 0000000..4219961 Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/Soccer/SoccerProjectile.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Soccer/SoccerProjectile.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/Soccer/SoccerProjectile.prefab.meta new file mode 100644 index 0000000..2134a68 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/Soccer/SoccerProjectile.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 762a682186b5cda41a046f67f242f3d7 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Soccer/Weapon_Soccer.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/Soccer/Weapon_Soccer.prefab new file mode 100644 index 0000000..2e81054 Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/Soccer/Weapon_Soccer.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Soccer/Weapon_Soccer.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/Soccer/Weapon_Soccer.prefab.meta new file mode 100644 index 0000000..cccb5cf --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/Soccer/Weapon_Soccer.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 40ce6d35b184a974ba575bfdc28eba6d +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Weapon_Base.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/Weapon_Base.prefab new file mode 100644 index 0000000..8d1a638 Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/Weapon_Base.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Weapon_Base.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/Weapon_Base.prefab.meta new file mode 100644 index 0000000..5b2c777 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/Weapon_Base.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 11766ceae9097a941b43b768cc27576d +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Weapon_Guard12.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/Weapon_Guard12.prefab new file mode 100644 index 0000000..b153a67 Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/Weapon_Guard12.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Weapon_Guard12.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/Weapon_Guard12.prefab.meta new file mode 100644 index 0000000..389256b --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/Weapon_Guard12.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 101482bbf124041ffb86be9051d550a6 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Weapon_Laser9.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/Weapon_Laser9.prefab new file mode 100644 index 0000000..dad8848 Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/Weapon_Laser9.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Weapon_Laser9.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/Weapon_Laser9.prefab.meta new file mode 100644 index 0000000..9256357 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/Weapon_Laser9.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 43dc90f3a0e934be6a399cd2c0281692 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Weapon_Lightning8.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/Weapon_Lightning8.prefab new file mode 100644 index 0000000..435f94d Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/Weapon_Lightning8.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Weapon_Lightning8.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/Weapon_Lightning8.prefab.meta new file mode 100644 index 0000000..2e07496 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/Weapon_Lightning8.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0c53c73f3b66542aa9709b9f072d7d3f +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Weapon_MineLauncher1.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/Weapon_MineLauncher1.prefab new file mode 100644 index 0000000..9d97d08 Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/Weapon_MineLauncher1.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Weapon_MineLauncher1.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/Weapon_MineLauncher1.prefab.meta new file mode 100644 index 0000000..5dd4ef3 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/Weapon_MineLauncher1.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9d2734cc6e3916e4bb8c612fc03183a3 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Weapon_Missle7.prefab b/proj/unity/Assets/Prefabs/PHome/Weapon/Weapon_Missle7.prefab new file mode 100644 index 0000000..a6269cd Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/Weapon/Weapon_Missle7.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/Weapon/Weapon_Missle7.prefab.meta b/proj/unity/Assets/Prefabs/PHome/Weapon/Weapon_Missle7.prefab.meta new file mode 100644 index 0000000..ba91d08 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/Weapon/Weapon_Missle7.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 24a6ab8ebc955468897a23b07e256fbf +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/PHome/WorldBall/WorldBallPrefab_Test.prefab b/proj/unity/Assets/Prefabs/PHome/WorldBall/WorldBallPrefab_Test.prefab new file mode 100644 index 0000000..c9e6327 Binary files /dev/null and b/proj/unity/Assets/Prefabs/PHome/WorldBall/WorldBallPrefab_Test.prefab differ diff --git a/proj/unity/Assets/Prefabs/PHome/WorldBall/WorldBallPrefab_Test.prefab.meta b/proj/unity/Assets/Prefabs/PHome/WorldBall/WorldBallPrefab_Test.prefab.meta new file mode 100644 index 0000000..e521980 --- /dev/null +++ b/proj/unity/Assets/Prefabs/PHome/WorldBall/WorldBallPrefab_Test.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a5e14611896e2c349b83e187c3430b23 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/StateTrack.meta b/proj/unity/Assets/Prefabs/StateTrack.meta new file mode 100644 index 0000000..6b59a31 --- /dev/null +++ b/proj/unity/Assets/Prefabs/StateTrack.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7a8c9158674ddf04bb1f2125ecb96ae7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Prefabs/StateTrack/TrackLayer.prefab b/proj/unity/Assets/Prefabs/StateTrack/TrackLayer.prefab new file mode 100644 index 0000000..d5109ff Binary files /dev/null and b/proj/unity/Assets/Prefabs/StateTrack/TrackLayer.prefab differ diff --git a/proj/unity/Assets/Prefabs/StateTrack/TrackLayer.prefab.meta b/proj/unity/Assets/Prefabs/StateTrack/TrackLayer.prefab.meta new file mode 100644 index 0000000..0daee75 --- /dev/null +++ b/proj/unity/Assets/Prefabs/StateTrack/TrackLayer.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d2cce7e8461790741af3731e47765658 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Resources/Art assets/WorldBallVideos/WorldBallvideos_Grassland02.mp4 b/proj/unity/Assets/Resources/Art assets/WorldBallVideos/WorldBallvideos_Grassland02.mp4 new file mode 100644 index 0000000..8f3086b Binary files /dev/null and b/proj/unity/Assets/Resources/Art assets/WorldBallVideos/WorldBallvideos_Grassland02.mp4 differ diff --git a/proj/unity/Assets/Resources/Art assets/WorldBallVideos/WorldBallvideos_Grassland02.mp4.meta b/proj/unity/Assets/Resources/Art assets/WorldBallVideos/WorldBallvideos_Grassland02.mp4.meta new file mode 100644 index 0000000..ad89729 --- /dev/null +++ b/proj/unity/Assets/Resources/Art assets/WorldBallVideos/WorldBallvideos_Grassland02.mp4.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: c338572f3a2edee48a7dec7054474104 +VideoClipImporter: + externalObjects: {} + serializedVersion: 2 + frameRange: 0 + startFrame: -1 + endFrame: -1 + colorSpace: 0 + deinterlace: 0 + encodeAlpha: 0 + flipVertical: 0 + flipHorizontal: 0 + importAudio: 1 + targetSettings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Resources/ODUnityExtension/ObjectMapping/ObjectMapper.prefab b/proj/unity/Assets/Resources/ODUnityExtension/ObjectMapping/ObjectMapper.prefab index 0f33eea..ee2d036 100644 Binary files a/proj/unity/Assets/Resources/ODUnityExtension/ObjectMapping/ObjectMapper.prefab and b/proj/unity/Assets/Resources/ODUnityExtension/ObjectMapping/ObjectMapper.prefab differ diff --git a/proj/unity/Assets/Resources/UI/UIPanel/UI_common full screen.png.meta b/proj/unity/Assets/Resources/UI/UIPanel/UI_common full screen.png.meta index f05736e..d32b318 100644 --- a/proj/unity/Assets/Resources/UI/UIPanel/UI_common full screen.png.meta +++ b/proj/unity/Assets/Resources/UI/UIPanel/UI_common full screen.png.meta @@ -3,7 +3,7 @@ guid: 62d7b1819e80ce7438bf6c0077289f3e TextureImporter: internalIDToNameTable: [] externalObjects: {} - serializedVersion: 13 + serializedVersion: 12 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,12 +20,11 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 - flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 - ignoreMipmapLimit: 0 + ignoreMasterTextureLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -64,7 +63,6 @@ TextureImporter: textureFormatSet: 0 ignorePngGamma: 0 applyGammaDecoding: 0 - swizzle: 50462976 cookieLightType: 0 platformSettings: - serializedVersion: 3 @@ -77,7 +75,6 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 - ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - serializedVersion: 3 @@ -90,7 +87,6 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 - ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - serializedVersion: 3 @@ -103,7 +99,6 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 - ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - serializedVersion: 3 @@ -116,7 +111,6 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 - ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - serializedVersion: 3 @@ -129,7 +123,6 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 - ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - serializedVersion: 3 @@ -142,7 +135,6 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 - ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: @@ -152,15 +144,16 @@ TextureImporter: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 - internalID: 1537655665 + internalID: 0 vertices: [] indices: edges: [] weights: [] secondaryTextures: [] nameFileIdTable: {} - mipmapLimitGroupName: + spritePackingTag: pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/proj/unity/Assets/Scenes/MiniWorld/MainWorld.unity b/proj/unity/Assets/Scenes/MiniWorld/MainWorld.unity index e014831..0e6b31a 100644 Binary files a/proj/unity/Assets/Scenes/MiniWorld/MainWorld.unity and b/proj/unity/Assets/Scenes/MiniWorld/MainWorld.unity differ diff --git a/proj/unity/Assets/Scenes/MiniWorld/TestWorld.unity b/proj/unity/Assets/Scenes/MiniWorld/TestWorld.unity index a04e1f5..896942a 100644 Binary files a/proj/unity/Assets/Scenes/MiniWorld/TestWorld.unity and b/proj/unity/Assets/Scenes/MiniWorld/TestWorld.unity differ diff --git a/proj/unity/Assets/Scripts/Animation.meta b/proj/unity/Assets/Scripts/Animation.meta new file mode 100644 index 0000000..bd4f258 --- /dev/null +++ b/proj/unity/Assets/Scripts/Animation.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7e339a2624c281142aefa4b4147d549f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Scripts/Animation/SpriteSequencePlayer.cs b/proj/unity/Assets/Scripts/Animation/SpriteSequencePlayer.cs new file mode 100644 index 0000000..1230dec --- /dev/null +++ b/proj/unity/Assets/Scripts/Animation/SpriteSequencePlayer.cs @@ -0,0 +1,92 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +[RequireComponent(typeof(SpriteRenderer))] +public class SpriteSequencePlayer : MonoBehaviour +{ + // Array of sprites to animate + public Sprite[] Sprites; + + // Speed of the animation in frames per second + [Range(1, 60)] + public int FramesPerSecond = 10; + + // Whether the animation should loop + public bool Loop = true; + + // SpriteRenderer to apply the animation to + private SpriteRenderer m_spriteRenderer; + + // Timer to track the current frame + private float m_timer; + + // Current frame index + private int m_currentFrame; + + void Start() + { + // Get the SpriteRenderer component on this GameObject + m_spriteRenderer = GetComponent(); + + // Ensure we have sprites to animate + if (Sprites == null || Sprites.Length == 0) + { + Debug.LogWarning("No sprites assigned to the animator."); + } + } + + void Update() + { + if (Sprites == null || Sprites.Length == 0) + { + return; + } + + if (!Loop && m_currentFrame >= Sprites.Length) + { + return; + } + + // Calculate the time for each frame based on the animation speed + float frameDuration = 1f / FramesPerSecond; + + // Increment the timer by the time elapsed since the last frame + m_timer += Time.deltaTime; + + // If the timer exceeds the frame duration, update the frame + if (m_timer >= frameDuration) + { + m_timer -= frameDuration; + + // Increment the frame index + m_currentFrame++; + + // Check if we reached the end of the sprite array + if (m_currentFrame >= Sprites.Length) + { + if (Loop) + { + m_currentFrame = 0; // Loop back to the first frame + } + else + { + //m_currentFrame = -1; + } + } + + Sprite sprite; + if (m_currentFrame < 0 || m_currentFrame >= Sprites.Length) + { + sprite = null; + } + else + { + sprite = Sprites[m_currentFrame]; + } + + // Update the sprite on the SpriteRenderer + m_spriteRenderer.sprite = sprite; + } + } +} diff --git a/proj/unity/Assets/Scripts/Animation/SpriteSequencePlayer.cs.meta b/proj/unity/Assets/Scripts/Animation/SpriteSequencePlayer.cs.meta new file mode 100644 index 0000000..5c07a05 --- /dev/null +++ b/proj/unity/Assets/Scripts/Animation/SpriteSequencePlayer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4d6731f1b7e1f7545a91f8722fd6df5c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Scripts/JoyStick/VirtualJoystick.cs b/proj/unity/Assets/Scripts/JoyStick/VirtualJoystick.cs index 186bc63..17d2420 100644 --- a/proj/unity/Assets/Scripts/JoyStick/VirtualJoystick.cs +++ b/proj/unity/Assets/Scripts/JoyStick/VirtualJoystick.cs @@ -1,6 +1,7 @@ using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; +using UnityEngine.InputSystem; public class VirtualJoystick : MonoBehaviour, IDragHandler, IPointerUpHandler, IPointerDownHandler { @@ -25,9 +26,9 @@ public class VirtualJoystick : MonoBehaviour, IDragHandler, IPointerUpHandler, I m_click = true; Vector2 position; Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); - LayerMask mask = LayerMask.GetMask("MysticalScent"); + //LayerMask mask = LayerMask.GetMask("MysticalScent"); RaycastHit2D hit = Physics2D.Raycast(ray.origin, ray.direction); - if (RectTransformUtility.ScreenPointToLocalPointInRectangle(canvas.transform as RectTransform, eventData.position, eventData.pressEventCamera, out position)) + if (RectTransformUtility.ScreenPointToLocalPointInRectangle(transform as RectTransform, eventData.position, eventData.pressEventCamera, out position)) { // Activate and move the joystick to the click position joystickBackground.anchoredPosition = position; @@ -85,12 +86,28 @@ public class VirtualJoystick : MonoBehaviour, IDragHandler, IPointerUpHandler, I currPlayer = player; } + //public void SetLeftStickValue(Vector2 value) + //{ + // // Get the gamepad (if present) + // var gamepad = Gamepad.current; + // if (gamepad == null) + // { + // Debug.LogWarning("No gamepad connected to simulate input."); + // return; + // } + + // // Simulate input by sending an event + // InputSystem.QueueDeltaStateEvent(gamepad.leftStick, value); + // InputSystem.Update(); // Apply the event immediately + //} + void Update () { if(currPlayer!=null) { currPlayer.Move(inputVector.normalized); //currPlayer.Anim(inputVector.normalized); + //SetLeftStickValue(inputVector.normalized); } } } diff --git a/proj/unity/Assets/Scripts/ODUnityExpansion/ODUnityCollection.cs b/proj/unity/Assets/Scripts/ODUnityExpansion/ODUnityCollection.cs new file mode 100644 index 0000000..6a51da1 --- /dev/null +++ b/proj/unity/Assets/Scripts/ODUnityExpansion/ODUnityCollection.cs @@ -0,0 +1,125 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using Sirenix.OdinInspector; + +namespace ODUnityCollection +{ + [System.Serializable] + public struct KVPair + { + public TKey Key; + public TValue Value; + + public KVPair(TKey key, TValue value) + { + Key = key; + Value = value; + } + } + + [Serializable] + public class SerializableDictionary : IEnumerable>, ISerializationCallbackReceiver + { + [SerializeField] + private KVPair m_defaultValue; + + [SerializeField] + [DrawWithUnity] + private System.Collections.Generic.List> m_values = new System.Collections.Generic.List>(); + + private Dictionary m_dictionary = new Dictionary(); + + public void OnBeforeSerialize() + { + m_values.Clear(); + foreach (var item in m_dictionary) + { + m_values.Add(new KVPair(item.Key, item.Value)); + } + } + + public void OnAfterDeserialize() + { + m_dictionary.Clear(); + TKey defaultKey = default; + foreach (KVPair item in m_values) + { + KVPair pair = item; + if (Equals(defaultKey, pair.Key) || m_dictionary.ContainsKey(pair.Key)) + { + pair = m_defaultValue; + } + m_dictionary.TryAdd(pair.Key, pair.Value); + } + } + + public Dictionary ToCollection() + { + var result = new Dictionary(); + foreach (var item in m_values) + { + result.Add(item.Key, item.Value); + } + return result; + } + + public IEnumerator> GetEnumerator() + { + return m_values.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + throw new NotImplementedException(); + } + } + + [Serializable] + public class SerializableSet : IEnumerable, ISerializationCallbackReceiver + { + [SerializeField] + private TValue m_defaultValue; + + [SerializeField] + [DrawWithUnity] + private System.Collections.Generic.List m_values = new System.Collections.Generic.List(); + + private HashSet m_set = new HashSet(); + + public void OnBeforeSerialize() + { + m_values.Clear(); + foreach (var item in m_set) + { + m_values.Add(item); + } + } + + public void OnAfterDeserialize() + { + m_set.Clear(); + TValue defaultValue = default; + foreach (TValue item in m_values) + { + TValue pair = item; + if (Equals(defaultValue, pair) || m_set.Contains(pair)) + { + pair = m_defaultValue; + } + m_set.Add(pair); + } + } + + public IEnumerator GetEnumerator() + { + return m_values.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + throw new NotImplementedException(); + } + } +} diff --git a/proj/unity/Assets/Scripts/ODUnityExpansion/ODUnityCollection.cs.meta b/proj/unity/Assets/Scripts/ODUnityExpansion/ODUnityCollection.cs.meta new file mode 100644 index 0000000..0d3458a --- /dev/null +++ b/proj/unity/Assets/Scripts/ODUnityExpansion/ODUnityCollection.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 971eea92c4a16a64d85415d591496893 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Scripts/PHome/EnemyWaves/PHomeEnemyManager.cs b/proj/unity/Assets/Scripts/PHome/EnemyWaves/PHomeEnemyManager.cs new file mode 100644 index 0000000..d334782 --- /dev/null +++ b/proj/unity/Assets/Scripts/PHome/EnemyWaves/PHomeEnemyManager.cs @@ -0,0 +1,168 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class PHomeEnemyManager : MonoBehaviour +{ + #region Define + + private class EnemyCounter + { + public HashSet Enemies = new HashSet(); + } + + public class SpawnKey + { + public bool Removed; + + public GameObject MonsterPrefab; + public int Count; + } + + #endregion + + public PHomeGameMode GameMode; + + [SerializeField] + private float m_monsterRepositionRadius; + + [SerializeField] + private float m_spawnRadius; + + private Dictionary m_enemyCounters = new Dictionary(); + + private float m_spawnHealthBoost; + + public float SpawnHealthBoost + { + get + { + return m_spawnHealthBoost; + } + + set + { + m_spawnHealthBoost = value; + } + } + + private float m_spawnCountBoost; + + public float SpawnCountBoost + { + get + { + return m_spawnCountBoost; + } + + set + { + m_spawnCountBoost = value; + } + } + + public SpawnKey AddMonsterCount(GameObject prefab, int count) + { + SpawnKey newKey = new SpawnKey() + { + MonsterPrefab = prefab, + Count = count + }; + + m_enemyCounters.Add(newKey, new EnemyCounter()); + return newKey; + } + + public void RemoveMonsterCount(SpawnKey key) + { + key.Removed = true; + } + + // Update is called once per frame + void Update() + { + CheckOnce(); + } + + private void RemoveDeadObject(HashSet gameObjects) + { + gameObjects.RemoveWhere(x => x == null); + } + + private bool ShouldRepositionEnemy(Transform unitTR) + { + if (m_monsterRepositionRadius <= 0.0f) + { + return false; + } + + PHomePlayer player = PHomeGameMode.main.PlayerUnit; + if (Vector2.Distance(unitTR.position, player.transform.position) < m_monsterRepositionRadius) + { + return false; + } + + return true; + } + + private Vector2 GetRandomPoint() + { + return PHomeUtils.GetRandomSpawnPoint(PHomeGameMode.main.PlayerScreen, m_spawnRadius); + } + + private void CheckOnce() + { + // Update enemy count + foreach (var item in m_enemyCounters) + { + GameObject config = item.Key.MonsterPrefab; + EnemyCounter counter = item.Value; + + RemoveDeadObject(counter.Enemies); + + int destSpawnCount; + if (item.Key.Removed) + { + destSpawnCount = 0; + } + else + { + destSpawnCount = (int)(item.Key.Count * (1 + m_spawnCountBoost)); + } + int curCount = counter.Enemies.Count; + + int spawnCount = destSpawnCount - curCount; + int clearCount = -spawnCount; + + foreach (GameObject aliveMonster in counter.Enemies) + { + if (!ShouldRepositionEnemy(aliveMonster.transform)) + { + continue; + } + + if (clearCount > 0) + { + Destroy(aliveMonster); + clearCount--; + continue; + } + + Vector2 repositionPoint = GetRandomPoint(); + aliveMonster.transform.position = repositionPoint; + } + + for (int i = 0; i < spawnCount; i++) + { + Vector3 spawnPoint = GetRandomPoint(); + GameObject prefab = config; + PHomeUnit unit = GameMode.SpawnUnit(spawnPoint, prefab); + + unit.MaxHealth = unit.MaxHealth * (1 + m_spawnHealthBoost); + unit.Health = unit.MaxHealth; + + counter.Enemies.Add(unit.gameObject); + } + } + } +} diff --git a/proj/unity/Assets/Scripts/PHome/EnemyWaves/PHomeEnemyManager.cs.meta b/proj/unity/Assets/Scripts/PHome/EnemyWaves/PHomeEnemyManager.cs.meta new file mode 100644 index 0000000..51ae22e --- /dev/null +++ b/proj/unity/Assets/Scripts/PHome/EnemyWaves/PHomeEnemyManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cddbb74775f84d54ebbd6de35221f7d7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Scripts/PHome/EnemyWaves/PHomeEnemyWaveSpawner.cs b/proj/unity/Assets/Scripts/PHome/EnemyWaves/PHomeEnemyWaveSpawner.cs index 0d48dcb..e154e09 100644 --- a/proj/unity/Assets/Scripts/PHome/EnemyWaves/PHomeEnemyWaveSpawner.cs +++ b/proj/unity/Assets/Scripts/PHome/EnemyWaves/PHomeEnemyWaveSpawner.cs @@ -129,6 +129,7 @@ public class PHomeEnemyWaveSpawner : MonoBehaviour { public float SpawnRadius; public float MonsterRepositionRadius; + public List NodeGroups; private PHomeGroupSpawner m_currentGroupSpawner; @@ -149,6 +150,11 @@ public class PHomeEnemyWaveSpawner : MonoBehaviour return true; } + public Vector2 GetRandomSpawnPoint() + { + return PHomeUtils.GetRandomSpawnPoint(PHomeGameMode.main.PlayerScreen, SpawnRadius); + } + private void Update() { PHomeGameMode gameMode = PHomeGameMode.main; @@ -169,33 +175,4 @@ public class PHomeEnemyWaveSpawner : MonoBehaviour m_currentGroupSpawner.Update(Time.deltaTime); } - - public Vector3 GetRandomSpawnPoint() - { - Vector3 playerPos = PHomeGameMode.main.PlayerUnit.transform.position; - Vector2 playerPos2D = playerPos; - int randTimes = 0; - - while (true) - { - randTimes++; - if (randTimes > 1000) - { - Debug.LogError($"Cannot find random point with radius {SpawnRadius}"); - return default; - } - - // һ - Vector2 randomPoint2D = playerPos2D + UnityEngine.Random.insideUnitCircle.normalized * SpawnRadius; - if (PHomeGameMode.main.PlayerUnit.PlayerScreen.IsInside(randomPoint2D)) - { - continue; - } - - Vector3 result = playerPos; - result.x = randomPoint2D.x; - result.y = randomPoint2D.y; - return result; - } - } } diff --git a/proj/unity/Assets/Scripts/PHome/EventHandler/PEffect_Common_Explode.cs b/proj/unity/Assets/Scripts/PHome/EventHandler/PEffect_Common_Explode.cs new file mode 100644 index 0000000..144ed79 --- /dev/null +++ b/proj/unity/Assets/Scripts/PHome/EventHandler/PEffect_Common_Explode.cs @@ -0,0 +1,34 @@ +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +public class PEffect_Common_Explode : PHomeProjectileCommonEventHandler +{ + public float Radius; + public float Damage; + public float Force; + + public PHomePlayParticleParam ExplodeEffect; + + public override void Handle(ProjectileEventContext context) + { + base.Handle(context); + + var units = AreaUtils.FindUnits(context.Projectile.transform.position, Radius); + var enemies = units.Where(unit => PHomeGameMode.IsEnemy(context.Projectile.Instigator, unit)); + var enemyBodies = enemies.Select(unit => unit.PhysicsBody); + + foreach (var item in enemies) + { + PHomeGameMode.main.DoProjectileAttack(context.Projectile.Instigator, item, context.Projectile, Damage + context.Projectile.GetWeaponDamage()); + } + + foreach (var item in enemyBodies) + { + item.AddForce((item.transform.position - context.Projectile.transform.position).normalized * Force); + } + + ExplodeEffect.PlayParticle(context.Projectile.gameObject); + } +} diff --git a/proj/unity/Assets/Scripts/PHome/EventHandler/PEffect_Common_Explode.cs.meta b/proj/unity/Assets/Scripts/PHome/EventHandler/PEffect_Common_Explode.cs.meta new file mode 100644 index 0000000..c07d2b9 --- /dev/null +++ b/proj/unity/Assets/Scripts/PHome/EventHandler/PEffect_Common_Explode.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c6c4771c08be6e54fa793ac84e9a7bd7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Scripts/PHome/EventHandler/ProjectileCollideHurtHandler.cs b/proj/unity/Assets/Scripts/PHome/EventHandler/ProjectileCollideHurtHandler.cs index e54b810..811fe7e 100644 --- a/proj/unity/Assets/Scripts/PHome/EventHandler/ProjectileCollideHurtHandler.cs +++ b/proj/unity/Assets/Scripts/PHome/EventHandler/ProjectileCollideHurtHandler.cs @@ -59,10 +59,10 @@ public class ProjectileCollideHurtHandler : PHomeProjectileCollideEventHandler { dir = projectile.GetComponent().DestVelocity; } - if (projectile.GetComponent() != null) - { - dir = projectile.GetComponent().DestVelocity; - } + //if (projectile.GetComponent() != null) + //{ + // dir = projectile.GetComponent().DestVelocity; + //} if (OutForce) { dir = projectile.GetOutDir(); diff --git a/proj/unity/Assets/Scripts/PHome/PHomeGameMode.cs b/proj/unity/Assets/Scripts/PHome/PHomeGameMode.cs index bbc445a..5ec3a3f 100644 --- a/proj/unity/Assets/Scripts/PHome/PHomeGameMode.cs +++ b/proj/unity/Assets/Scripts/PHome/PHomeGameMode.cs @@ -53,6 +53,17 @@ public class PHomeGameMode : MonoBehaviour [SerializeField] private PHomePush m_push; + [SerializeField] + private PHomeEnemyManager m_enemyManager; + + public PHomeEnemyManager EnemyManager + { + get + { + return m_enemyManager; + } + } + [SerializeField] private GameObject m_dropGemPrefab; @@ -64,8 +75,8 @@ public class PHomeGameMode : MonoBehaviour } } - [SerializeField] - private List m_weaponUpdateConfig; + //[SerializeField] + //private List m_weaponUpdateConfig; [SerializeField] private AnimationCurve m_levelDifficultyCurve; [SerializeField] @@ -74,6 +85,17 @@ public class PHomeGameMode : MonoBehaviour public List m_eventCards; private PHomePortal m_portal; + + [SerializeField] + private PHomePlayerScreen m_playerScreen; + public PHomePlayerScreen PlayerScreen + { + get + { + return m_playerScreen; + } + } + public void DoUnitAttack(PHomeUnit source, PHomeUnit target, PHomeProjectile projectile = null) { float curHealth = target.Health; @@ -263,38 +285,38 @@ public class PHomeGameMode : MonoBehaviour PHomeWeapon weaponScript = SpawnWeapon(Vector3.zero, weapon.gameObject, unit.transform); unit.AddWeapon(weaponScript); weaponScript.Init(unit); - for (int j = 0; j < m_weaponUpdateConfig.Count; j++) - { - List matchNames = m_weaponUpdateConfig[j].MatchNames; - bool isContain = false; - for (int k = 0; k < matchNames.Count; k++) - { - if (matchNames[k] == weapon.WeaponName) - { - isContain = true; - } - } - if (isContain) - { - bool canUpdate = true; - for (int k = 0; k < matchNames.Count; k++) - { - if (!unit.HaveWeapon(matchNames[k])) - { - canUpdate = false; - break; - } - } - if (canUpdate) - { - for (int k = 0; k < matchNames.Count; k++) - { - RemoveWeapon(unit, matchNames[k]); - } - AddWeapon(unit, m_weaponUpdateConfig[j].SpawnWeaponPrefabs); - } - } - } + //for (int j = 0; j < m_weaponUpdateConfig.Count; j++) + //{ + // List matchNames = m_weaponUpdateConfig[j].MatchNames; + // bool isContain = false; + // for (int k = 0; k < matchNames.Count; k++) + // { + // if (matchNames[k] == weapon.WeaponName) + // { + // isContain = true; + // } + // } + // if (isContain) + // { + // bool canUpdate = true; + // for (int k = 0; k < matchNames.Count; k++) + // { + // if (!unit.HaveWeapon(matchNames[k])) + // { + // canUpdate = false; + // break; + // } + // } + // if (canUpdate) + // { + // for (int k = 0; k < matchNames.Count; k++) + // { + // RemoveWeapon(unit, matchNames[k]); + // } + // AddWeapon(unit, m_weaponUpdateConfig[j].SpawnWeaponPrefabs); + // } + // } + //} } diff --git a/proj/unity/Assets/Scripts/PHome/PHomePlayer.cs b/proj/unity/Assets/Scripts/PHome/PHomePlayer.cs index 680bf58..55eb6ee 100644 --- a/proj/unity/Assets/Scripts/PHome/PHomePlayer.cs +++ b/proj/unity/Assets/Scripts/PHome/PHomePlayer.cs @@ -20,17 +20,6 @@ public class PHomePlayer : PHomeUnit [SerializeField] private GameObject m_proejctilePrefab; - [SerializeField] - private PHomePlayerScreen m_playerScreen; - - public PHomePlayerScreen PlayerScreen - { - get - { - return m_playerScreen; - } - } - [SerializeField] private int m_killMonsterCount; diff --git a/proj/unity/Assets/Scripts/PHome/PHomePlayerScreen.cs b/proj/unity/Assets/Scripts/PHome/PHomePlayerScreen.cs index 57f558e..2f32f3d 100644 --- a/proj/unity/Assets/Scripts/PHome/PHomePlayerScreen.cs +++ b/proj/unity/Assets/Scripts/PHome/PHomePlayerScreen.cs @@ -7,7 +7,27 @@ public class PHomePlayerScreen : MonoBehaviour, IArea [SerializeField] private BoxCollider2D m_collider; - public Vector2 Size; + public BoxCollider2D Collider + { + get + { + return m_collider; + } + } + + public float HalfHeight; + public float AspectRatio; + + public float HalfWidth + { + get + { + return HalfHeight * AspectRatio; + } + } + + [SerializeField] + private Camera m_camera; public IEnumerable FindUnits() { @@ -33,8 +53,8 @@ public class PHomePlayerScreen : MonoBehaviour, IArea public Vector2 GetRandomPoint() { - float halfWidth = Size.x / 2; - float halfHeight = Size.y / 2; + float halfWidth = HalfWidth; + float halfHeight = HalfHeight; Vector2 result = transform.position; return new Vector2() { @@ -45,14 +65,19 @@ public class PHomePlayerScreen : MonoBehaviour, IArea private void Awake() { - m_collider.size = Size; + m_collider.size = new Vector2() + { + x = HalfWidth * 2.0f, + y = HalfHeight * 2.0f, + }; + m_camera.orthographicSize = HalfHeight; } public bool IsInside(Vector2 point) { Vector2 myPos = transform.position; point = point - myPos; - return Mathf.Abs(point.x) <= Size.x / 2f && Mathf.Abs(point.y) <= Size.y / 2f; + return Mathf.Abs(point.x) <= HalfWidth && Mathf.Abs(point.y) <= HalfHeight; } #region Debug diff --git a/proj/unity/Assets/Scripts/PHome/PHomeProjectile.cs b/proj/unity/Assets/Scripts/PHome/PHomeProjectile.cs index e360115..b34fec2 100644 --- a/proj/unity/Assets/Scripts/PHome/PHomeProjectile.cs +++ b/proj/unity/Assets/Scripts/PHome/PHomeProjectile.cs @@ -49,6 +49,13 @@ public class PHomeProjectile : MonoBehaviour [SerializeField] protected ShootDataPoints m_spawnAt; + [SerializeField] + protected bool m_attachToUnit; + + [SerializeField] + [ShowIf("m_attachToUnit")] + protected ShootDataUnits m_attachedUnit; + [SerializeField] protected bool m_hasCollision; public bool HasCollision @@ -63,6 +70,55 @@ public class PHomeProjectile : MonoBehaviour } } + [SerializeField] + [ShowIf("m_hasCollision")] + protected bool m_noRepeatCollide; + public bool NoRepeatCollide + { + get + { + return m_noRepeatCollide; + } + + set + { + m_noRepeatCollide = value; + } + } + + [SerializeField] + [ShowIf("m_hasCollision")] + protected bool m_collideWithEnemyUnits = true; + public bool CollideWithEnemyUnits + { + get + { + return m_collideWithEnemyUnits; + } + } + + [SerializeField] + [ShowIf("m_hasCollision")] + protected bool m_collideWithFriendlyUnits = false; + public bool CollideWithFriendlyUnits + { + get + { + return m_collideWithFriendlyUnits; + } + } + + [SerializeField] + [ShowIf("m_hasCollision")] + protected bool m_collideWithProjectiles = false; + public bool CollideWithProjectiles + { + get + { + return m_collideWithProjectiles; + } + } + //[SerializeField] //protected float m_collideRadius; //public float CollideRadius @@ -140,8 +196,23 @@ public class PHomeProjectile : MonoBehaviour //protected Vector3 m_targetPosition; [SerializeField] + protected bool m_useLifeTime; + + [SerializeField] + [ShowIf("m_useLifeTime")] protected float m_lifeTime; + [SerializeField] + protected bool m_useCollideLifeTime; + + [SerializeField] + [ShowIf("m_useCollideLifeTime")] + protected int m_collideLifeTime; + + [BoxGroup("Debug")] + [SerializeField] + protected int m_collideTimes; + //[SerializeField] //protected bool m_resetCollision; //public bool ResetCollision @@ -246,7 +317,10 @@ public class PHomeProjectile : MonoBehaviour private void Start() { - Destroy(gameObject, m_lifeTime); + if (m_useLifeTime) + { + Destroy(gameObject, m_lifeTime); + } } void OnDestroy() diff --git a/proj/unity/Assets/Scripts/PHome/PHomePush.cs b/proj/unity/Assets/Scripts/PHome/PHomePush.cs index b5f6728..0e5d7d0 100644 --- a/proj/unity/Assets/Scripts/PHome/PHomePush.cs +++ b/proj/unity/Assets/Scripts/PHome/PHomePush.cs @@ -373,10 +373,22 @@ public class PHomePush : MonoBehaviour [SerializeField] private UnTalkAnim m_unTalkAnim; + [SerializeField] + private StateTrack.MultipleTrack m_startStateTrack; + private List m_chosingLines = new List(); private GameObject m_movingLine; + private float m_pushStartTime; + public float PushStartTime + { + get + { + return m_pushStartTime; + } + } + private bool m_isPushingStarted; private PuzzleGameMode.VoidDelegate OnAfterIsPushingStarted; public bool IsPushingStarted @@ -460,57 +472,38 @@ public class PHomePush : MonoBehaviour void UpdateNodeDisplay(int choseIndex) { NodeChoseItem currItem = m_choseItems[m_choseIndex]; - PHomeBuff currBuff = m_choseItems[m_choseIndex].GrantBuff; - PHomePet currPet = m_choseItems[m_choseIndex].GrantPet; - PHomeLottery currLottery = m_choseItems[m_choseIndex].GrantLottery; - PHomeMysteriousDialogue currDialogue = m_choseItems[m_choseIndex].GrantMysteriousDialogue; - if(currBuff!=null) - { - m_route.GetDestNode(m_pushNode, choseIndex).SetNodeType(NodeType.Health); - if(choseIndex>=m_pushNode.m_pathChildNodes.Count){return;} - PHomeChildNodeList childNodeList = m_pushNode.m_pathChildNodes[choseIndex]; - if(childNodeList.m_childNodes!=null){ - for (var i = 0; i < childNodeList.m_childNodes.Count; i++) - { - childNodeList.m_childNodes[i].SetNodeType(NodeType.Health); - } - } + //PHomeBuff currBuff = m_choseItems[m_choseIndex].GrantBuff; + //PHomePet currPet = m_choseItems[m_choseIndex].GrantPet; + //PHomeLottery currLottery = m_choseItems[m_choseIndex].GrantLottery; + //PHomeMysteriousDialogue currDialogue = m_choseItems[m_choseIndex].GrantMysteriousDialogue; + //if (currBuff != null) + //{ + // m_route.GetDestNode(m_pushNode, choseIndex).SetNodeType(NodeType.Health); + //} + //else if (currPet != null) + //{ + // m_route.GetDestNode(m_pushNode, choseIndex).SetNodeType(NodeType.Pet); + //} + //else if (currLottery != null) + //{ + // m_route.GetDestNode(m_pushNode, choseIndex).SetNodeType(NodeType.Lottery); + //} + //else if (currDialogue != null) + //{ + // m_route.GetDestNode(m_pushNode, choseIndex).SetNodeType(NodeType.Dialogue); + //} + m_route.GetDestNode(m_pushNode, choseIndex).SetNodeSprite(currItem.DesImage); + + if (choseIndex >= m_pushNode.m_pathChildNodes.Count) + { + return; } - else if(currPet!=null) + PHomeChildNodeList childNodeList = m_pushNode.m_pathChildNodes[choseIndex]; + if (childNodeList.m_childNodes != null) { - m_route.GetDestNode(m_pushNode, choseIndex).SetNodeType(NodeType.Pet); - if(choseIndex>=m_pushNode.m_pathChildNodes.Count){return;} - PHomeChildNodeList childNodeList = m_pushNode.m_pathChildNodes[choseIndex]; - if(childNodeList.m_childNodes!=null) + for (var i = 0; i < childNodeList.m_childNodes.Count; i++) { - for (var i = 0; i < childNodeList.m_childNodes.Count; i++) - { - childNodeList.m_childNodes[i].SetNodeType(NodeType.Pet); - } - } - } - else if(currLottery!=null) - { - m_route.GetDestNode(m_pushNode, choseIndex).SetNodeType(NodeType.Lottery); - if(choseIndex>=m_pushNode.m_pathChildNodes.Count){return;} - PHomeChildNodeList childNodeList = m_pushNode.m_pathChildNodes[choseIndex]; - if(childNodeList.m_childNodes!=null){ - for (var i = 0; i < childNodeList.m_childNodes.Count; i++) - { - childNodeList.m_childNodes[i].SetNodeType(NodeType.Lottery); - } - } - } - else if(currDialogue!=null) - { - m_route.GetDestNode(m_pushNode, choseIndex).SetNodeType(NodeType.Dialogue); - if(choseIndex>=m_pushNode.m_pathChildNodes.Count){return;} - PHomeChildNodeList childNodeList = m_pushNode.m_pathChildNodes[choseIndex]; - if(childNodeList.m_childNodes!=null){ - for (var i = 0; i < childNodeList.m_childNodes.Count; i++) - { - childNodeList.m_childNodes[i].SetNodeType(NodeType.Dialogue); - } + childNodeList.m_childNodes[i].SetNodeType(NodeType.Dialogue); } } } @@ -781,9 +774,11 @@ public class PHomePush : MonoBehaviour public void StartPush() { + m_pushStartTime = Time.time; IsPushingStarted = true; m_cart.StartPush(); OnPushingStart(); + StateTrack.StateTrackUtils.PlayStateTrack(m_startStateTrack); } private CartPushRoute GetRoute() diff --git a/proj/unity/Assets/Scripts/PHome/PHomeRouteNode.cs b/proj/unity/Assets/Scripts/PHome/PHomeRouteNode.cs index fc96050..5267477 100644 --- a/proj/unity/Assets/Scripts/PHome/PHomeRouteNode.cs +++ b/proj/unity/Assets/Scripts/PHome/PHomeRouteNode.cs @@ -24,7 +24,6 @@ public class PHomeRouteNode : MonoBehaviour } } - private NodeType m_nodeType; private SpriteRenderer m_sprite; @@ -34,6 +33,11 @@ public class PHomeRouteNode : MonoBehaviour m_parentNode = parentNode; } + public void SetNodeSprite(Sprite sprite) + { + m_sprite.sprite = sprite; + } + public void SetNodeType(NodeType nodeType) { m_nodeType = nodeType; diff --git a/proj/unity/Assets/Scripts/PHome/PHomeSpawner.cs b/proj/unity/Assets/Scripts/PHome/PHomeSpawner.cs index 6851a21..b3be3bc 100644 --- a/proj/unity/Assets/Scripts/PHome/PHomeSpawner.cs +++ b/proj/unity/Assets/Scripts/PHome/PHomeSpawner.cs @@ -213,7 +213,7 @@ public class PHomeSpawner : MonoBehaviour { Vector3 randomPoint = Vector3.zero; bool foundPoint = false; - Vector2 screenSize = PHomeGameMode.main.PlayerUnit.PlayerScreen.Size; + Vector2 screenSize = default;// PHomeGameMode.main.PlayerUnit.PlayerScreen.HalfWidth; Vector3 finalPos = PHomeGameMode.main.PlayerUnit.transform.position + randomPoint; while (!foundPoint) diff --git a/proj/unity/Assets/Scripts/PHome/PHomeUIManager.cs b/proj/unity/Assets/Scripts/PHome/PHomeUIManager.cs index 7c855ab..52dbd9a 100644 --- a/proj/unity/Assets/Scripts/PHome/PHomeUIManager.cs +++ b/proj/unity/Assets/Scripts/PHome/PHomeUIManager.cs @@ -202,6 +202,11 @@ public class PHomeUIManager : MonoBehaviour private void Start_PreStage() { + if (PHomeGameMode.main == null) + { + return; + } + PHomeGameMode.main.OnAfterIsInPreStageChanged += OnAfterIsInPreStageChanged; } @@ -212,6 +217,11 @@ public class PHomeUIManager : MonoBehaviour private void Update_PreStage() { + if (PHomeGameMode.main == null) + { + return; + } + if (!PHomeGameMode.main.IsInPreStage) { return; diff --git a/proj/unity/Assets/Scripts/PHome/PHomeUtils.cs b/proj/unity/Assets/Scripts/PHome/PHomeUtils.cs new file mode 100644 index 0000000..7414424 --- /dev/null +++ b/proj/unity/Assets/Scripts/PHome/PHomeUtils.cs @@ -0,0 +1,56 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public static class PHomeUtils +{ + public static Vector2 GetRandomSpawnPoint(PHomePlayerScreen playerScreen, float spawnRadius = 11) + { + Vector2 playerPos = playerScreen.transform.position; + int randTimes = 0; + + while (true) + { + randTimes++; + if (randTimes > 1000) + { + Debug.LogError($"Cannot find random point with radius {spawnRadius}"); + return default; + } + + // һ + Vector2 randomPoint2D = playerPos + UnityEngine.Random.insideUnitCircle.normalized * spawnRadius; + if (playerScreen.IsInside(randomPoint2D)) + { + continue; + } + + return randomPoint2D; + } + } + + public static PHomeUnit GetNearestTarget(IEnumerable targets, Vector2 nearTo) + { + PHomeUnit result = null; + float nearValue = float.MaxValue; + foreach (var target in targets) + { + float distance = ((Vector2)(target.transform.position) - nearTo).sqrMagnitude; + if (result == null) + { + result = target; + nearValue = distance; + } + else + { + if (distance < nearValue) + { + result = target; + nearValue = distance; + } + } + } + + return result; + } +} diff --git a/proj/unity/Assets/Scripts/PHome/PHomeUtils.cs.meta b/proj/unity/Assets/Scripts/PHome/PHomeUtils.cs.meta new file mode 100644 index 0000000..4c9c2b0 --- /dev/null +++ b/proj/unity/Assets/Scripts/PHome/PHomeUtils.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cca5da4675282b54f9718fe4267ce930 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Scripts/PHome/PHomeWeapon.cs b/proj/unity/Assets/Scripts/PHome/PHomeWeapon.cs index 12d54e3..f2478b0 100644 --- a/proj/unity/Assets/Scripts/PHome/PHomeWeapon.cs +++ b/proj/unity/Assets/Scripts/PHome/PHomeWeapon.cs @@ -210,14 +210,20 @@ public class PHomeWeapon : MonoBehaviour public void RefreshAttr() { + GameObject lastPrefab = m_projectilePrefab; for (int i = 0; i < LevelConfig.Count; i++) { + if (LevelConfig[i].m_projectilePrefab != null) + { + lastPrefab = LevelConfig[i].m_projectilePrefab; + } + if (LevelConfig[i].Level == m_level) { FireRate = LevelConfig[i].FireRate; //ShootRate = LevelConfig[i].ShootRate; ShootCount = LevelConfig[i].ShootCount; - m_projectilePrefab = LevelConfig[i].m_projectilePrefab; + m_projectilePrefab = lastPrefab; } } } diff --git a/proj/unity/Assets/Scripts/PHome/Particle/PHomeParticle.cs b/proj/unity/Assets/Scripts/PHome/Particle/PHomeParticle.cs index 5c34be2..f9a1b8b 100644 --- a/proj/unity/Assets/Scripts/PHome/Particle/PHomeParticle.cs +++ b/proj/unity/Assets/Scripts/PHome/Particle/PHomeParticle.cs @@ -29,7 +29,10 @@ public class PHomeParticle : MonoBehaviour private IEnumerator StopRoutine(float delaySeconds) { yield return new WaitForSeconds(delaySeconds); - ParticleSystem.Stop(); + if (ParticleSystem != null) + { + ParticleSystem.Stop(); + } yield return new WaitForSeconds(m_maxStopTime); Destroy(gameObject); } diff --git a/proj/unity/Assets/Scripts/PHome/Projectile/PHomeProjectileBase.cs b/proj/unity/Assets/Scripts/PHome/Projectile/PHomeProjectileBase.cs index d1e4e99..450fc40 100644 --- a/proj/unity/Assets/Scripts/PHome/Projectile/PHomeProjectileBase.cs +++ b/proj/unity/Assets/Scripts/PHome/Projectile/PHomeProjectileBase.cs @@ -101,11 +101,25 @@ public class PHomeProjectileBase : PHomeProjectile unit = target?.GetComponent(); projectile = target?.GetComponent(); - if (unit == null && projectile == null) + if (projectile != null && !CollideWithProjectiles) { return; } + if (unit != null) + { + bool hostile = PHomeGameMode.IsEnemy(Instigator, unit); + if (!CollideWithEnemyUnits && hostile) + { + return; + } + + if (!CollideWithFriendlyUnits && !hostile) + { + return; + } + } + ProjectileCollideContext context = new ProjectileCollideContext() { GameMode = PHomeGameMode.main, @@ -114,11 +128,28 @@ public class PHomeProjectileBase : PHomeProjectile Projectile = this, }; - if (m_collidedObject.Add(target)) + if (NoRepeatCollide) { + if (!m_collidedObject.Add(target)) + { + return; + } + NoRepeatCollideEvent.Invoke(context); } + ProjectileCollideEvent.Invoke(context); + + Mover?.OnCollide(context); + + if (m_useCollideLifeTime) + { + m_collideTimes++; + if (m_collideTimes >= m_collideLifeTime) + { + Destroy(gameObject); + } + } } public void ClearCollideList() @@ -218,6 +249,18 @@ public class PHomeProjectileBase : PHomeProjectile //} } + private void Update_Attach() + { + if (m_attachToUnit) + { + PHomeUnit toAttach = m_shootData.GetUnit(m_attachedUnit); + if (toAttach != null) + { + ProjectilePosition = toAttach.transform.position; + } + } + } + public void OnMovingFinished() { if (MoveFinishDestroy) @@ -232,6 +275,7 @@ public class PHomeProjectileBase : PHomeProjectile base.Init(shootData); ProjectilePosition = m_shootData.GetPoint(m_spawnAt).Value; Mover?.Init(m_shootData, null); + //if (ResetCollision && m_projectileMover != null) //{ // m_projectileMover.Init(shootData, MoveFinish); @@ -262,6 +306,7 @@ public class PHomeProjectileBase : PHomeProjectile base.Virtual_Update(); Update_Timer(); + Update_Attach(); } } diff --git a/proj/unity/Assets/Scripts/PHome/ProjectileMover/PHomeProjectileMover.cs b/proj/unity/Assets/Scripts/PHome/ProjectileMover/PHomeProjectileMover.cs index 6ef9e5f..778aaeb 100644 --- a/proj/unity/Assets/Scripts/PHome/ProjectileMover/PHomeProjectileMover.cs +++ b/proj/unity/Assets/Scripts/PHome/ProjectileMover/PHomeProjectileMover.cs @@ -2,6 +2,7 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; using System; +using System.Linq; using Sirenix.OdinInspector; [System.Serializable] @@ -34,6 +35,12 @@ public struct ProjectileDirection } } +public enum PHomeBounceRules +{ + NearestEnemyOrPhysics, + Physics, +} + public class PHomeProjectileMover : MonoBehaviour { private PHomeProjectileBase m_projectile; @@ -193,14 +200,25 @@ public class PHomeProjectileMover : MonoBehaviour } } - [SerializeField] - protected bool m_return; - public bool Return + protected bool m_bounceOffCollide; + + public bool BounceOffCollide { get { - return m_return; + return m_bounceOffCollide; + } + } + + [SerializeField] + [ShowIf("BounceEnabled")] + protected PHomeBounceRules m_bounceRule; + public PHomeBounceRules BounceRule + { + get + { + return m_bounceRule; } } @@ -214,25 +232,42 @@ public class PHomeProjectileMover : MonoBehaviour } } - [BoxGroup("Debug")] + [BoxGroup("Editor Config")] [SerializeField] - protected Vector3 m_destVelocity; - public Vector3 DestVelocity + [ShowIf("m_bounceOffScreen")] + protected float m_bounceRadius = 0.1f; + public float BounceRadius { get { - return m_destVelocity; + return m_bounceRadius; } set { - m_destVelocity = value; + m_bounceRadius = value; } } + [BoxGroup("Editor Config")] + [SerializeField] + private float m_minBounceDeg = 30.0f; + + [BoxGroup("Editor Config")] + [SerializeField] + private float m_collideBounceSearchRadius = 5f; + private Vector2? m_lastDestVelocity; - public Vector3 Velocity + public Vector2? LastDestVelocity + { + get + { + return m_lastDestVelocity; + } + } + + public Vector2 Velocity { get { @@ -241,7 +276,7 @@ public class PHomeProjectileMover : MonoBehaviour case MoveType.PhysicsMovement2D: return PhysicsBody.velocity; case MoveType.PositionMovement: - return m_destVelocity; + return m_lastDestVelocity.Value; default: break; } @@ -250,6 +285,14 @@ public class PHomeProjectileMover : MonoBehaviour } } + private bool BounceEnabled + { + get + { + return BounceOffCollide || BounceOffScreen; + } + } + protected ShootData m_shootData; private Action m_moveFinishAc; @@ -321,7 +364,7 @@ public class PHomeProjectileMover : MonoBehaviour } } - protected virtual void Update_Movement() + private void Update_Movement() { TryFinishMove(); @@ -383,280 +426,142 @@ public class PHomeProjectileMover : MonoBehaviour } } - private void PositionMovement() + private void Update_BounceScreen() { - switch (m_moveCalType) + if (!BounceOffScreen) { - case MoveCalType.Linear: - LinearToEndPositionMove(); - break; - case MoveCalType.LaserWave: - LaserWaveMove(); - break; - case MoveCalType.CircleMove: - CircleMove(); - break; - case MoveCalType.BezierCurveMove: - BezierCurveMove(); - break; - default: - break; + return; } - } - - Vector2 midPos = Vector2.zero; - private float t = 0f; - [BoxGroup("Debug")] - public Vector2 nextPos; - void BezierCurveMove() - { - if(MoveFinish){return;} - if(minPos == Vector2.zero) + PHomePlayerScreen playerScreen = PHomeGameMode.main.PlayerScreen; + if (playerScreen == null) { - CalMidPos(); + return; } - if (t < 1f) + + BoxCollider2D boxCollider = playerScreen.Collider; + + // Get the bounds of the box collider + Bounds boxBounds = boxCollider.bounds; + + // Get the center of the circle collider + Vector2 circleCenter = transform.position; + + // Calculate the closest point on the box collider to the circle + float closestX = Mathf.Clamp(circleCenter.x, boxBounds.min.x, boxBounds.max.x); + float closestY = Mathf.Clamp(circleCenter.y, boxBounds.min.y, boxBounds.max.y); + + // Get the vector from the circle center to the closest point on the box + Vector2 closestPoint = new Vector2(closestX, closestY); + Vector2 directionToClosestPoint = closestPoint - circleCenter; + + // Check the distance from the circle's center to the closest point + float distance = directionToClosestPoint.magnitude; + + // If the distance is less than the radius of the circle, they are colliding + if (distance >= BounceRadius) { - t += Time.deltaTime * Speed; - t = t > 1 ? 1 : t; - Vector2 position = GetCurvePoint(t, m_shootData.StartPoint, midPos, m_shootData.EndPoint.Value); - float nextT = t+0.01f; - nextPos = GetCurvePoint(nextT>1?1:nextT, m_shootData.StartPoint, midPos, m_shootData.EndPoint.Value) - position; - if(transform!=null && position.x!=float.NaN) - { - transform.position = position; - } + return; } - else + + Vector2 curVel = m_rigidBody.velocity; + float speed = curVel.magnitude; + + Vector2 normal = Vector2.zero; + bool collided = false; + + // Determine the closest edge and calculate the normal + if (Mathf.Abs(closestX - boxBounds.min.x) < 0.1f && curVel.x < 0.0f) { - Projectile.ProjectilePosition = m_shootData.EndPoint.Value; - if (m_moveFinishAc != null) m_moveFinishAc(); - //m_moveFinished = true; + normal = Vector2.right; + collided = true; } - } - - public static Vector2 GetCurvePoint(float t,Vector2 _point0, Vector2 _point1, Vector2 _point2) - { - t = Mathf.Clamp(t, 0.0f, 1.0f); - // Debug.Log("~~t:"+t+" "+_point0+ " "+_point1+" "+_point2); - float x = ((1 - t) * (1 - t)) * _point0.x + 2 * t * (1 - t) * _point1.x + t * t * _point2.x; - float y = ((1 - t) * (1 - t)) * _point0.y + 2 * t * (1 - t) * _point1.y + t * t * _point2.y; - //float z = ((1 - t) * (1 - t)) * _point0.z + 2 * t * (1 - t) * _point1.z + t * t * _point2.z; - Vector2 pos = new Vector2(x, y); - return pos; - } - - void CalMidPos() - { - // 计算中点 - Vector2 midPoint = (m_shootData.StartPoint + m_shootData.EndPoint.Value) / 2; - - // 计算起点到终点的方向 - Vector2 direction = m_shootData.EndPoint.Value - m_shootData.StartPoint; - - // 计算垂直方向(法线方向) - Vector3 perpendicular = new Vector3(-direction.y, direction.x).normalized; - - // 计算控制点 - //if (m_shootData.ProjectileIndex % 2 == 0) - //{ - // midPos = midPoint + (perpendicular * 0.3f * direction.magnitude) ; - //} - //else - //{ - // midPos = midPoint - (perpendicular * 0.7f * direction.magnitude); - //} - } - - float currAngle = -1; - void CircleMove() - { - //if (currAngle == -1) - //{ - // currAngle = m_shootData.Angle; - //} - //currAngle += Time.deltaTime * Speed; - //if (currAngle > 360) { currAngle = currAngle % 360; } - //float x = m_shootData.Radius * Mathf.Cos(currAngle * Mathf.Deg2Rad); - //float y = m_shootData.Radius * Mathf.Sin(currAngle * Mathf.Deg2Rad); - //transform.position = m_shootData.TargetUnit.transform.position + new Vector3(x, y, 0); - } - - bool projectileReturn; - float posX; - float posY; - Vector3 projectilePos; - void LaserWaveMove() - { - //if (m_shootData.ProjectileIndex % 2 == 0) - //{ - // if (projectileReturn) - // { - // posX += Time.deltaTime * Speed; - // } - // else - // { - // posX -= Time.deltaTime * Speed; - // } - // if (posX <= -1) - // { - // projectileReturn = true; - // } - // else if (posX >= 0) - // { - // projectileReturn = false; - // } - //} - //else - //{ - // if (projectileReturn) - // { - // posX -= Time.deltaTime * Speed; - // } - // else - // { - // posX += Time.deltaTime * Speed; - // } - // if (posX > 1) - // { - // projectileReturn = true; - // } - // else if (posX <= 0) - // { - // projectileReturn = false; - // } - //} - //if (m_shootData.ProjectileIndex < 2) - //{ - // posY += Time.deltaTime * Speed / 2; - //} - //else - //{ - // posY -= Time.deltaTime * Speed / 2; - //} - //if (posY > 3 || posY < -3) - //{ - // Destroy(gameObject); - //} - //projectilePos.x = posX; - //projectilePos.y = posY; - //transform.position = m_shootData.StartPoint + projectilePos; - } - - Vector2 maxPos; - Vector2 minPos; - void LinearDirectionMove() - { - if (m_destVelocity == Vector3.zero) + else if (Mathf.Abs(closestX - boxBounds.max.x) < 0.1f && curVel.x > 0.0f) { - m_destVelocity = (m_shootData.EndPoint.Value - m_shootData.StartPoint).normalized; + normal = Vector2.left; + collided = true; } - Vector2 ScreenPos = Camera.main.WorldToScreenPoint(transform.position); - if (BounceOffScreen) + else if (Mathf.Abs(closestY - boxBounds.min.y) < 0.1f && curVel.y < 0.0f) { - if (ScreenPos.x >= Screen.width && m_destVelocity.x > 0) - { - m_destVelocity.x = -m_destVelocity.x; - } - if (ScreenPos.x <= 0 && m_destVelocity.x < 0) - { - m_destVelocity.x = -m_destVelocity.x; - } - if (ScreenPos.y >= Screen.height && m_destVelocity.y > 0) - { - m_destVelocity.y = -m_destVelocity.y; - } - if (ScreenPos.y <= 0 && m_destVelocity.y < 0) - { - m_destVelocity.y = -m_destVelocity.y; - } - // maxPos = PHomeGameMode.main.PlayerUnit.GetPosMax(); - // minPos = PHomeGameMode.main.PlayerUnit.GetPosMin(); - // if (transform.position.x >= maxPos.x && m_destVelocity.x > 0) - // { - // m_destVelocity.x = -m_destVelocity.x; - // } - // if (transform.position.x <= minPos.x && m_destVelocity.x < 0) - // { - // m_destVelocity.x = -m_destVelocity.x; - // } - // if (transform.position.y >= maxPos.y && m_destVelocity.y > 0) - // { - // m_destVelocity.y = -m_destVelocity.y; - // } - // if (transform.position.y <= minPos.y && m_destVelocity.y < 0) - // { - // m_destVelocity.y = -m_destVelocity.y; - // } + normal = Vector2.up; + collided = true; } - finalVel = m_destVelocity * Speed; - transform.position = transform.position + finalVel * Time.deltaTime; - } - - public void LinearToTargetMove() - { - if (m_shootData.TargetUnit == null) + else if (Mathf.Abs(closestY - boxBounds.max.y) < 0.1f && curVel.y > 0.0f) { - //目标丢失事件 - TargetLos(); + normal = Vector2.down; + collided = true; } - else + + if (!collided) { - m_destVelocity = m_shootData.TargetUnit.transform.position - transform.position; - //m_preVelocity = m_destVelocity.normalized; - PhysicsMovement.DestVelocity = m_destVelocity.normalized * Speed; + return; } - } - public void Rebound(Transform collider) - { - m_destVelocity = transform.position - collider.transform.position; - } - - - Vector3 finalVel = Vector3.zero; - //bool m_moveFinished; - bool m_returnSpeed; - void LinearToEndPositionMove() - { - // TODO iii - //if (m_moveFinished) return; - //if (m_destVelocity == Vector3.zero) - //{ - // m_destVelocity = (m_shootData.EndPoint.Value - m_shootData.StartPoint).normalized; - //} - //finalVel = m_destVelocity * Speed; - //transform.position = transform.position + finalVel * Time.deltaTime; - //if (Return && m_returnSpeed) return; - //if ((transform.position - m_shootData.StartPoint).magnitude >= (m_shootData.EndPoint - m_shootData.StartPoint).magnitude) - //{ - // transform.position = m_shootData.EndPoint; - // if (m_moveFinishAc != null) m_moveFinishAc(); - // if (Return) - // { - // m_returnSpeed = true; - // m_destVelocity = m_shootData.StartPoint - m_shootData.EndPoint; - // } - // else - // { - // m_moveFinished = true; - // } - //} - } - - - void TargetLos() - { - //m_movement.DestVelocity = m_preVelocity * Speed; - } - - void ArriveTarget() - { - if (m_destVelocity.magnitude < 0.01f) + if (DoBounce()) { - FinishMoving(); + return; } + + // Calculate reflected velocity + Vector2 reflectedVelocity = Vector2.Reflect(curVel, normal); + + // Calculate the angle between the reflected velocity and the normal + float angle = Vector2.Angle(reflectedVelocity, normal); + + // If the angle is less than the minimum bounce angle + if (angle < m_minBounceDeg) + { + // Rotate the reflected velocity to meet the minimum bounce angle + float rotateAngle = m_minBounceDeg - angle; + reflectedVelocity = Quaternion.Euler(0, 0, Mathf.Sign(Vector3.Cross(normal, reflectedVelocity).z) * rotateAngle) * reflectedVelocity; + } + + + m_rigidBody.velocity = reflectedVelocity; + } + + public void OnCollide(ProjectileCollideContext context) + { + if (!BounceOffCollide) + { + return; + } + + if (DoBounce(context.OtherUnit)) + { + return; + } + + Vector2 curVel = m_rigidBody.velocity; + curVel.y = -curVel.y; + m_rigidBody.velocity = curVel; + } + + // Return false if should bounce by physics + private bool DoBounce(PHomeUnit exclude = null) + { + if (BounceRule == PHomeBounceRules.Physics) + { + return false; + } + + PHomeUnit nearestTarget = SearchForNearestTarget(exclude); + if (nearestTarget == null) + { + return false; + } + + Vector2 curVel = m_rigidBody.velocity; + float curSpeed = curVel.magnitude; + m_rigidBody.velocity = (nearestTarget.transform.position - transform.position).normalized * curSpeed; + return true; + } + + private PHomeUnit SearchForNearestTarget(PHomeUnit exclude = null) + { + var units = AreaUtils.FindUnits(transform.position, m_collideBounceSearchRadius); + var enemies = units.Where(unit => PHomeGameMode.IsEnemy(Projectile.Instigator, unit) && unit != exclude); + return PHomeUtils.GetNearestTarget(enemies, transform.position); } void FinishMoving() @@ -674,5 +579,6 @@ public class PHomeProjectileMover : MonoBehaviour { Update_Movement(); Update_Pos(); + Update_BounceScreen(); } } diff --git a/proj/unity/Assets/Scripts/PHome/ProjectileRotator/PHomeProjectileRotator.cs b/proj/unity/Assets/Scripts/PHome/ProjectileRotator/PHomeProjectileRotator.cs index cdca796..3422dd2 100644 --- a/proj/unity/Assets/Scripts/PHome/ProjectileRotator/PHomeProjectileRotator.cs +++ b/proj/unity/Assets/Scripts/PHome/ProjectileRotator/PHomeProjectileRotator.cs @@ -51,10 +51,10 @@ public class PHomeProjectileRotator : MonoBehaviour LookAtVelocity(rotTrans, MoverScript.Velocity); break; case RotateType.LookAtDestVelocity: - LookAtVelocity(rotTrans, MoverScript.DestVelocity); + LookAtVelocity(rotTrans, MoverScript.LastDestVelocity ?? Vector2.right); break; case RotateType.LookAtNextPos: - LookAtVelocity(rotTrans, MoverScript.nextPos); + //LookAtVelocity(rotTrans, MoverScript.nextPos); break; case RotateType.Contant: { diff --git a/proj/unity/Assets/Scripts/PHome/StateTracks.meta b/proj/unity/Assets/Scripts/PHome/StateTracks.meta new file mode 100644 index 0000000..6d0027f --- /dev/null +++ b/proj/unity/Assets/Scripts/PHome/StateTracks.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a16188ba6900ef04e8580d9e16b8cb66 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Scripts/PHome/StateTracks/ST_EnemyCountBoost.cs b/proj/unity/Assets/Scripts/PHome/StateTracks/ST_EnemyCountBoost.cs new file mode 100644 index 0000000..a48fbe3 --- /dev/null +++ b/proj/unity/Assets/Scripts/PHome/StateTracks/ST_EnemyCountBoost.cs @@ -0,0 +1,72 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class ST_EnemyCountBoost : StateTrack.Track +{ + public AnimationCurve BoostCurve; + + private float? m_usedValue; + + public override void OnStart(bool skipped = false) + { + if (skipped) + { + return; + } + + ReturnValue(); + AddValue(0); + } + + public override void OnUpdate(float relativeTime) + { + ReturnValue(); + AddValue(relativeTime); + } + + public override void OnEnd(bool skipped = false) + { + if (skipped) + { + return; + } + + ReturnValue(); + } + + private void AddValue(float time) + { + if (m_usedValue != null) + { + throw new System.Exception($"Please release old values before adding new ones"); + } + + PHomeEnemyManager manager = PHomeGameMode.main.EnemyManager; + + m_usedValue = BoostCurve.Evaluate(time); + manager.SpawnCountBoost += m_usedValue.Value; + } + + private void ReturnValue() + { + PHomeEnemyManager manager = PHomeGameMode.main.EnemyManager; + + if (m_usedValue.HasValue) + { + manager.SpawnCountBoost -= m_usedValue.Value; + m_usedValue = null; + } + } + + #region Editor +#if UNITY_EDITOR + + public override string GetTrackDisplayName() + { + return ""; + } + +#endif + #endregion +} diff --git a/proj/unity/Assets/Scripts/PHome/StateTracks/ST_EnemyCountBoost.cs.meta b/proj/unity/Assets/Scripts/PHome/StateTracks/ST_EnemyCountBoost.cs.meta new file mode 100644 index 0000000..523e0dd --- /dev/null +++ b/proj/unity/Assets/Scripts/PHome/StateTracks/ST_EnemyCountBoost.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6fac51dfbd526ee439c3a76e3e795fec +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Scripts/PHome/StateTracks/ST_EnemyHealthBoost.cs b/proj/unity/Assets/Scripts/PHome/StateTracks/ST_EnemyHealthBoost.cs new file mode 100644 index 0000000..f8dcb14 --- /dev/null +++ b/proj/unity/Assets/Scripts/PHome/StateTracks/ST_EnemyHealthBoost.cs @@ -0,0 +1,72 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class ST_EnemyHealthBoost : StateTrack.Track +{ + public AnimationCurve BoostCurve; + + private float? m_usedValue; + + public override void OnStart(bool skipped = false) + { + if (skipped) + { + return; + } + + ReturnValue(); + AddValue(0); + } + + public override void OnUpdate(float relativeTime) + { + ReturnValue(); + AddValue(relativeTime); + } + + public override void OnEnd(bool skipped = false) + { + if (skipped) + { + return; + } + + ReturnValue(); + } + + private void AddValue(float time) + { + if (m_usedValue != null) + { + throw new System.Exception($"Please release old values before adding new ones"); + } + + PHomeEnemyManager manager = PHomeGameMode.main.EnemyManager; + + m_usedValue = BoostCurve.Evaluate(time); + manager.SpawnHealthBoost += m_usedValue.Value; + } + + private void ReturnValue() + { + PHomeEnemyManager manager = PHomeGameMode.main.EnemyManager; + + if (m_usedValue.HasValue) + { + manager.SpawnHealthBoost -= m_usedValue.Value; + m_usedValue = null; + } + } + + #region Editor +#if UNITY_EDITOR + + public override string GetTrackDisplayName() + { + return "Ѫ"; + } + +#endif + #endregion +} diff --git a/proj/unity/Assets/Scripts/PHome/StateTracks/ST_EnemyHealthBoost.cs.meta b/proj/unity/Assets/Scripts/PHome/StateTracks/ST_EnemyHealthBoost.cs.meta new file mode 100644 index 0000000..9e00814 --- /dev/null +++ b/proj/unity/Assets/Scripts/PHome/StateTracks/ST_EnemyHealthBoost.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b820213960d8caa4b89de7967100a860 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Scripts/PHome/StateTracks/ST_EnemyWave.cs b/proj/unity/Assets/Scripts/PHome/StateTracks/ST_EnemyWave.cs new file mode 100644 index 0000000..29140c6 --- /dev/null +++ b/proj/unity/Assets/Scripts/PHome/StateTracks/ST_EnemyWave.cs @@ -0,0 +1,57 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using ODUnityCollection; + +public class ST_EnemyWave : StateTrack.Track +{ + [SerializeField] + private SerializableDictionary m_monsters; + + private List m_keys = new List(); + + public override void OnStart(bool skipped = false) + { + if (skipped) + { + return; + } + + Return(); + + foreach (var monster in m_monsters) + { + m_keys.Add(PHomeGameMode.main.EnemyManager.AddMonsterCount(monster.Key.gameObject, monster.Value)); + } + } + + public override void OnEnd(bool skipped = false) + { + if (skipped) + { + return; + } + + Return(); + } + + private void Return() + { + foreach (var key in m_keys) + { + PHomeGameMode.main.EnemyManager.RemoveMonsterCount(key); + } + m_keys.Clear(); + } + + #region Editor +#if UNITY_EDITOR + + public override string GetTrackDisplayName() + { + return "ˢ"; + } + +#endif + #endregion +} diff --git a/proj/unity/Assets/Scripts/PHome/StateTracks/ST_EnemyWave.cs.meta b/proj/unity/Assets/Scripts/PHome/StateTracks/ST_EnemyWave.cs.meta new file mode 100644 index 0000000..93b769f --- /dev/null +++ b/proj/unity/Assets/Scripts/PHome/StateTracks/ST_EnemyWave.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7afcf527d086c4f48b82d1be17bfc8ff +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Scripts/PHome/Weapon/PHomeFirer/PHomeFirer_Common.cs b/proj/unity/Assets/Scripts/PHome/Weapon/PHomeFirer/PHomeFirer_Common.cs index f546868..c53d6cd 100644 --- a/proj/unity/Assets/Scripts/PHome/Weapon/PHomeFirer/PHomeFirer_Common.cs +++ b/proj/unity/Assets/Scripts/PHome/Weapon/PHomeFirer/PHomeFirer_Common.cs @@ -38,26 +38,7 @@ public class PHomeFirer_Common : PHomeFirer { case ShootType.NearestTarget: { - targets = new List(GetTargetUnits()); - if (targets.Count == 0) - { - yield break; - } - - PHomeUnit target; - if (targets.Count == 1) - { - target = targets[0]; - } - else - { - target = targets.Aggregate((a, b) => - { - float distA = Vector2.Distance(a.transform.position, transform.position); - float distB = Vector2.Distance(b.transform.position, transform.position); - return distA < distB ? a : b; - }); - } + PHomeUnit target = PHomeUtils.GetNearestTarget(GetTargetUnits(), transform.position); if (target == null) { @@ -96,7 +77,7 @@ public class PHomeFirer_Common : PHomeFirer break; case ShootType.ScreenRandomPoint: { - Vector2 dest = PHomeGameMode.main.PlayerUnit.PlayerScreen.GetRandomPoint(); + Vector2 dest = PHomeGameMode.main.PlayerScreen.GetRandomPoint(); ShootData shootData = GetShootData(); shootData.EndPoint = dest; @@ -105,7 +86,34 @@ public class PHomeFirer_Common : PHomeFirer break; case ShootType.UnitPos: break; + case ShootType.NearestOrRandomDirection: + { + ShootData shootData = GetShootData(); + + PHomeUnit target = PHomeUtils.GetNearestTarget(GetTargetUnits(), transform.position); + + if (target == null) + { + float rand = UnityEngine.Random.Range(0.0f, 2.0f * Mathf.PI); + shootData.Direction = new Vector2() + { + x = Mathf.Cos(rand), + y = Mathf.Sin(rand) + }; + } + else + { + shootData.Direction = target.transform.position - transform.position; + } + + ShootProjectiles(shootData); + } + break; case ShootType.None: + { + ShootData shootData = GetShootData(); + ShootProjectiles(shootData); + } break; default: break; @@ -126,6 +134,7 @@ public class PHomeFirer_Common : PHomeFirer case ShootType.NearbyRandomPoint: case ShootType.ScreenRandomPoint: case ShootType.UnitPos: + case ShootType.NearestOrRandomDirection: case ShootType.None: return false; default: @@ -146,8 +155,7 @@ public class PHomeFirer_Common : PHomeFirer switch (m_shootType) { case ShootType.NearestTarget: - Gizmos.color = Color.red; - GizmosUtils.DrawCircle(transform.position, m_radius); + break; case ShootType.NearbyRandomPoint: break; @@ -164,6 +172,9 @@ public class PHomeFirer_Common : PHomeFirer default: break; } + + Gizmos.color = Color.red; + GizmosUtils.DrawCircle(transform.position, m_radius); } #endregion diff --git a/proj/unity/Assets/Scripts/PHome/Weapon/PHomeWeaponBase.cs b/proj/unity/Assets/Scripts/PHome/Weapon/PHomeWeaponBase.cs index 3e3dc93..47def0c 100644 --- a/proj/unity/Assets/Scripts/PHome/Weapon/PHomeWeaponBase.cs +++ b/proj/unity/Assets/Scripts/PHome/Weapon/PHomeWeaponBase.cs @@ -1,5 +1,6 @@ using System.Collections; using System.Collections.Generic; +using System.Data; using System.Linq; using UnityEngine; @@ -340,6 +341,7 @@ public enum ShootType NearbyAllTarget,// 周围随机敌人射击 ScreenRandomPoint,// 玩家屏幕随机点射击 UnitPos,//所有者坐标点生成 + NearestOrRandomDirection, None, } @@ -358,6 +360,12 @@ public enum ShootDataPoints TargetUnit, } +public enum ShootDataUnits +{ + Unit, + TargetUnit, +} + public struct ShootData { public PHomeUnit Unit; @@ -441,6 +449,21 @@ public struct ShootData return null; } + + public PHomeUnit GetUnit(ShootDataUnits unit) + { + switch (unit) + { + case ShootDataUnits.Unit: + return Unit; + case ShootDataUnits.TargetUnit: + return TargetUnit; + default: + break; + } + + return null; + } } [System.Serializable] diff --git a/proj/unity/Assets/Scripts/StateTrack.meta b/proj/unity/Assets/Scripts/StateTrack.meta new file mode 100644 index 0000000..d8e9d01 --- /dev/null +++ b/proj/unity/Assets/Scripts/StateTrack.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ffb887756270a9c4ba9542d1e2a57135 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Scripts/StateTrack/ITimedTrack.cs b/proj/unity/Assets/Scripts/StateTrack/ITimedTrack.cs new file mode 100644 index 0000000..a787922 --- /dev/null +++ b/proj/unity/Assets/Scripts/StateTrack/ITimedTrack.cs @@ -0,0 +1,12 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace StateTrack +{ + public interface ITimedTrack + { + public float Offset { get; } + public float? Duration { get; } + } +} \ No newline at end of file diff --git a/proj/unity/Assets/Scripts/StateTrack/ITimedTrack.cs.meta b/proj/unity/Assets/Scripts/StateTrack/ITimedTrack.cs.meta new file mode 100644 index 0000000..b5e3a1e --- /dev/null +++ b/proj/unity/Assets/Scripts/StateTrack/ITimedTrack.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 876877a0be23cab43ba9b2ca62b57246 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Scripts/StateTrack/MultipleTrack.cs b/proj/unity/Assets/Scripts/StateTrack/MultipleTrack.cs new file mode 100644 index 0000000..d7ee5a0 --- /dev/null +++ b/proj/unity/Assets/Scripts/StateTrack/MultipleTrack.cs @@ -0,0 +1,147 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using Sirenix.OdinInspector; +using System.Linq; + +namespace StateTrack +{ + public class MultipleTrack : MonoBehaviour, ITimedTrack + { + public float Offset + { + get + { + return 0; + } + } + + public float? Duration + { + get + { + return StateTrackUtils.CalculateMaxDuration(TrackLayers); + } + } + + public IEnumerable TrackLayers + { + get + { + foreach (Transform tr in transform) + { + var layerScript = tr.GetComponent(); + yield return layerScript; + } + } + } + + public IEnumerable GetTracksAtTime(float time) + { + return TrackLayers + .Select(x => x.GetTrackAtTime(time - Offset)) + .Where(x => x != null); + } + + public IEnumerable GetAllTracksBetween(float startTime, float endTime) + { + return TrackLayers + .Select(x => x.GetAllTracksBetween(startTime - Offset, endTime - Offset)) + .SelectMany(x => x); + } + + #region Runtime + + + #endregion + + #region Editor +#if UNITY_EDITOR + + public GameObject LayerPrefab; + + [Button] + public TrackLayer AddNewLayer() + { + if (LayerPrefab == null) + { + Debug.LogError("LayerPrefab is not assigned!"); + return null; + } + + // Create a prefab instance that maintains the prefab connection + GameObject newLayerObj = UnityEditor.PrefabUtility.InstantiatePrefab(LayerPrefab, transform) as GameObject; + + // Name the new layer based on current child count + newLayerObj.name = $"Layer_{transform.childCount}"; + + // Get and return the TrackLayer component + TrackLayer newLayer = newLayerObj.GetComponent(); + if (newLayer == null) + { + Debug.LogError("LayerPrefab does not contain a TrackLayer component!"); + DestroyImmediate(newLayerObj); + return null; + } + + return newLayer; + } + + [Button] + public bool RemoveLayer(TrackLayer layer) + { + if (layer == null) + return false; + + // Check if the layer is actually a child of this MultipleTrack + if (layer.transform.parent != transform) + { + Debug.LogError("Attempted to remove a layer that is not a child of this MultipleTrack!"); + return false; + } + + // Destroy the layer's GameObject + DestroyImmediate(layer.gameObject); + return true; + } + + public int GetLayerIndex(TrackLayer layer) + { + int index = 0; + foreach (TrackLayer layerItem in TrackLayers) + { + if (layerItem == layer) + { + return index; + } + index++; + } + + return -1; + } + + public int SetLayerIndex(TrackLayer layer, int newIndex) + { + if (layer.transform.parent != transform) + { + throw new System.Exception($"This {nameof(TrackLayer)}({layer}) does not belong to this {nameof(MultipleTrack)}"); + } + + int childCount = transform.childCount; + if (newIndex < 0) + { + newIndex = 0; + } + else if (newIndex > childCount) + { + newIndex = childCount; + } + layer.transform.SetSiblingIndex(newIndex); + + return newIndex; + } +#endif + #endregion + + } +} diff --git a/proj/unity/Assets/Scripts/StateTrack/MultipleTrack.cs.meta b/proj/unity/Assets/Scripts/StateTrack/MultipleTrack.cs.meta new file mode 100644 index 0000000..ded534c --- /dev/null +++ b/proj/unity/Assets/Scripts/StateTrack/MultipleTrack.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: ca00702d128c181448d4f8de7a616e66 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: + - LayerPrefab: {fileID: 8974008682178218887, guid: d2cce7e8461790741af3731e47765658, + type: 3} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Scripts/StateTrack/MultipleTrackEditor.cs b/proj/unity/Assets/Scripts/StateTrack/MultipleTrackEditor.cs new file mode 100644 index 0000000..75c7b02 --- /dev/null +++ b/proj/unity/Assets/Scripts/StateTrack/MultipleTrackEditor.cs @@ -0,0 +1,523 @@ +#if UNITY_EDITOR + +using UnityEngine; +using Sirenix.OdinInspector.Editor; +using Sirenix.OdinInspector; +using Sirenix.Utilities.Editor; +using UnityEditor; +using System.Collections.Generic; +using System.Linq; +using System; + +namespace StateTrack +{ + public class MultipleTrackEditor : EditorWindow + { + [MenuItem("Tools/State Track/Track Editor")] + private static void OpenWindow() + { + GetWindow().Show(); + } + + [SerializeField] + private MultipleTrack m_targetTrack; + + [SerializeField] + private Vector2 m_scrollPosition; + + [SerializeField] + private float m_timelineScale = 100f; // Pixels per second + + private const float TRACK_HEIGHT = 40f; + private const float LAYER_SPACING = 10f; + private const float TIMELINE_HEADER_HEIGHT = 30f; + private const float TRACK_NAME_WIDTH = 150f; + + private Track m_draggedTrack; + private float m_dragStartOffset; + private float m_dragStartDuration; + private Vector2 m_dragStartMousePosition; + + private enum DragMode + { + None, + Move, + ResizeLeft, + ResizeRight + } + + private DragMode currentDragMode; + private const float RESIZE_HANDLE_WIDTH = 10f; + + private StateTrackPlayer m_player; + + private void OnSelectionChange() + { + GameObject selectedObject = Selection.activeGameObject; + if (selectedObject != null) + { + MultipleTrack selectedTrack = selectedObject.GetComponent(); + if (selectedTrack != null) + { + m_targetTrack = selectedTrack; + Repaint(); + } + } + } + + private void OnGUI() + { + DrawTargetObjectField(); + + if (m_targetTrack == null) return; + + DrawToolbar(); + DrawTimelineHeader(); + DrawTimelineLayers(); + } + + private void DrawTargetObjectField() + { + EditorGUILayout.Space(); + m_targetTrack = EditorGUILayout.ObjectField("Target Track", m_targetTrack, typeof(MultipleTrack), true) as MultipleTrack; + EditorGUILayout.Space(); + } + + private void DrawToolbar() + { + EditorGUILayout.BeginHorizontal(EditorStyles.toolbar); + + if (GUILayout.Button("Add Layer", EditorStyles.toolbarButton)) + { + AddNewLayer(); + } + + m_timelineScale = EditorGUILayout.Slider("Zoom", m_timelineScale, 5f, 200f); + + EditorGUILayout.EndHorizontal(); + + if (m_targetTrack != null) + { + m_player = m_targetTrack.GetComponent(); + if (m_player != null) + { + EditorGUILayout.BeginHorizontal(EditorStyles.toolbar); + + if (!m_player.IsPlaying) + { + if (GUILayout.Button("Play", EditorStyles.toolbarButton, GUILayout.Width(50))) + { + m_player.Play(); + } + } + else + { + if (GUILayout.Button("Pause", EditorStyles.toolbarButton, GUILayout.Width(50))) + { + m_player.Pause(); + } + } + + if (GUILayout.Button("Stop", EditorStyles.toolbarButton, GUILayout.Width(50))) + { + m_player.Stop(); + } + + EditorGUILayout.LabelField($"Time: {m_player.CurrentTime:F2}s", GUILayout.Width(100)); + + EditorGUILayout.EndHorizontal(); + } + } + } + + private void DrawTimelineHeader() + { + Rect headerRect = GUILayoutUtility.GetRect(position.width, TIMELINE_HEADER_HEIGHT); + GUI.Box(headerRect, ""); + + float visibleSeconds = (position.width - TRACK_NAME_WIDTH) / m_timelineScale; + + float timeStep = 1f; + if (m_timelineScale < 10f) timeStep = 10f; + else if (m_timelineScale < 20f) timeStep = 5f; + else if (m_timelineScale < 50f) timeStep = 2f; + + for (float time = 0; time <= visibleSeconds; time += timeStep) + { + float xPos = TRACK_NAME_WIDTH + time * m_timelineScale; + + if (xPos < position.width) + { + Rect markerRect = new Rect(xPos - 1, headerRect.y, 2, headerRect.height); + EditorGUI.DrawRect(markerRect, Color.gray); + + float labelWidth = timeStep >= 5f ? 40f : 30f; + Rect labelRect = new Rect(xPos - labelWidth/2, headerRect.y, labelWidth, 20); + GUI.Label(labelRect, ((int)time).ToString()); + } + } + + if (m_player != null) + { + float pointerX = TRACK_NAME_WIDTH + m_player.CurrentTime * m_timelineScale; + + Rect pointerRect = new Rect(pointerX - 1, headerRect.y, 2, position.height); + EditorGUI.DrawRect(pointerRect, new Color(1f, 0.3f, 0.3f, 0.8f)); + + Vector3[] trianglePoints = new Vector3[] + { + new Vector3(pointerX - 8, headerRect.y), + new Vector3(pointerX + 8, headerRect.y), + new Vector3(pointerX, headerRect.y + 8) + }; + + Handles.BeginGUI(); + Handles.color = new Color(1f, 0.3f, 0.3f, 0.8f); + Handles.DrawAAConvexPolygon(trianglePoints); + Handles.EndGUI(); + } + } + + private void DrawTimelineLayers() + { + m_scrollPosition = EditorGUILayout.BeginScrollView(m_scrollPosition); + + int layerIndex = 0; + foreach (var layer in m_targetTrack.TrackLayers.Reverse()) + { + DrawLayer(layer); + layerIndex++; + } + + EditorGUILayout.EndScrollView(); + } + + private void DrawLayer(TrackLayer layer) + { + int layerIndex = m_targetTrack.GetLayerIndex(layer); + + if (layerIndex > 0) + { + Rect separatorRect = EditorGUILayout.GetControlRect(false, 2); + EditorGUI.DrawRect(separatorRect, new Color(0.5f, 0.5f, 0.5f, 0.5f)); + } + + EditorGUILayout.BeginHorizontal(); + + GUIStyle arrowStyle = new GUIStyle(EditorStyles.miniButton) + { + fixedHeight = TRACK_HEIGHT / 2, + alignment = TextAnchor.MiddleCenter, + margin = new RectOffset(0, 0, 1, 1) + }; + + EditorGUILayout.BeginVertical(GUILayout.Width(25)); + GUI.enabled = layerIndex < m_targetTrack.TrackLayers.Count() - 1; + if (GUILayout.Button("↑", arrowStyle)) + { + MoveLayerUp(layer); + } + + GUI.enabled = layerIndex > 0; + if (GUILayout.Button("↓", arrowStyle)) + { + MoveLayerDown(layer); + } + GUI.enabled = true; + EditorGUILayout.EndVertical(); + + GUIStyle removeButtonStyle = new GUIStyle(EditorStyles.miniButton) + { + fixedHeight = TRACK_HEIGHT, + alignment = TextAnchor.MiddleCenter, + margin = new RectOffset(0, 0, 2, 2) + }; + + if (GUILayout.Button("×", removeButtonStyle, GUILayout.Width(25))) + { + RemoveLayer(layer); + return; + } + + GUIStyle layerHeaderStyle = new GUIStyle(EditorStyles.miniButton) + { + alignment = TextAnchor.MiddleLeft, + fixedHeight = TRACK_HEIGHT, + margin = new RectOffset(0, 0, 2, 2), + padding = new RectOffset(10, 10, 5, 5) + }; + + if (GUILayout.Button($"Layer {layerIndex}", layerHeaderStyle, GUILayout.Width(TRACK_NAME_WIDTH - 25 - 25))) + { + Selection.activeObject = layer; + } + + foreach (Track track in layer.Tracks) + { + DrawTrack(track); + } + + int tracksCount = layer.Tracks.Count(); + if (tracksCount == 0) + { + if (GUILayout.Button("+", GUILayout.Width(40), GUILayout.Height(TRACK_HEIGHT))) + { + ShowTrackSelectionMenu(layer); + } + } + + EditorGUILayout.EndHorizontal(); + EditorGUILayout.Space(LAYER_SPACING); + } + + private void DrawTrack(Track track) + { + float trackWidth; + if (track != null && track.Duration.HasValue) + { + trackWidth = Mathf.Max(150f, track.Duration.Value * m_timelineScale); + } + else + { + trackWidth = position.width - TRACK_NAME_WIDTH - (track?.Offset ?? 0) * m_timelineScale; + } + + float xOffset = track.Offset * m_timelineScale; + GUILayout.Space(xOffset); + + EditorGUILayout.BeginVertical(GUILayout.Width(trackWidth)); + + Rect trackRect = GUILayoutUtility.GetRect(trackWidth, TRACK_HEIGHT); + + Rect borderRect = new Rect(trackRect.x - 1, trackRect.y - 1, trackRect.width + 2, trackRect.height + 2); + EditorGUI.DrawRect(borderRect, Color.black); + + if (track != null) + { + EditorGUI.DrawRect(trackRect, new Color(0.3f, 0.5f, 0.8f, 0.5f)); + + Rect removeRect = new Rect(trackRect.xMin, trackRect.y + 5, 20, 20); + if (GUI.Button(removeRect, "×")) + { + RemoveTrack(track); + } + + if (track.Duration.HasValue) + { + Rect leftHandle = new Rect(trackRect.x, trackRect.y, RESIZE_HANDLE_WIDTH, trackRect.height); + Rect rightHandle = new Rect(trackRect.xMax - RESIZE_HANDLE_WIDTH, trackRect.y, RESIZE_HANDLE_WIDTH, trackRect.height); + + EditorGUIUtility.AddCursorRect(leftHandle, MouseCursor.ResizeHorizontal); + EditorGUIUtility.AddCursorRect(rightHandle, MouseCursor.ResizeHorizontal); + EditorGUIUtility.AddCursorRect(new Rect(trackRect.x + RESIZE_HANDLE_WIDTH, trackRect.y, + trackRect.width - 2 * RESIZE_HANDLE_WIDTH, trackRect.height), MouseCursor.MoveArrow); + + HandleTrackEvent(track, trackRect, leftHandle, rightHandle); + } + else + { + EditorGUIUtility.AddCursorRect(trackRect, MouseCursor.MoveArrow); + HandleTrackEvent(track, trackRect, Rect.zero, Rect.zero); + } + + GUIStyle centeredStyle = new GUIStyle(GUI.skin.label) + { + alignment = TextAnchor.MiddleCenter, + normal = { textColor = Color.white } + }; + + string durationText = track.Duration.HasValue ? $"{track.Duration:F2}s" : "∞"; + string destText = string.IsNullOrEmpty(track.Description) ? "" : $"({track.Description})"; + string displayText = $"{track.GetTrackDisplayName()}{destText}\n{durationText} | Offset: {track.Offset:F2}s"; + GUI.Label(trackRect, displayText, centeredStyle); + } + + EditorGUILayout.EndVertical(); + } + + private void HandleTrackEvent(Track track, Rect trackRect, Rect leftHandle, Rect rightHandle) + { + Event current = Event.current; + bool used = false; + + switch (current.type) + { + case EventType.MouseDown: + if (current.button == 0) + { + if (leftHandle.Contains(current.mousePosition)) + { + m_draggedTrack = track; + currentDragMode = DragMode.ResizeLeft; + m_dragStartOffset = track.Offset; + m_dragStartDuration = track.Duration ?? 1f; + m_dragStartMousePosition = current.mousePosition; + used = true; + } + else if (rightHandle.Contains(current.mousePosition)) + { + m_draggedTrack = track; + currentDragMode = DragMode.ResizeRight; + m_dragStartOffset = track.Offset; + m_dragStartDuration = track.Duration ?? 1f; + m_dragStartMousePosition = current.mousePosition; + used = true; + } + else if (trackRect.Contains(current.mousePosition)) + { + m_draggedTrack = track; + currentDragMode = DragMode.Move; + m_dragStartOffset = track.Offset; + m_dragStartMousePosition = current.mousePosition; + used = true; + } + + if (used) + { + EditorGUIUtility.hotControl = GUIUtility.GetControlID(FocusType.Passive); + Selection.activeObject = track; + } + } + else if (current.button == 1) + { + if (trackRect.Contains(current.mousePosition)) + { + track.Endless = !track.Endless; + used = true; + } + } + break; + + case EventType.MouseDrag: + if (m_draggedTrack == track) + { + float mouseDelta = current.mousePosition.x - m_dragStartMousePosition.x; + float deltaDuration = mouseDelta / m_timelineScale; + + Undo.RecordObject(m_targetTrack, "Adjust Track"); + + switch (currentDragMode) + { + case DragMode.Move: + { + float newOffset = m_dragStartOffset + deltaDuration; + track.Offset = Mathf.Max(0, newOffset); + } + break; + case DragMode.ResizeLeft: + { + float newDuration = Mathf.Max(0.1f, m_dragStartDuration - deltaDuration); + track.Duration = newDuration; + float newOffset = Mathf.Max(0.1f, m_dragStartOffset + deltaDuration); + track.Offset = newOffset; + } + break; + case DragMode.ResizeRight: + { + float newDuration = Mathf.Max(0.1f, m_dragStartDuration + deltaDuration); + track.Duration = newDuration; + } + break; + } + + EditorUtility.SetDirty(m_targetTrack); + used = true; + } + break; + + case EventType.MouseUp: + if (m_draggedTrack == track) + { + m_draggedTrack = null; + currentDragMode = DragMode.None; + EditorGUIUtility.hotControl = 0; + used = true; + } + break; + } + + if (used) + { + GUI.changed = true; + current.Use(); + } + } + + private void ShowTrackSelectionMenu(TrackLayer layer) + { + var menu = new GenericMenu(); + var trackTypes = StateTrackUtils.GetAllTrackTypes().Where(x => x != typeof(Track)); + + foreach (System.Type trackType in trackTypes) + { + Track defaultObject = Activator.CreateInstance(trackType) as Track; + menu.AddItem(new GUIContent(defaultObject.GetTrackDisplayName()), false, () => + { + AddTrackToLayer(layer, trackType); + }); + } + + menu.ShowAsContext(); + } + + private void AddNewLayer() + { + if (m_targetTrack == null) + { + return; + } + + Undo.RecordObject(m_targetTrack, "Add Layer"); + m_targetTrack.AddNewLayer(); + EditorUtility.SetDirty(m_targetTrack); + } + + private void RemoveLayer(TrackLayer layer) + { + Undo.RecordObject(m_targetTrack, "Remove Layer"); + layer.MultipleTrack.RemoveLayer(layer); + EditorUtility.SetDirty(m_targetTrack); + } + + private void AddTrackToLayer(TrackLayer layer, System.Type trackType) + { + Undo.RecordObject(m_targetTrack, "Add Track"); + Track track = layer.AddNewTrack(trackType); + track.Duration = 3; + EditorUtility.SetDirty(m_targetTrack); + } + + private void RemoveTrack(Track track) + { + Undo.RecordObject(m_targetTrack, "Remove Track"); + track.Layer.RemoveTrack(track); + EditorUtility.SetDirty(m_targetTrack); + } + + private void MoveLayerUp(TrackLayer layer) + { + int toIndex = m_targetTrack.GetLayerIndex(layer) + 1; + Undo.RecordObject(m_targetTrack, "Move Layer Up"); + m_targetTrack.SetLayerIndex(layer, toIndex); + EditorUtility.SetDirty(m_targetTrack); + } + + private void MoveLayerDown(TrackLayer layer) + { + int toIndex = m_targetTrack.GetLayerIndex(layer) - 1; + Undo.RecordObject(m_targetTrack, "Move Layer Down"); + m_targetTrack.SetLayerIndex(layer, toIndex); + EditorUtility.SetDirty(m_targetTrack); + } + + private void OnInspectorUpdate() + { + if (m_player != null && m_player.IsPlaying) + { + Repaint(); + } + } + } +} + +#endif \ No newline at end of file diff --git a/proj/unity/Assets/Scripts/StateTrack/MultipleTrackEditor.cs.meta b/proj/unity/Assets/Scripts/StateTrack/MultipleTrackEditor.cs.meta new file mode 100644 index 0000000..1c6529d --- /dev/null +++ b/proj/unity/Assets/Scripts/StateTrack/MultipleTrackEditor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ad9bd0d3ed070e34295daf7eaebfcc4c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Scripts/StateTrack/StateTrackPlayer.cs b/proj/unity/Assets/Scripts/StateTrack/StateTrackPlayer.cs new file mode 100644 index 0000000..ad2aff8 --- /dev/null +++ b/proj/unity/Assets/Scripts/StateTrack/StateTrackPlayer.cs @@ -0,0 +1,205 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using System.Linq; +using Sirenix.OdinInspector; + +namespace StateTrack +{ + public class StateTrackPlayer : MonoBehaviour + { + [ShowInInspector] + private float m_currentTime = 0; + + [ShowInInspector] + private bool m_isPlaying = false; + + private MultipleTrack m_trackInstance; + + private HashSet m_activeTrackSet = new HashSet(); + + public bool IsPlaying + { + get { return m_isPlaying; } + } + + public float? Duration + { + get + { + EnsureInitialize(); + return m_trackInstance.Duration; + } + } + + public float CurrentTime + { + get + { + return m_currentTime; + } + } + + private void EnsureInitialize() + { + if (m_trackInstance == null) + { + throw new System.Exception($"{nameof(StateTrackPlayer)} must be initialized with a instance of {nameof(MultipleTrack)} before use."); + } + } + + public void Initialize(MultipleTrack instance) + { + if (m_trackInstance != null) + { + throw new System.Exception($"{nameof(StateTrackPlayer)} is already initialized."); + } + + m_trackInstance = instance; + EnsureInitialize(); + } + + [Button] + public void Play() + { + EnsureInitialize(); + m_currentTime = 0; + m_activeTrackSet.Clear(); + m_isPlaying = true; + } + + [Button] + public void Resume() + { + EnsureInitialize(); + m_isPlaying = true; + } + + [Button] + public void Pause() + { + EnsureInitialize(); + m_isPlaying = false; + } + + [Button] + public void Stop() + { + EnsureInitialize(); + m_isPlaying = false; + Clear(); + } + + private void Clear() + { + foreach (Track track in m_activeTrackSet) + { + track.OnEnd(); + } + m_currentTime = 0; + m_activeTrackSet.Clear(); + } + + private void Update() + { + if (!m_isPlaying) + { + return; + } + + Step(Time.deltaTime); + + float? duration = m_trackInstance.Duration; + + if (duration.HasValue && m_currentTime >= duration.Value) + { + Stop(); + } + } + + public void Step(float deltaTime) + { + EnsureInitialize(); + + float newTime = m_currentTime + deltaTime; + var newTracks = m_trackInstance.GetTracksAtTime(newTime); + + // Handle tracks that are no longer active + foreach (Track track in m_activeTrackSet.Where(t => !newTracks.Contains(t))) + { + track.OnEnd(false); + } + + // Handle skipped tracks + var skippedTracks = m_trackInstance.GetAllTracksBetween(m_currentTime, newTime) + .Where(t => !m_activeTrackSet.Contains(t) && !newTracks.Contains(t)); + foreach (Track track in skippedTracks) + { + track.OnStart(true); + track.OnEnd(true); + } + + // Handle new tracks + foreach (Track track in newTracks) + { + if (!m_activeTrackSet.Contains(track)) + { + track.OnStart(false); + track.OnUpdate(newTime - track.Offset); + } + else + { + track.OnUpdate(newTime - track.Offset); + } + } + + // Update active track set + m_activeTrackSet.Clear(); + m_activeTrackSet.UnionWith(newTracks); + m_currentTime = newTime; + } + + public void JumpTo(float time) + { + EnsureInitialize(); + + var newTracks = m_trackInstance.GetTracksAtTime(time); + + // Handle tracks that are no longer active + foreach (Track track in m_activeTrackSet.Where(t => !newTracks.Contains(t))) + { + track.OnEnd(false); + } + + // Handle new tracks + foreach (Track track in newTracks) + { + if (!m_activeTrackSet.Contains(track)) + { + track.OnStart(false); + track.OnUpdate(time - track.Offset); + } + else + { + track.OnUpdate(time - track.Offset); + } + } + + // Update active track set + m_activeTrackSet.Clear(); + m_activeTrackSet.UnionWith(newTracks); + m_currentTime = time; + } + + private void OnDestroy() + { + if (m_trackInstance != null) + { + foreach (Track track in m_activeTrackSet) + { + track.OnEnd(); + } + } + } + } +} \ No newline at end of file diff --git a/proj/unity/Assets/Scripts/StateTrack/StateTrackPlayer.cs.meta b/proj/unity/Assets/Scripts/StateTrack/StateTrackPlayer.cs.meta new file mode 100644 index 0000000..2d612b4 --- /dev/null +++ b/proj/unity/Assets/Scripts/StateTrack/StateTrackPlayer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 87642381a30854d469e33008cce419d5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Scripts/StateTrack/StateTrackUtils.cs b/proj/unity/Assets/Scripts/StateTrack/StateTrackUtils.cs new file mode 100644 index 0000000..7dd46a9 --- /dev/null +++ b/proj/unity/Assets/Scripts/StateTrack/StateTrackUtils.cs @@ -0,0 +1,105 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using System.Linq; + +namespace StateTrack +{ + public static class StateTrackUtils + { + public static float? CalculateMaxDuration(IEnumerable timedTracks) + { + float maxDuration = float.MinValue; + foreach (ITimedTrack timedTrack in timedTracks) + { + if (timedTrack.Duration == null) + { + return null; + } + + if (timedTrack.Duration.Value > maxDuration) + { + maxDuration = timedTrack.Duration.Value; + } + } + + return maxDuration; + } + + public static float? CalculateTotalDuration(IEnumerable timedTracks) + { + float result = 0.0f; + foreach (ITimedTrack item in timedTracks) + { + if (item.Duration == null) + { + return null; + } + + result += item.Duration.Value; + } + + return result; + } + + public static StateTrackPlayer PlayStateTrack(MultipleTrack trackPrefab, bool pauseAtStart = false) + { + if (trackPrefab == null) + { + Debug.LogWarning($"{nameof(trackPrefab)} is null"); + return null; + } + + GameObject multipleTrackPrefab = trackPrefab.gameObject; + + GameObject newGO = MonoBehaviour.Instantiate(multipleTrackPrefab, Vector3.zero, Quaternion.identity); + MultipleTrack trackScript = newGO.GetComponent(); + StateTrackPlayer playerScript = newGO.AddComponent(); + playerScript.Initialize(trackScript); + + if (!pauseAtStart) + { + playerScript.Play(); + } + + return playerScript; + } + + public static StateTrackPlayer PlayStateTrack(GameObject multipleTrackPrefab, bool pauseAtStart = false) + { + if (multipleTrackPrefab == null) + { + Debug.LogWarning($"{nameof(multipleTrackPrefab)} is null"); + return null; + } + + MultipleTrack prefabTrackScript = multipleTrackPrefab.GetComponent(); + if (prefabTrackScript == null) + { + throw new System.Exception($"{nameof(multipleTrackPrefab)} must have {nameof(MultipleTrack)} script on it!"); + } + + return PlayStateTrack(prefabTrackScript, pauseAtStart); + } + + // Return all types that inherit from Track + public static IEnumerable GetAllTrackTypes() + { + return System.AppDomain.CurrentDomain.GetAssemblies() + .SelectMany(assembly => assembly.GetTypes()) + .Where(type => type.IsClass + && !type.IsAbstract + && typeof(Track).IsAssignableFrom(type)); + } + + public static IEnumerable GetAllTrackNames() + { + return GetAllTrackTypes().Select(x => x.Name); + } + + public static System.Type GetTrackWithName(string typeName) + { + return GetAllTrackTypes().Where(x => x.Name == typeName).FirstOrDefault(); + } + } +} \ No newline at end of file diff --git a/proj/unity/Assets/Scripts/StateTrack/StateTrackUtils.cs.meta b/proj/unity/Assets/Scripts/StateTrack/StateTrackUtils.cs.meta new file mode 100644 index 0000000..20a9221 --- /dev/null +++ b/proj/unity/Assets/Scripts/StateTrack/StateTrackUtils.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8fdd258fd7acc454f8e8f38c698253df +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Scripts/StateTrack/Track.cs b/proj/unity/Assets/Scripts/StateTrack/Track.cs new file mode 100644 index 0000000..96eaafd --- /dev/null +++ b/proj/unity/Assets/Scripts/StateTrack/Track.cs @@ -0,0 +1,107 @@ +using Sirenix.OdinInspector; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace StateTrack +{ + public class Track : MonoBehaviour, ITimedTrack + { + [SerializeField] + private float m_offset; + + public float Offset + { + get + { + return m_offset; + } + + set + { + m_offset = value; + } + } + + [SerializeField] + private bool m_endless; + + public bool Endless + { + get + { + return m_endless; + } + + set + { + m_endless = value; + } + } + + [SerializeField] + [HideIf("m_endless")] + private float m_duration; + + public float? Duration + { + get + { + if (m_endless) + { + return null; + } + return m_duration; + } + + set + { + m_endless = !value.HasValue; + if (value.HasValue) + { + m_duration = value.Value; + } + } + } + + public TrackLayer Layer + { + get + { + return transform.parent.GetComponent(); + } + } + + #region Runtime + + public virtual void OnStart(bool skipped = false) + { + + } + + public virtual void OnUpdate(float relativeTime) + { + + } + + public virtual void OnEnd(bool skipped = false) + { + + } + + #endregion + + #region Editor +#if UNITY_EDITOR + + public string Description; + + public virtual string GetTrackDisplayName() + { + return GetType().Name; + } + +#endif + #endregion + } +} diff --git a/proj/unity/Assets/Scripts/StateTrack/Track.cs.meta b/proj/unity/Assets/Scripts/StateTrack/Track.cs.meta new file mode 100644 index 0000000..a4e247f --- /dev/null +++ b/proj/unity/Assets/Scripts/StateTrack/Track.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5d035b0895edd7f42aa35e3cec45d922 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/proj/unity/Assets/Scripts/StateTrack/TrackLayer.cs b/proj/unity/Assets/Scripts/StateTrack/TrackLayer.cs new file mode 100644 index 0000000..3af5360 --- /dev/null +++ b/proj/unity/Assets/Scripts/StateTrack/TrackLayer.cs @@ -0,0 +1,157 @@ +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; +using Sirenix.OdinInspector; + +namespace StateTrack +{ + public class TrackLayer : MonoBehaviour, ITimedTrack + { + public float Offset { get; set; } + + public float? Duration + { + get + { + return StateTrackUtils.CalculateTotalDuration(Tracks); + } + } + + public IEnumerable Tracks + { + get + { + foreach (Transform tr in transform) + { + var script = tr.GetComponent(); + yield return script; + } + } + } + + public MultipleTrack MultipleTrack + { + get + { + return transform.parent.GetComponent(); + } + } + + public Track GetTrackAtTime(float relativeTime) + { + foreach (Track track in Tracks) + { + if (relativeTime < track.Offset) + { + return null; + } + + if (track.Duration == null) + { + return track; + } + + if (relativeTime < track.Offset + track.Duration) + { + return track; + } + } + + return null; + } + + public IEnumerable GetAllTracksBetween(float relativeStartTime, float relativeEndTime) + { + foreach (Track track in Tracks) + { + float trackEndTime = track.Duration.HasValue + ? track.Offset + track.Duration.Value + : float.PositiveInfinity; + + // Check if the track overlaps with the given time range + if (track.Offset <= relativeEndTime && trackEndTime >= relativeStartTime) + { + yield return track; + } + } + } + + #region Editor +#if UNITY_EDITOR + + public T AddNewTrack() + where T : Track + { + return AddNewTrack(typeof(T)) as T; + } + + public Track AddNewTrack(System.Type trackType) + { + // Create a new empty GameObject + GameObject newTrackObj = new GameObject(trackType.Name); + + // Set parent and reset transform + newTrackObj.transform.SetParent(transform, false); + newTrackObj.transform.localPosition = Vector3.zero; + newTrackObj.transform.localRotation = Quaternion.identity; + newTrackObj.transform.localScale = Vector3.one; + + // Name the new track based on its type and current child count + newTrackObj.name = $"{trackType.Name}_{transform.childCount}"; + + // Add the track component + Track newTrack = newTrackObj.AddComponent(trackType) as Track; + + return newTrack; + } + + [SerializeField] + [ValueDropdown("@StateTrackUtils.GetAllTrackNames()")] + private string m_newTrackName; + + [Button] + public void AddNewTrack() + { + if (XHelper.StringUtils.IsEmpty(m_newTrackName)) + { + return; + } + + AddNewTrack(StateTrackUtils.GetTrackWithName(m_newTrackName)); + } + + [Button] + public bool RemoveTrack(Track track) + { + if (track == null) + { + return false; + } + + // Check if the track is actually a child of this layer + if (track.transform.parent != transform) + { + Debug.LogError("Attempted to remove a track that is not a child of this layer!"); + return false; + } + + // Destroy the track's GameObject + DestroyImmediate(track.gameObject); + return true; + } + + [Button] + public void RemoveAllTracks() + { + foreach (var item in Tracks.ToList()) + { + // Destroy the track's GameObject + DestroyImmediate(item.gameObject); + } + } +#endif + #endregion + } + +} diff --git a/proj/unity/Assets/Scripts/StateTrack/TrackLayer.cs.meta b/proj/unity/Assets/Scripts/StateTrack/TrackLayer.cs.meta new file mode 100644 index 0000000..4a960cc --- /dev/null +++ b/proj/unity/Assets/Scripts/StateTrack/TrackLayer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 225ed52dd6a90c94c8cef1c4cfc561be +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: