diff --git a/FactoryNumeric/Assets/AssetArt/Atlas/Atlas_Battle.spriteatlasv2 b/FactoryNumeric/Assets/AssetArt/Atlas/Atlas_Battle.spriteatlasv2 index 0471a446..b5b3939b 100644 --- a/FactoryNumeric/Assets/AssetArt/Atlas/Atlas_Battle.spriteatlasv2 +++ b/FactoryNumeric/Assets/AssetArt/Atlas/Atlas_Battle.spriteatlasv2 @@ -11,10 +11,12 @@ SpriteAtlasAsset: m_MasterAtlas: {fileID: 0} m_ImporterData: packables: - - {fileID: 21300000, guid: c95935206d18f42399e9881ce6bdf61c, type: 3} - - {fileID: 21300000, guid: 1f44cb90b6ae648c783dac573bfe9cd0, type: 3} - - {fileID: 21300000, guid: bfad0e64f8ef1491c8def7e679187b89, type: 3} - - {fileID: 21300000, guid: a43cb397a444ce44f9becc183ced96ed, type: 3} - {fileID: 21300000, guid: f43899c31dd434901b0422f98bcde88b, type: 3} - {fileID: 21300000, guid: 01ccaea9b49214edda39f03f648b5b8b, type: 3} + - {fileID: 21300000, guid: 1f44cb90b6ae648c783dac573bfe9cd0, type: 3} + - {fileID: 21300000, guid: bfad0e64f8ef1491c8def7e679187b89, type: 3} + - {fileID: 21300000, guid: af67f6c46933441daaa64d6880890586, type: 3} + - {fileID: 21300000, guid: c95935206d18f42399e9881ce6bdf61c, type: 3} + - {fileID: 21300000, guid: a43cb397a444ce44f9becc183ced96ed, type: 3} m_IsVariant: 0 + m_ScriptablePacker: {fileID: 0} diff --git a/FactoryNumeric/Assets/AssetArt/Atlas/Atlas_Battle.spriteatlasv2.meta b/FactoryNumeric/Assets/AssetArt/Atlas/Atlas_Battle.spriteatlasv2.meta index b381ba67..066162e1 100644 --- a/FactoryNumeric/Assets/AssetArt/Atlas/Atlas_Battle.spriteatlasv2.meta +++ b/FactoryNumeric/Assets/AssetArt/Atlas/Atlas_Battle.spriteatlasv2.meta @@ -14,7 +14,7 @@ SpriteAtlasImporter: crunchedCompression: 0 sRGB: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Android maxTextureSize: 2048 resizeAlgorithm: 0 @@ -27,8 +27,8 @@ SpriteAtlasImporter: ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 - buildTarget: iPhone + - serializedVersion: 4 + buildTarget: iOS maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: 49 @@ -40,7 +40,7 @@ SpriteAtlasImporter: ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: WebGL maxTextureSize: 2048 resizeAlgorithm: 0 @@ -53,6 +53,19 @@ SpriteAtlasImporter: ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: 49 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 1 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 packingSettings: serializedVersion: 2 padding: 4 diff --git a/FactoryNumeric/Assets/Plugins.meta b/FactoryNumeric/Assets/Plugins.meta new file mode 100644 index 00000000..6d884048 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 65c18d699fcadad459bc3e16558c2bd2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/HighlightPlusBundle.meta b/FactoryNumeric/Assets/Plugins/HighlightPlusBundle.meta new file mode 100644 index 00000000..79b6e6da --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/HighlightPlusBundle.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 68ae7b96c4d474fbb89db44167089a60 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/HighlightPlusBundle/Builtin.meta b/FactoryNumeric/Assets/Plugins/HighlightPlusBundle/Builtin.meta new file mode 100644 index 00000000..772d961d --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/HighlightPlusBundle/Builtin.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d04d6c36e2bc14d5c831b9afeb270cf9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/HighlightPlusBundle/Builtin/HighlightPlus_Builtin_Pipeline.unitypackage.meta b/FactoryNumeric/Assets/Plugins/HighlightPlusBundle/Builtin/HighlightPlus_Builtin_Pipeline.unitypackage.meta new file mode 100644 index 00000000..645dfac7 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/HighlightPlusBundle/Builtin/HighlightPlus_Builtin_Pipeline.unitypackage.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4c87a0e1993f7439285693c04d6dab68 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/HighlightPlusBundle/URP.meta b/FactoryNumeric/Assets/Plugins/HighlightPlusBundle/URP.meta new file mode 100644 index 00000000..080f8fe8 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/HighlightPlusBundle/URP.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 33be22ed704cc4513850fb40f2298226 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/HighlightPlusBundle/URP/HighlightPlus_URP_Pipeline.unitypackage.meta b/FactoryNumeric/Assets/Plugins/HighlightPlusBundle/URP/HighlightPlus_URP_Pipeline.unitypackage.meta new file mode 100644 index 00000000..20bc5863 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/HighlightPlusBundle/URP/HighlightPlus_URP_Pipeline.unitypackage.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 52f45c84fa7e04a17922d3833762b05c +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/HighlightPlusBundle/_README.txt b/FactoryNumeric/Assets/Plugins/HighlightPlusBundle/_README.txt new file mode 100644 index 00000000..ae973791 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/HighlightPlusBundle/_README.txt @@ -0,0 +1,24 @@ + +This asset contains 2 main packages. Please use the appropriate package according to the rendering pipeline of your project: + +** Built-in pipeline ** +- Import the package from the folder /Builtin. +- Requires Unity 2021.3 or later. + +** Universal Rendering Pipeline ** +- Import the package from the folder /URP +- Requires Unity 2021.3 or later. Setup video: https://youtu.be/wXNS3gaBxHE?si=QkPaidmBHrmSeeua + + +Once imported, read the PDF documentation for additional details. +Thanks for using Highlight Plus. + + +Questions / Suggestions / Support +--------------------------------- + +* Support-Web: https://kronnect.com/support +* Support-Discord: https://discord.gg/EH2GMaM +* Email: contact@kronnect.com +* Twitter: @Kronnect + diff --git a/FactoryNumeric/Assets/Plugins/HighlightPlusBundle/_README.txt.meta b/FactoryNumeric/Assets/Plugins/HighlightPlusBundle/_README.txt.meta new file mode 100644 index 00000000..2c50cd1c --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/HighlightPlusBundle/_README.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2b60423aba8cd4a19bf6f546a883a794 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween.meta b/FactoryNumeric/Assets/Plugins/PrimeTween.meta new file mode 100644 index 00000000..14213309 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: da2e19a1c5f8b4e2ca7c1785ea338b2e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo.meta new file mode 100644 index 00000000..0eb98277 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e6cc44d08e8de4cf7878638624e59a94 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Demo.unity b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Demo.unity new file mode 100644 index 00000000..33ac3ecd --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Demo.unity @@ -0,0 +1,5496 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 1 + m_FogColor: {r: 0.90588236, g: 0.72156864, b: 0.627451, a: 1} + m_FogMode: 1 + m_FogDensity: 1 + m_LinearFogStart: 15 + m_LinearFogEnd: 25 + m_AmbientSkyColor: {r: 1, g: 1, b: 1, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 3 + m_SubtractiveShadowColor: {r: 1, g: 1, b: 1, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 10 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVRFilteringMode: 2 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ShowResolutionOverlay: 1 + m_LightingDataAsset: {fileID: 112000000, guid: 64acb5532649148ad8702bd2c1c99441, + type: 2} + m_UseShadowmask: 1 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &69086296 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 69086297} + - component: {fileID: 69086298} + m_Layer: 0 + m_Name: CameraController + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &69086297 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 69086296} + m_LocalRotation: {x: -0, y: 0.88705486, z: -0, w: 0.46166408} + m_LocalPosition: {x: 0, y: 0.72, z: -0.29} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 142301654} + m_Father: {fileID: 0} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: -1314.989, z: 0} +--- !u!114 &69086298 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 69086296} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3f2f29997e7148b98e1d84f3de1011bc, type: 3} + m_Name: + m_EditorClassIdentifier: + highlightedElementController: {fileID: 843756321} + swipeTutorial: {fileID: 1619205711} + mainCamera: {fileID: 142301653} + cameraShakeStrength: 0.4 +--- !u!1 &142301651 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 142301654} + - component: {fileID: 142301653} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!20 &142301653 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 142301651} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0.90588236, g: 0.72156864, b: 0.627451, a: 1} + m_projectionMatrixMode: 1 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_GateFitMode: 2 + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 50 + field of view: 60 + orthographic: 0 + orthographic size: 3.09 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &142301654 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 142301651} + m_LocalRotation: {x: 0.20917961, y: -0, z: 0.000000007450579, w: 0.9778772} + m_LocalPosition: {x: 0, y: 2.863728, z: -6.3874187} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 69086297} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &182366647 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 182366649} + - component: {fileID: 182366648} + m_Layer: 0 + m_Name: Demo + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &182366648 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 182366647} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 945298e218f9841b08c8270c494cb200, type: 3} + m_Name: + m_EditorClassIdentifier: + animateAllType: 0 + sequenceTimelineSlider: {fileID: 1161269159} + pausedLabel: {fileID: 300583104} + animateAllPartsButton: {fileID: 508772385} + typewriterAnimatorExample: {fileID: 1920139813} + animatables: + - {fileID: 655457573} + - {fileID: 1686344449} + - {fileID: 1526516044} + - {fileID: 1686344451} + - {fileID: 1884916166} + - {fileID: 1946040352} + - {fileID: 460664918} + - {fileID: 810504353} + wheels: {fileID: 810504353} + timeScale: 1 +--- !u!4 &182366649 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 182366647} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &192232450 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 192232451} + - component: {fileID: 192232453} + - component: {fileID: 192232452} + m_Layer: 5 + m_Name: Buttons + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &192232451 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 192232450} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 730005265} + - {fileID: 414605617} + - {fileID: 269285985} + - {fileID: 1900965550} + - {fileID: 508772384} + m_Father: {fileID: 2027684627} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 5, y: 5} + m_SizeDelta: {x: 191.21143, y: 231.61594} + m_Pivot: {x: 0, y: 0} +--- !u!114 &192232452 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 192232450} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1297475563, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 0 + m_Bottom: 0 + m_ChildAlignment: 6 + m_Spacing: 5 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 0 + m_ChildControlWidth: 0 + m_ChildControlHeight: 0 +--- !u!222 &192232453 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 192232450} + m_CullTransparentMesh: 0 +--- !u!1 &206828973 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 206828976} + - component: {fileID: 206828975} + - component: {fileID: 206828974} + m_Layer: 0 + m_Name: InputController + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &206828974 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 206828973} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ea1502cb33ab4d4ca1fedbdde163c980, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &206828975 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 206828973} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -619905303, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_FirstSelected: {fileID: 0} + m_sendNavigationEvents: 1 + m_DragThreshold: 10 +--- !u!4 &206828976 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 206828973} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -400, y: -356.47668, z: 0} + m_LocalScale: {x: 0.69084626, y: 0.69084626, z: 0.69084626} + m_Children: [] + m_Father: {fileID: 2027684627} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &269285984 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 269285985} + - component: {fileID: 269285988} + - component: {fileID: 269285987} + - component: {fileID: 269285986} + - component: {fileID: 269285989} + m_Layer: 5 + m_Name: Button-Camera Projection + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &269285985 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 269285984} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1287318625} + m_Father: {fileID: 192232451} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 150, y: 28} + m_Pivot: {x: 0, y: 0} +--- !u!114 &269285986 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 269285984} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 0.3962264, g: 0.3962264, b: 0.3962264, a: 0.34117648} + m_HighlightedColor: {r: 0.3962264, g: 0.3962264, b: 0.3962264, a: 0.34117648} + m_PressedColor: {r: 0.6901961, g: 0.6901961, b: 0.6901961, a: 0.32156864} + m_DisabledColor: {r: 0.9529412, g: 0, b: 1, a: 1} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 269285987} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 269285989} + m_MethodName: AnimateCameraProjection + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!114 &269285987 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 269285984} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 +--- !u!222 &269285988 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 269285984} + m_CullTransparentMesh: 0 +--- !u!114 &269285989 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 269285984} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 900e84e1426b4fc8a386a58aaee3b4ba, type: 3} + m_Name: + m_EditorClassIdentifier: + mainCamera: {fileID: 142301653} +--- !u!1 &300583102 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 300583103} + - component: {fileID: 300583105} + - component: {fileID: 300583104} + m_Layer: 5 + m_Name: pausedLabel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &300583103 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 300583102} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1161269158} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0.000015258789, y: 24.61} + m_SizeDelta: {x: 160, y: 30} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &300583104 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 300583102} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 1 + m_BestFit: 0 + m_MinSize: 1 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Paused +--- !u!222 &300583105 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 300583102} + m_CullTransparentMesh: 0 +--- !u!1 &315743953 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 315743954} + m_Layer: 0 + m_Name: left + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &315743954 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 315743953} + m_LocalRotation: {x: -0.000000021855694, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0.755, y: -0.079034865, z: 0.03866959} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 911097553} + - {fileID: 1933132477} + m_Father: {fileID: 655457572} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &384398580 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 384398582} + - component: {fileID: 384398581} + - component: {fileID: 384398583} + m_Layer: 0 + m_Name: DirectionalLightController + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &384398581 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 384398580} + m_Enabled: 1 + serializedVersion: 8 + m_Type: 1 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 1.4 + m_Range: 10 + m_SpotAngle: 30 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 0.556 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &384398582 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 384398580} + m_LocalRotation: {x: 0.35355338, y: 0.35355338, z: -0.1464466, w: 0.8535535} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 45, y: 45, z: 0} +--- !u!114 &384398583 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 384398580} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: db622a6d0e0fa4b68852ef1a7fc60dba, type: 3} + m_Name: + m_EditorClassIdentifier: + directionalLight: {fileID: 384398581} + mainCamera: {fileID: 142301653} + startColor: {r: 1, g: 0.9490196, b: 0.8509804, a: 1} + endColor: {r: 0.69803923, g: 0.87058824, b: 1, a: 1} +--- !u!1 &414605616 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 414605617} + - component: {fileID: 414605621} + - component: {fileID: 414605620} + - component: {fileID: 414605619} + - component: {fileID: 414605618} + m_Layer: 5 + m_Name: Button-Squeeze + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &414605617 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 414605616} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1113543885} + m_Father: {fileID: 192232451} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 150, y: 28} + m_Pivot: {x: 0, y: 0} +--- !u!114 &414605618 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 414605616} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 613ad9fe5121a4b02b556b6b16cad710, type: 3} + m_Name: + m_EditorClassIdentifier: + target: {fileID: 543450652013950231} +--- !u!114 &414605619 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 414605616} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 0.3962264, g: 0.3962264, b: 0.3962264, a: 0.34117648} + m_HighlightedColor: {r: 0.3962264, g: 0.3962264, b: 0.3962264, a: 0.34117648} + m_PressedColor: {r: 0.6901961, g: 0.6901961, b: 0.6901961, a: 0.32156864} + m_DisabledColor: {r: 0.9529412, g: 0, b: 1, a: 1} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 414605620} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 414605618} + m_MethodName: PlayAnimation + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!114 &414605620 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 414605616} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 +--- !u!222 &414605621 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 414605616} + m_CullTransparentMesh: 0 +--- !u!1 &460664916 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 460664917} + - component: {fileID: 460664918} + m_Layer: 0 + m_Name: Road + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &460664917 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 460664916} + m_LocalRotation: {x: -0, y: 1, z: -0, w: 0} + m_LocalPosition: {x: -1.09, y: 0, z: -0.36} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1077484924} + m_Father: {fileID: 0} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &460664918 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 460664916} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a4e192d6601c4753961099a3db72b66f, type: 3} + m_Name: + m_EditorClassIdentifier: + roadModel: {fileID: 1077484921} + ease: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.25 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.65 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.8 + value: 0.25 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 +--- !u!1 &480829268 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 480829269} + - component: {fileID: 480829272} + - component: {fileID: 480829271} + - component: {fileID: 480829270} + m_Layer: 0 + m_Name: exterior.002 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &480829269 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 480829268} + m_LocalRotation: {x: 0.000000059604645, y: 0, z: -0, w: 1} + m_LocalPosition: {x: -0, y: -0.000000014899477, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 655457572} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!64 &480829270 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 480829268} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Convex: 0 + m_CookingOptions: 14 + m_Mesh: {fileID: 4300032, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!23 &480829271 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 480829268} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: e3fb3841a697f42f18609c8864d87886, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &480829272 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 480829268} + m_Mesh: {fileID: 4300032, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!1 &508772383 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 508772384} + - component: {fileID: 508772387} + - component: {fileID: 508772386} + - component: {fileID: 508772385} + m_Layer: 5 + m_Name: Button-Animate All Parts + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &508772384 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 508772383} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1902477809} + m_Father: {fileID: 192232451} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 150, y: 28} + m_Pivot: {x: 0, y: 0} +--- !u!114 &508772385 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 508772383} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 0.3962264, g: 0.3962264, b: 0.3962264, a: 0.34117648} + m_HighlightedColor: {r: 0.3962264, g: 0.3962264, b: 0.3962264, a: 0.34117648} + m_PressedColor: {r: 0.6901961, g: 0.6901961, b: 0.6901961, a: 0.32156864} + m_DisabledColor: {r: 0.9529412, g: 0, b: 1, a: 1} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 508772386} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 810504353} + m_MethodName: OnClick + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!114 &508772386 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 508772383} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 +--- !u!222 &508772387 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 508772383} + m_CullTransparentMesh: 0 +--- !u!1 &655457571 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 655457572} + - component: {fileID: 655457574} + - component: {fileID: 655457573} + m_Layer: 0 + m_Name: Headlights + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &655457572 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 655457571} + m_LocalRotation: {x: 0.000000021855694, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.65403485, z: 2.3863304} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 480829269} + - {fileID: 315743954} + - {fileID: 759060660} + m_Father: {fileID: 543450652013950231} + m_RootOrder: 9 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &655457573 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 655457571} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7bc81275df8d244a1a7568f9443b5e93, type: 3} + m_Name: + m_EditorClassIdentifier: + ease: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 7.722292 + outSlope: 7.722292 + tangentMode: 34 + weightedMode: 0 + inWeight: 0 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.12949523 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.21629333 + value: 0.01210352 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.31928205 + value: 0.9868132 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33685845 + - serializedVersion: 3 + time: 0.48927683 + value: 0.012353897 + inSlope: -0.029328367 + outSlope: -0.029328367 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.7624979 + value: 0.009361729 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 4.1710715 + outSlope: 4.1710715 + tangentMode: 34 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + lights: + - {fileID: 911097554} + - {fileID: 1933132478} + - {fileID: 671979176} + - {fileID: 1453060464} +--- !u!114 &655457574 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 655457571} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5fbd7d6a5982d440282a82998473a306, type: 3} + m_Name: + m_EditorClassIdentifier: + highlightAnchor: {fileID: 480829269} +--- !u!1 &671979174 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 671979175} + - component: {fileID: 671979176} + m_Layer: 0 + m_Name: Spot Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &671979175 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 671979174} + m_LocalRotation: {x: 0.24988215, y: -0, z: -0, w: 0.96827626} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 759060660} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 28.941002, y: 0, z: 0} +--- !u!108 &671979176 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 671979174} + m_Enabled: 1 + serializedVersion: 8 + m_Type: 0 + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Intensity: 0 + m_Range: 10 + m_SpotAngle: 83 + m_CookieSize: 10 + m_Shadows: + m_Type: 0 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!1 &730005264 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 730005265} + - component: {fileID: 730005269} + - component: {fileID: 730005268} + - component: {fileID: 730005267} + - component: {fileID: 730005266} + m_Layer: 5 + m_Name: Button-Jump + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &730005265 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 730005264} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1088776685} + m_Father: {fileID: 192232451} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 150, y: 28} + m_Pivot: {x: 0, y: 0} +--- !u!114 &730005266 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 730005264} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 453932c77a72487599d5103bcde610da, type: 3} + m_Name: + m_EditorClassIdentifier: + target: {fileID: 543450652013950231} +--- !u!114 &730005267 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 730005264} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 0.3962264, g: 0.3962264, b: 0.3962264, a: 0.34117648} + m_HighlightedColor: {r: 0.3962264, g: 0.3962264, b: 0.3962264, a: 0.34117648} + m_PressedColor: {r: 0.6901961, g: 0.6901961, b: 0.6901961, a: 0.32156864} + m_DisabledColor: {r: 0.9529412, g: 0, b: 1, a: 1} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 730005268} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 730005266} + m_MethodName: PlayAnimation + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!114 &730005268 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 730005264} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 +--- !u!222 &730005269 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 730005264} + m_CullTransparentMesh: 0 +--- !u!1 &759060659 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 759060660} + m_Layer: 0 + m_Name: right + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &759060660 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 759060659} + m_LocalRotation: {x: -0.000000021855694, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.753, y: -0.079034865, z: 0.03866959} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 671979175} + - {fileID: 1453060463} + m_Father: {fileID: 655457572} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &795061382 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 795061383} + - component: {fileID: 795061385} + - component: {fileID: 795061384} + m_Layer: 5 + m_Name: gcAllocText + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &795061383 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 795061382} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1755549104} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &795061384 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 795061382} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 1 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: 'Heap allocations: 0B' +--- !u!222 &795061385 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 795061382} + m_CullTransparentMesh: 0 +--- !u!114 &810504352 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1024366685134399085} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5fbd7d6a5982d440282a82998473a306, type: 3} + m_Name: + m_EditorClassIdentifier: + highlightAnchor: {fileID: 2590561584456245742} +--- !u!114 &810504353 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1024366685134399085} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6113f6e98f16c489f87f373fc4133597, type: 3} + m_Name: + m_EditorClassIdentifier: + wheels: + - {fileID: 4185769961175156060} + - {fileID: 7375368130044152401} + - {fileID: 3640928673919294776} + - {fileID: 8214177323173603408} +--- !u!1 &822037459 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 822037460} + - component: {fileID: 822037462} + - component: {fileID: 822037461} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &822037460 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 822037459} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1900965550} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &822037461 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 822037459} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 1 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Camera Shake +--- !u!222 &822037462 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 822037459} + m_CullTransparentMesh: 0 +--- !u!1 &843756320 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 843756322} + - component: {fileID: 843756321} + m_Layer: 0 + m_Name: HighlightedElementController + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &843756321 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 843756320} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9e831710f8fb47e4a09c640d573d1358, type: 3} + m_Name: + m_EditorClassIdentifier: + mainCamera: {fileID: 142301653} + cameraProjectionMatrixAnimation: {fileID: 269285989} +--- !u!4 &843756322 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 843756320} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &911097552 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 911097553} + - component: {fileID: 911097554} + m_Layer: 0 + m_Name: Spot Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &911097553 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 911097552} + m_LocalRotation: {x: 0.24988215, y: -0, z: -0, w: 0.96827626} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 315743954} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 28.941002, y: 0, z: 0} +--- !u!108 &911097554 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 911097552} + m_Enabled: 1 + serializedVersion: 8 + m_Type: 0 + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Intensity: 0 + m_Range: 10 + m_SpotAngle: 83 + m_CookieSize: 10 + m_Shadows: + m_Type: 0 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!1 &1077484920 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1077484924} + - component: {fileID: 1077484923} + - component: {fileID: 1077484921} + m_Layer: 0 + m_Name: model + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!23 &1077484921 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1077484920} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 26e88e1e3f85449949238833334c3914, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1077484923 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1077484920} + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1077484924 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1077484920} + m_LocalRotation: {x: -0, y: 0.38268304, z: -0, w: 0.92387974} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 100, y: 1, z: 100} + m_Children: [] + m_Father: {fileID: 460664917} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 45, z: 0} +--- !u!1 &1080535449 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1080535450} + - component: {fileID: 1080535452} + - component: {fileID: 1080535451} + m_Layer: 5 + m_Name: Background + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1080535450 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1080535449} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1161269158} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.25} + m_AnchorMax: {x: 1, y: 0.75} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1080535451 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1080535449} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 +--- !u!222 &1080535452 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1080535449} + m_CullTransparentMesh: 0 +--- !u!1 &1088776684 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1088776685} + - component: {fileID: 1088776687} + - component: {fileID: 1088776686} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1088776685 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1088776684} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 730005265} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1088776686 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1088776684} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 1 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Jump +--- !u!222 &1088776687 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1088776684} + m_CullTransparentMesh: 0 +--- !u!1 &1113543884 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1113543885} + - component: {fileID: 1113543887} + - component: {fileID: 1113543886} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1113543885 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1113543884} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 414605617} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1113543886 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1113543884} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 1 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Squeeze +--- !u!222 &1113543887 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1113543884} + m_CullTransparentMesh: 0 +--- !u!1 &1161269157 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1161269158} + - component: {fileID: 1161269159} + m_Layer: 5 + m_Name: sequenceTimelineSlider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1161269158 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1161269157} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1080535450} + - {fileID: 1859953128} + - {fileID: 2061135563} + - {fileID: 300583103} + m_Father: {fileID: 2027684627} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 0} + m_AnchoredPosition: {x: 77.76001, y: 8.460022} + m_SizeDelta: {x: -162.42, y: 20} + m_Pivot: {x: 0.5, y: 0} +--- !u!114 &1161269159 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1161269157} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -113659843, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 1703196966} + m_FillRect: {fileID: 2107903321} + m_HandleRect: {fileID: 1703196965} + m_Direction: 0 + m_MinValue: 0 + m_MaxValue: 1 + m_WholeNumbers: 0 + m_Value: 0 + m_OnValueChanged: + m_PersistentCalls: + m_Calls: [] +--- !u!1 &1287318624 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1287318625} + - component: {fileID: 1287318627} + - component: {fileID: 1287318626} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1287318625 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1287318624} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 269285985} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1287318626 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1287318624} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 1 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Camera Projection +--- !u!222 &1287318627 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1287318624} + m_CullTransparentMesh: 0 +--- !u!1 &1453060462 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1453060463} + - component: {fileID: 1453060464} + m_Layer: 0 + m_Name: Point Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1453060463 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1453060462} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0.179} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 759060660} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!108 &1453060464 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1453060462} + m_Enabled: 1 + serializedVersion: 8 + m_Type: 2 + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Intensity: 0 + m_Range: 10 + m_SpotAngle: 30 + m_CookieSize: 10 + m_Shadows: + m_Type: 0 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!114 &1526516044 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5520051320514970037} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4efa7d4d94464bb0b3e6ea597eb13637, type: 3} + m_Name: + m_EditorClassIdentifier: + cameraController: {fileID: 69086298} + animationAnchor: {fileID: 1441162320435695677} +--- !u!114 &1526516045 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5520051320514970037} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5fbd7d6a5982d440282a82998473a306, type: 3} + m_Name: + m_EditorClassIdentifier: + highlightAnchor: {fileID: 7842203396053052413} +--- !u!1 &1549457030 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1549457031} + - component: {fileID: 1549457033} + - component: {fileID: 1549457032} + m_Layer: 5 + m_Name: tweensCountText + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1549457031 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1549457030} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1755549104} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1549457032 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1549457030} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 1 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: 'Animations played: 999' +--- !u!222 &1549457033 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1549457030} + m_CullTransparentMesh: 0 +--- !u!1 &1619205709 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1619205710} + - component: {fileID: 1619205713} + - component: {fileID: 1619205712} + - component: {fileID: 1619205711} + m_Layer: 5 + m_Name: SwipeTutorial + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1619205710 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1619205709} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 2027684627} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0} + m_AnchorMax: {x: 0.5, y: 0} + m_AnchoredPosition: {x: 0, y: 57.25} + m_SizeDelta: {x: 362.76373, y: 30} + m_Pivot: {x: 0.5, y: 0} +--- !u!114 &1619205711 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1619205709} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d20b7aac1e6a4f1dbdbe52c7ca1ad4b4, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &1619205712 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1619205709} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 1 + m_BestFit: 0 + m_MinSize: 0 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: Swipe to rotate the camera +--- !u!222 &1619205713 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1619205709} + m_CullTransparentMesh: 0 +--- !u!114 &1686344447 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7530153028561895661} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5fbd7d6a5982d440282a82998473a306, type: 3} + m_Name: + m_EditorClassIdentifier: + highlightAnchor: {fileID: 172780826922127087} +--- !u!114 &1686344449 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7530153028561895661} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4efa7d4d94464bb0b3e6ea597eb13637, type: 3} + m_Name: + m_EditorClassIdentifier: + cameraController: {fileID: 69086298} + animationAnchor: {fileID: 7119166486829381719} +--- !u!114 &1686344451 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9058890211913245811} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4efa7d4d94464bb0b3e6ea597eb13637, type: 3} + m_Name: + m_EditorClassIdentifier: + cameraController: {fileID: 69086298} + animationAnchor: {fileID: 3271767513617999204} +--- !u!114 &1686344452 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9058890211913245811} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5fbd7d6a5982d440282a82998473a306, type: 3} + m_Name: + m_EditorClassIdentifier: + highlightAnchor: {fileID: 4914293776580820246} +--- !u!1 &1703196964 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1703196965} + - component: {fileID: 1703196967} + - component: {fileID: 1703196966} + m_Layer: 5 + m_Name: Handle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1703196965 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1703196964} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 2061135563} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 20, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1703196966 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1703196964} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 +--- !u!222 &1703196967 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1703196964} + m_CullTransparentMesh: 0 +--- !u!1 &1755549103 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1755549104} + - component: {fileID: 1755549109} + - component: {fileID: 1755549108} + - component: {fileID: 1755549105} + - component: {fileID: 1755549107} + - component: {fileID: 1755549106} + m_Layer: 5 + m_Name: DebugInfo + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1755549104 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1755549103} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1549457031} + - {fileID: 795061383} + m_Father: {fileID: 2027684627} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 5, y: -5} + m_SizeDelta: {x: 179.4021, y: 50} + m_Pivot: {x: 0, y: 1} +--- !u!114 &1755549105 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1755549103} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1297475563, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 5 + m_Right: 5 + m_Top: 5 + m_Bottom: 5 + m_ChildAlignment: 0 + m_Spacing: 5 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 1 + m_ChildControlWidth: 1 + m_ChildControlHeight: 1 +--- !u!114 &1755549106 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1755549103} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6af581ca2a164600b2d47b0f7f7d5570, type: 3} + m_Name: + m_EditorClassIdentifier: + logAllocations: 1 + logFiltered: 0 + logIgnored: 0 + filterAllocations: [] + ignoreAllocations: + - RaycastHit.get_collider() + - Component.get_transform() + - Component.get_gameObject() + - MeasureMemoryAllocations + - DebugInfo +--- !u!114 &1755549107 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1755549103} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c0ef97c778caf4b70aea23911ded98ab, type: 3} + m_Name: + m_EditorClassIdentifier: + measureMemoryAllocations: {fileID: 1755549106} + tweensCountText: {fileID: 1549457032} + gcAllocText: {fileID: 795061384} +--- !u!114 &1755549108 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1755549103} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.6981132, g: 0.6981132, b: 0.6981132, a: 0.28627452} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 +--- !u!222 &1755549109 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1755549103} + m_CullTransparentMesh: 0 +--- !u!1 &1859953127 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1859953128} + m_Layer: 5 + m_Name: Fill Area + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1859953128 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1859953127} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 2107903321} + m_Father: {fileID: 1161269158} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.25} + m_AnchorMax: {x: 1, y: 0.75} + m_AnchoredPosition: {x: -5, y: 0} + m_SizeDelta: {x: -20, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1884916165 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4680849219148963205} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5fbd7d6a5982d440282a82998473a306, type: 3} + m_Name: + m_EditorClassIdentifier: + highlightAnchor: {fileID: 2707615149424617030} +--- !u!114 &1884916166 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4680849219148963205} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c42977785d1b549d59c346556945e0c5, type: 3} + m_Name: + m_EditorClassIdentifier: + animationAnchor: {fileID: 9120391027429686458} + openedPos: {x: 0, y: 0, z: 0} + midPos: {x: 1.13, y: 0, z: 0} + closedPos: {x: 1.13, y: 0, z: -0.24} +--- !u!1 &1900965549 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1900965550} + - component: {fileID: 1900965554} + - component: {fileID: 1900965553} + - component: {fileID: 1900965552} + m_Layer: 5 + m_Name: Button-Camera Shake + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1900965550 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1900965549} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 822037460} + m_Father: {fileID: 192232451} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 150, y: 28} + m_Pivot: {x: 0, y: 0} +--- !u!114 &1900965552 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1900965549} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 0.3962264, g: 0.3962264, b: 0.3962264, a: 0.34117648} + m_HighlightedColor: {r: 0.3962264, g: 0.3962264, b: 0.3962264, a: 0.34117648} + m_PressedColor: {r: 0.6901961, g: 0.6901961, b: 0.6901961, a: 0.32156864} + m_DisabledColor: {r: 0.9529412, g: 0, b: 1, a: 1} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 1900965553} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 69086298} + m_MethodName: ShakeCamera + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!114 &1900965553 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1900965549} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 +--- !u!222 &1900965554 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1900965549} + m_CullTransparentMesh: 0 +--- !u!1 &1902477808 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1902477809} + - component: {fileID: 1902477811} + - component: {fileID: 1902477810} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1902477809 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1902477808} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 508772384} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1902477810 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1902477808} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 1 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Animate All Parts +--- !u!222 &1902477811 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1902477808} + m_CullTransparentMesh: 0 +--- !u!1 &1920139811 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1920139812} + - component: {fileID: 1920139814} + - component: {fileID: 1920139813} + m_Layer: 5 + m_Name: TypewriterAnimationExample + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1920139812 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1920139811} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 2027684627} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -5, y: -5} + m_SizeDelta: {x: 180, y: 30} + m_Pivot: {x: 1, y: 1} +--- !u!114 &1920139813 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1920139811} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f62b6e70f1114e5d867a36459e0352bf, type: 3} + m_Name: + m_EditorClassIdentifier: + animationType: 1 + charsPerSecond: 40 + pauseAfterPunctuation: 20 +--- !u!222 &1920139814 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1920139811} + m_CullTransparentMesh: 0 +--- !u!1 &1933132476 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1933132477} + - component: {fileID: 1933132478} + m_Layer: 0 + m_Name: Point Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1933132477 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1933132476} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0.179} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 315743954} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!108 &1933132478 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1933132476} + m_Enabled: 1 + serializedVersion: 8 + m_Type: 2 + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Intensity: 0 + m_Range: 10 + m_SpotAngle: 30 + m_CookieSize: 10 + m_Shadows: + m_Type: 0 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!114 &1946040352 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6291292912582762050} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 27b542649ab4a463aa343c437387783e, type: 3} + m_Name: + m_EditorClassIdentifier: + animationAnchor: {fileID: 1139714121598866790} +--- !u!114 &1946040353 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6291292912582762050} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5fbd7d6a5982d440282a82998473a306, type: 3} + m_Name: + m_EditorClassIdentifier: + highlightAnchor: {fileID: 8272619152164736657} +--- !u!1 &2027684623 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2027684627} + - component: {fileID: 2027684626} + - component: {fileID: 2027684625} + - component: {fileID: 2027684624} + m_Layer: 5 + m_Name: Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &2027684624 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2027684623} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1301386320, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &2027684625 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2027684623} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!223 &2027684626 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2027684623} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!224 &2027684627 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2027684623} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 192232451} + - {fileID: 1619205710} + - {fileID: 1755549104} + - {fileID: 206828976} + - {fileID: 1161269158} + - {fileID: 1920139812} + m_Father: {fileID: 0} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!1 &2061135562 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2061135563} + m_Layer: 5 + m_Name: Handle Slide Area + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2061135563 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2061135562} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1703196965} + m_Father: {fileID: 1161269158} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: -20, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &2107903320 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2107903321} + - component: {fileID: 2107903323} + - component: {fileID: 2107903322} + m_Layer: 5 + m_Name: Fill + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2107903321 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2107903320} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1859953128} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 10, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &2107903322 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2107903320} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 +--- !u!222 &2107903323 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2107903320} + m_CullTransparentMesh: 0 +--- !u!4 &95317135125387569 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6291292912582762050} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0.22998282, y: 2.7259037, z: -1.4789121} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 8272619152164736657} + m_Father: {fileID: 543450652013950231} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &172780826922127087 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5769078734430259581} + m_LocalRotation: {x: 0, y: -2.3140616e-30, z: -0, w: 1} + m_LocalPosition: {x: -0, y: -0.0000000120113945, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 7119166486829381719} + m_Father: {fileID: 5596421173225246262} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &382836270145210570 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3802291232760194840} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 004ae8b11200d44ac83be82a3ee1ebb8, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!64 &482691359192624379 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1454953783326346074} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Convex: 1 + m_CookingOptions: 30 + m_Mesh: {fileID: 4300010, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!4 &495537392595300989 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2694482714574987048} + m_LocalRotation: {x: 0.00000008146034, y: 0, z: -0, w: 1} + m_LocalPosition: {x: -0, y: 0.30891964, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 543450652013950231} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &543450652013950231 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132147486207917} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 95317135125387569} + - {fileID: 5596421173225246262} + - {fileID: 3186703855294423644} + - {fileID: 8949606274296942739} + - {fileID: 1324398456776219820} + - {fileID: 495537392595300989} + - {fileID: 6302706739155191070} + - {fileID: 7345334598355961312} + - {fileID: 8614371467897437538} + - {fileID: 655457572} + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &868337851955314430 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6843584649582098237} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: c6826ed5c575c40c58f681e880fad469, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &919132147486207917 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450652013950231} + m_Layer: 0 + m_Name: Van + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1024366685134399085 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8614371467897437538} + - component: {fileID: 810504352} + - component: {fileID: 810504353} + m_Layer: 0 + m_Name: Wheels + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1139639555779975955 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8272619152164736657} + m_Layer: 0 + m_Name: highlightAnchor.002 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1139714121598866790 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1834832845902164278} + m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 8272619152164736657} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &1171545932194268010 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1454953783326346074} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: e3fb3841a697f42f18609c8864d87886, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1174928188556136133 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1834832845902164278} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: e3fb3841a697f42f18609c8864d87886, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!4 &1324398456776219820 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3802291232760194840} + m_LocalRotation: {x: 0.00000008146034, y: 0, z: -0, w: 1} + m_LocalPosition: {x: -0, y: 1.3254354, z: 1.2354684} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 543450652013950231} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &1343927956986588318 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3802291232760194840} + m_Mesh: {fileID: 4300004, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!23 &1358460171711815190 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3115097983429087125} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: e3fb3841a697f42f18609c8864d87886, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1370731719672604263 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6004201493088789044} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 697445d70f82745a39de4df5f36c514c, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1399470409057338219 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4914293776580820246} + m_Layer: 0 + m_Name: highlightAnchor.005 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1441162320435695677 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4651293638409442919} + m_LocalRotation: {x: -4.8343667e-14, y: -0.000000061212965, z: 0.0000004897039, + w: 1} + m_LocalPosition: {x: -0, y: 0.00000001756581, z: 0.00000011920929} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 5811884583841482940} + - {fileID: 1920425508572067436} + m_Father: {fileID: 7842203396053052413} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1454953783326346074 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8884403382647605949} + - component: {fileID: 1957376192961816002} + - component: {fileID: 1171545932194268010} + - component: {fileID: 482691359192624379} + m_Layer: 0 + m_Name: model + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!33 &1455088385366471267 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4642532271868578956} + m_Mesh: {fileID: 4300008, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!64 &1607796130768432570 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4642532271868578956} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Convex: 1 + m_CookingOptions: 30 + m_Mesh: {fileID: 4300008, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!1 &1834832845902164278 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1139714121598866790} + - component: {fileID: 3419681041113134397} + - component: {fileID: 1174928188556136133} + - component: {fileID: 8467988917364075122} + m_Layer: 0 + m_Name: baggage.001 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1920425508572067436 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6843584649582098237} + m_LocalRotation: {x: 0.9360078, y: -0.00000057927593, z: 0.3519793, w: -0.00000003444576} + m_LocalPosition: {x: -2.210752, y: 0.66151613, z: 0.86207104} + m_LocalScale: {x: 0.99999976, y: 1, z: 0.99999976} + m_Children: [] + m_Father: {fileID: 1441162320435695677} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &1957376192961816002 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1454953783326346074} + m_Mesh: {fileID: 4300010, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!4 &2590561584456245742 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7703323664971899662} + m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4185769961175156060} + - {fileID: 7375368130044152401} + - {fileID: 3640928673919294776} + - {fileID: 8214177323173603408} + m_Father: {fileID: 8614371467897437538} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &2694482714574987048 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 495537392595300989} + - component: {fileID: 5241015756857210826} + - component: {fileID: 8511394294721429138} + m_Layer: 0 + m_Name: windows + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2707615149424617030 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6438736019791643338} + m_LocalRotation: {x: 0, y: -2.3140616e-30, z: -0, w: 1} + m_LocalPosition: {x: -0, y: 0.000000023258746, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 9120391027429686458} + m_Father: {fileID: 6302706739155191070} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &2733681770876101857 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3640928673919294776} + - component: {fileID: 7544692034629471860} + - component: {fileID: 3191571841974369270} + - component: {fileID: 5191966308643470003} + m_Layer: 0 + m_Name: Wheels.003 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!23 &2943542174511385624 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5663755497419489490} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: c6826ed5c575c40c58f681e880fad469, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &3006387494640674227 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4185769961175156060} + - component: {fileID: 6106411283768265515} + - component: {fileID: 5258278074737671557} + - component: {fileID: 5494872313710049251} + m_Layer: 0 + m_Name: Wheels.001 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &3115097983429087125 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8949606274296942739} + - component: {fileID: 6063279496900936839} + - component: {fileID: 1358460171711815190} + m_Layer: 0 + m_Name: exterior + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &3140191690125254210 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8955083193884922905} + - component: {fileID: 8451929593771308738} + - component: {fileID: 6241182156023366564} + - component: {fileID: 5657825584776022733} + m_Layer: 0 + m_Name: wnd_trunk + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3186703855294423644 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5520051320514970037} + m_LocalRotation: {x: 0.000000015454313, y: 0.70710677, z: -0.000000015454312, w: 0.7071068} + m_LocalPosition: {x: 1.0949476, y: 0.9704342, z: 2.1051562} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 7842203396053052413} + m_Father: {fileID: 543450652013950231} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &3191571841974369270 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2733681770876101857} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 697445d70f82745a39de4df5f36c514c, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &3199042364890404102 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3423717910921782154} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 697445d70f82745a39de4df5f36c514c, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!4 &3271767513617999204 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6252852214270557190} + m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 3519659678996002217} + - {fileID: 8955083193884922905} + m_Father: {fileID: 4914293776580820246} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &3419681041113134397 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1834832845902164278} + m_Mesh: {fileID: 4300014, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!1 &3423717910921782154 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8214177323173603408} + - component: {fileID: 8728280931639377909} + - component: {fileID: 3199042364890404102} + - component: {fileID: 6673732408918896394} + m_Layer: 0 + m_Name: Wheels.004 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3519659678996002217 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6611973956703832923} + m_LocalRotation: {x: 0.54812384, y: 0.54812384, z: 0.4467217, w: 0.44672164} + m_LocalPosition: {x: -0.00000023841858, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 3271767513617999204} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &3623644531452767477 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6435797359462470268} + m_Mesh: {fileID: 4300006, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!4 &3640928673919294776 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2733681770876101857} + m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.9920766, y: 1.0288258, z: -0.0347642} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 2590561584456245742} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &3759489000277892601 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 9120391027429686458} + m_Layer: 0 + m_Name: animationAnchor + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &3802291232760194840 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1324398456776219820} + - component: {fileID: 1343927956986588318} + - component: {fileID: 382836270145210570} + m_Layer: 0 + m_Name: interior + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &3815856358122545974 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7842203396053052413} + m_Layer: 0 + m_Name: highlightAnchor.003 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4185769961175156060 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3006387494640674227} + m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0.9920766, y: 1.0288258, z: -0.0347642} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 2590561584456245742} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!64 &4247479592392523373 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6004201493088789044} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Convex: 1 + m_CookingOptions: 30 + m_Mesh: {fileID: 4300022, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!4 &4268089046573804721 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6435797359462470268} + m_LocalRotation: {x: 0.00000013621633, y: 0.905096, z: -0.000000125865, w: 0.42520732} + m_LocalPosition: {x: -2.3136199, y: -0.66151446, z: 0.50435114} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 7119166486829381719} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &4642532271868578956 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8179810329907547395} + - component: {fileID: 1455088385366471267} + - component: {fileID: 9015279149317773823} + - component: {fileID: 1607796130768432570} + m_Layer: 0 + m_Name: wnd + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &4651293638409442919 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1441162320435695677} + m_Layer: 0 + m_Name: animationAnchor.002 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &4680849219148963205 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6302706739155191070} + - component: {fileID: 1884916165} + - component: {fileID: 1884916166} + m_Layer: 0 + m_Name: SlidingDoor + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4914293776580820246 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1399470409057338219} + m_LocalRotation: {x: 0.5, y: -0.49999997, z: -0.5, w: -0.5} + m_LocalPosition: {x: -0, y: -0.0000001180379, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 3271767513617999204} + m_Father: {fileID: 7345334598355961312} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!64 &5106260460584101894 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7388158607944762906} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Convex: 1 + m_CookingOptions: 30 + m_Mesh: {fileID: 4300016, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!64 &5191966308643470003 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2733681770876101857} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Convex: 1 + m_CookingOptions: 30 + m_Mesh: {fileID: 4300024, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!33 &5241015756857210826 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2694482714574987048} + m_Mesh: {fileID: 4300000, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!23 &5258278074737671557 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3006387494640674227} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 697445d70f82745a39de4df5f36c514c, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!64 &5381014078299772781 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5663755497419489490} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Convex: 1 + m_CookingOptions: 30 + m_Mesh: {fileID: 4300012, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!64 &5494872313710049251 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3006387494640674227} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Convex: 1 + m_CookingOptions: 30 + m_Mesh: {fileID: 4300020, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!1 &5520051320514970037 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3186703855294423644} + - component: {fileID: 1526516045} + - component: {fileID: 1526516044} + m_Layer: 0 + m_Name: Door_Right + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5596421173225246262 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7530153028561895661} + m_LocalRotation: {x: 0.000000015454313, y: -0.70710677, z: 0.000000015454312, w: 0.7071068} + m_LocalPosition: {x: -1.0888067, y: 0.97043407, z: 2.1027858} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 172780826922127087} + m_Father: {fileID: 543450652013950231} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!64 &5657825584776022733 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3140191690125254210} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Convex: 1 + m_CookingOptions: 30 + m_Mesh: {fileID: 4300030, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!1 &5663755497419489490 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6826833664794589208} + - component: {fileID: 8295461951754712187} + - component: {fileID: 2943542174511385624} + - component: {fileID: 5381014078299772781} + m_Layer: 0 + m_Name: wnd_sliding_door + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!64 &5735167825942767281 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6611973956703832923} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Convex: 1 + m_CookingOptions: 30 + m_Mesh: {fileID: 4300028, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!1 &5769078734430259581 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 172780826922127087} + m_Layer: 0 + m_Name: highlightAnchor.001 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5811884583841482940 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7388158607944762906} + m_LocalRotation: {x: 0.9360078, y: -0.00000057927593, z: 0.3519793, w: -0.00000003444576} + m_LocalPosition: {x: -2.210752, y: 0.66151613, z: 0.86207104} + m_LocalScale: {x: 0.99999976, y: 1, z: 0.99999976} + m_Children: [] + m_Father: {fileID: 1441162320435695677} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &6004201493088789044 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7375368130044152401} + - component: {fileID: 6619152687717085965} + - component: {fileID: 1370731719672604263} + - component: {fileID: 4247479592392523373} + m_Layer: 0 + m_Name: Wheels.002 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!33 &6063279496900936839 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3115097983429087125} + m_Mesh: {fileID: 4300002, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!33 &6106411283768265515 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3006387494640674227} + m_Mesh: {fileID: 4300020, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!23 &6241182156023366564 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3140191690125254210} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: c6826ed5c575c40c58f681e880fad469, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &6252852214270557190 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3271767513617999204} + m_Layer: 0 + m_Name: animationAnchor.003 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &6291292912582762050 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 95317135125387569} + - component: {fileID: 1946040353} + - component: {fileID: 1946040352} + m_Layer: 0 + m_Name: Baggage + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6302706739155191070 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4680849219148963205} + m_LocalRotation: {x: 0.000000015454313, y: -0.70710677, z: 0.000000015454312, w: 0.7071068} + m_LocalPosition: {x: -1.2138957, y: 0.3600602, z: -1.4809437} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 2707615149424617030} + m_Father: {fileID: 543450652013950231} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &6435797359462470268 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4268089046573804721} + - component: {fileID: 3623644531452767477} + - component: {fileID: 6501821075990103296} + - component: {fileID: 7984562176574974897} + m_Layer: 0 + m_Name: door_ext_l + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &6438736019791643338 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2707615149424617030} + m_Layer: 0 + m_Name: highlightAnchor + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!23 &6501821075990103296 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6435797359462470268} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: e3fb3841a697f42f18609c8864d87886, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &6553321204619296590 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6843584649582098237} + m_Mesh: {fileID: 4300018, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!1 &6611973956703832923 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3519659678996002217} + - component: {fileID: 7899167285067355741} + - component: {fileID: 8094023842156325340} + - component: {fileID: 5735167825942767281} + m_Layer: 0 + m_Name: trunk_model + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!33 &6619152687717085965 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6004201493088789044} + m_Mesh: {fileID: 4300022, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!64 &6673732408918896394 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3423717910921782154} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Convex: 1 + m_CookingOptions: 30 + m_Mesh: {fileID: 4300026, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!4 &6826833664794589208 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5663755497419489490} + m_LocalRotation: {x: 0.000000099748036, y: 0.7071067, z: -0.00000009974802, w: 0.7071068} + m_LocalPosition: {x: 0.0012955666, y: 1.3280718, z: 0.007947803} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 9120391027429686458} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &6843584649582098237 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1920425508572067436} + - component: {fileID: 6553321204619296590} + - component: {fileID: 868337851955314430} + - component: {fileID: 7151003084770373271} + m_Layer: 0 + m_Name: wnd_r + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7119166486829381719 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9038607207086042419} + m_LocalRotation: {x: -3.1711317e-15, y: -0.00000007093701, z: 0.000000026011023, + w: 1} + m_LocalPosition: {x: -0, y: 0.00000010719789, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4268089046573804721} + - {fileID: 8179810329907547395} + m_Father: {fileID: 172780826922127087} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!64 &7151003084770373271 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6843584649582098237} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Convex: 1 + m_CookingOptions: 30 + m_Mesh: {fileID: 4300018, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!4 &7345334598355961312 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9058890211913245811} + m_LocalRotation: {x: 1.7112914e-15, y: 1, z: -0.000000021855694, w: 0.0000000754979} + m_LocalPosition: {x: -6.344926e-18, y: 2.246028, z: -2.7539887} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4914293776580820246} + m_Father: {fileID: 543450652013950231} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &7375368130044152401 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6004201493088789044} + m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.9920766, y: -1.7450808, z: -0.034764405} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 2590561584456245742} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &7388158607944762906 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5811884583841482940} + - component: {fileID: 7865082802916841334} + - component: {fileID: 8096064714667366686} + - component: {fileID: 5106260460584101894} + m_Layer: 0 + m_Name: exterior.001 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &7530153028561895661 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5596421173225246262} + - component: {fileID: 1686344447} + - component: {fileID: 1686344449} + m_Layer: 0 + m_Name: Door_Left + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!33 &7544692034629471860 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2733681770876101857} + m_Mesh: {fileID: 4300024, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!1 &7703323664971899662 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2590561584456245742} + m_Layer: 0 + m_Name: highlightAnchor.004 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7842203396053052413 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3815856358122545974} + m_LocalRotation: {x: -0.000000059604645, y: 0.0000000437114, z: 1, w: -0.00000019470718} + m_LocalPosition: {x: -0, y: -0.000000011742969, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1441162320435695677} + m_Father: {fileID: 3186703855294423644} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &7865082802916841334 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7388158607944762906} + m_Mesh: {fileID: 4300016, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!33 &7899167285067355741 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6611973956703832923} + m_Mesh: {fileID: 4300028, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!64 &7984562176574974897 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6435797359462470268} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Convex: 1 + m_CookingOptions: 30 + m_Mesh: {fileID: 4300006, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!23 &8094023842156325340 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6611973956703832923} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: e3fb3841a697f42f18609c8864d87886, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &8096064714667366686 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7388158607944762906} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: e3fb3841a697f42f18609c8864d87886, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!4 &8179810329907547395 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4642532271868578956} + m_LocalRotation: {x: 0.00000013621633, y: 0.905096, z: -0.000000125865, w: 0.42520732} + m_LocalPosition: {x: -2.3136199, y: -0.66151446, z: 0.50435114} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 7119166486829381719} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &8214177323173603408 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3423717910921782154} + m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0.9920766, y: -1.7450808, z: -0.034764405} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 2590561584456245742} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &8272619152164736657 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1139639555779975955} + m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1139714121598866790} + m_Father: {fileID: 95317135125387569} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &8295461951754712187 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5663755497419489490} + m_Mesh: {fileID: 4300012, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!33 &8451929593771308738 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3140191690125254210} + m_Mesh: {fileID: 4300030, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!64 &8467988917364075122 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1834832845902164278} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Convex: 1 + m_CookingOptions: 30 + m_Mesh: {fileID: 4300014, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!23 &8511394294721429138 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2694482714574987048} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: c6826ed5c575c40c58f681e880fad469, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!4 &8614371467897437538 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1024366685134399085} + m_LocalRotation: {x: 0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.39952204, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 2590561584456245742} + m_Father: {fileID: 543450652013950231} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &8728280931639377909 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3423717910921782154} + m_Mesh: {fileID: 4300026, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!4 &8884403382647605949 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1454953783326346074} + m_LocalRotation: {x: 0.000000099748036, y: 0.7071067, z: -0.00000009974802, w: 0.7071068} + m_LocalPosition: {x: -0, y: -0.00000012575286, z: 0.00000011920929} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 9120391027429686458} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &8949606274296942739 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3115097983429087125} + m_LocalRotation: {x: 0.00000008146034, y: 0, z: -0, w: 1} + m_LocalPosition: {x: -0, y: 0.30891964, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 543450652013950231} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &8955083193884922905 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3140191690125254210} + m_LocalRotation: {x: 0.54812384, y: 0.54812384, z: 0.4467217, w: 0.44672164} + m_LocalPosition: {x: 2.3065257, y: 0.0000002092075, z: -2.4529128} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 3271767513617999204} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &9015279149317773823 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4642532271868578956} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: c6826ed5c575c40c58f681e880fad469, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &9038607207086042419 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7119166486829381719} + m_Layer: 0 + m_Name: animationAnchor.001 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9058890211913245811 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7345334598355961312} + - component: {fileID: 1686344452} + - component: {fileID: 1686344451} + m_Layer: 0 + m_Name: Door_Trunk + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &9120391027429686458 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3759489000277892601} + m_LocalRotation: {x: 0, y: -2.3140616e-30, z: -0, w: 1} + m_LocalPosition: {x: -0, y: -0.00000000654358, z: -0.00000011920929} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 8884403382647605949} + - {fileID: 6826833664794589208} + m_Father: {fileID: 2707615149424617030} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Demo.unity.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Demo.unity.meta new file mode 100644 index 00000000..58bacfe4 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Demo.unity.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 13170347bc506405f88d3a87bd0982b3 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Demo.unity + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Demo_URP.unity b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Demo_URP.unity new file mode 100644 index 00000000..059072ed --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Demo_URP.unity @@ -0,0 +1,5977 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 1 + m_FogColor: {r: 0.90588236, g: 0.72156864, b: 0.627451, a: 1} + m_FogMode: 1 + m_FogDensity: 1 + m_LinearFogStart: 15 + m_LinearFogEnd: 25 + m_AmbientSkyColor: {r: 1, g: 1, b: 1, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 3 + m_SubtractiveShadowColor: {r: 1, g: 1, b: 1, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 512 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 0 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 112000000, guid: 64acb5532649148ad8702bd2c1c99441, type: 2} + m_LightingSettings: {fileID: 4890085278179872738, guid: 57f0c8ec6c3514d5786caf6ce528a88a, type: 2} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &69086296 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 69086297} + - component: {fileID: 69086298} + m_Layer: 0 + m_Name: CameraController + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &69086297 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 69086296} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: 0.88705486, z: -0, w: 0.46166408} + m_LocalPosition: {x: 0, y: 0.72, z: -0.29} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 142301654} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: -1314.989, z: 0} +--- !u!114 &69086298 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 69086296} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3f2f29997e7148b98e1d84f3de1011bc, type: 3} + m_Name: + m_EditorClassIdentifier: + highlightedElementController: {fileID: 843756321} + swipeTutorial: {fileID: 1619205711} + mainCamera: {fileID: 142301653} + cameraShakeStrength: 0.4 +--- !u!1 &142301651 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 142301654} + - component: {fileID: 142301653} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!20 &142301653 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 142301651} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0.90588236, g: 0.72156864, b: 0.627451, a: 1} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 50 + field of view: 60 + orthographic: 0 + orthographic size: 3.09 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &142301654 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 142301651} + serializedVersion: 2 + m_LocalRotation: {x: 0.20917961, y: -0, z: 0.000000007450579, w: 0.9778772} + m_LocalPosition: {x: 0, y: 2.863728, z: -6.3874187} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 69086297} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &182366647 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 182366649} + - component: {fileID: 182366648} + m_Layer: 0 + m_Name: Demo + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &182366648 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 182366647} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 945298e218f9841b08c8270c494cb200, type: 3} + m_Name: + m_EditorClassIdentifier: + animateAllType: 0 + sequenceTimelineSlider: {fileID: 1161269159} + pausedLabel: {fileID: 300583104} + animateAllPartsButton: {fileID: 508772385} + typewriterAnimatorExample: {fileID: 1920139813} + animatables: + - {fileID: 655457573} + - {fileID: 1686344449} + - {fileID: 1526516044} + - {fileID: 1686344451} + - {fileID: 1884916166} + - {fileID: 1946040352} + - {fileID: 460664918} + - {fileID: 810504353} + wheels: {fileID: 810504353} + timeScale: 1 +--- !u!4 &182366649 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 182366647} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &192232450 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 192232451} + - component: {fileID: 192232453} + - component: {fileID: 192232452} + m_Layer: 5 + m_Name: Buttons + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &192232451 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 192232450} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 730005265} + - {fileID: 414605617} + - {fileID: 269285985} + - {fileID: 1900965550} + - {fileID: 508772384} + m_Father: {fileID: 2027684627} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 5, y: 5} + m_SizeDelta: {x: 191.21143, y: 231.61594} + m_Pivot: {x: 0, y: 0} +--- !u!114 &192232452 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 192232450} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 0 + m_Bottom: 0 + m_ChildAlignment: 6 + m_Spacing: 5 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 0 + m_ChildControlWidth: 0 + m_ChildControlHeight: 0 + m_ChildScaleWidth: 0 + m_ChildScaleHeight: 0 + m_ReverseArrangement: 0 +--- !u!222 &192232453 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 192232450} + m_CullTransparentMesh: 0 +--- !u!1 &206828973 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 206828976} + - component: {fileID: 206828975} + - component: {fileID: 206828974} + m_Layer: 0 + m_Name: InputController + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &206828974 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 206828973} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ea1502cb33ab4d4ca1fedbdde163c980, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &206828975 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 206828973} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_FirstSelected: {fileID: 0} + m_sendNavigationEvents: 1 + m_DragThreshold: 10 +--- !u!4 &206828976 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 206828973} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -400, y: -356.47668, z: 0} + m_LocalScale: {x: 0.69084626, y: 0.69084626, z: 0.69084626} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2027684627} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &269285984 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 269285985} + - component: {fileID: 269285988} + - component: {fileID: 269285987} + - component: {fileID: 269285986} + - component: {fileID: 269285989} + m_Layer: 5 + m_Name: Button-Camera Projection + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &269285985 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 269285984} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1287318625} + m_Father: {fileID: 192232451} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 150, y: 28} + m_Pivot: {x: 0, y: 0} +--- !u!114 &269285986 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 269285984} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 0.3962264, g: 0.3962264, b: 0.3962264, a: 0.34117648} + m_HighlightedColor: {r: 0.3962264, g: 0.3962264, b: 0.3962264, a: 0.34117648} + m_PressedColor: {r: 0.6901961, g: 0.6901961, b: 0.6901961, a: 0.32156864} + m_SelectedColor: {r: 0.3962264, g: 0.3962264, b: 0.3962264, a: 0.34117648} + m_DisabledColor: {r: 0.9529412, g: 0, b: 1, a: 1} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Highlighted + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 269285987} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 269285989} + m_TargetAssemblyTypeName: + m_MethodName: AnimateCameraProjection + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!114 &269285987 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 269285984} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &269285988 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 269285984} + m_CullTransparentMesh: 0 +--- !u!114 &269285989 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 269285984} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 900e84e1426b4fc8a386a58aaee3b4ba, type: 3} + m_Name: + m_EditorClassIdentifier: + mainCamera: {fileID: 142301653} +--- !u!1 &300583102 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 300583103} + - component: {fileID: 300583105} + - component: {fileID: 300583104} + m_Layer: 5 + m_Name: pausedLabel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &300583103 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 300583102} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1161269158} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0.000015258789, y: 24.61} + m_SizeDelta: {x: 160, y: 30} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &300583104 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 300583102} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 1 + m_BestFit: 0 + m_MinSize: 1 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Paused +--- !u!222 &300583105 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 300583102} + m_CullTransparentMesh: 0 +--- !u!1 &315743953 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 315743954} + m_Layer: 0 + m_Name: left + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &315743954 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 315743953} + serializedVersion: 2 + m_LocalRotation: {x: -0.000000021855694, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0.755, y: -0.079034865, z: 0.03866959} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 911097553} + - {fileID: 1933132477} + m_Father: {fileID: 655457572} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &384398580 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 384398582} + - component: {fileID: 384398581} + - component: {fileID: 384398583} + m_Layer: 0 + m_Name: DirectionalLightController + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &384398581 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 384398580} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 1 + m_Shape: 0 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 1.4 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.802082 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 0.556 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &384398582 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 384398580} + serializedVersion: 2 + m_LocalRotation: {x: 0.35355338, y: 0.35355338, z: -0.1464466, w: 0.8535535} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 45, y: 45, z: 0} +--- !u!114 &384398583 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 384398580} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: db622a6d0e0fa4b68852ef1a7fc60dba, type: 3} + m_Name: + m_EditorClassIdentifier: + directionalLight: {fileID: 384398581} + mainCamera: {fileID: 142301653} + startColor: {r: 1, g: 0.9490196, b: 0.8509804, a: 1} + endColor: {r: 0.69803923, g: 0.87058824, b: 1, a: 1} +--- !u!1 &414605616 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 414605617} + - component: {fileID: 414605621} + - component: {fileID: 414605620} + - component: {fileID: 414605619} + - component: {fileID: 414605618} + m_Layer: 5 + m_Name: Button-Squeeze + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &414605617 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 414605616} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1113543885} + m_Father: {fileID: 192232451} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 150, y: 28} + m_Pivot: {x: 0, y: 0} +--- !u!114 &414605618 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 414605616} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 613ad9fe5121a4b02b556b6b16cad710, type: 3} + m_Name: + m_EditorClassIdentifier: + target: {fileID: 543450652013950231} +--- !u!114 &414605619 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 414605616} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 0.3962264, g: 0.3962264, b: 0.3962264, a: 0.34117648} + m_HighlightedColor: {r: 0.3962264, g: 0.3962264, b: 0.3962264, a: 0.34117648} + m_PressedColor: {r: 0.6901961, g: 0.6901961, b: 0.6901961, a: 0.32156864} + m_SelectedColor: {r: 0.3962264, g: 0.3962264, b: 0.3962264, a: 0.34117648} + m_DisabledColor: {r: 0.9529412, g: 0, b: 1, a: 1} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Highlighted + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 414605620} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 414605618} + m_TargetAssemblyTypeName: + m_MethodName: PlayAnimation + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!114 &414605620 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 414605616} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &414605621 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 414605616} + m_CullTransparentMesh: 0 +--- !u!1 &460664916 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 460664917} + - component: {fileID: 460664918} + m_Layer: 0 + m_Name: Road + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &460664917 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 460664916} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: 1, z: -0, w: 0} + m_LocalPosition: {x: -1.09, y: 0, z: -0.36} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1077484924} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &460664918 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 460664916} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a4e192d6601c4753961099a3db72b66f, type: 3} + m_Name: + m_EditorClassIdentifier: + roadModel: {fileID: 1077484921} + ease: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.25 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.65 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.8 + value: 0.25 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 +--- !u!1 &480829268 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 480829269} + - component: {fileID: 480829272} + - component: {fileID: 480829271} + - component: {fileID: 480829270} + m_Layer: 0 + m_Name: exterior.002 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &480829269 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 480829268} + serializedVersion: 2 + m_LocalRotation: {x: 0.000000059604645, y: 0, z: -0, w: 1} + m_LocalPosition: {x: -0, y: -0.000000014899477, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 655457572} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!64 &480829270 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 480829268} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 5 + m_Convex: 0 + m_CookingOptions: 30 + m_Mesh: {fileID: 4300032, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!23 &480829271 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 480829268} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 4664d12bb5ac04e998b3008d8f2803dc, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &480829272 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 480829268} + m_Mesh: {fileID: 4300032, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!1 &508772383 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 508772384} + - component: {fileID: 508772387} + - component: {fileID: 508772386} + - component: {fileID: 508772385} + m_Layer: 5 + m_Name: Button-Animate All Parts + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &508772384 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 508772383} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1902477809} + m_Father: {fileID: 192232451} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 150, y: 28} + m_Pivot: {x: 0, y: 0} +--- !u!114 &508772385 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 508772383} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 0.3962264, g: 0.3962264, b: 0.3962264, a: 0.34117648} + m_HighlightedColor: {r: 0.3962264, g: 0.3962264, b: 0.3962264, a: 0.34117648} + m_PressedColor: {r: 0.6901961, g: 0.6901961, b: 0.6901961, a: 0.32156864} + m_SelectedColor: {r: 0.3962264, g: 0.3962264, b: 0.3962264, a: 0.34117648} + m_DisabledColor: {r: 0.9529412, g: 0, b: 1, a: 1} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Highlighted + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 508772386} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 810504353} + m_TargetAssemblyTypeName: + m_MethodName: OnClick + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!114 &508772386 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 508772383} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &508772387 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 508772383} + m_CullTransparentMesh: 0 +--- !u!1 &655457571 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 655457572} + - component: {fileID: 655457574} + - component: {fileID: 655457573} + m_Layer: 0 + m_Name: Headlights + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &655457572 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 655457571} + serializedVersion: 2 + m_LocalRotation: {x: 0.000000021855694, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.65403485, z: 2.3863304} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 480829269} + - {fileID: 315743954} + - {fileID: 759060660} + m_Father: {fileID: 543450652013950231} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &655457573 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 655457571} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7bc81275df8d244a1a7568f9443b5e93, type: 3} + m_Name: + m_EditorClassIdentifier: + ease: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 7.722292 + outSlope: 7.722292 + tangentMode: 34 + weightedMode: 0 + inWeight: 0 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.12949523 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.21629333 + value: 0.01210352 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.31928205 + value: 0.9868132 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33685845 + - serializedVersion: 3 + time: 0.48927683 + value: 0.012353897 + inSlope: -0.029328367 + outSlope: -0.029328367 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.7624979 + value: 0.009361729 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 4.1710715 + outSlope: 4.1710715 + tangentMode: 34 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + lights: + - {fileID: 911097554} + - {fileID: 1933132478} + - {fileID: 671979176} + - {fileID: 1453060464} +--- !u!114 &655457574 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 655457571} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5fbd7d6a5982d440282a82998473a306, type: 3} + m_Name: + m_EditorClassIdentifier: + highlightAnchor: {fileID: 480829269} +--- !u!1 &671979174 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 671979175} + - component: {fileID: 671979176} + m_Layer: 0 + m_Name: Spot Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &671979175 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 671979174} + serializedVersion: 2 + m_LocalRotation: {x: 0.24988215, y: -0, z: -0, w: 0.96827626} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 759060660} + m_LocalEulerAnglesHint: {x: 28.941002, y: 0, z: 0} +--- !u!108 &671979176 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 671979174} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 0 + m_Shape: 0 + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Intensity: 0 + m_Range: 10 + m_SpotAngle: 83 + m_InnerSpotAngle: 64.90425 + m_CookieSize: 10 + m_Shadows: + m_Type: 0 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!1 &730005264 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 730005265} + - component: {fileID: 730005269} + - component: {fileID: 730005268} + - component: {fileID: 730005267} + - component: {fileID: 730005266} + m_Layer: 5 + m_Name: Button-Jump + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &730005265 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 730005264} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1088776685} + m_Father: {fileID: 192232451} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 150, y: 28} + m_Pivot: {x: 0, y: 0} +--- !u!114 &730005266 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 730005264} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 453932c77a72487599d5103bcde610da, type: 3} + m_Name: + m_EditorClassIdentifier: + target: {fileID: 543450652013950231} +--- !u!114 &730005267 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 730005264} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 0.3962264, g: 0.3962264, b: 0.3962264, a: 0.34117648} + m_HighlightedColor: {r: 0.3962264, g: 0.3962264, b: 0.3962264, a: 0.34117648} + m_PressedColor: {r: 0.6901961, g: 0.6901961, b: 0.6901961, a: 0.32156864} + m_SelectedColor: {r: 0.3962264, g: 0.3962264, b: 0.3962264, a: 0.34117648} + m_DisabledColor: {r: 0.9529412, g: 0, b: 1, a: 1} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Highlighted + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 730005268} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 730005266} + m_TargetAssemblyTypeName: + m_MethodName: PlayAnimation + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!114 &730005268 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 730005264} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &730005269 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 730005264} + m_CullTransparentMesh: 0 +--- !u!1 &759060659 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 759060660} + m_Layer: 0 + m_Name: right + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &759060660 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 759060659} + serializedVersion: 2 + m_LocalRotation: {x: -0.000000021855694, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.753, y: -0.079034865, z: 0.03866959} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 671979175} + - {fileID: 1453060463} + m_Father: {fileID: 655457572} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &795061382 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 795061383} + - component: {fileID: 795061385} + - component: {fileID: 795061384} + m_Layer: 5 + m_Name: gcAllocText + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &795061383 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 795061382} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1755549104} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &795061384 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 795061382} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 1 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: 'Heap allocations: 0B' +--- !u!222 &795061385 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 795061382} + m_CullTransparentMesh: 0 +--- !u!114 &810504352 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1024366685134399085} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5fbd7d6a5982d440282a82998473a306, type: 3} + m_Name: + m_EditorClassIdentifier: + highlightAnchor: {fileID: 2590561584456245742} +--- !u!114 &810504353 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1024366685134399085} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6113f6e98f16c489f87f373fc4133597, type: 3} + m_Name: + m_EditorClassIdentifier: + wheels: + - {fileID: 4185769961175156060} + - {fileID: 7375368130044152401} + - {fileID: 3640928673919294776} + - {fileID: 8214177323173603408} +--- !u!1 &822037459 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 822037460} + - component: {fileID: 822037462} + - component: {fileID: 822037461} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &822037460 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 822037459} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1900965550} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &822037461 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 822037459} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 1 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Camera Shake +--- !u!222 &822037462 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 822037459} + m_CullTransparentMesh: 0 +--- !u!1 &843756320 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 843756322} + - component: {fileID: 843756321} + m_Layer: 0 + m_Name: HighlightedElementController + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &843756321 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 843756320} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9e831710f8fb47e4a09c640d573d1358, type: 3} + m_Name: + m_EditorClassIdentifier: + mainCamera: {fileID: 142301653} + cameraProjectionMatrixAnimation: {fileID: 269285989} +--- !u!4 &843756322 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 843756320} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &911097552 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 911097553} + - component: {fileID: 911097554} + m_Layer: 0 + m_Name: Spot Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &911097553 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 911097552} + serializedVersion: 2 + m_LocalRotation: {x: 0.24988215, y: -0, z: -0, w: 0.96827626} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 315743954} + m_LocalEulerAnglesHint: {x: 28.941002, y: 0, z: 0} +--- !u!108 &911097554 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 911097552} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 0 + m_Shape: 0 + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Intensity: 0 + m_Range: 10 + m_SpotAngle: 83 + m_InnerSpotAngle: 64.90425 + m_CookieSize: 10 + m_Shadows: + m_Type: 0 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!1 &1077484920 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1077484924} + - component: {fileID: 1077484923} + - component: {fileID: 1077484921} + m_Layer: 0 + m_Name: model + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!23 &1077484921 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1077484920} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 5b3bd009b3212427983eb7f4e416527a, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1077484923 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1077484920} + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1077484924 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1077484920} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: 0.38268304, z: -0, w: 0.92387974} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 100, y: 1, z: 100} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 460664917} + m_LocalEulerAnglesHint: {x: 0, y: 45, z: 0} +--- !u!1 &1080535449 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1080535450} + - component: {fileID: 1080535452} + - component: {fileID: 1080535451} + m_Layer: 5 + m_Name: Background + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1080535450 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1080535449} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1161269158} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.25} + m_AnchorMax: {x: 1, y: 0.75} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1080535451 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1080535449} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &1080535452 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1080535449} + m_CullTransparentMesh: 0 +--- !u!1 &1088776684 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1088776685} + - component: {fileID: 1088776687} + - component: {fileID: 1088776686} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1088776685 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1088776684} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 730005265} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1088776686 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1088776684} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 1 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Jump +--- !u!222 &1088776687 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1088776684} + m_CullTransparentMesh: 0 +--- !u!1 &1113543884 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1113543885} + - component: {fileID: 1113543887} + - component: {fileID: 1113543886} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1113543885 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1113543884} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 414605617} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1113543886 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1113543884} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 1 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Squeeze +--- !u!222 &1113543887 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1113543884} + m_CullTransparentMesh: 0 +--- !u!1 &1161269157 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1161269158} + - component: {fileID: 1161269159} + m_Layer: 5 + m_Name: sequenceTimelineSlider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1161269158 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1161269157} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1080535450} + - {fileID: 1859953128} + - {fileID: 2061135563} + - {fileID: 300583103} + m_Father: {fileID: 2027684627} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 0} + m_AnchoredPosition: {x: 77.76001, y: 8.460022} + m_SizeDelta: {x: -162.42, y: 20} + m_Pivot: {x: 0.5, y: 0} +--- !u!114 &1161269159 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1161269157} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 67db9e8f0e2ae9c40bc1e2b64352a6b4, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Highlighted + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 1703196966} + m_FillRect: {fileID: 2107903321} + m_HandleRect: {fileID: 1703196965} + m_Direction: 0 + m_MinValue: 0 + m_MaxValue: 1 + m_WholeNumbers: 0 + m_Value: 0 + m_OnValueChanged: + m_PersistentCalls: + m_Calls: [] +--- !u!1 &1287318624 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1287318625} + - component: {fileID: 1287318627} + - component: {fileID: 1287318626} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1287318625 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1287318624} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 269285985} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1287318626 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1287318624} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 1 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Camera Projection +--- !u!222 &1287318627 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1287318624} + m_CullTransparentMesh: 0 +--- !u!1 &1453060462 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1453060463} + - component: {fileID: 1453060464} + m_Layer: 0 + m_Name: Point Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1453060463 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1453060462} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0.179} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 759060660} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!108 &1453060464 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1453060462} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 2 + m_Shape: 0 + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Intensity: 0 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.802082 + m_CookieSize: 10 + m_Shadows: + m_Type: 0 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!114 &1526516044 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5520051320514970037} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4efa7d4d94464bb0b3e6ea597eb13637, type: 3} + m_Name: + m_EditorClassIdentifier: + cameraController: {fileID: 69086298} + animationAnchor: {fileID: 1441162320435695677} +--- !u!114 &1526516045 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5520051320514970037} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5fbd7d6a5982d440282a82998473a306, type: 3} + m_Name: + m_EditorClassIdentifier: + highlightAnchor: {fileID: 7842203396053052413} +--- !u!1 &1549457030 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1549457031} + - component: {fileID: 1549457033} + - component: {fileID: 1549457032} + m_Layer: 5 + m_Name: tweensCountText + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1549457031 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1549457030} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1755549104} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1549457032 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1549457030} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 1 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: 'Animations played: 999' +--- !u!222 &1549457033 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1549457030} + m_CullTransparentMesh: 0 +--- !u!1 &1619205709 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1619205710} + - component: {fileID: 1619205713} + - component: {fileID: 1619205712} + - component: {fileID: 1619205711} + m_Layer: 5 + m_Name: SwipeTutorial + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1619205710 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1619205709} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2027684627} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0} + m_AnchorMax: {x: 0.5, y: 0} + m_AnchoredPosition: {x: 0, y: 57.25} + m_SizeDelta: {x: 362.76373, y: 30} + m_Pivot: {x: 0.5, y: 0} +--- !u!114 &1619205711 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1619205709} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d20b7aac1e6a4f1dbdbe52c7ca1ad4b4, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &1619205712 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1619205709} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 1 + m_BestFit: 0 + m_MinSize: 0 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: Swipe to rotate the camera +--- !u!222 &1619205713 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1619205709} + m_CullTransparentMesh: 0 +--- !u!114 &1686344447 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7530153028561895661} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5fbd7d6a5982d440282a82998473a306, type: 3} + m_Name: + m_EditorClassIdentifier: + highlightAnchor: {fileID: 172780826922127087} +--- !u!114 &1686344449 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7530153028561895661} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4efa7d4d94464bb0b3e6ea597eb13637, type: 3} + m_Name: + m_EditorClassIdentifier: + cameraController: {fileID: 69086298} + animationAnchor: {fileID: 7119166486829381719} +--- !u!114 &1686344451 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9058890211913245811} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4efa7d4d94464bb0b3e6ea597eb13637, type: 3} + m_Name: + m_EditorClassIdentifier: + cameraController: {fileID: 69086298} + animationAnchor: {fileID: 3271767513617999204} +--- !u!114 &1686344452 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9058890211913245811} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5fbd7d6a5982d440282a82998473a306, type: 3} + m_Name: + m_EditorClassIdentifier: + highlightAnchor: {fileID: 4914293776580820246} +--- !u!1 &1703196964 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1703196965} + - component: {fileID: 1703196967} + - component: {fileID: 1703196966} + m_Layer: 5 + m_Name: Handle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1703196965 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1703196964} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2061135563} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 20, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1703196966 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1703196964} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &1703196967 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1703196964} + m_CullTransparentMesh: 0 +--- !u!1 &1755549103 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1755549104} + - component: {fileID: 1755549109} + - component: {fileID: 1755549108} + - component: {fileID: 1755549105} + - component: {fileID: 1755549107} + - component: {fileID: 1755549106} + m_Layer: 5 + m_Name: DebugInfo + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1755549104 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1755549103} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1549457031} + - {fileID: 795061383} + m_Father: {fileID: 2027684627} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 5, y: -5} + m_SizeDelta: {x: 179.4021, y: 50} + m_Pivot: {x: 0, y: 1} +--- !u!114 &1755549105 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1755549103} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 5 + m_Right: 5 + m_Top: 5 + m_Bottom: 5 + m_ChildAlignment: 0 + m_Spacing: 5 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 1 + m_ChildControlWidth: 1 + m_ChildControlHeight: 1 + m_ChildScaleWidth: 0 + m_ChildScaleHeight: 0 + m_ReverseArrangement: 0 +--- !u!114 &1755549106 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1755549103} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6af581ca2a164600b2d47b0f7f7d5570, type: 3} + m_Name: + m_EditorClassIdentifier: + logAllocations: 1 + logFiltered: 0 + logIgnored: 0 + filterAllocations: [] + ignoreAllocations: + - RaycastHit.get_collider() + - Component.get_transform() + - Component.get_gameObject() + - MeasureMemoryAllocations + - DebugInfo +--- !u!114 &1755549107 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1755549103} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c0ef97c778caf4b70aea23911ded98ab, type: 3} + m_Name: + m_EditorClassIdentifier: + measureMemoryAllocations: {fileID: 1755549106} + tweensCountText: {fileID: 1549457032} + gcAllocText: {fileID: 795061384} +--- !u!114 &1755549108 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1755549103} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.6981132, g: 0.6981132, b: 0.6981132, a: 0.28627452} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &1755549109 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1755549103} + m_CullTransparentMesh: 0 +--- !u!1 &1859953127 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1859953128} + m_Layer: 5 + m_Name: Fill Area + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1859953128 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1859953127} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 2107903321} + m_Father: {fileID: 1161269158} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.25} + m_AnchorMax: {x: 1, y: 0.75} + m_AnchoredPosition: {x: -5, y: 0} + m_SizeDelta: {x: -20, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1884916165 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4680849219148963205} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5fbd7d6a5982d440282a82998473a306, type: 3} + m_Name: + m_EditorClassIdentifier: + highlightAnchor: {fileID: 2707615149424617030} +--- !u!114 &1884916166 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4680849219148963205} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c42977785d1b549d59c346556945e0c5, type: 3} + m_Name: + m_EditorClassIdentifier: + animationAnchor: {fileID: 9120391027429686458} + openedPos: {x: 0, y: 0, z: 0} + midPos: {x: 1.13, y: 0, z: 0} + closedPos: {x: 1.13, y: 0, z: -0.24} +--- !u!1 &1900965549 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1900965550} + - component: {fileID: 1900965554} + - component: {fileID: 1900965553} + - component: {fileID: 1900965552} + m_Layer: 5 + m_Name: Button-Camera Shake + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1900965550 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1900965549} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 822037460} + m_Father: {fileID: 192232451} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 150, y: 28} + m_Pivot: {x: 0, y: 0} +--- !u!114 &1900965552 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1900965549} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 0.3962264, g: 0.3962264, b: 0.3962264, a: 0.34117648} + m_HighlightedColor: {r: 0.3962264, g: 0.3962264, b: 0.3962264, a: 0.34117648} + m_PressedColor: {r: 0.6901961, g: 0.6901961, b: 0.6901961, a: 0.32156864} + m_SelectedColor: {r: 0.3962264, g: 0.3962264, b: 0.3962264, a: 0.34117648} + m_DisabledColor: {r: 0.9529412, g: 0, b: 1, a: 1} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Highlighted + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 1900965553} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 69086298} + m_TargetAssemblyTypeName: + m_MethodName: ShakeCamera + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!114 &1900965553 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1900965549} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &1900965554 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1900965549} + m_CullTransparentMesh: 0 +--- !u!1 &1902477808 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1902477809} + - component: {fileID: 1902477811} + - component: {fileID: 1902477810} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1902477809 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1902477808} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 508772384} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1902477810 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1902477808} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 1 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Animate All Parts +--- !u!222 &1902477811 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1902477808} + m_CullTransparentMesh: 0 +--- !u!1 &1920139811 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1920139812} + - component: {fileID: 1920139814} + - component: {fileID: 1920139813} + m_Layer: 5 + m_Name: TypewriterAnimationExample + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1920139812 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1920139811} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2027684627} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -5, y: -5} + m_SizeDelta: {x: 180, y: 30} + m_Pivot: {x: 1, y: 1} +--- !u!114 &1920139813 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1920139811} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f62b6e70f1114e5d867a36459e0352bf, type: 3} + m_Name: + m_EditorClassIdentifier: + animationType: 1 + charsPerSecond: 40 + pauseAfterPunctuation: 20 +--- !u!222 &1920139814 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1920139811} + m_CullTransparentMesh: 0 +--- !u!1 &1933132476 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1933132477} + - component: {fileID: 1933132478} + m_Layer: 0 + m_Name: Point Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1933132477 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1933132476} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0.179} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 315743954} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!108 &1933132478 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1933132476} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 2 + m_Shape: 0 + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Intensity: 0 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.802082 + m_CookieSize: 10 + m_Shadows: + m_Type: 0 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!114 &1946040352 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6291292912582762050} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 27b542649ab4a463aa343c437387783e, type: 3} + m_Name: + m_EditorClassIdentifier: + animationAnchor: {fileID: 1139714121598866790} +--- !u!114 &1946040353 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6291292912582762050} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5fbd7d6a5982d440282a82998473a306, type: 3} + m_Name: + m_EditorClassIdentifier: + highlightAnchor: {fileID: 8272619152164736657} +--- !u!1 &2027684623 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2027684627} + - component: {fileID: 2027684626} + - component: {fileID: 2027684625} + - component: {fileID: 2027684624} + m_Layer: 5 + m_Name: Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &2027684624 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2027684623} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &2027684625 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2027684623} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 0 +--- !u!223 &2027684626 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2027684623} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_VertexColorAlwaysGammaSpace: 0 + m_AdditionalShaderChannelsFlag: 0 + m_UpdateRectTransformForStandalone: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!224 &2027684627 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2027684623} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 192232451} + - {fileID: 1619205710} + - {fileID: 1755549104} + - {fileID: 206828976} + - {fileID: 1161269158} + - {fileID: 1920139812} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!1 &2061135562 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2061135563} + m_Layer: 5 + m_Name: Handle Slide Area + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2061135563 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2061135562} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1703196965} + m_Father: {fileID: 1161269158} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: -20, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &2107903320 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2107903321} + - component: {fileID: 2107903323} + - component: {fileID: 2107903322} + m_Layer: 5 + m_Name: Fill + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2107903321 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2107903320} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1859953128} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 10, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &2107903322 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2107903320} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &2107903323 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2107903320} + m_CullTransparentMesh: 0 +--- !u!4 &95317135125387569 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6291292912582762050} + serializedVersion: 2 + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0.22998282, y: 2.7259037, z: -1.4789121} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 8272619152164736657} + m_Father: {fileID: 543450652013950231} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &172780826922127087 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5769078734430259581} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: -2.3140616e-30, z: -0, w: 1} + m_LocalPosition: {x: -0, y: -0.0000000120113945, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 7119166486829381719} + m_Father: {fileID: 5596421173225246262} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &382836270145210570 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3802291232760194840} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 4ba9f664d3cac4d60b6c273c337e94b1, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!64 &482691359192624379 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1454953783326346074} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 5 + m_Convex: 1 + m_CookingOptions: 30 + m_Mesh: {fileID: 4300010, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!4 &495537392595300989 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2694482714574987048} + serializedVersion: 2 + m_LocalRotation: {x: 0.00000008146034, y: 0, z: -0, w: 1} + m_LocalPosition: {x: -0, y: 0.30891964, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 543450652013950231} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &543450652013950231 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132147486207917} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 95317135125387569} + - {fileID: 5596421173225246262} + - {fileID: 3186703855294423644} + - {fileID: 8949606274296942739} + - {fileID: 1324398456776219820} + - {fileID: 495537392595300989} + - {fileID: 6302706739155191070} + - {fileID: 7345334598355961312} + - {fileID: 8614371467897437538} + - {fileID: 655457572} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &868337851955314430 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6843584649582098237} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 1b921feeacddd4a24ba5661d0ce5d33e, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &919132147486207917 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450652013950231} + m_Layer: 0 + m_Name: Van + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1024366685134399085 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8614371467897437538} + - component: {fileID: 810504352} + - component: {fileID: 810504353} + m_Layer: 0 + m_Name: Wheels + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1139639555779975955 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8272619152164736657} + m_Layer: 0 + m_Name: highlightAnchor.002 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1139714121598866790 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1834832845902164278} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 8272619152164736657} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &1171545932194268010 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1454953783326346074} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 4664d12bb5ac04e998b3008d8f2803dc, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!23 &1174928188556136133 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1834832845902164278} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 4664d12bb5ac04e998b3008d8f2803dc, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!4 &1324398456776219820 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3802291232760194840} + serializedVersion: 2 + m_LocalRotation: {x: 0.00000008146034, y: 0, z: -0, w: 1} + m_LocalPosition: {x: -0, y: 1.3254354, z: 1.2354684} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 543450652013950231} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &1343927956986588318 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3802291232760194840} + m_Mesh: {fileID: 4300004, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!23 &1358460171711815190 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3115097983429087125} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 4664d12bb5ac04e998b3008d8f2803dc, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!23 &1370731719672604263 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6004201493088789044} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: b18e327865ce74717850a9fa00d61d6a, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &1399470409057338219 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4914293776580820246} + m_Layer: 0 + m_Name: highlightAnchor.005 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1441162320435695677 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4651293638409442919} + serializedVersion: 2 + m_LocalRotation: {x: -4.8343667e-14, y: -0.000000061212965, z: 0.0000004897039, w: 1} + m_LocalPosition: {x: -0, y: 0.00000001756581, z: 0.00000011920929} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 5811884583841482940} + - {fileID: 1920425508572067436} + m_Father: {fileID: 7842203396053052413} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1454953783326346074 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8884403382647605949} + - component: {fileID: 1957376192961816002} + - component: {fileID: 1171545932194268010} + - component: {fileID: 482691359192624379} + m_Layer: 0 + m_Name: model + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!33 &1455088385366471267 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4642532271868578956} + m_Mesh: {fileID: 4300008, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!64 &1607796130768432570 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4642532271868578956} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 5 + m_Convex: 1 + m_CookingOptions: 30 + m_Mesh: {fileID: 4300008, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!1 &1834832845902164278 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1139714121598866790} + - component: {fileID: 3419681041113134397} + - component: {fileID: 1174928188556136133} + - component: {fileID: 8467988917364075122} + m_Layer: 0 + m_Name: baggage.001 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1920425508572067436 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6843584649582098237} + serializedVersion: 2 + m_LocalRotation: {x: 0.9360078, y: -0.00000057927593, z: 0.3519793, w: -0.00000003444576} + m_LocalPosition: {x: -2.210752, y: 0.66151613, z: 0.86207104} + m_LocalScale: {x: 0.99999976, y: 1, z: 0.99999976} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1441162320435695677} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &1957376192961816002 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1454953783326346074} + m_Mesh: {fileID: 4300010, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!4 &2590561584456245742 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7703323664971899662} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4185769961175156060} + - {fileID: 7375368130044152401} + - {fileID: 3640928673919294776} + - {fileID: 8214177323173603408} + m_Father: {fileID: 8614371467897437538} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &2694482714574987048 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 495537392595300989} + - component: {fileID: 5241015756857210826} + - component: {fileID: 8511394294721429138} + m_Layer: 0 + m_Name: windows + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2707615149424617030 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6438736019791643338} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: -2.3140616e-30, z: -0, w: 1} + m_LocalPosition: {x: -0, y: 0.000000023258746, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 9120391027429686458} + m_Father: {fileID: 6302706739155191070} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &2733681770876101857 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3640928673919294776} + - component: {fileID: 7544692034629471860} + - component: {fileID: 3191571841974369270} + - component: {fileID: 5191966308643470003} + m_Layer: 0 + m_Name: Wheels.003 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!23 &2943542174511385624 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5663755497419489490} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 1b921feeacddd4a24ba5661d0ce5d33e, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &3006387494640674227 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4185769961175156060} + - component: {fileID: 6106411283768265515} + - component: {fileID: 5258278074737671557} + - component: {fileID: 5494872313710049251} + m_Layer: 0 + m_Name: Wheels.001 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &3115097983429087125 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8949606274296942739} + - component: {fileID: 6063279496900936839} + - component: {fileID: 1358460171711815190} + m_Layer: 0 + m_Name: exterior + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &3140191690125254210 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8955083193884922905} + - component: {fileID: 8451929593771308738} + - component: {fileID: 6241182156023366564} + - component: {fileID: 5657825584776022733} + m_Layer: 0 + m_Name: wnd_trunk + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3186703855294423644 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5520051320514970037} + serializedVersion: 2 + m_LocalRotation: {x: 0.000000015454313, y: 0.70710677, z: -0.000000015454312, w: 0.7071068} + m_LocalPosition: {x: 1.0949476, y: 0.9704342, z: 2.1051562} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 7842203396053052413} + m_Father: {fileID: 543450652013950231} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &3191571841974369270 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2733681770876101857} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: b18e327865ce74717850a9fa00d61d6a, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!23 &3199042364890404102 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3423717910921782154} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: b18e327865ce74717850a9fa00d61d6a, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!4 &3271767513617999204 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6252852214270557190} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 3519659678996002217} + - {fileID: 8955083193884922905} + m_Father: {fileID: 4914293776580820246} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &3419681041113134397 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1834832845902164278} + m_Mesh: {fileID: 4300014, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!1 &3423717910921782154 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8214177323173603408} + - component: {fileID: 8728280931639377909} + - component: {fileID: 3199042364890404102} + - component: {fileID: 6673732408918896394} + m_Layer: 0 + m_Name: Wheels.004 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3519659678996002217 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6611973956703832923} + serializedVersion: 2 + m_LocalRotation: {x: 0.54812384, y: 0.54812384, z: 0.4467217, w: 0.44672164} + m_LocalPosition: {x: -0.00000023841858, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3271767513617999204} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &3623644531452767477 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6435797359462470268} + m_Mesh: {fileID: 4300006, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!4 &3640928673919294776 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2733681770876101857} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.9920766, y: 1.0288258, z: -0.0347642} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2590561584456245742} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &3759489000277892601 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 9120391027429686458} + m_Layer: 0 + m_Name: animationAnchor + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &3802291232760194840 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1324398456776219820} + - component: {fileID: 1343927956986588318} + - component: {fileID: 382836270145210570} + m_Layer: 0 + m_Name: interior + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &3815856358122545974 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7842203396053052413} + m_Layer: 0 + m_Name: highlightAnchor.003 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4185769961175156060 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3006387494640674227} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0.9920766, y: 1.0288258, z: -0.0347642} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2590561584456245742} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!64 &4247479592392523373 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6004201493088789044} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 5 + m_Convex: 1 + m_CookingOptions: 30 + m_Mesh: {fileID: 4300022, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!4 &4268089046573804721 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6435797359462470268} + serializedVersion: 2 + m_LocalRotation: {x: 0.00000013621633, y: 0.905096, z: -0.000000125865, w: 0.42520732} + m_LocalPosition: {x: -2.3136199, y: -0.66151446, z: 0.50435114} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 7119166486829381719} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &4642532271868578956 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8179810329907547395} + - component: {fileID: 1455088385366471267} + - component: {fileID: 9015279149317773823} + - component: {fileID: 1607796130768432570} + m_Layer: 0 + m_Name: wnd + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &4651293638409442919 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1441162320435695677} + m_Layer: 0 + m_Name: animationAnchor.002 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &4680849219148963205 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6302706739155191070} + - component: {fileID: 1884916165} + - component: {fileID: 1884916166} + m_Layer: 0 + m_Name: SlidingDoor + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4914293776580820246 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1399470409057338219} + serializedVersion: 2 + m_LocalRotation: {x: 0.5, y: -0.49999997, z: -0.5, w: -0.5} + m_LocalPosition: {x: -0, y: -0.0000001180379, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 3271767513617999204} + m_Father: {fileID: 7345334598355961312} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!64 &5106260460584101894 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7388158607944762906} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 5 + m_Convex: 1 + m_CookingOptions: 30 + m_Mesh: {fileID: 4300016, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!64 &5191966308643470003 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2733681770876101857} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 5 + m_Convex: 1 + m_CookingOptions: 30 + m_Mesh: {fileID: 4300024, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!33 &5241015756857210826 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2694482714574987048} + m_Mesh: {fileID: 4300000, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!23 &5258278074737671557 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3006387494640674227} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: b18e327865ce74717850a9fa00d61d6a, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!64 &5381014078299772781 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5663755497419489490} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 5 + m_Convex: 1 + m_CookingOptions: 30 + m_Mesh: {fileID: 4300012, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!64 &5494872313710049251 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3006387494640674227} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 5 + m_Convex: 1 + m_CookingOptions: 30 + m_Mesh: {fileID: 4300020, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!1 &5520051320514970037 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3186703855294423644} + - component: {fileID: 1526516045} + - component: {fileID: 1526516044} + m_Layer: 0 + m_Name: Door_Right + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5596421173225246262 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7530153028561895661} + serializedVersion: 2 + m_LocalRotation: {x: 0.000000015454313, y: -0.70710677, z: 0.000000015454312, w: 0.7071068} + m_LocalPosition: {x: -1.0888067, y: 0.97043407, z: 2.1027858} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 172780826922127087} + m_Father: {fileID: 543450652013950231} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!64 &5657825584776022733 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3140191690125254210} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 5 + m_Convex: 1 + m_CookingOptions: 30 + m_Mesh: {fileID: 4300030, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!1 &5663755497419489490 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6826833664794589208} + - component: {fileID: 8295461951754712187} + - component: {fileID: 2943542174511385624} + - component: {fileID: 5381014078299772781} + m_Layer: 0 + m_Name: wnd_sliding_door + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!64 &5735167825942767281 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6611973956703832923} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 5 + m_Convex: 1 + m_CookingOptions: 30 + m_Mesh: {fileID: 4300028, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!1 &5769078734430259581 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 172780826922127087} + m_Layer: 0 + m_Name: highlightAnchor.001 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5811884583841482940 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7388158607944762906} + serializedVersion: 2 + m_LocalRotation: {x: 0.9360078, y: -0.00000057927593, z: 0.3519793, w: -0.00000003444576} + m_LocalPosition: {x: -2.210752, y: 0.66151613, z: 0.86207104} + m_LocalScale: {x: 0.99999976, y: 1, z: 0.99999976} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1441162320435695677} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &6004201493088789044 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7375368130044152401} + - component: {fileID: 6619152687717085965} + - component: {fileID: 1370731719672604263} + - component: {fileID: 4247479592392523373} + m_Layer: 0 + m_Name: Wheels.002 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!33 &6063279496900936839 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3115097983429087125} + m_Mesh: {fileID: 4300002, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!33 &6106411283768265515 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3006387494640674227} + m_Mesh: {fileID: 4300020, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!23 &6241182156023366564 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3140191690125254210} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 1b921feeacddd4a24ba5661d0ce5d33e, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &6252852214270557190 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3271767513617999204} + m_Layer: 0 + m_Name: animationAnchor.003 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &6291292912582762050 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 95317135125387569} + - component: {fileID: 1946040353} + - component: {fileID: 1946040352} + m_Layer: 0 + m_Name: Baggage + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6302706739155191070 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4680849219148963205} + serializedVersion: 2 + m_LocalRotation: {x: 0.000000015454313, y: -0.70710677, z: 0.000000015454312, w: 0.7071068} + m_LocalPosition: {x: -1.2138957, y: 0.3600602, z: -1.4809437} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 2707615149424617030} + m_Father: {fileID: 543450652013950231} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &6435797359462470268 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4268089046573804721} + - component: {fileID: 3623644531452767477} + - component: {fileID: 6501821075990103296} + - component: {fileID: 7984562176574974897} + m_Layer: 0 + m_Name: door_ext_l + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &6438736019791643338 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2707615149424617030} + m_Layer: 0 + m_Name: highlightAnchor + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!23 &6501821075990103296 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6435797359462470268} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 4664d12bb5ac04e998b3008d8f2803dc, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &6553321204619296590 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6843584649582098237} + m_Mesh: {fileID: 4300018, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!1 &6611973956703832923 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3519659678996002217} + - component: {fileID: 7899167285067355741} + - component: {fileID: 8094023842156325340} + - component: {fileID: 5735167825942767281} + m_Layer: 0 + m_Name: trunk_model + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!33 &6619152687717085965 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6004201493088789044} + m_Mesh: {fileID: 4300022, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!64 &6673732408918896394 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3423717910921782154} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 5 + m_Convex: 1 + m_CookingOptions: 30 + m_Mesh: {fileID: 4300026, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!4 &6826833664794589208 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5663755497419489490} + serializedVersion: 2 + m_LocalRotation: {x: 0.000000099748036, y: 0.7071067, z: -0.00000009974802, w: 0.7071068} + m_LocalPosition: {x: 0.0012955666, y: 1.3280718, z: 0.007947803} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 9120391027429686458} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &6843584649582098237 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1920425508572067436} + - component: {fileID: 6553321204619296590} + - component: {fileID: 868337851955314430} + - component: {fileID: 7151003084770373271} + m_Layer: 0 + m_Name: wnd_r + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7119166486829381719 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9038607207086042419} + serializedVersion: 2 + m_LocalRotation: {x: -3.1711317e-15, y: -0.00000007093701, z: 0.000000026011023, w: 1} + m_LocalPosition: {x: -0, y: 0.00000010719789, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4268089046573804721} + - {fileID: 8179810329907547395} + m_Father: {fileID: 172780826922127087} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!64 &7151003084770373271 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6843584649582098237} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 5 + m_Convex: 1 + m_CookingOptions: 30 + m_Mesh: {fileID: 4300018, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!4 &7345334598355961312 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9058890211913245811} + serializedVersion: 2 + m_LocalRotation: {x: 1.7112914e-15, y: 1, z: -0.000000021855694, w: 0.0000000754979} + m_LocalPosition: {x: -6.344926e-18, y: 2.246028, z: -2.7539887} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4914293776580820246} + m_Father: {fileID: 543450652013950231} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &7375368130044152401 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6004201493088789044} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.9920766, y: -1.7450808, z: -0.034764405} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2590561584456245742} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &7388158607944762906 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5811884583841482940} + - component: {fileID: 7865082802916841334} + - component: {fileID: 8096064714667366686} + - component: {fileID: 5106260460584101894} + m_Layer: 0 + m_Name: exterior.001 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &7530153028561895661 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5596421173225246262} + - component: {fileID: 1686344447} + - component: {fileID: 1686344449} + m_Layer: 0 + m_Name: Door_Left + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!33 &7544692034629471860 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2733681770876101857} + m_Mesh: {fileID: 4300024, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!1 &7703323664971899662 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2590561584456245742} + m_Layer: 0 + m_Name: highlightAnchor.004 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7842203396053052413 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3815856358122545974} + serializedVersion: 2 + m_LocalRotation: {x: -0.000000059604645, y: 0.0000000437114, z: 1, w: -0.00000019470718} + m_LocalPosition: {x: -0, y: -0.000000011742969, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1441162320435695677} + m_Father: {fileID: 3186703855294423644} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &7865082802916841334 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7388158607944762906} + m_Mesh: {fileID: 4300016, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!33 &7899167285067355741 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6611973956703832923} + m_Mesh: {fileID: 4300028, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!64 &7984562176574974897 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6435797359462470268} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 5 + m_Convex: 1 + m_CookingOptions: 30 + m_Mesh: {fileID: 4300006, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!23 &8094023842156325340 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6611973956703832923} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 4664d12bb5ac04e998b3008d8f2803dc, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!23 &8096064714667366686 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7388158607944762906} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 4664d12bb5ac04e998b3008d8f2803dc, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!4 &8179810329907547395 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4642532271868578956} + serializedVersion: 2 + m_LocalRotation: {x: 0.00000013621633, y: 0.905096, z: -0.000000125865, w: 0.42520732} + m_LocalPosition: {x: -2.3136199, y: -0.66151446, z: 0.50435114} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 7119166486829381719} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &8214177323173603408 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3423717910921782154} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0.9920766, y: -1.7450808, z: -0.034764405} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2590561584456245742} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &8272619152164736657 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1139639555779975955} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1139714121598866790} + m_Father: {fileID: 95317135125387569} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &8295461951754712187 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5663755497419489490} + m_Mesh: {fileID: 4300012, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!33 &8451929593771308738 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3140191690125254210} + m_Mesh: {fileID: 4300030, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!64 &8467988917364075122 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1834832845902164278} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 5 + m_Convex: 1 + m_CookingOptions: 30 + m_Mesh: {fileID: 4300014, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!23 &8511394294721429138 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2694482714574987048} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 1b921feeacddd4a24ba5661d0ce5d33e, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!4 &8614371467897437538 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1024366685134399085} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.39952204, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 2590561584456245742} + m_Father: {fileID: 543450652013950231} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &8728280931639377909 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3423717910921782154} + m_Mesh: {fileID: 4300026, guid: c9da341d2d3a64cf8b2adc9bba8ec9ec, type: 3} +--- !u!4 &8884403382647605949 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1454953783326346074} + serializedVersion: 2 + m_LocalRotation: {x: 0.000000099748036, y: 0.7071067, z: -0.00000009974802, w: 0.7071068} + m_LocalPosition: {x: -0, y: -0.00000012575286, z: 0.00000011920929} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 9120391027429686458} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &8949606274296942739 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3115097983429087125} + serializedVersion: 2 + m_LocalRotation: {x: 0.00000008146034, y: 0, z: -0, w: 1} + m_LocalPosition: {x: -0, y: 0.30891964, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 543450652013950231} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &8955083193884922905 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3140191690125254210} + serializedVersion: 2 + m_LocalRotation: {x: 0.54812384, y: 0.54812384, z: 0.4467217, w: 0.44672164} + m_LocalPosition: {x: 2.3065257, y: 0.0000002092075, z: -2.4529128} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3271767513617999204} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &9015279149317773823 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4642532271868578956} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 1b921feeacddd4a24ba5661d0ce5d33e, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &9038607207086042419 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7119166486829381719} + m_Layer: 0 + m_Name: animationAnchor.001 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9058890211913245811 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7345334598355961312} + - component: {fileID: 1686344452} + - component: {fileID: 1686344451} + m_Layer: 0 + m_Name: Door_Trunk + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &9120391027429686458 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3759489000277892601} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: -2.3140616e-30, z: -0, w: 1} + m_LocalPosition: {x: -0, y: -0.00000000654358, z: -0.00000011920929} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 8884403382647605949} + - {fileID: 6826833664794589208} + m_Father: {fileID: 2707615149424617030} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 182366649} + - {fileID: 543450652013950231} + - {fileID: 384398582} + - {fileID: 69086297} + - {fileID: 843756322} + - {fileID: 460664917} + - {fileID: 2027684627} diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Demo_URP.unity.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Demo_URP.unity.meta new file mode 100644 index 00000000..6135544f --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Demo_URP.unity.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 15054139658a5445689224c71f805b10 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Demo_URP.unity + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts.meta new file mode 100644 index 00000000..8cab0ae1 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4788bd8dfc445485781b23a4cf21188b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Animatable.cs b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Animatable.cs new file mode 100644 index 00000000..ebcf49dd --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Animatable.cs @@ -0,0 +1,13 @@ +#if PRIME_TWEEN_INSTALLED +using PrimeTween; +using UnityEngine; + +namespace PrimeTweenDemo { + public abstract class Animatable : MonoBehaviour { + public virtual void OnClick() { + } + + public abstract Sequence Animate(bool toEndValue); + } +} +#endif \ No newline at end of file diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Animatable.cs.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Animatable.cs.meta new file mode 100644 index 00000000..3d841c24 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Animatable.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: f631a276db10467c9860e2814855df25 +timeCreated: 1695283968 +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Scripts/Animatable.cs + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Baggage.cs b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Baggage.cs new file mode 100644 index 00000000..14ab7090 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Baggage.cs @@ -0,0 +1,29 @@ +#if PRIME_TWEEN_INSTALLED +using PrimeTween; +using UnityEngine; + +namespace PrimeTweenDemo { + public class Baggage : Animatable { + [SerializeField] Transform animationAnchor; + Sequence sequence; + + public override void OnClick() { + PlayFlipAnimation(); + } + + public override Sequence Animate(bool _) { + return PlayFlipAnimation(); + } + + Sequence PlayFlipAnimation() { + if (!sequence.isAlive) { + const float jumpDuration = 0.3f; + sequence = Tween.LocalPositionZ(animationAnchor, 0.2f, jumpDuration) + .Chain(Tween.LocalEulerAngles(animationAnchor, Vector3.zero, new Vector3(0, 360, 0), 0.9f, Ease.InOutBack)) + .Chain(Tween.LocalPositionZ(animationAnchor, 0, jumpDuration)); + } + return sequence; + } + } +} +#endif \ No newline at end of file diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Baggage.cs.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Baggage.cs.meta new file mode 100644 index 00000000..9de6c66c --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Baggage.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 27b542649ab4a463aa343c437387783e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Scripts/Baggage.cs + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/CameraController.cs b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/CameraController.cs new file mode 100644 index 00000000..439cb9a8 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/CameraController.cs @@ -0,0 +1,55 @@ +#if PRIME_TWEEN_INSTALLED && UNITY_UGUI_INSTALLED +using PrimeTween; +using UnityEngine; +using UnityEngine.EventSystems; + +namespace PrimeTweenDemo { + public class CameraController : MonoBehaviour { + [SerializeField] HighlightedElementController highlightedElementController; + [SerializeField] SwipeTutorial swipeTutorial; + [SerializeField] Camera mainCamera; + [SerializeField, Range(0f, 1f)] float cameraShakeStrength = 0.4f; + float currentAngle; + Vector2? inputBeginPos; + bool isAnimating; + float curRotationSpeed; + + void OnEnable() { + currentAngle = transform.localEulerAngles.y; + isAnimating = true; + Tween.Custom(this, 0, 5, 2, (target, val) => target.curRotationSpeed = val); + } + + void Update() { + if (isAnimating) { + currentAngle += curRotationSpeed * Time.deltaTime; + transform.localEulerAngles = new Vector3(0f, currentAngle); + } + if (highlightedElementController.current == null && InputController.GetDown() && !EventSystem.current.IsPointerOverGameObject()) { + inputBeginPos = InputController.screenPosition; + } + if (InputController.GetUp()) { + inputBeginPos = null; + } + if (inputBeginPos.HasValue) { + var deltaMove = InputController.screenPosition - inputBeginPos.Value; + if (Mathf.Abs(deltaMove.x) / Screen.width > 0.05f) { + isAnimating = false; + inputBeginPos = null; + currentAngle += Mathf.Sign(deltaMove.x) * 45f; + Tween.LocalRotation(transform, new Vector3(0f, currentAngle), 1.5f, Ease.OutCubic); + swipeTutorial.Hide(); + } + } + } + + public void ShakeCamera() { + Shake(); + } + + internal Sequence Shake(float startDelay = 0) { + return Tween.ShakeCamera(mainCamera, cameraShakeStrength, startDelay: startDelay); + } + } +} +#endif diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/CameraController.cs.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/CameraController.cs.meta new file mode 100644 index 00000000..28a63a80 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/CameraController.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 3f2f29997e7148b98e1d84f3de1011bc +timeCreated: 1682326446 +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Scripts/CameraController.cs + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/CameraProjectionMatrixAnimation.cs b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/CameraProjectionMatrixAnimation.cs new file mode 100644 index 00000000..972d8dd9 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/CameraProjectionMatrixAnimation.cs @@ -0,0 +1,40 @@ +#if PRIME_TWEEN_INSTALLED +using PrimeTween; +using UnityEngine; + +namespace PrimeTweenDemo { + public class CameraProjectionMatrixAnimation : MonoBehaviour { + [SerializeField] Camera mainCamera; + float interpolationFactor; + bool isOrthographic; + Tween tween; + + public void AnimateCameraProjection() { + isOrthographic = !isOrthographic; + tween.Stop(); + tween = Tween.Custom(this, interpolationFactor, isOrthographic ? 1 : 0, 0.6f, ease: Ease.InOutSine, onValueChange: (target, t) => { + target.InterpolateProjectionMatrix(t); + }) + .OnComplete(this, target => { + target.mainCamera.orthographic = target.isOrthographic; + target.mainCamera.ResetProjectionMatrix(); + }); + } + + void InterpolateProjectionMatrix(float _interpolationFactor) { + interpolationFactor = _interpolationFactor; + float aspect = (float)Screen.width / Screen.height; + var orthographicSize = mainCamera.orthographicSize; + var perspectiveMatrix = Matrix4x4.Perspective(mainCamera.fieldOfView, aspect, mainCamera.nearClipPlane, mainCamera.farClipPlane); + var orthoMatrix = Matrix4x4.Ortho(-orthographicSize * aspect, orthographicSize * aspect, -orthographicSize, orthographicSize, mainCamera.nearClipPlane, mainCamera.farClipPlane); + Matrix4x4 projectionMatrix = default; + for (int i = 0; i < 16; i++) { + projectionMatrix[i] = Mathf.Lerp(perspectiveMatrix[i], orthoMatrix[i], _interpolationFactor); + } + mainCamera.projectionMatrix = projectionMatrix; + } + + public bool IsAnimating => tween.isAlive; + } +} +#endif \ No newline at end of file diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/CameraProjectionMatrixAnimation.cs.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/CameraProjectionMatrixAnimation.cs.meta new file mode 100644 index 00000000..f80ed10a --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/CameraProjectionMatrixAnimation.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 900e84e1426b4fc8a386a58aaee3b4ba +timeCreated: 1685260544 +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Scripts/CameraProjectionMatrixAnimation.cs + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Demo.cs b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Demo.cs new file mode 100644 index 00000000..349f7b01 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Demo.cs @@ -0,0 +1,136 @@ +#if PRIME_TWEEN_INSTALLED && UNITY_UGUI_INSTALLED +using PrimeTween; +using UnityEngine.UI; +#endif +using UnityEngine; + +namespace PrimeTweenDemo { + public class Demo : MonoBehaviour { + #if PRIME_TWEEN_INSTALLED && UNITY_UGUI_INSTALLED + [SerializeField] AnimateAllType animateAllType; enum AnimateAllType { Sequence, Async, Coroutine } + [SerializeField] Slider sequenceTimelineSlider; + [SerializeField] Text pausedLabel; + [SerializeField] Button animateAllPartsButton; + [SerializeField] TypewriterAnimatorExample typewriterAnimatorExample; + [SerializeField] Animatable[] animatables; + [SerializeField] Wheels wheels; + [SerializeField, Range(0.5f, 5f)] float timeScale = 1; + bool isAnimatingWithCoroutineOrAsync; + public Sequence animateAllSequence; + public static Demo instance { get; private set; } + + void Awake() { + instance = this; + PrimeTweenConfig.SetTweensCapacity(100); + } + + void OnEnable() { + sequenceTimelineSlider.fillRect.gameObject.SetActive(false); + sequenceTimelineSlider.onValueChanged.AddListener(SequenceTimelineSliderChanged); + } + + void OnDisable() => sequenceTimelineSlider.onValueChanged.RemoveListener(SequenceTimelineSliderChanged); + + void OnDestroy() => instance = null; + + void SequenceTimelineSliderChanged(float sliderValue) { + if (!notifySliderChanged) { + return; + } + if (!animateAllSequence.isAlive) { + wheels.OnClick(); + } + animateAllSequence.isPaused = true; + animateAllSequence.progressTotal = sliderValue; + } + + bool notifySliderChanged = true; + + void UpdateSlider() { + var isSliderVisible = animateAllType == AnimateAllType.Sequence && !isAnimatingWithCoroutineOrAsync; + sequenceTimelineSlider.gameObject.SetActive(isSliderVisible); + if (!isSliderVisible) { + return; + } + pausedLabel.gameObject.SetActive(animateAllSequence.isAlive && animateAllSequence.isPaused); + var isSequenceAlive = animateAllSequence.isAlive; + sequenceTimelineSlider.handleRect.gameObject.SetActive(isSequenceAlive); + if (isSequenceAlive) { + notifySliderChanged = false; + sequenceTimelineSlider.value = animateAllSequence.progressTotal; // Unity 2018 doesn't have SetValueWithoutNotify(), so use notifySliderChanged instead + notifySliderChanged = true; + } + } + + void Update() { + Time.timeScale = timeScale; + + animateAllPartsButton.GetComponent().enabled = !isAnimatingWithCoroutineOrAsync; + animateAllPartsButton.GetComponentInChildren().enabled = !isAnimatingWithCoroutineOrAsync; + + UpdateSlider(); + } + + public void AnimateAll(bool toEndValue) { + if (isAnimatingWithCoroutineOrAsync) { + return; + } + switch (animateAllType) { + case AnimateAllType.Sequence: + AnimateAllSequence(toEndValue); + break; + case AnimateAllType.Async: + AnimateAllAsync(toEndValue); + break; + case AnimateAllType.Coroutine: + StartCoroutine(AnimateAllCoroutine(toEndValue)); + break; + } + } + + /// Tweens and sequences can be grouped with and chained to other tweens and sequences. + /// The advantage of using this method instead of and is the ability to stop/complete/pause the combined sequence. + /// Also, this method doesn't generate garbage related to starting a coroutine or awaiting an async method. + void AnimateAllSequence(bool toEndValue) { + if (animateAllSequence.isAlive) { + animateAllSequence.isPaused = !animateAllSequence.isPaused; + return; + } + animateAllSequence = Sequence.Create(); + #if TEXT_MESH_PRO_INSTALLED + animateAllSequence.Group(typewriterAnimatorExample.Animate()); + #endif + float delay = 0f; + foreach (var animatable in animatables) { + animateAllSequence.Insert(delay, animatable.Animate(toEndValue)); + delay += 0.6f; + } + } + + /// Tweens and sequences can be awaited in async methods. + async void AnimateAllAsync(bool toEndValue) { + isAnimatingWithCoroutineOrAsync = true; + foreach (var animatable in animatables) { + await animatable.Animate(toEndValue); + } + isAnimatingWithCoroutineOrAsync = false; + } + + /// Tweens and sequences can also be used in coroutines with the help of ToYieldInstruction() method. + System.Collections.IEnumerator AnimateAllCoroutine(bool toEndValue) { + isAnimatingWithCoroutineOrAsync = true; + foreach (var animatable in animatables) { + yield return animatable.Animate(toEndValue).ToYieldInstruction(); + } + isAnimatingWithCoroutineOrAsync = false; + } + #else // PRIME_TWEEN_INSTALLED + void Awake() { + Debug.LogError("Please install PrimeTween via 'Assets/Plugins/PrimeTween/PrimeTweenInstaller'."); + #if !UNITY_2019_1_OR_NEWER + Debug.LogError("And add the 'PRIME_TWEEN_INSTALLED' define to the 'Project Settings/Player/Scripting Define Symbols' to run the Demo in Unity 2018."); + #endif + } + #endif + } +} diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Demo.cs.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Demo.cs.meta new file mode 100644 index 00000000..c2bc4934 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Demo.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 945298e218f9841b08c8270c494cb200 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Scripts/Demo.cs + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/DirectionalLightController.cs b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/DirectionalLightController.cs new file mode 100644 index 00000000..0c863954 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/DirectionalLightController.cs @@ -0,0 +1,35 @@ +#if PRIME_TWEEN_INSTALLED +using PrimeTween; +using UnityEngine; + +namespace PrimeTweenDemo { + public class DirectionalLightController : MonoBehaviour { + [SerializeField] Light directionalLight; + [SerializeField] Camera mainCamera; + [SerializeField] Color startColor; + [SerializeField] Color endColor; + float angleX; + float angleY; + + void OnEnable() { + // This overload is simpler, but allocates small amount of garbage because 'this' reference is captured in a closure. + // It ok to use it once in a while but for hot code paths consider using the overload that accepts 'target' as first parameter. + var xRotationSettings = new TweenSettings(45, 10, 10, Ease.Linear, -1, CycleMode.Yoyo); + Tween.Custom(xRotationSettings, newX => angleX = newX); + + // This overload is more verbose, but doesn't allocate garbage. + var yRotationSettings = new TweenSettings(45, 405, 20, Ease.Linear, -1); + Tween.Custom(this, yRotationSettings, (target, newY) => target.angleY = newY); + + var colorSettings = new TweenSettings(startColor, endColor, 10, Ease.InCirc, -1, CycleMode.Rewind); + Tween.LightColor(directionalLight, colorSettings); + Tween.CameraBackgroundColor(mainCamera, colorSettings); + Tween.Custom(colorSettings, color => RenderSettings.fogColor = color); + } + + void Update() { + transform.localEulerAngles = new Vector3(angleX, angleY); + } + } +} +#endif \ No newline at end of file diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/DirectionalLightController.cs.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/DirectionalLightController.cs.meta new file mode 100644 index 00000000..cea9343a --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/DirectionalLightController.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: db622a6d0e0fa4b68852ef1a7fc60dba +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Scripts/DirectionalLightController.cs + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Door.cs b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Door.cs new file mode 100644 index 00000000..dad56264 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Door.cs @@ -0,0 +1,29 @@ +#if PRIME_TWEEN_INSTALLED && UNITY_UGUI_INSTALLED +using PrimeTween; +using UnityEngine; + +namespace PrimeTweenDemo { + public class Door : Animatable { + [SerializeField] CameraController cameraController; + [SerializeField] Transform animationAnchor; + bool isClosed; + + public override void OnClick() { + Animate(!isClosed); + } + + public override Sequence Animate(bool _isClosed) { + if (isClosed == _isClosed) { + return Sequence.Create(); + } + isClosed = _isClosed; + var rotationTween = Tween.LocalRotation(animationAnchor, _isClosed ? new Vector3(0, -90) : Vector3.zero, 0.7f, Ease.InOutElastic); + var sequence = Sequence.Create(rotationTween); + if (_isClosed) { + sequence.Group(cameraController.Shake(0.5f)); + } + return sequence; + } + } +} +#endif \ No newline at end of file diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Door.cs.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Door.cs.meta new file mode 100644 index 00000000..d261e214 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Door.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 4efa7d4d94464bb0b3e6ea597eb13637 +timeCreated: 1682159642 +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Scripts/Door.cs + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Headlights.cs b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Headlights.cs new file mode 100644 index 00000000..ba3ef5c0 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Headlights.cs @@ -0,0 +1,25 @@ +#if PRIME_TWEEN_INSTALLED +using PrimeTween; +using UnityEngine; + +namespace PrimeTweenDemo { + public class Headlights : Animatable { + [SerializeField] AnimationCurve ease; + [SerializeField] Light[] lights; + bool isOn; + + public override void OnClick() { + Animate(!isOn); + } + + public override Sequence Animate(bool _isOn) { + isOn = _isOn; + var sequence = Sequence.Create(); + foreach (var _light in lights) { + sequence.Group(Tween.LightIntensity(_light, _isOn ? 0.7f : 0, 0.8f, ease)); + } + return sequence; + } + } +} +#endif \ No newline at end of file diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Headlights.cs.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Headlights.cs.meta new file mode 100644 index 00000000..be061a4f --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Headlights.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 7bc81275df8d244a1a7568f9443b5e93 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Scripts/Headlights.cs + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/HighlightableElement.cs b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/HighlightableElement.cs new file mode 100644 index 00000000..6d63d0ea --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/HighlightableElement.cs @@ -0,0 +1,17 @@ +#if PRIME_TWEEN_INSTALLED +using UnityEngine; + +namespace PrimeTweenDemo { + public class HighlightableElement : MonoBehaviour { + [SerializeField] public Transform highlightAnchor; + public MeshRenderer[] models { get; private set; } + + void OnEnable() { + models = GetComponentsInChildren(); + foreach (var mr in models) { + _ = mr.material; // copy shared material + } + } + } +} +#endif \ No newline at end of file diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/HighlightableElement.cs.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/HighlightableElement.cs.meta new file mode 100644 index 00000000..6f58f553 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/HighlightableElement.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 5fbd7d6a5982d440282a82998473a306 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Scripts/HighlightableElement.cs + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/HighlightedElementController.cs b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/HighlightedElementController.cs new file mode 100644 index 00000000..fd835c0a --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/HighlightedElementController.cs @@ -0,0 +1,67 @@ +#if PRIME_TWEEN_INSTALLED +using JetBrains.Annotations; +using PrimeTween; +using UnityEngine; + +namespace PrimeTweenDemo { + public class HighlightedElementController : MonoBehaviour { + [SerializeField] Camera mainCamera; + [SerializeField] CameraProjectionMatrixAnimation cameraProjectionMatrixAnimation; + [CanBeNull] public HighlightableElement current { get; private set; } + + void Awake() { + #if UNITY_2019_1_OR_NEWER && !PHYSICS_MODULE_INSTALLED + Debug.LogError("Please install the package needed for Physics.Raycast(): 'Package Manager/Packages/Built-in/Physics' (com.unity.modules.physics)."); + #endif + } + + void Update() { + if (cameraProjectionMatrixAnimation.IsAnimating) { + return; + } + if (InputController.touchSupported && !InputController.Get()) { + SetCurrentHighlighted(null); + return; + } + var ray = mainCamera.ScreenPointToRay(InputController.screenPosition); + var highlightableElement = RaycastHighlightableElement(ray); + SetCurrentHighlighted(highlightableElement); + + if (current != null && InputController.GetDown()) { + current.GetComponent().OnClick(); + } + } + + [CanBeNull] + static HighlightableElement RaycastHighlightableElement(Ray ray) { + #if !UNITY_2019_1_OR_NEWER || PHYSICS_MODULE_INSTALLED + // If you're seeing a compilation error on the next line, please install the package needed for Physics.Raycast(): 'Package Manager/Packages/Built-in/Physics' (com.unity.modules.physics). + return Physics.Raycast(ray, out var hit) ? hit.collider.GetComponentInParent() : null; + #else + return null; + #endif + } + + void SetCurrentHighlighted([CanBeNull] HighlightableElement newHighlighted) { + if (newHighlighted != current) { + if (current != null) { + AnimateHighlightedElement(current, false); + } + current = newHighlighted; + if (newHighlighted != null) { + AnimateHighlightedElement(newHighlighted, true); + } + } + } + + static readonly int emissionColorPropId = Shader.PropertyToID("_EmissionColor"); + + static void AnimateHighlightedElement([NotNull] HighlightableElement highlightable, bool isHighlighted) { + Tween.LocalPositionZ(highlightable.highlightAnchor, isHighlighted ? 0.08f : 0, 0.3f); + foreach (var model in highlightable.models) { + Tween.MaterialColor(model.material, emissionColorPropId, isHighlighted ? Color.white * 0.25f : Color.black, 0.2f, Ease.OutQuad); + } + } + } +} +#endif diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/HighlightedElementController.cs.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/HighlightedElementController.cs.meta new file mode 100644 index 00000000..c6c86dd3 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/HighlightedElementController.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9e831710f8fb47e4a09c640d573d1358 +timeCreated: 1682327543 +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Scripts/HighlightedElementController.cs + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/InputController.cs b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/InputController.cs new file mode 100644 index 00000000..74a81ee3 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/InputController.cs @@ -0,0 +1,114 @@ +using UnityEngine; +#if INPUT_SYSTEM_INSTALLED && ENABLE_INPUT_SYSTEM +using UnityEngine.InputSystem; +using UnityEngine.InputSystem.EnhancedTouch; +using UnityEngine.InputSystem.UI; +using TouchPhase = UnityEngine.InputSystem.TouchPhase; +using Touch = UnityEngine.InputSystem.EnhancedTouch.Touch; +#endif + +namespace PrimeTweenDemo { + public class InputController : MonoBehaviour { + void Awake() { + if (isNewInputSystemEnabled && !isLegacyInputManagerEnabled) { + gameObject.SetActive(false); + #if INPUT_SYSTEM_INSTALLED && ENABLE_INPUT_SYSTEM + var inputModule = gameObject.AddComponent(); + inputModule.pointerBehavior = UIPointerBehavior.AllPointersAsIs; + EnhancedTouchSupport.Enable(); + #endif + gameObject.SetActive(true); + } else { + #if UNITY_UGUI_INSTALLED + gameObject.AddComponent(); + #endif + } + } + + static bool isNewInputSystemEnabled { + get { + #if INPUT_SYSTEM_INSTALLED && ENABLE_INPUT_SYSTEM + return true; + #else + return false; + #endif + } + } + + static bool isLegacyInputManagerEnabled { + get { + #if ENABLE_LEGACY_INPUT_MANAGER + return true; + #else + return false; + #endif + } + } + + public static bool touchSupported { + get { + #if INPUT_SYSTEM_INSTALLED && ENABLE_INPUT_SYSTEM + if (isNewInputSystemEnabled) { + return Touchscreen.current != null; + } + #endif + return Input.touchSupported; + } + } + + public static bool GetDown() { + #if INPUT_SYSTEM_INSTALLED && ENABLE_INPUT_SYSTEM + if (Mouse.current != null) { + return Mouse.current.leftButton.wasPressedThisFrame; + } + if (isNewInputSystemEnabled) { + return Touch.activeTouches.Count > 0 && Touch.activeTouches[0].phase == TouchPhase.Began; + } + #endif + return Input.GetMouseButtonDown(0); + } + + public static bool Get() { + #if INPUT_SYSTEM_INSTALLED && ENABLE_INPUT_SYSTEM + if (isNewInputSystemEnabled) { + if (Mouse.current != null) { + return Mouse.current.leftButton.isPressed; + } + if (Touch.activeTouches.Count == 0) { + return false; + } + var phase = Touch.activeTouches[0].phase; + return phase == TouchPhase.Stationary || phase == TouchPhase.Moved; + } + #endif + return Input.GetMouseButtonDown(0); + } + + public static bool GetUp() { + #if INPUT_SYSTEM_INSTALLED && ENABLE_INPUT_SYSTEM + if (isNewInputSystemEnabled) { + if (Mouse.current != null) { + return Mouse.current.leftButton.wasReleasedThisFrame; + } + return Touch.activeTouches.Count > 0 && Touch.activeTouches[0].phase == TouchPhase.Ended; + } + #endif + return Input.GetMouseButtonUp(0); + } + + public static Vector2 screenPosition { + get { + #if INPUT_SYSTEM_INSTALLED && ENABLE_INPUT_SYSTEM + if (isNewInputSystemEnabled) { + if (Mouse.current != null) { + return Mouse.current.position.ReadValue(); + } + var activeTouches = Touch.activeTouches; + return activeTouches.Count > 0 ? activeTouches[0].screenPosition : Vector2.zero; + } + #endif + return Input.mousePosition; + } + } + } +} diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/InputController.cs.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/InputController.cs.meta new file mode 100644 index 00000000..48579b4d --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/InputController.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: ea1502cb33ab4d4ca1fedbdde163c980 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Scripts/InputController.cs + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/JumpAnimation.cs b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/JumpAnimation.cs new file mode 100644 index 00000000..7d48f59c --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/JumpAnimation.cs @@ -0,0 +1,21 @@ +#if PRIME_TWEEN_INSTALLED +using PrimeTween; +using UnityEngine; + +namespace PrimeTweenDemo { + public class JumpAnimation : MonoBehaviour { + [SerializeField] Transform target; + Sequence sequence; + + public void PlayAnimation() { + if (!sequence.isAlive) { + const float jumpDuration = 0.3f; + sequence = Tween.Scale(target, new Vector3(1.1f, 0.8f, 1.1f), 0.15f, Ease.OutQuad, 2, CycleMode.Yoyo) + .Chain(Tween.LocalPositionY(target, 1, jumpDuration)) + .Chain(Tween.LocalEulerAngles(target, Vector3.zero, new Vector3(0, 360), 1.5f, Ease.InOutBack)) + .Chain(Tween.LocalPositionY(target, 0, jumpDuration)); + } + } + } +} +#endif \ No newline at end of file diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/JumpAnimation.cs.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/JumpAnimation.cs.meta new file mode 100644 index 00000000..2982853d --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/JumpAnimation.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 453932c77a72487599d5103bcde610da +timeCreated: 1685366944 +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Scripts/JumpAnimation.cs + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/MeasureAllocations.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/MeasureAllocations.meta new file mode 100644 index 00000000..554c673d --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/MeasureAllocations.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8add66110a942479c9b69ed4eb7e777e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/MeasureAllocations/DebugInfo.cs b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/MeasureAllocations/DebugInfo.cs new file mode 100644 index 00000000..9f8a7aee --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/MeasureAllocations/DebugInfo.cs @@ -0,0 +1,67 @@ +#if PRIME_TWEEN_INSTALLED && UNITY_UGUI_INSTALLED +#if UNITY_EDITOR && UNITY_2019_1_OR_NEWER +using UnityEngine.Profiling; +#endif +using PrimeTween; +using UnityEngine; +using UnityEngine.UI; + +namespace PrimeTweenDemo { + /// + /// PrimeTween uses static delegates (lambdas with no external captures) to play animations. + /// The first time a particular animation is played, C# runtime caches the delegate for this animation, and the GC.Alloc is shown in Profiler. + /// Such allocations are not technically 'garbage' because they are not subject to garbage collection. + /// All subsequent calls will use the cached delegate and will never allocate again. + /// + /// To replicate '0B' heap allocations shown in the promo video: + /// Disable the 'Project Settings/Editor/Enter Play Mode Settings/Reload Domain' setting. + /// Enable Profiler with Deep Profile. + /// Run the Demo and play all animations at least once. This will cache the aforementioned static delegates. + /// Restart the Demo scene and observe that PrimeTween doesn't allocate heap memory after static delegates warm-up. + /// + public class DebugInfo : MonoBehaviour { + #pragma warning disable 0414 + [SerializeField] MeasureMemoryAllocations measureMemoryAllocations; + [SerializeField] Text tweensCountText; + [SerializeField] Text gcAllocText; + #pragma warning restore 0414 + #if UNITY_EDITOR && UNITY_2019_1_OR_NEWER + long curTweensCount = -1; + int? curGCAlloc; + + void Start() { + gcAllocText.text = string.Empty; + if (shouldDisable()) { + gameObject.SetActive(false); + } + if (Profiler.enabled && !UnityEditorInternal.ProfilerDriver.deepProfiling) { + Debug.LogWarning("Please enable 'Deep Profile' for more accurate memory allocation measurements."); + } + } + + static bool shouldDisable() { + if (!Application.isEditor) { + return true; + } + if (UnityEditor.EditorApplication.isPaused) { + return false; // Profiler.enabled returns false if scene is started paused in Unity 2021.3.26 + } + return !Profiler.enabled; + } + + void Update() { + var newTweensCount = PrimeTweenManager.Instance.lastId; + if (curTweensCount != newTweensCount) { + curTweensCount = newTweensCount; + tweensCountText.text = $"Animations: {newTweensCount}"; + } + var newGCAlloc = measureMemoryAllocations.gcAllocTotal; + if (newGCAlloc.HasValue && curGCAlloc != newGCAlloc.Value) { + curGCAlloc = newGCAlloc.Value; + gcAllocText.text = $"Heap allocations: {UnityEditor.EditorUtility.FormatBytes(newGCAlloc.Value)}"; + } + } + #endif + } +} +#endif diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/MeasureAllocations/DebugInfo.cs.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/MeasureAllocations/DebugInfo.cs.meta new file mode 100644 index 00000000..17df4f3a --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/MeasureAllocations/DebugInfo.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: c0ef97c778caf4b70aea23911ded98ab +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Scripts/MeasureAllocations/DebugInfo.cs + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/MeasureAllocations/MeasureMemoryAllocations.cs b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/MeasureAllocations/MeasureMemoryAllocations.cs new file mode 100644 index 00000000..238f067a --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/MeasureAllocations/MeasureMemoryAllocations.cs @@ -0,0 +1,152 @@ +using System.Collections.Generic; +using UnityEngine; +#if UNITY_EDITOR && UNITY_2019_1_OR_NEWER +using System.Linq; +using UnityEditor; +using UnityEditor.Profiling; +using UnityEditorInternal; +using UnityEngine.Profiling; +#endif + +namespace PrimeTweenDemo { + public class MeasureMemoryAllocations : MonoBehaviour { + #pragma warning disable 0414 + [SerializeField] bool logAllocations; + [SerializeField] bool logFiltered; + [SerializeField] bool logIgnored; + [SerializeField] List filterAllocations = new List(); + [SerializeField] List ignoreAllocations = new List(); + #pragma warning restore 0414 + #if UNITY_EDITOR && UNITY_2019_1_OR_NEWER + public int? gcAllocTotal { get; private set; } + readonly Stack stack = new Stack(); + readonly List childrenBuffer = new List(); + readonly List fullIdPathBuffer = new List(); + readonly List ignoredPaths = new List(); + readonly List filteredPaths = new List(); + int lastProcessedFrame = -1; + + void Awake() { + filterAllocations.Add("PrimeTween.Runtime"); + filterAllocations.Add("PrimeTweenDemo"); + } + + void OnEnable() { + ProfilerDriver.ClearAllFrames(); + } + + void Update() { + if (!Profiler.enabled) { + return; + } + var startFrame = Mathf.Max(lastProcessedFrame + 1, ProfilerDriver.firstFrameIndex); + for (int i = startFrame; i <= ProfilerDriver.lastFrameIndex; i++) { + var gcAlloc = calcGCAllocInFrame(i); + if (!gcAlloc.HasValue) { + break; + } + lastProcessedFrame = i; + if (gcAllocTotal.HasValue) { + gcAllocTotal += gcAlloc.Value; + } else { + gcAllocTotal = gcAlloc.Value; + } + } + } + + int? calcGCAllocInFrame(int frameIndex) { + int result = 0; + const HierarchyFrameDataView.ViewModes viewMode = HierarchyFrameDataView.ViewModes.MergeSamplesWithTheSameName | HierarchyFrameDataView.ViewModes.HideEditorOnlySamples; + using (var data = ProfilerDriver.GetHierarchyFrameDataView(frameIndex, 0, viewMode, HierarchyFrameDataView.columnGcMemory, false)) { + if (!data.valid) { + return null; + } + stack.Clear(); + stack.Push(data.GetRootItemID()); + while (stack.Count > 0) { + var current = stack.Pop(); + UnityEngine.Assertions.Assert.IsTrue(data.HasItemChildren(current)); + data.GetItemChildren(current, childrenBuffer); + foreach (var childId in childrenBuffer) { + var gcAlloc = (int)data.GetItemColumnDataAsSingle(childId, HierarchyFrameDataView.columnGcMemory); + if (gcAlloc == 0) { + continue; + } + if (data.HasItemChildren(childId)) { + stack.Push(childId); + continue; + } + data.GetItemMarkerIDPath(childId, fullIdPathBuffer); + if (ContainsSequence(ignoredPaths, fullIdPathBuffer)) { + continue; + } + if (!ContainsSequence(filteredPaths, fullIdPathBuffer)) { + if (shouldFilter()) { + filteredPaths.Add(fullIdPathBuffer.ToArray()); + } else { + ignoredPaths.Add(fullIdPathBuffer.ToArray()); + continue; + } + bool shouldFilter() { + if (filterAllocations.Count == 0) { + return true; + } + var itemPath = data.GetItemPath(childId); + foreach (var filter in filterAllocations) { + if (itemPath.Contains(filter) && !ignoreAllocations.Any(itemPath.Contains)) { + if (logFiltered) { + print($"FILTER {itemPath}"); + } + return true; + } + } + if (logIgnored) { + print($"IGNORE {itemPath}"); + } + return false; + } + } + if (logAllocations) { + print($"GC Alloc in frame {frameIndex}: {EditorUtility.FormatBytes(gcAlloc)}\n" + + $"Path: {data.GetItemPath(childId)}\n"); + } + result += gcAlloc; + } + } + } + return result; + } + + static bool ContainsSequence(List arrays, List list) { + foreach (var arr in arrays) { + if (SequenceEqual(arr, list)) { + return true; + } + } + return false; + + // Unity 2019.4.40 doesn't support static local methods + // ReSharper disable once LocalFunctionCanBeMadeStatic + bool SequenceEqual(int[] arr, List _list) { + if (arr.Length != _list.Count) { + return false; + } + for (var i = 0; i < arr.Length; i++) { + if (arr[i] != _list[i]) { + return false; + } + } + return true; + } + } + #else + void Awake() { + if (Application.isEditor) { + Debug.LogWarning($"{nameof(MeasureMemoryAllocations)} is only supported in Unity 2019.1 or newer.", this); + } else { + gameObject.SetActive(false); + } + } + #endif + } +} diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/MeasureAllocations/MeasureMemoryAllocations.cs.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/MeasureAllocations/MeasureMemoryAllocations.cs.meta new file mode 100644 index 00000000..eecc8f7e --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/MeasureAllocations/MeasureMemoryAllocations.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 6af581ca2a164600b2d47b0f7f7d5570 +timeCreated: 1686221280 +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Scripts/MeasureAllocations/MeasureMemoryAllocations.cs + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/MeasureAllocations/PrimeTween.Debug.asmdef b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/MeasureAllocations/PrimeTween.Debug.asmdef new file mode 100644 index 00000000..5f748245 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/MeasureAllocations/PrimeTween.Debug.asmdef @@ -0,0 +1,27 @@ +{ + "name": "PrimeTween.Debug", + "rootNamespace": "", + "references": [ + "PrimeTween.Runtime" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [ + { + "name": "com.kyrylokuzyk.primetween", + "expression": "1.0.0", + "define": "PRIME_TWEEN_INSTALLED" + }, + { + "name": "com.unity.ugui", + "expression": "1.0.0", + "define": "UNITY_UGUI_INSTALLED" + } + ], + "noEngineReferences": false +} \ No newline at end of file diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/MeasureAllocations/PrimeTween.Debug.asmdef.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/MeasureAllocations/PrimeTween.Debug.asmdef.meta new file mode 100644 index 00000000..87ce9bbd --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/MeasureAllocations/PrimeTween.Debug.asmdef.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: bd26724a735bb4282b7fbdef4681eb5f +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Scripts/MeasureAllocations/PrimeTween.Debug.asmdef + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/PrimeTween.Demo.asmdef b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/PrimeTween.Demo.asmdef new file mode 100644 index 00000000..96d60d75 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/PrimeTween.Demo.asmdef @@ -0,0 +1,49 @@ +{ + "name": "PrimeTween.Demo", + "rootNamespace": "", + "references": [ + "PrimeTween.Runtime", + "Unity.TextMeshPro", + "Unity.InputSystem" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [ + { + "name": "com.unity.modules.physics", + "expression": "1.0.0", + "define": "PHYSICS_MODULE_INSTALLED" + }, + { + "name": "com.unity.ugui", + "expression": "1.0.0", + "define": "UNITY_UGUI_INSTALLED" + }, + { + "name": "com.kyrylokuzyk.primetween", + "expression": "1.0.0", + "define": "PRIME_TWEEN_INSTALLED" + }, + { + "name": "com.unity.textmeshpro", + "expression": "1.0.0", + "define": "TEXT_MESH_PRO_INSTALLED" + }, + { + "name": "com.unity.inputsystem", + "expression": "1.0.0", + "define": "INPUT_SYSTEM_INSTALLED" + }, + { + "name": "com.unity.ugui", + "expression": "2.0.0", + "define": "TEXT_MESH_PRO_INSTALLED" + } + ], + "noEngineReferences": false +} \ No newline at end of file diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/PrimeTween.Demo.asmdef.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/PrimeTween.Demo.asmdef.meta new file mode 100644 index 00000000..994e9c47 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/PrimeTween.Demo.asmdef.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 85ffa6ed6408b405d94d60bf1dce1057 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Scripts/PrimeTween.Demo.asmdef + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Road.cs b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Road.cs new file mode 100644 index 00000000..2f883004 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Road.cs @@ -0,0 +1,29 @@ +#if PRIME_TWEEN_INSTALLED +using PrimeTween; +using UnityEngine; + +namespace PrimeTweenDemo { + public class Road : Animatable { + [SerializeField] MeshRenderer roadModel; + [SerializeField] AnimationCurve ease; + float currentSpeed; + + void Awake() { + _ = roadModel.material; // copy shared material + } + + public override Sequence Animate(bool isAnimating) { + var currentSpeedTween = Tween.Custom(this, currentSpeed, isAnimating ? 0.3f : 0, 1, (_this, val) => _this.currentSpeed = val); + var sequence = Sequence.Create(currentSpeedTween); + if (isAnimating) { + sequence.Group(Tween.LocalPositionY(transform, 0, -0.5f, 0.7f, ease)); + } + return sequence; + } + + void Update() { + roadModel.material.mainTextureOffset += new Vector2(-1f, 1f) * currentSpeed * Time.deltaTime; + } + } +} +#endif \ No newline at end of file diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Road.cs.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Road.cs.meta new file mode 100644 index 00000000..48136884 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Road.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: a4e192d6601c4753961099a3db72b66f +timeCreated: 1682262719 +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Scripts/Road.cs + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/SlidingDoor.cs b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/SlidingDoor.cs new file mode 100644 index 00000000..c9bf8c2d --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/SlidingDoor.cs @@ -0,0 +1,33 @@ +#if PRIME_TWEEN_INSTALLED && UNITY_UGUI_INSTALLED +using PrimeTween; +using UnityEngine; + +namespace PrimeTweenDemo { + public class SlidingDoor : Animatable { + [SerializeField] Transform animationAnchor; + [SerializeField] Vector3 openedPos, midPos, closedPos; + bool isClosed; + Sequence sequence; + + public override void OnClick() { + if (!Demo.instance.animateAllSequence.isAlive) { + Animate(!isClosed); + } + } + + public override Sequence Animate(bool _isClosed) { + if (isClosed == _isClosed) { + return Sequence.Create(); + } + isClosed = _isClosed; + if (sequence.isAlive) { + sequence.Stop(); + } + var tweenSettings = new TweenSettings(0.4f, Ease.OutBack, endDelay: 0.1f); + sequence = Tween.LocalPosition(animationAnchor, midPos, tweenSettings) + .Chain(Tween.LocalPosition(animationAnchor, _isClosed ? closedPos : openedPos, tweenSettings)); + return sequence; + } + } +} +#endif diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/SlidingDoor.cs.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/SlidingDoor.cs.meta new file mode 100644 index 00000000..ad929391 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/SlidingDoor.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: c42977785d1b549d59c346556945e0c5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Scripts/SlidingDoor.cs + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/SqueezeAnimation.cs b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/SqueezeAnimation.cs new file mode 100644 index 00000000..78019b40 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/SqueezeAnimation.cs @@ -0,0 +1,17 @@ +#if PRIME_TWEEN_INSTALLED +using PrimeTween; +using UnityEngine; + +namespace PrimeTweenDemo { + public class SqueezeAnimation : MonoBehaviour { + [SerializeField] Transform target; + Tween tween; + + public void PlayAnimation() { + if (!tween.isAlive) { + tween = Tween.Scale(target, new Vector3(1.15f, 0.9f, 1.15f), 0.2f, Ease.OutSine, 2, CycleMode.Yoyo); + } + } + } +} +#endif \ No newline at end of file diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/SqueezeAnimation.cs.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/SqueezeAnimation.cs.meta new file mode 100644 index 00000000..a9f90a51 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/SqueezeAnimation.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 613ad9fe5121a4b02b556b6b16cad710 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Scripts/SqueezeAnimation.cs + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/SwipeTutorial.cs b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/SwipeTutorial.cs new file mode 100644 index 00000000..01c0c61d --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/SwipeTutorial.cs @@ -0,0 +1,25 @@ +#if PRIME_TWEEN_INSTALLED +using PrimeTween; +using UnityEngine; + +namespace PrimeTweenDemo { + public class SwipeTutorial : MonoBehaviour { + Tween tween; + + void OnEnable() { + #if !UNITY_2019_1_OR_NEWER || UNITY_UGUI_INSTALLED + tween = Tween.Alpha(GetComponent(), 1, 0, 1, Ease.InOutSine, -1, CycleMode.Yoyo); + #else + Debug.LogError("Please install the package and re-open the Demo scene: 'Package Manager/Packages/Unity Registry/Unity UI' (com.unity.ugui)."); + #endif + } + + public void Hide() { + if (tween.isAlive) { + // Stop cycling the animation when it reaches the 'endValue' (0) + tween.SetRemainingCycles(true); + } + } + } +} +#endif \ No newline at end of file diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/SwipeTutorial.cs.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/SwipeTutorial.cs.meta new file mode 100644 index 00000000..7689ca6b --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/SwipeTutorial.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: d20b7aac1e6a4f1dbdbe52c7ca1ad4b4 +timeCreated: 1685344395 +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Scripts/SwipeTutorial.cs + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/TypewriterAnimatorExample.cs b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/TypewriterAnimatorExample.cs new file mode 100644 index 00000000..e1c5fb90 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/TypewriterAnimatorExample.cs @@ -0,0 +1,148 @@ +#if PRIME_TWEEN_INSTALLED +#if TEXT_MESH_PRO_INSTALLED +using TMPro; +#endif +using JetBrains.Annotations; +using PrimeTween; +using UnityEngine; + +namespace PrimeTweenDemo { + [PublicAPI] + public class TypewriterAnimatorExample : MonoBehaviour { + enum AnimationType { Simple, WithPunctuations, ByWords } + [SerializeField] AnimationType animationType = AnimationType.WithPunctuations; + [SerializeField] float charsPerSecond = 40f; + [SerializeField] int pauseAfterPunctuation = 20; + #if TEXT_MESH_PRO_INSTALLED + TextMeshProUGUI text; + + void Awake() { + text = gameObject.AddComponent(); + text.maxVisibleCharacters = 0; + text.alignment = TextAlignmentOptions.TopLeft; + text.fontSize = 12; + text.color = Color.black * 0.8f; + text.text = "This text is animated with zero allocations, see 'TypewriterAnimatorExample' script for more details.\n\n" + + "PrimeTween rocks!"; + } + + public Tween Animate() { + switch (animationType) { + case AnimationType.Simple: + return TypewriterAnimationSimple(); + case AnimationType.WithPunctuations: + return TypewriterAnimationWithPunctuations(); + case AnimationType.ByWords: + return TypewriterAnimationByWords(); + default: + throw new System.Exception(); + } + } + + /// A simple typewriter animation that uses built-in animation method. + public Tween TypewriterAnimationSimple() { + text.ForceMeshUpdate(); + int characterCount = text.textInfo.characterCount; + float duration = characterCount / charsPerSecond; + return Tween.TextMaxVisibleCharacters(text, 0, characterCount, duration, Ease.Linear); + } + + #region TypewriterAnimationWithPunctuations + /// Typewriter animation which inserts pauses after punctuation marks. + public Tween TypewriterAnimationWithPunctuations() { + text.ForceMeshUpdate(); + RemapWithPunctuations(text, int.MaxValue, out int remappedCount, out _); + float duration = remappedCount / charsPerSecond; + return Tween.Custom(this, 0f, remappedCount, duration, (t, x) => t.UpdateMaxVisibleCharsWithPunctuation(x), Ease.Linear); + } + + void UpdateMaxVisibleCharsWithPunctuation(float progress) { + int remappedEndIndex = Mathf.RoundToInt(progress); + RemapWithPunctuations(text, remappedEndIndex, out _, out int visibleCharsCount); + if (text.maxVisibleCharacters != visibleCharsCount) { + text.maxVisibleCharacters = visibleCharsCount; + // play keyboard typing sound here if needed + } + } + + void RemapWithPunctuations([NotNull] TMP_Text text, int remappedEndIndex, out int remappedCount, out int visibleCharsCount) { + remappedCount = 0; + visibleCharsCount = 0; + int count = text.textInfo.characterCount; + var characterInfos = text.textInfo.characterInfo; + for (int i = 0; i < count; i++) { + if (remappedCount >= remappedEndIndex) { + break; + } + remappedCount++; + visibleCharsCount++; + if (IsPunctuationChar(characterInfos[i].character)) { + int nextIndex = i + 1; + if (nextIndex != count && !IsPunctuationChar(characterInfos[nextIndex].character)) { + // add pause after the last subsequent punctuation character + remappedCount += Mathf.Max(0, pauseAfterPunctuation); + } + } + } + + bool IsPunctuationChar(char c) { + return ".,:;!?".IndexOf(c) != -1; + } + } + #endregion + + #region TypewriterAnimationByWords + /// Typewriter animation that shows text word by word. + public Tween TypewriterAnimationByWords() { + text.ForceMeshUpdate(); + RemapWords(text, int.MaxValue, out int numWords, out _); + float duration = text.textInfo.characterCount / charsPerSecond; + return Tween.Custom(this, 0f, numWords, duration, (t, x) => t.UpdateVisibleWords(x), Ease.Linear); + } + + void UpdateVisibleWords(float progress) { + int curWordIndex = Mathf.RoundToInt(progress); + RemapWords(text, curWordIndex, out _, out int visibleCharsCount); + if (text.maxVisibleCharacters != visibleCharsCount) { + text.maxVisibleCharacters = visibleCharsCount; + // play keyboard typing sound here if needed + } + } + + static void RemapWords([NotNull] TMP_Text text, int remappedEndIndex, out int remappedCount, out int visibleCharsCount) { + visibleCharsCount = 0; + int count = text.textInfo.characterCount; + if (count == 0) { + remappedCount = 0; + return; + } + remappedCount = 1; + var characterInfos = text.textInfo.characterInfo; + for (int i = 0; i < count; i++) { + if (remappedCount >= remappedEndIndex) { + return; + } + remappedCount++; + if (IsWordSeparatorChar(characterInfos[i].character)) { + int nextIndex = i + 1; + if (nextIndex == count || !IsWordSeparatorChar(characterInfos[nextIndex].character)) { + remappedCount++; + visibleCharsCount = nextIndex; + } + } + } + visibleCharsCount = count; + + bool IsWordSeparatorChar(char ch) { + return " \n".IndexOf(ch) != -1; + } + } + #endregion + #else + void Awake() { + Debug.LogWarning("Please install TextMeshPro 'com.unity.textmeshpro' to enable TypewriterAnimatorExample.", this); + } + #endif + } +} +#endif diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/TypewriterAnimatorExample.cs.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/TypewriterAnimatorExample.cs.meta new file mode 100644 index 00000000..51f089ce --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/TypewriterAnimatorExample.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: f62b6e70f1114e5d867a36459e0352bf +timeCreated: 1702471534 +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Scripts/TypewriterAnimatorExample.cs + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Wheels.cs b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Wheels.cs new file mode 100644 index 00000000..7e7cb3f6 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Wheels.cs @@ -0,0 +1,37 @@ +#if PRIME_TWEEN_INSTALLED && UNITY_UGUI_INSTALLED +using PrimeTween; +using UnityEngine; + +namespace PrimeTweenDemo { + public class Wheels : Animatable { + [SerializeField] Transform[] wheels; + bool isAnimating; + Sequence sequence; + + public override void OnClick() { + Demo.instance.AnimateAll(!isAnimating); + } + + public override Sequence Animate(bool _isAnimating) { + isAnimating = _isAnimating; + // Spinning wheels is an infinite animation, and we should not return it as result of this method. + // Instead, we should wrap the SpinWheelsInfinitely() call inside the empty Sequence. This way, the SpinWheelsInfinitely() call can be grouped and chained with other tweens and sequences. + return Sequence.Create().ChainCallback(this, target => target.SpinWheelsInfinitely()); + } + + void SpinWheelsInfinitely() { + if (isAnimating) { + sequence.Complete(); + sequence = Sequence.Create(-1); + foreach (var wheel in wheels) { + sequence.Group(Tween.LocalEulerAngles(wheel, Vector3.zero, new Vector3(360, 0), 1, Ease.Linear)); + } + } else { + if (sequence.isAlive) { + sequence.SetRemainingCycles(0); + } + } + } + } +} +#endif diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Wheels.cs.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Wheels.cs.meta new file mode 100644 index 00000000..77477c39 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Scripts/Wheels.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 6113f6e98f16c489f87f373fc4133597 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Scripts/Wheels.cs + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo.meta new file mode 100644 index 00000000..6a33a340 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b7265872bef874265b6a013be67f7ef9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/CREDITS.txt b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/CREDITS.txt new file mode 100644 index 00000000..ae4e19df --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/CREDITS.txt @@ -0,0 +1,6 @@ +Thanks for the model to Fero Andezo (feroz)! +Model link: +https://skfb.ly/6SZVz + +If you like what Fero does, follow him on Sketchfab: +https://sketchfab.com/ferofluid \ No newline at end of file diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/CREDITS.txt.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/CREDITS.txt.meta new file mode 100644 index 00000000..b8a0ee66 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/CREDITS.txt.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 064ca2a5c3a844e29a2223f62216e16e +timeCreated: 1683535537 +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/CREDITS.txt + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Exterior.png b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Exterior.png new file mode 100644 index 00000000..244e3317 Binary files /dev/null and b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Exterior.png differ diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Exterior.png.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Exterior.png.meta new file mode 100644 index 00000000..e89fc233 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Exterior.png.meta @@ -0,0 +1,154 @@ +fileFormatVersion: 2 +guid: f94c989c837ae4db8bd9b10ab17903ce +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + 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 + vTOnly: 0 + ignoreMasterTextureLimit: 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: 1 + 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: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + 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: Standalone + 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: 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: Android + 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: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + 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: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Exterior.png + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Interior.png b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Interior.png new file mode 100644 index 00000000..26c46011 Binary files /dev/null and b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Interior.png differ diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Interior.png.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Interior.png.meta new file mode 100644 index 00000000..5bdd3f28 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Interior.png.meta @@ -0,0 +1,154 @@ +fileFormatVersion: 2 +guid: d9cb62c342d1047c088a4343b86104f5 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + 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 + vTOnly: 0 + ignoreMasterTextureLimit: 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: 1 + 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: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + 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: Standalone + 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: 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: Android + 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: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + 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: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Interior.png + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials.meta new file mode 100644 index 00000000..6f804a96 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b43cf3f34f8b246978c0dd5eda5ce9fe +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials/Exterior.mat b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials/Exterior.mat new file mode 100644 index 00000000..cddd9ec9 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials/Exterior.mat @@ -0,0 +1,77 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Exterior + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _EMISSION + m_LightmapFlags: 1 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: f94c989c837ae4db8bd9b10ab17903ce, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 0 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 0 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials/Exterior.mat.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials/Exterior.mat.meta new file mode 100644 index 00000000..a5ff0c9b --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials/Exterior.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: e3fb3841a697f42f18609c8864d87886 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials/Exterior.mat + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials/Wheel.mat b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials/Wheel.mat new file mode 100644 index 00000000..e13dc9cb --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials/Wheel.mat @@ -0,0 +1,77 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Wheel + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _EMISSION + m_LightmapFlags: 1 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: a6031cf05af9b4bea8d67125e8027bdf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 0 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 0 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials/Wheel.mat.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials/Wheel.mat.meta new file mode 100644 index 00000000..48a00270 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials/Wheel.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 697445d70f82745a39de4df5f36c514c +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials/Wheel.mat + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials/Window.mat b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials/Window.mat new file mode 100644 index 00000000..c77d0067 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials/Window.mat @@ -0,0 +1,78 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Window + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _ALPHAPREMULTIPLY_ON _EMISSION + m_LightmapFlags: 1 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 3000 + stringTagMap: + RenderType: Transparent + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: b294bf67965a84cc8b4efe16fa9aa316, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 10 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 3 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 0.19999999} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials/Window.mat.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials/Window.mat.meta new file mode 100644 index 00000000..90174e6a --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials/Window.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: c6826ed5c575c40c58f681e880fad469 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials/Window.mat + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials/interior.mat b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials/interior.mat new file mode 100644 index 00000000..ac8d3da9 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials/interior.mat @@ -0,0 +1,77 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: interior + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _EMISSION + m_LightmapFlags: 1 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: d9cb62c342d1047c088a4343b86104f5, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 0 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 0 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials/interior.mat.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials/interior.mat.meta new file mode 100644 index 00000000..26848c6e --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials/interior.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 004ae8b11200d44ac83be82a3ee1ebb8 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials/interior.mat + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials_URP.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials_URP.meta new file mode 100644 index 00000000..01922111 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials_URP.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9f482305119714e1e89e90d6468dc350 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials_URP/Exterior.mat b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials_URP/Exterior.mat new file mode 100644 index 00000000..f03c26c3 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials_URP/Exterior.mat @@ -0,0 +1,139 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Exterior + m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - _EMISSION + - _ENVIRONMENTREFLECTIONS_OFF + - _SPECULARHIGHLIGHTS_OFF + m_InvalidKeywords: + - _GLOSSYREFLECTIONS_OFF + m_LightmapFlags: 1 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: + RenderType: Opaque + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseMap: + m_Texture: {fileID: 2800000, guid: f94c989c837ae4db8bd9b10ab17903ce, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: f94c989c837ae4db8bd9b10ab17903ce, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AlphaClip: 0 + - _AlphaToMask: 0 + - _Blend: 0 + - _BlendModePreserveSpecular: 1 + - _BumpScale: 1 + - _ClearCoatMask: 0 + - _ClearCoatSmoothness: 0 + - _Cull: 2 + - _Cutoff: 0.5 + - _DetailAlbedoMapScale: 1 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _DstBlendAlpha: 0 + - _EnvironmentReflections: 0 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 0 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _QueueOffset: 0 + - _ReceiveShadows: 1 + - _Smoothness: 0 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 0 + - _SrcBlend: 1 + - _SrcBlendAlpha: 1 + - _Surface: 0 + - _UVSec: 0 + - _WorkflowMode: 1 + - _ZWrite: 1 + m_Colors: + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_BuildTextureStacks: [] +--- !u!114 &7263079360766289332 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 7 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials_URP/Exterior.mat.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials_URP/Exterior.mat.meta new file mode 100644 index 00000000..3af33adc --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials_URP/Exterior.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 4664d12bb5ac04e998b3008d8f2803dc +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials_URP/Exterior.mat + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials_URP/Wheel.mat b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials_URP/Wheel.mat new file mode 100644 index 00000000..81d9b392 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials_URP/Wheel.mat @@ -0,0 +1,139 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-4735658937689173692 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 7 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Wheel + m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - _EMISSION + - _ENVIRONMENTREFLECTIONS_OFF + - _SPECULARHIGHLIGHTS_OFF + m_InvalidKeywords: + - _GLOSSYREFLECTIONS_OFF + m_LightmapFlags: 1 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: + RenderType: Opaque + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseMap: + m_Texture: {fileID: 2800000, guid: a6031cf05af9b4bea8d67125e8027bdf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: a6031cf05af9b4bea8d67125e8027bdf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AlphaClip: 0 + - _AlphaToMask: 0 + - _Blend: 0 + - _BlendModePreserveSpecular: 1 + - _BumpScale: 1 + - _ClearCoatMask: 0 + - _ClearCoatSmoothness: 0 + - _Cull: 2 + - _Cutoff: 0.5 + - _DetailAlbedoMapScale: 1 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _DstBlendAlpha: 0 + - _EnvironmentReflections: 0 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 0 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _QueueOffset: 0 + - _ReceiveShadows: 1 + - _Smoothness: 0 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 0 + - _SrcBlend: 1 + - _SrcBlendAlpha: 1 + - _Surface: 0 + - _UVSec: 0 + - _WorkflowMode: 1 + - _ZWrite: 1 + m_Colors: + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_BuildTextureStacks: [] diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials_URP/Wheel.mat.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials_URP/Wheel.mat.meta new file mode 100644 index 00000000..0c07c84a --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials_URP/Wheel.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: b18e327865ce74717850a9fa00d61d6a +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials_URP/Wheel.mat + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials_URP/Window.mat b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials_URP/Window.mat new file mode 100644 index 00000000..9bc11c59 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials_URP/Window.mat @@ -0,0 +1,140 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Window + m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - _ALPHAPREMULTIPLY_ON + - _EMISSION + - _SURFACE_TYPE_TRANSPARENT + m_InvalidKeywords: [] + m_LightmapFlags: 1 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 3000 + stringTagMap: + RenderType: Transparent + disabledShaderPasses: + - DepthOnly + - SHADOWCASTER + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseMap: + m_Texture: {fileID: 2800000, guid: b294bf67965a84cc8b4efe16fa9aa316, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: b294bf67965a84cc8b4efe16fa9aa316, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AlphaClip: 0 + - _AlphaToMask: 0 + - _Blend: 0 + - _BlendModePreserveSpecular: 1 + - _BumpScale: 1 + - _ClearCoatMask: 0 + - _ClearCoatSmoothness: 0 + - _Cull: 2 + - _Cutoff: 0.5 + - _DetailAlbedoMapScale: 1 + - _DetailNormalMapScale: 1 + - _DstBlend: 10 + - _DstBlendAlpha: 10 + - _EnvironmentReflections: 1 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 3 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _QueueOffset: 0 + - _ReceiveShadows: 1 + - _Smoothness: 0 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _SrcBlendAlpha: 1 + - _Surface: 1 + - _UVSec: 0 + - _WorkflowMode: 1 + - _ZWrite: 0 + m_Colors: + - _BaseColor: {r: 1, g: 1, b: 1, a: 0.19999999} + - _Color: {r: 1, g: 1, b: 1, a: 0.19999999} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_BuildTextureStacks: [] +--- !u!114 &3728866138871552857 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 7 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials_URP/Window.mat.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials_URP/Window.mat.meta new file mode 100644 index 00000000..22813004 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials_URP/Window.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 1b921feeacddd4a24ba5661d0ce5d33e +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials_URP/Window.mat + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials_URP/interior.mat b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials_URP/interior.mat new file mode 100644 index 00000000..f16ac94b --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials_URP/interior.mat @@ -0,0 +1,139 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: interior + m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - _EMISSION + - _ENVIRONMENTREFLECTIONS_OFF + - _SPECULARHIGHLIGHTS_OFF + m_InvalidKeywords: + - _GLOSSYREFLECTIONS_OFF + m_LightmapFlags: 1 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: + RenderType: Opaque + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseMap: + m_Texture: {fileID: 2800000, guid: d9cb62c342d1047c088a4343b86104f5, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: d9cb62c342d1047c088a4343b86104f5, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AlphaClip: 0 + - _AlphaToMask: 0 + - _Blend: 0 + - _BlendModePreserveSpecular: 1 + - _BumpScale: 1 + - _ClearCoatMask: 0 + - _ClearCoatSmoothness: 0 + - _Cull: 2 + - _Cutoff: 0.5 + - _DetailAlbedoMapScale: 1 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _DstBlendAlpha: 0 + - _EnvironmentReflections: 0 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 0 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _QueueOffset: 0 + - _ReceiveShadows: 1 + - _Smoothness: 0 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 0 + - _SrcBlend: 1 + - _SrcBlendAlpha: 1 + - _Surface: 0 + - _UVSec: 0 + - _WorkflowMode: 1 + - _ZWrite: 1 + m_Colors: + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_BuildTextureStacks: [] +--- !u!114 &6538925729129028096 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 7 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials_URP/interior.mat.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials_URP/interior.mat.meta new file mode 100644 index 00000000..288bcc3c --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials_URP/interior.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 4ba9f664d3cac4d60b6c273c337e94b1 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Materials_URP/interior.mat + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Van.fbx b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Van.fbx new file mode 100644 index 00000000..2bf60640 Binary files /dev/null and b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Van.fbx differ diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Van.fbx.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Van.fbx.meta new file mode 100644 index 00000000..37246ae3 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Van.fbx.meta @@ -0,0 +1,257 @@ +fileFormatVersion: 2 +guid: c9da341d2d3a64cf8b2adc9bba8ec9ec +ModelImporter: + serializedVersion: 23 + fileIDToRecycleName: + 100000: animationAnchor + 100002: animationAnchor.001 + 100004: animationAnchor.002 + 100006: animationAnchor.003 + 100008: baggage + 100010: baggage.001 + 100012: door_ext_l + 100014: door_l + 100016: door_r + 100018: exterior + 100020: exterior.001 + 100022: highlightAnchor + 100024: highlightAnchor.001 + 100026: highlightAnchor.002 + 100028: highlightAnchor.003 + 100030: highlightAnchor.004 + 100032: highlightAnchor.005 + 100034: interior + 100036: model + 100038: sliding_door + 100040: trunk + 100042: trunk_model + 100044: //RootNode + 100046: Wheels + 100048: Wheels.001 + 100050: Wheels.002 + 100052: Wheels.003 + 100054: Wheels.004 + 100056: windows + 100058: wnd + 100060: wnd_r + 100062: wnd_sliding_door + 100064: wnd_trunk + 100066: exterior.002 + 100068: Headlights + 400000: animationAnchor + 400002: animationAnchor.001 + 400004: animationAnchor.002 + 400006: animationAnchor.003 + 400008: baggage + 400010: baggage.001 + 400012: door_ext_l + 400014: door_l + 400016: door_r + 400018: exterior + 400020: exterior.001 + 400022: highlightAnchor + 400024: highlightAnchor.001 + 400026: highlightAnchor.002 + 400028: highlightAnchor.003 + 400030: highlightAnchor.004 + 400032: highlightAnchor.005 + 400034: interior + 400036: model + 400038: sliding_door + 400040: trunk + 400042: trunk_model + 400044: //RootNode + 400046: Wheels + 400048: Wheels.001 + 400050: Wheels.002 + 400052: Wheels.003 + 400054: Wheels.004 + 400056: windows + 400058: wnd + 400060: wnd_r + 400062: wnd_sliding_door + 400064: wnd_trunk + 400066: exterior.002 + 400068: Headlights + 2300000: baggage.001 + 2300002: door_ext_l + 2300004: exterior + 2300006: exterior.001 + 2300008: interior + 2300010: model + 2300012: trunk_model + 2300014: Wheels.001 + 2300016: Wheels.002 + 2300018: Wheels.003 + 2300020: Wheels.004 + 2300022: windows + 2300024: wnd + 2300026: wnd_r + 2300028: wnd_sliding_door + 2300030: wnd_trunk + 2300032: exterior.002 + 3300000: baggage.001 + 3300002: door_ext_l + 3300004: exterior + 3300006: exterior.001 + 3300008: interior + 3300010: model + 3300012: trunk_model + 3300014: Wheels.001 + 3300016: Wheels.002 + 3300018: Wheels.003 + 3300020: Wheels.004 + 3300022: windows + 3300024: wnd + 3300026: wnd_r + 3300028: wnd_sliding_door + 3300030: wnd_trunk + 3300032: exterior.002 + 4300000: windows + 4300002: exterior + 4300004: interior + 4300006: door_ext_l + 4300008: wnd + 4300010: model + 4300012: wnd_sliding_door + 4300014: baggage.001 + 4300016: exterior.001 + 4300018: wnd_r + 4300020: Wheels.001 + 4300022: Wheels.002 + 4300024: Wheels.003 + 4300026: Wheels.004 + 4300028: trunk_model + 4300030: wnd_trunk + 4300032: exterior.002 + 6400000: baggage.001 + 6400002: door_ext_l + 6400004: exterior + 6400006: exterior.001 + 6400008: interior + 6400010: model + 6400012: trunk_model + 6400014: Wheels.001 + 6400016: Wheels.002 + 6400018: Wheels.003 + 6400020: Wheels.004 + 6400022: windows + 6400024: wnd + 6400026: wnd_r + 6400028: wnd_sliding_door + 6400030: wnd_trunk + 6400032: exterior.002 + 9500000: //RootNode + externalObjects: + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: Exterior + second: {fileID: 2100000, guid: e3fb3841a697f42f18609c8864d87886, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: Wheel + second: {fileID: 2100000, guid: 697445d70f82745a39de4df5f36c514c, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: Window + second: {fileID: 2100000, guid: c6826ed5c575c40c58f681e880fad469, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: interior + second: {fileID: 2100000, guid: 004ae8b11200d44ac83be82a3ee1ebb8, type: 2} + materials: + importMaterials: 0 + materialName: 0 + materialSearch: 1 + materialLocation: 0 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + motionNodeName: + rigImportErrors: + rigImportWarnings: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + importConstraints: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: [] + isReadable: 1 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 1 + useSRGBMaterialColor: 1 + importVisibility: 0 + importBlendShapes: 0 + importCameras: 0 + importLights: 0 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + optimizeMeshForGPU: 1 + keepQuads: 0 + weldVertices: 1 + preserveHierarchy: 0 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVPackMargin: 4 + useFileScale: 0 + previousCalculatedGlobalScale: 1 + hasPreviousCalculatedGlobalScale: 1 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 0 + importAnimation: 0 + copyAvatar: 0 + humanDescription: + serializedVersion: 2 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + rootMotionBoneName: + hasTranslationDoF: 0 + hasExtraRoot: 1 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + animationType: 0 + humanoidOversampling: 1 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Van.fbx + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Wheel.png b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Wheel.png new file mode 100644 index 00000000..fd14b29c Binary files /dev/null and b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Wheel.png differ diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Wheel.png.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Wheel.png.meta new file mode 100644 index 00000000..34baba66 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Wheel.png.meta @@ -0,0 +1,154 @@ +fileFormatVersion: 2 +guid: a6031cf05af9b4bea8d67125e8027bdf +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + 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 + vTOnly: 0 + ignoreMasterTextureLimit: 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: 1 + 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: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + 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: Standalone + 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: 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: Android + 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: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + 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: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Wheel.png + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Window.png b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Window.png new file mode 100644 index 00000000..a2d41353 Binary files /dev/null and b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Window.png differ diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Window.png.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Window.png.meta new file mode 100644 index 00000000..21ae0eb3 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Window.png.meta @@ -0,0 +1,154 @@ +fileFormatVersion: 2 +guid: b294bf67965a84cc8b4efe16fa9aa316 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + 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 + vTOnly: 0 + ignoreMasterTextureLimit: 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: 1 + 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: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + 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: Standalone + 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: 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: Android + 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: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + 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: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Stylized Cartoon Van by Fero Andezo/Window.png + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo.meta new file mode 100644 index 00000000..c88e92c1 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5b354bf83193b4a368b1277ed473048c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/CREDITS.txt b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/CREDITS.txt new file mode 100644 index 00000000..cb893080 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/CREDITS.txt @@ -0,0 +1,9 @@ +Thanks for the texture to João Paulo! +Texture link: +https://3dtextures.me/2020/06/25/stylized-sand-001/ + +If you like what João does, consider subscribing to his Patreon for more awesome textures: +https://www.patreon.com/gendo + +Or buy him a coffee :) +https://ko-fi.com/katsukagi \ No newline at end of file diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/CREDITS.txt.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/CREDITS.txt.meta new file mode 100644 index 00000000..af766f9c --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/CREDITS.txt.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 888c010893c54ac1853f8034ca33eb3a +timeCreated: 1683535263 +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/CREDITS.txt + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_ambientOcclusion.jpg b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_ambientOcclusion.jpg new file mode 100644 index 00000000..849bc783 Binary files /dev/null and b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_ambientOcclusion.jpg differ diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_ambientOcclusion.jpg.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_ambientOcclusion.jpg.meta new file mode 100644 index 00000000..baf88b5e --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_ambientOcclusion.jpg.meta @@ -0,0 +1,154 @@ +fileFormatVersion: 2 +guid: dbd48884ce5a84f42b722cf62cb95fc3 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + 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 + vTOnly: 0 + ignoreMasterTextureLimit: 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: 1 + 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: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + 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: Standalone + 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: 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: Android + 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: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + 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: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_ambientOcclusion.jpg + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_basecolor.jpg b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_basecolor.jpg new file mode 100644 index 00000000..6315c56c Binary files /dev/null and b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_basecolor.jpg differ diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_basecolor.jpg.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_basecolor.jpg.meta new file mode 100644 index 00000000..ea4df3ad --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_basecolor.jpg.meta @@ -0,0 +1,154 @@ +fileFormatVersion: 2 +guid: 4438c948bc895459fa8cb061c3a59f08 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + 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 + vTOnly: 0 + ignoreMasterTextureLimit: 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: 1 + 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: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + 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: Standalone + 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: 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: Android + 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: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + 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: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_basecolor.jpg + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_basecolor.mat b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_basecolor.mat new file mode 100644 index 00000000..ef9212c4 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_basecolor.mat @@ -0,0 +1,83 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Stylized_Sand_001_basecolor + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ValidKeywords: + - _NORMALMAP + - _PARALLAXMAP + - _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 2800000, guid: 1a3bff52702914ae3852de7736bd754d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 2800000, guid: bec405a93954d4bf78b26a45fa4d1278, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 4438c948bc895459fa8cb061c3a59f08, type: 3} + m_Scale: {x: 100, y: 100} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 2800000, guid: dbd48884ce5a84f42b722cf62cb95fc3, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 2800000, guid: 593e1963d5983481bb7a93634ccbdf4c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 0.356 + - _Glossiness: 0.438 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.0369 + - _SmoothnessTextureChannel: 1 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0.509434, g: 0.509434, b: 0.509434, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + m_BuildTextureStacks: [] diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_basecolor.mat.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_basecolor.mat.meta new file mode 100644 index 00000000..a48f6848 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_basecolor.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 26e88e1e3f85449949238833334c3914 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_basecolor.mat + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_basecolor_URP.mat b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_basecolor_URP.mat new file mode 100644 index 00000000..ca62cadf --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_basecolor_URP.mat @@ -0,0 +1,139 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Stylized_Sand_001_basecolor_URP + m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - _NORMALMAP + - _OCCLUSIONMAP + - _PARALLAXMAP + - _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: + RenderType: Opaque + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseMap: + m_Texture: {fileID: 2800000, guid: 4438c948bc895459fa8cb061c3a59f08, type: 3} + m_Scale: {x: 100, y: 100} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 2800000, guid: 1a3bff52702914ae3852de7736bd754d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 2800000, guid: bec405a93954d4bf78b26a45fa4d1278, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 4438c948bc895459fa8cb061c3a59f08, type: 3} + m_Scale: {x: 100, y: 100} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 2800000, guid: dbd48884ce5a84f42b722cf62cb95fc3, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 2800000, guid: 593e1963d5983481bb7a93634ccbdf4c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AlphaClip: 0 + - _AlphaToMask: 0 + - _Blend: 0 + - _BlendModePreserveSpecular: 1 + - _BumpScale: 1 + - _ClearCoatMask: 0 + - _ClearCoatSmoothness: 0 + - _Cull: 2 + - _Cutoff: 0.5 + - _DetailAlbedoMapScale: 1 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _DstBlendAlpha: 0 + - _EnvironmentReflections: 1 + - _GlossMapScale: 0.356 + - _Glossiness: 0.438 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.0369 + - _QueueOffset: 0 + - _ReceiveShadows: 1 + - _Smoothness: 0.438 + - _SmoothnessTextureChannel: 1 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _SrcBlendAlpha: 1 + - _Surface: 0 + - _UVSec: 0 + - _WorkflowMode: 1 + - _ZWrite: 1 + m_Colors: + - _BaseColor: {r: 0.509434, g: 0.509434, b: 0.509434, a: 1} + - _Color: {r: 0.509434, g: 0.509434, b: 0.509434, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_BuildTextureStacks: [] +--- !u!114 &8482762829682952528 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 7 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_basecolor_URP.mat.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_basecolor_URP.mat.meta new file mode 100644 index 00000000..79760eff --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_basecolor_URP.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 5b3bd009b3212427983eb7f4e416527a +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_basecolor_URP.mat + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_height.png b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_height.png new file mode 100644 index 00000000..f4f175e7 Binary files /dev/null and b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_height.png differ diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_height.png.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_height.png.meta new file mode 100644 index 00000000..dc3b89f6 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_height.png.meta @@ -0,0 +1,154 @@ +fileFormatVersion: 2 +guid: 593e1963d5983481bb7a93634ccbdf4c +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + 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 + vTOnly: 0 + ignoreMasterTextureLimit: 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: 1 + 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: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + 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: Standalone + 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: 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: Android + 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: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + 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: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_height.png + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_normal.jpg b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_normal.jpg new file mode 100644 index 00000000..2abdc9ac Binary files /dev/null and b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_normal.jpg differ diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_normal.jpg.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_normal.jpg.meta new file mode 100644 index 00000000..ae751788 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_normal.jpg.meta @@ -0,0 +1,154 @@ +fileFormatVersion: 2 +guid: 1a3bff52702914ae3852de7736bd754d +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + 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 + vTOnly: 0 + ignoreMasterTextureLimit: 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: 1 + 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: 1 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + 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: Standalone + 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: 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: Android + 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: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + 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: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_normal.jpg + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_roughness.jpg b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_roughness.jpg new file mode 100644 index 00000000..67aa4a6a Binary files /dev/null and b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_roughness.jpg differ diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_roughness.jpg.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_roughness.jpg.meta new file mode 100644 index 00000000..7b902819 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_roughness.jpg.meta @@ -0,0 +1,154 @@ +fileFormatVersion: 2 +guid: bec405a93954d4bf78b26a45fa4d1278 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + 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 + vTOnly: 0 + ignoreMasterTextureLimit: 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: 1 + 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: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + 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: Standalone + 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: 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: Android + 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: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + 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: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/Demo/Stylized Sand by Joao Paulo/Stylized_Sand_001_roughness.jpg + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/PrimeTweenInstaller.asset b/FactoryNumeric/Assets/Plugins/PrimeTween/PrimeTweenInstaller.asset new file mode 100644 index 00000000..fd935913 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/PrimeTweenInstaller.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 118450fad714b420684eb5f984268b5c, type: 3} + m_Name: PrimeTweenInstaller + m_EditorClassIdentifier: + demoScene: {fileID: 102900000, guid: 13170347bc506405f88d3a87bd0982b3, type: 3} + demoSceneUrp: {fileID: 102900000, guid: 15054139658a5445689224c71f805b10, type: 3} + uninstallButtonColor: {r: 1, g: 0.23113209, b: 0.2762581, a: 1} diff --git a/FactoryNumeric/Assets/Plugins/PrimeTween/PrimeTweenInstaller.asset.meta b/FactoryNumeric/Assets/Plugins/PrimeTween/PrimeTweenInstaller.asset.meta new file mode 100644 index 00000000..32a191cb --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/PrimeTween/PrimeTweenInstaller.asset.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: aafeeef745bb4406db1b2cd166853022 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 252960 + packageName: "PrimeTween \xB7 High-Performance Animations and Sequences" + packageVersion: 1.2.2 + assetPath: Assets/Plugins/PrimeTween/PrimeTweenInstaller.asset + uploadId: 745996 diff --git a/FactoryNumeric/Assets/Plugins/Sirenix.meta b/FactoryNumeric/Assets/Plugins/Sirenix.meta new file mode 100644 index 00000000..2b43858a --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7db84c72b2408b24da5a225550b562ff +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies.meta new file mode 100644 index 00000000..fc264204 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 05b1eef81f23d6648992c93437892982 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/NoEditor.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/NoEditor.meta new file mode 100644 index 00000000..c5b7db43 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/NoEditor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: aa3dc305dd00dad49bbc1ff3996b055d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Serialization.dll b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Serialization.dll new file mode 100644 index 00000000..a1592131 Binary files /dev/null and b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Serialization.dll differ diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Serialization.dll.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Serialization.dll.meta new file mode 100644 index 00000000..1a97dca0 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Serialization.dll.meta @@ -0,0 +1,79 @@ +fileFormatVersion: 2 +guid: 5651992cdad94894a3af7dc3f1da9170 +timeCreated: 1488828285 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Any: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude N3DS: 0 + Exclude OSXIntel: 1 + Exclude OSXIntel64: 1 + Exclude OSXUniversal: 1 + Exclude PS4: 0 + Exclude PSM: 0 + Exclude PSP2: 0 + Exclude SamsungTV: 0 + Exclude Tizen: 0 + Exclude WebGL: 0 + Exclude WiiU: 0 + Exclude Win: 1 + Exclude Win64: 1 + Exclude WindowsStoreApps: 0 + Exclude XboxOne: 0 + Exclude iOS: 0 + Exclude tvOS: 0 + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + N3DS: + enabled: 1 + settings: {} + PS4: + enabled: 1 + settings: {} + 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 + XboxOne: + enabled: 1 + settings: {} + iOS: + enabled: 1 + settings: {} + tvOS: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Utilities.dll b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Utilities.dll new file mode 100644 index 00000000..a996815d Binary files /dev/null and b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Utilities.dll differ diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Utilities.dll.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Utilities.dll.meta new file mode 100644 index 00000000..21e88ae1 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Utilities.dll.meta @@ -0,0 +1,79 @@ +fileFormatVersion: 2 +guid: 5978f8f3dd274e848fbb7a123bde1fb9 +timeCreated: 1488828285 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Any: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude N3DS: 0 + Exclude OSXIntel: 1 + Exclude OSXIntel64: 1 + Exclude OSXUniversal: 1 + Exclude PS4: 0 + Exclude PSM: 0 + Exclude PSP2: 0 + Exclude SamsungTV: 0 + Exclude Tizen: 0 + Exclude WebGL: 0 + Exclude WiiU: 0 + Exclude Win: 1 + Exclude Win64: 1 + Exclude WindowsStoreApps: 0 + Exclude XboxOne: 0 + Exclude iOS: 0 + Exclude tvOS: 0 + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + N3DS: + enabled: 1 + settings: {} + PS4: + enabled: 1 + settings: {} + 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 + XboxOne: + enabled: 1 + settings: {} + iOS: + enabled: 1 + settings: {} + tvOS: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor.meta new file mode 100644 index 00000000..cefd7a7a --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a73a691127ad93941b89586292291dab +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Serialization.dll b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Serialization.dll new file mode 100644 index 00000000..5bef928c Binary files /dev/null and b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Serialization.dll differ diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Serialization.dll.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Serialization.dll.meta new file mode 100644 index 00000000..ac8769d2 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Serialization.dll.meta @@ -0,0 +1,76 @@ +fileFormatVersion: 2 +guid: d2a8f0021d6b47c5923d8972dfb81ef1 +timeCreated: 1488828285 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 1 + settings: {} + Any: + enabled: 0 + settings: + Exclude Android: 0 + Exclude Editor: 1 + Exclude Linux: 0 + Exclude Linux64: 0 + Exclude LinuxUniversal: 0 + Exclude N3DS: 1 + Exclude OSXIntel: 0 + Exclude OSXIntel64: 0 + Exclude OSXUniversal: 0 + Exclude PS4: 1 + Exclude PSM: 1 + Exclude PSP2: 1 + Exclude SamsungTV: 1 + Exclude Tizen: 1 + Exclude WebGL: 1 + Exclude WiiU: 1 + Exclude Win: 0 + Exclude Win64: 0 + Exclude WindowsStoreApps: 1 + Exclude XboxOne: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + Linux: + enabled: 1 + settings: {} + Linux64: + enabled: 1 + settings: {} + LinuxUniversal: + enabled: 1 + settings: {} + OSXIntel: + enabled: 1 + 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 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Utilities.dll b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Utilities.dll new file mode 100644 index 00000000..ca86fbbd Binary files /dev/null and b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Utilities.dll differ diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Utilities.dll.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Utilities.dll.meta new file mode 100644 index 00000000..f158c550 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Utilities.dll.meta @@ -0,0 +1,76 @@ +fileFormatVersion: 2 +guid: 1e0a9643dc0d4b46bf2321f72c4e503e +timeCreated: 1488828285 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 1 + settings: {} + Any: + enabled: 0 + settings: + Exclude Android: 0 + Exclude Editor: 1 + Exclude Linux: 0 + Exclude Linux64: 0 + Exclude LinuxUniversal: 0 + Exclude N3DS: 1 + Exclude OSXIntel: 0 + Exclude OSXIntel64: 0 + Exclude OSXUniversal: 0 + Exclude PS4: 1 + Exclude PSM: 1 + Exclude PSP2: 1 + Exclude SamsungTV: 1 + Exclude Tizen: 1 + Exclude WebGL: 1 + Exclude WiiU: 1 + Exclude Win: 0 + Exclude Win64: 0 + Exclude WindowsStoreApps: 1 + Exclude XboxOne: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + Linux: + enabled: 1 + settings: {} + Linux64: + enabled: 1 + settings: {} + LinuxUniversal: + enabled: 1 + settings: {} + OSXIntel: + enabled: 1 + 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 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.dll b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.dll new file mode 100644 index 00000000..769bc7bf Binary files /dev/null and b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.dll differ diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.dll.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.dll.meta new file mode 100644 index 00000000..77ae9293 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.dll.meta @@ -0,0 +1,46 @@ +fileFormatVersion: 2 +guid: 47a84ebde4ec47fabb620b30cc7a3e5c +timeCreated: 1488828285 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Any: + enabled: 1 + settings: + Exclude Android: 0 + Exclude Editor: 0 + Exclude Linux: 0 + Exclude Linux64: 0 + Exclude LinuxUniversal: 0 + Exclude N3DS: 0 + Exclude OSXIntel: 0 + Exclude OSXIntel64: 0 + Exclude OSXUniversal: 0 + Exclude PS4: 0 + Exclude PSM: 0 + Exclude PSP2: 0 + Exclude SamsungTV: 0 + Exclude Tizen: 0 + Exclude WebGL: 0 + Exclude WiiU: 0 + Exclude Win: 0 + Exclude Win64: 0 + Exclude WindowsStoreApps: 0 + Exclude XboxOne: 0 + Exclude iOS: 0 + Exclude tvOS: 0 + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + WindowsStoreApps: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.xml b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.xml new file mode 100644 index 00000000..0649312d --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.xml @@ -0,0 +1,6441 @@ + + + + Sirenix.OdinInspector.Attributes + + + + + AssetLists is used on lists and arrays and single elements of unity types, and replaces the default list drawer with a list of all possible assets with the specified filter. + Use this to both filter and include or exclude assets from a list or an array, without navigating the project window. + + + Asset lists works on all asset types such as materials, scriptable objects, prefabs, custom components, audio, textures etc, and does also show inherited types. + + + The following example will display an asset list of all prefabs located in the project window. + + public class AssetListExamples : MonoBehaviour + { + [InfoBox("The AssetList attribute work on both lists of UnityEngine.Object types and UnityEngine.Object types, but have different behaviour.")] + [AssetList] + [InlineEditor(InlineEditorModes.LargePreview)] + public GameObject Prefab; + + [AssetList] + public List<PlaceableObject> PlaceableObjects; + + [AssetList(Path = "Plugins/Sirenix/")] + [InlineEditor(InlineEditorModes.LargePreview)] + public UnityEngine.Object Object; + + [AssetList(AutoPopulate = true)] + public List<PlaceableObject> PlaceableObjectsAutoPopulated; + + [AssetList(LayerNames = "MyLayerName")] + public GameObject[] AllPrefabsWithLayerName; + + [AssetList(AssetNamePrefix = "Rock")] + public List<GameObject> PrefabsStartingWithRock; + + [AssetList(Path = "/Plugins/Sirenix/")] + public List<GameObject> AllPrefabsLocatedInFolder; + + [AssetList(Tags = "MyTagA, MyTabB", Path = "/Plugins/Sirenix/")] + public List<GameObject> GameObjectsWithTag; + + [AssetList(Path = "/Plugins/Sirenix/")] + public List<Material> AllMaterialsInSirenix; + + [AssetList(Path = "/Plugins/Sirenix/")] + public List<ScriptableObject> AllScriptableObjects; + + [InfoBox("Use a method as a custom filter for the asset list.")] + [AssetList(CustomFilterMethod = "HasRigidbodyComponent")] + public List<GameObject> MyRigidbodyPrefabs; + + private bool HasRigidbodyComponent(GameObject obj) + { + return obj.GetComponent<Rigidbody>() != null; + } + } + + + + + + If true, all assets found and displayed by the asset list, will automatically be added to the list when inspected. + + + + + Comma separated list of tags to filter the asset list. + + + + + Filter the asset list to only include assets with a specified layer. + + + + + Filter the asset list to only include assets which name begins with. + + + + + Filter the asset list to only include assets which is located at the specified path. + + + + + Filter the asset list to only include assets for which the given filter method returns true. + + + + + Initializes a new instance of the class. + + + + + The AssetSelector attribute can be used on all Unity types and will prepend a small button next to the object field that when clicked, + will present the user with a dropdown of assets to select from which can be customized from the attribute. + + + + + True by default. + + + + + True by default. If the ValueDropdown attribute is applied to a list, then disabling this, + will render all child elements normally without using the ValueDropdown. The ValueDropdown will + still show up when you click the add button on the list drawer, unless is true. + + + + + False by default. + + + + + If the ValueDropdown attribute is applied to a list, and is set to true, then enabling this, + will exclude existing values, instead of rendering a checkbox indicating whether the item is already included or not. + + + + + If the dropdown renders a tree-view, then setting this to true will ensure everything is expanded by default. + + + + + By default, the dropdown will create a tree view. + + + + + Gets or sets the width of the dropdown. Default is zero. + + + + + Gets or sets the height of the dropdown. Default is zero. + + + + + Gets or sets the title for the dropdown. Null by default. + + + + + Specify which folders to search in. Specifying no folders will make it search in your entire project. + Use the property for a more clean way of populating this array through attributes. + + + + + The filters we should use when calling AssetDatabase.FindAssets. + + + + + + Specify which folders to search in. Specifying no folders will make it search in your entire project. + You can decalir multiple paths using '|' as the seperator. + Example: [AssetList(Paths = "Assets/Textures|Assets/Other/Textures")] + + + This property is simply a more clean way of populating the array. + + + + + + AssetsOnly is used on object properties, and restricts the property to project assets, and not scene objects. + Use this when you want to ensure an object is from the project, and not from the scene. + + + The following example shows a component with a game object property, that must be a prefab from the project, and not a scene object. + + public MyComponent : MonoBehaviour + { + [AssetsOnly] + public GameObject MyPrefab; + } + + + + + + + BoxGroup is used on any property and organizes the property in a boxed group. + Use this to cleanly organize relevant values together in the inspector. + + + The following example shows how BoxGroup is used to organize properties together into a box. + + public class BoxGroupExamples : MonoBehaviour + { + // Box with a centered title. + [BoxGroup("Centered Title", centerLabel: true)] + public int A; + + [BoxGroup("Centered Title", centerLabel: true)] + public int B; + + [BoxGroup("Centered Title", centerLabel: true)] + public int C; + + // Box with a title. + [BoxGroup("Left Oriented Title")] + public int D; + + [BoxGroup("Left Oriented Title")] + public int E; + + // Box with a title recieved from a field. + [BoxGroup("$DynamicTitle1"), LabelText("Dynamic Title")] + public string DynamicTitle1 = "Dynamic box title"; + + [BoxGroup("$DynamicTitle1")] + public int F; + + // Box with a title recieved from a property. + [BoxGroup("$DynamicTitle2")] + public int G; + + [BoxGroup("$DynamicTitle2")] + public int H; + + // Box without a title. + [InfoBox("You can also hide the label of a box group.")] + [BoxGroup("NoTitle", false)] + public int I; + + [BoxGroup("NoTitle")] + public int J; + + [BoxGroup("NoTitle")] + public int K; + + #if UNITY_EDITOR + public string DynamicTitle2 + { + get { return UnityEditor.PlayerSettings.productName; } + } + #endif + + [BoxGroup("Boxed Struct"), HideLabel] + public SomeStruct BoxedStruct; + + public SomeStruct DefaultStruct; + + [Serializable] + public struct SomeStruct + { + public int One; + public int Two; + public int Three; + } + } + + + + + + + + + + + If true a label for the group will be drawn on top. + + + + + If true the header label will be places in the center of the group header. Otherwise it will be in left side. + + + + + If non-null, this is used instead of the group's name as the title label. + + + + + Adds the property to the specified box group. + + The box group. + If true a label will be drawn for the group. + If set to true the header label will be centered. + The order of the group in the inspector. + + + + Initializes a new instance of the class. Use the other constructor overloads in order to show a header-label on the box group. + + + + + Combines the box group with another group. + + The other group. + + + + Buttons are used on functions, and allows for clickable buttons in the inspector. + + + The following example shows a component that has an initialize method, that can be called from the inspector. + + public class MyComponent : MonoBehaviour + { + [Button] + private void Init() + { + // ... + } + } + + + + The following example show how a Button could be used to test a function. + + public class MyBot : MonoBehaviour + { + [Button] + private void Jump() + { + // ... + } + } + + + + The following example show how a Button can named differently than the function it's been attached to. + + public class MyComponent : MonoBehaviour + { + [Button("Function")] + private void MyFunction() + { + // ... + } + } + + + + + + + + Use this to override the label on the button. + + + + + The style in which to draw the button. + + + + + If the button contains parameters, you can disable the foldout it creates by setting this to true. + + + + + Whether to display the button method's parameters (if any) as values in the inspector. True by default. + If this is set to false, the button method will instead be invoked through an ActionResolver or ValueResolver (based on whether it returns a value), giving access to contextual named parameter values like "InspectorProperty property" that can be passed to the button method. + + + + + 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. + + + + + If the button has a return type, set this to false to not draw the result. Default value is true. + + + + + Creates a button in the inspector named after the method. + + + + + Creates a button in the inspector named after the method. + + The size of the button. + + + + Creates a button in the inspector named after the method. + + The size of the button. + + + + Creates a button in the inspector with a custom name. + + Custom name for the button. + + + + Creates a button in the inspector with a custom name. + + Custom name for the button. + Size of the button. + + + + Creates a button in the inspector with a custom name. + + Custom name for the button. + Size of the button in pixels. + + + + Creates a button in the inspector named after the method. + + Button style for methods with parameters. + + + + Creates a button in the inspector named after the method. + + The size of the button. + Button style for methods with parameters. + + + + Creates a button in the inspector named after the method. + + The size of the button. + Button style for methods with parameters. + + + + Creates a button in the inspector with a custom name. + + Custom name for the button. + Button style for methods with parameters. + + + + Creates a button in the inspector with a custom name. + + Custom name for the button. + Size of the button. + Button style for methods with parameters. + + + + Creates a button in the inspector with a custom name. + + Custom name for the button. + 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. + Use this to organize multiple button in a tidy horizontal group. + + + The following example shows how ButtonGroup is used to organize two buttons into one group. + + public class MyComponent : MonoBehaviour + { + [ButtonGroup("MyGroup")] + private void A() + { + // .. + } + + [ButtonGroup("MyGroup")] + private void B() + { + // .. + } + } + + + + The following example shows how ButtonGroup can be used to create multiple groups of buttons. + + public class MyComponent : MonoBehaviour + { + [ButtonGroup("First")] + private void A() + { } + + [ButtonGroup("First")] + private void B() + { } + + [ButtonGroup("")] + private void One() + { } + + [ButtonGroup("")] + private void Two() + { } + + [ButtonGroup("")] + private void Three() + { } + } + + + + + + + + + + + + + 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. + + The group to organize the button into. + The order of the group in the inspector.. + + + + Button style for methods with parameters. + + + + + Draws a foldout box around the parameters of the method with the button on the box header itself. + This is the default style of a method with parameters. + + + + + Draws a button with a foldout to expose the parameters of the method. + + + + + Draws a foldout box around the parameters of the method with the button at the bottom of the box. + + + + + The ChildGameObjectsOnly attribute can be used on Components and GameObject fields and will prepend a small button next to the object-field that + will search through all child gameobjects for assignable objects and present them in a dropdown for the user to choose from. + + + + + + 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. + These drawers will out of the box have support for undo/redo and multi-selection. + + + Usage: + + public class CustomDrawerExamples : MonoBehaviour + { + public float From = 2, To = 7; + + [CustomValueDrawer("MyStaticCustomDrawerStatic")] + public float CustomDrawerStatic; + + [CustomValueDrawer("MyStaticCustomDrawerInstance")] + public float CustomDrawerInstance; + + [CustomValueDrawer("MyStaticCustomDrawerArray")] + public float[] CustomDrawerArray; + + #if UNITY_EDITOR + + private static float MyStaticCustomDrawerStatic(float value, GUIContent label) + { + return EditorGUILayout.Slider(value, 0f, 10f); + } + + private float MyStaticCustomDrawerInstance(float value, GUIContent label) + { + return EditorGUILayout.Slider(value, this.From, this.To); + } + + private float MyStaticCustomDrawerArray(float value, GUIContent label) + { + return EditorGUILayout.Slider(value, this.From, this.To); + } + + #endif + } + + + + + + Name of the custom drawer method. Obsolete; use the Action member instead. + + + + + A resolved string that defines the custom drawer action to take, such as an expression or method invocation. + + + + + 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. + These drawers will out of the box have support for undo/redo and multi-selection. + + 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 . + + + + + 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. + + + + + Disables a property if it is drawn from a prefab instance. + + + + + 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. + + + + public class InlineEditorExamples : MonoBehaviour + { + [EnableGUI] + public string SomeReadonlyProperty { get { return "My GUI is usually disabled." } } + } + + + + + + + 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. + + + + public enum MyEnum + { + One, + Two, + Three, + } + + public class MyMonoBehaviour : MonoBehaviour + { + [EnumPaging] + public MyEnum Value; + } + + + + + + + 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; + + // 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; + + // 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; + + // 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; + + // FilePath also supports member references with the $ symbol. + [FilePath(ParentFolder = "$DynamicParent", Extensions = "$DynamicExtensions")] + public string DynamicFilePath; + + public string DynamicParent = "Assets/Plugin/Sirenix"; + + public string DynamicExtensions = "cs, unity, jpg"; + } + + + + + + + + If true the FilePath will provide an absolute path, instead of a relative one. + + + + + Comma separated list of allowed file extensions. Dots are optional. + Supports member referencing with $. + + + + + ParentFolder provides an override for where the path is relative to. ParentFolder can be relative to the Unity project, or an absolute path. + Supports member referencing with $. + + + + + If true an error will be displayed for invalid, or missing paths. + + + + + If true an error will be displayed for non-existing paths. + + + + + 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. + + + + + FolderPath is used on string properties, and provides an interface for directory paths. + + + The following example demonstrates how FolderPath is used. + + public class FolderPathExamples : MonoBehaviour + { + // By default, FolderPath provides a path relative to the Unity project. + [FolderPath] + public string UnityProjectPath; + + // It is possible to provide custom parent patn. ParentFolder paths can be relative to the Unity project, or absolute. + [FolderPath(ParentFolder = "Assets/Plugins/Sirenix")] + public string RelativeToParentPath; + + // Using ParentFolder, FolderPath can also provide a path relative to a resources folder. + [FolderPath(ParentFolder = "Assets/Resources")] + public string ResourcePath; + + // By setting AbsolutePath to true, the FolderPath will provide an absolute path instead. + [FolderPath(AbsolutePath = true)] + public string AbsolutePath; + + // FolderPath can also be configured to show an error, if the provided path is invalid. + [FolderPath(RequireValidPath = true)] + public string ValidPath; + + // By default, FolderPath will enforce the use of forward slashes. It can also be configured to use backslashes instead. + [FolderPath(UseBackslashes = true)] + public string Backslashes; + + // FolderPath also supports member references with the $ symbol. + [FolderPath(ParentFolder = "$DynamicParent")] + public string DynamicFolderPath; + + public string DynamicParent = "Assets/Plugins/Sirenix"; + } + + + + + + + + If true the FolderPath will provide an absolute path, instead of a relative one. + + + + + ParentFolder provides an override for where the path is relative to. ParentFolder can be relative to the Unity project, or an absolute path. + Supports member referencing with $. + + + + + If true an error will be displayed for invalid, or missing paths. + + + + + If true an error will be displayed for non-existing paths. + + + + + 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.

+

The attribute is a group attribute and can therefore be combined with other group attributes, and even be used to show or hide entire groups.

+

Note that in the vast majority of cases where you simply want to be able to control the visibility of a single group, it is better to use the VisibleIf parameter that *all* group attributes have.

+
+ + + + + +
+ + + Whether or not to visually animate group visibility changes. + + + + + The optional member value. + + + + + Name of member to use when to hide the group. Defaults to the name of the group, by can be overriden by setting this property. + + + + + A resolved string that defines the condition to check the value of, such as a member name or an expression. + + + + + Makes a group that can be shown or hidden based on a condition. + + The group path. + If true then a fade animation will be played when the group is hidden or shown. + + + + Makes a group that can be shown or hidden based on a condition. + + The group path. + The value the member should equal for the property to shown. + If true then a fade animation will be played when the group is hidden or shown. + + + + Combines HideIfGroup attributes. + + 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 . + + + + + 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. + + + + + Hides a property if it is drawn from a prefab instance. + + + + + Hides a property if it is drawn from a prefab instance or a prefab asset. + + + + + 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. + This attribute has no effect on classes that are not derived from NetworkBehaviour. + + + The following example shows how to use this attribute. + + [HideNetworkBehaviourFields] + public class MyComponent : NetworkBehaviour + { + // The "Network Channel" and "Network Send Interval" properties 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. + + + + + 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. + + + + public class InlinePropertyExamples : MonoBehaviour + { + public Vector3 Vector3; + + public Vector3Int Vector3Int; + + [InlineProperty(LabelWidth = 12)] // It can be placed on classes as well as members + public Vector2Int Vector2Int; + + } + + [Serializable] + [InlineProperty(LabelWidth = 12)] // It can be placed on classes as well as members + public struct Vector3Int + { + [HorizontalGroup] + public int X; + + [HorizontalGroup] + public int Y; + + [HorizontalGroup] + public int Z; + } + + [Serializable] + public struct Vector2Int + { + [HorizontalGroup] + public int X; + + [HorizontalGroup] + public int Y; + } + + + + + + + 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. + + + The following example shows how LabelText is applied to a few property fields. + + public MyComponent : MonoBehaviour + { + [LabelWidth("3")] + public int MyInt3; + } + + + + + + + The new text of the label. + + + + + Give a property a custom label. + + 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. + + + + + OnCollectionChanged can be put on collections, and provides an event callback when the collection is about to be changed through the inspector, + and when the collection has been changed through the inspector. Additionally, it provides a CollectionChangeInfo struct containing information + about the exact changes made to the collection. This attribute works for all collections with a collection resolver, amongst them arrays, lists, + dictionaries, hashsets, stacks and linked lists. + + + + Note that this attribute only works in the editor! Collections changed by script will not trigger change events! + + + The following example shows how OnCollectionChanged can be used to get callbacks when a collection is being changed. + + [OnCollectionChanged("Before", "After")] + public List<string> list; + + public void Before(CollectionChangeInfo info) + { + if (info.ChangeType == CollectionChangeType.Add || info.ChangeType == CollectionChangeType.Insert) + { + Debug.Log("Adding to the list!"); + } + else if (info.ChangeType == CollectionChangeType.RemoveIndex || info.ChangeType == CollectionChangeType.RemoveValue) + { + Debug.Log("Removing from the list!"); + } + } + + public void After(CollectionChangeInfo info) + { + if (info.ChangeType == CollectionChangeType.Add || info.ChangeType == CollectionChangeType.Insert) + { + Debug.Log("Finished adding to the list!"); + } + else if (info.ChangeType == CollectionChangeType.RemoveIndex || info.ChangeType == CollectionChangeType.RemoveValue) + { + Debug.Log("Finished removing from the list!"); + } + } + + + + + + The OnInspectorDispose 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 disposed in the inspector. + Disposing will happen at least once, when the inspector changes selection or the property tree is collected by the garbage collector, but may also happen several times before that, most often when the type of a polymorphic property changes and it refreshes its drawer setup and recreates all its children, disposing of the old setup and children. + + + The following example demonstrates how OnInspectorDispose works. + + public class MyComponent : MonoBehaviour + { + [OnInspectorDispose(@"@UnityEngine.Debug.Log(""Dispose event invoked!"")")] + [ShowInInspector, InfoBox("When you change the type of this field, or set it to null, the former property setup is disposed. The property setup will also be disposed when you deselect this example."), DisplayAsString] + public BaseClass PolymorphicField; + + public abstract class BaseClass { public override string ToString() { return this.GetType().Name; } } + public class A : BaseClass { } + public class B : BaseClass { } + public class C : BaseClass { } + } + + + + + + This constructor should be used when the attribute is placed directly on a method. + + + + + 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. + Initialization will happen at least once during the first drawn frame of any given property, but may also happen several times later, most often when the type of a polymorphic property changes and it refreshes its drawer setup and recreates all its children. + + + The following example demonstrates how OnInspectorInit works. + + public class MyComponent : MonoBehaviour + { + // Display current time for reference. + [ShowInInspector, DisplayAsString, PropertyOrder(-1)] + public string CurrentTime { get { GUIHelper.RequestRepaint(); return DateTime.Now.ToString(); } } + + // OnInspectorInit executes the first time this string is about to be drawn in the inspector. + // It will execute again when the example is reselected. + [OnInspectorInit("@TimeWhenExampleWasOpened = DateTime.Now.ToString()")] + public string TimeWhenExampleWasOpened; + + // OnInspectorInit will not execute before the property is actually "resolved" in the inspector. + // Remember, Odin's property system is lazily evaluated, and so a property does not actually exist + // and is not initialized before something is actually asking for it. + // + // Therefore, this OnInspectorInit attribute won't execute until the foldout is expanded. + [FoldoutGroup("Delayed Initialization", Expanded = false, HideWhenChildrenAreInvisible = false)] + [OnInspectorInit("@TimeFoldoutWasOpened = DateTime.Now.ToString()")] + public string TimeFoldoutWasOpened; + } + + + + + + This constructor should be used when the attribute is placed directly on a method. + + + + + This constructor should be used when the attribute is placed on a non-method member. + + + + + + OnStateUpdate provides an event callback when the property's state should be updated, when the StateUpdaters run on the property instance. + This generally happens at least once per frame, and the callback will be invoked even when the property is not visible. This can be used to + approximate custom StateUpdaters like [ShowIf] without needing to make entire attributes and StateUpdaters for one-off cases. + + + + The following example shows how OnStateUpdate can be used to control the visible state of a property. + + public class MyComponent : MonoBehaviour + { + [OnStateUpdate("@$property.State.Visible = ToggleMyInt")] + public int MyInt; + + public bool ToggleMyInt; + } + + + + The following example shows how OnStateUpdate can be used to control the expanded state of a list. + + public class MyComponent : MonoBehaviour + { + [OnStateUpdate("@$property.State.Expanded = ExpandList")] + public List<string> list; + + public bool ExpandList; + } + + The following example shows how OnStateUpdate can be used to control the state of another property. + + public class MyComponent : MonoBehaviour + { + public List>string< list; + + [OnStateUpdate("@#(list).State.Expanded = $value")] + public bool ExpandList; + } + + + + + + + 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. + 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. + + + These object fields can also be selectively enabled and customized globally from the Odin preferences window. + + + + The following example shows how PreviewField is applied to a few property fields. + + public MyComponent : MonoBehaviour + { + [PreviewField] + public UnityEngine.Object SomeObject; + + [PreviewField] + public Texture SomeTexture; + + [HorizontalGroup, HideLabel, PreviewField(30)] + public Material A, B, C, D, F; + } + + + + + + + The height of the object field + + + + + The FilterMode to be used for the preview. + + + + + Left aligned. + + + + + 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. + + + + + Draws a square object field which renders a preview for UnityEngine.Object type objects. + + 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. + + 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. + + The alignment of the preview field. + + + + Draws a horizontal progress bar based on the value of the property. + Use it for displaying a meter to indicate how full an inventory is, or to make a visual indication of a health bar. + + + The following example shows how ProgressBar can be used. + + public class ProgressBarExample : MonoBehaviour + { + // Default progress bar. + [ProgressBar(0, 100)] + public int ProgressBar; + + // Health bar. + [ProgressBar(0, 100, ColorMember = "GetHealthBarColor")] + public float HealthBar = 50; + + private Color GetHealthBarColor(float value) + { + // Blends between red, and yellow color for when the health is below 30, + // and blends between yellow and green color for when the health is above 30. + return Color.Lerp(Color.Lerp( + Color.red, Color.yellow, MathUtilities.LinearStep(0f, 30f, value)), + Color.green, MathUtilities.LinearStep(0f, 100f, value)); + } + + // Stacked health bar. + // The ProgressBar attribute is placed on property, without a set method, so it can't be edited directly. + // So instead we have this Range attribute on a float to change the value. + [Range(0, 300)] + public float StackedHealth; + + [ProgressBar(0, 100, ColorMember = "GetStackedHealthColor", BackgroundColorMember = "GetStackHealthBackgroundColor")] + private float StackedHealthProgressBar + { + // Loops the stacked health value between 0, and 100. + get { return this.StackedHealth - 100 * (int)((this.StackedHealth - 1) / 100); } + } + + private Color GetStackedHealthColor() + { + return + this.StackedHealth > 200 ? Color.cyan : + this.StackedHealth > 100 ? Color.green : + Color.red; + } + + private Color GetStackHealthBackgroundColor() + { + return + this.StackedHealth > 200 ? Color.green : + this.StackedHealth > 100 ? Color.red : + new Color(0.16f, 0.16f, 0.16f, 1f); + } + + // Custom color and height. + [ProgressBar(-100, 100, r: 1, g: 1, b: 1, Height = 30)] + public short BigProgressBar = 50; + + // You can also reference members by name to dynamically assign the min and max progress bar values. + [ProgressBar("DynamicMin", "DynamicMax")] + public float DynamicProgressBar; + + public float DynamicMin, DynamicMax; + } + + + + + + + + + The minimum value. + + + + + The maximum value. + + + + + The name of a field, property or method to get the min values from. Obsolete; use the MinGetter member instead. + + + + + A resolved string that should evaluate to a float value, and will be used as the min bounds. + + + + + The name of a field, property or method to get the max values from. Obsolete; use the MaxGetter member instead. + + + + + A resolved string that should evaluate to a float value, and will be used as the max bounds. + + + + + The red channel of the color of the progress bar. + + + + + The green channel of the color of the progress bar. + + + + + The blue channel of the color of the progress bar. + + + + + The height of the progress bar in pixels. Defaults to 12 pixels. + + + + + Optional reference to a Color field, property or method, to dynamically change the color of the progress bar. Obsolete; use the ColorGetter member instead. + + + + 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. + + + + Optional reference to a Color field, property or method, to dynamically change the background color of the progress bar. + Default background color is (0.16, 0.16, 0.16, 1). + Obsolete; use the BackgroundColorGetter member instead. + + + + 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. + + + + If true then the progress bar will be drawn in tiles. + + + + + References a member by name to get a custom value label string from. Obsolete; use the CustomValueStringGetter member instead. + + + + + A resolved string to get a custom value label string from. + + + + + Draws a progress bar for the value. + + The minimum value. + The maximum value. + The red channel of the color of the progress bar. + The green channel of the color of the progress bar. + The blue channel of the color of the progress bar. + + + + Draws a progress bar for the value. + + A resolved string that should evaluate to a float value, and will be used as the min bounds. + The maximum value. + The red channel of the color of the progress bar. + The green channel of the color of the progress bar. + The blue channel of the color of the progress bar. + + + + Draws a progress bar for the value. + + The minimum value. + A resolved string that should evaluate to a float value, and will be used as the max bounds. + The red channel of the color of the progress bar. + The green channel of the color of the progress bar. + The blue channel of the color of the progress bar. + + + + Draws a progress bar for the value. + + A resolved string that should evaluate to a float value, and will be used as the min bounds. + A resolved string that should evaluate to a float value, and will be used as the max bounds. + The red channel of the color of the progress bar. + The green channel of the color of the progress bar. + The blue channel of the color of the progress bar. + + + + If true then there will be drawn a value label on top of the progress bar. + + + + + Gets a value indicating if the user has set a custom DrawValueLabel value. + + + + + The alignment of the value label on top of the progress bar. Defaults to center. + + + + + 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. + This is equivalent to Unity's Range attribute, but this attribute can be applied to both fields and property. + + The following example demonstrates how PropertyRange is used. + + public class MyComponent : MonoBehaviour + { + [PropertyRange(0, 100)] + public int MyInt; + + [PropertyRange(-100, 100)] + public float MyFloat; + + [PropertyRange(-100, -50)] + public decimal MyDouble; + + // This attribute also supports dynamically referencing members by name to assign the min and max values for the range field. + [PropertyRange("DynamicMin", "DynamicMax"] + public float MyDynamicValue; + + public float DynamicMin, DynamicMax; + } + + + + + + + + + The minimum value. + + + + + The maximum value. + + + + + The name of a field, property or method to get the min value from. Obsolete; use the MinGetter member instead. + + + + + A resolved string that should evaluate to a float value, and will be used as the min bounds. + + + + + The name of a field, property or method to get the max value from. Obsolete; use the MaxGetter member instead. + + + + + A resolved string that should evaluate to a float value, and will be used as the max bounds. + + + + + Creates a slider control to set the value of the property to between the specified range.. + + The minimum value. + The maximum value. + + + + Creates a slider control to set the value of the property to between the specified range.. + + A resolved string that should evaluate to a float value, and will be used as the min bounds. + The maximum value. + + + + Creates a slider control to set the value of the property to between the specified range.. + + The minimum value. + A resolved string that should evaluate to a float value, and will be used as the max bounds. + + + + Creates a slider control to set the value of the property to between the specified range.. + + A resolved string that should evaluate to a float value, and will be used as the min bounds. + A resolved string that should evaluate to a float value, and will be used as the max bounds. + + + + The PropertySpace attribute have the same function as Unity's existing Space attribute, but can be applied anywhere as opposed to just fields. + + + The following example demonstrates the usage of the PropertySpace attribute. + + [PropertySpace] // Defaults to a space of 8 pixels just like Unity's Space attribute. + public int MyField; + + [ShowInInspector, PropertySpace(16)] + public int MyProperty { get; set; } + + [ShowInInspector, PropertySpace(16, 16)] + public int MyProperty { get; set; } + + [Button, PropertySpace(32)] + public void MyMethod() + { + ... + } + + [PropertySpace(-8)] // A negative space can also be remove existing space between properties. + public int MovedUp; + + + + + + + + + + The space between properties in pixels. + + + + + The space between properties in pixels. + + + + + Adds a space of 8 pixels between properties. + + + + + Adds a space between properties. + + + + + 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. + + + + [ResponsiveButtonGroup] + public void Foo() { } + + [ResponsiveButtonGroup] + public void Bar() { } + + [ResponsiveButtonGroup] + public void Baz() { } + + + + + [ResponsiveButtonGroup(UniformLayout = true)] + public void Foo() { } + + [ResponsiveButtonGroup] + public void Bar() { } + + [ResponsiveButtonGroup] + public void Baz() { } + + + + + [ResponsiveButtonGroupAttribute(UniformLayout = true, DefaultButtonSize = ButtonSizes.Large)] + public void Foo() { } + + [GUIColor(0, 1, 0))] + [Button(ButtonSizes.Large)] + [ResponsiveButtonGroup] + public void Bar() { } + + [ResponsiveButtonGroup] + public void Baz() { } + + + + + [TabGroup("SomeTabGroup", "SomeTab")] + [ResponsiveButtonGroup("SomeTabGroup/SomeTab/SomeBtnGroup")] + public void Foo() { } + + [ResponsiveButtonGroup("SomeTabGroup/SomeTab/SomeBtnGroup")] + public void Bar() { } + + [ResponsiveButtonGroup("SomeTabGroup/SomeTab/SomeBtnGroup")] + public void Baz() { } + + + + + + The default size of the button. + + + + + If true then the widths of a line of buttons will be the same. + + + + + Draws a button that will be placed in a group that will respond to the horizontal space available to the group. + + The name of the group to place the button in. + + + + Merges the values of this group with another ResponsiveButtonGroupAttribute. + + 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.

+

The attribute is a group attribute and can therefore be combined with other group attributes, and even be used to show or hide entire groups.

+

Note that in the vast majority of cases where you simply want to be able to control the visibility of a single group, it is better to use the VisibleIf parameter that *all* group attributes have.

+
+ + + + + +
+ + + Whether or not to visually animate group visibility changes. Alias for AnimateVisibility. + + + + + The optional member value. + + + + + Name of member to use when to hide the group. Defaults to the name of the group, by can be overriden by setting this property. + + + + + A resolved string that defines the condition to check the value of, such as a member name or an expression. + + + + + Makes a group that can be shown or hidden based on a condition. + + The group path. + If true then a fade animation will be played when the group is hidden or shown. + + + + Makes a group that can be shown or hidden based on a condition. + + The group path. + The value the member should equal for the property to shown. + If true then a fade animation will be played when the group is hidden or shown. + + + + Combines ShowIfGroup attributes. + + 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. + + + + + + ShowPropertyResolver shows the property resolver responsible for bringing the member into the property tree. + This is useful in situations where you want to debug why a particular member that is normally not shown in the inspector suddenly is. + + + + + public class MyComponent : MonoBehaviour + { + [ShowPropertyResolver] + public int IndentedInt; + } + + + + + + The SuffixLabel attribute draws a label at the end of a property. + Use this for conveying intend about a property. Is the distance measured in meters, kilometers, or in light years?. + Is the angle measured in degrees or radians? + Using SuffixLabel, you can place a neat label at the end of a property, to clearly show how the the property is used. + + + The following example demonstrates how SuffixLabel is used. + + public class MyComponent : MonoBehaviour + { + // The SuffixLabel attribute draws a label at the end of a property. + // It's useful for conveying intend about a property. + // Fx, this field is supposed to have a prefab assigned. + [SuffixLabel("Prefab")] + public GameObject GameObject; + + // Using the Overlay property, the suffix label will be drawn on top of the property instead of behind it. + // Use this for a neat inline look. + [SuffixLabel("ms", Overlay = true)] + public float Speed; + + [SuffixLabel("radians", Overlay = true)] + public float Angle; + + // The SuffixLabel attribute also supports string member references by using $. + [SuffixLabel("$Suffix", Overlay = true)] + public string Suffix = "Dynamic suffix label"; + } + + + + + + + + + + The label displayed at the end of the property. + + + + + 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. + + 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 . + + + + [TableList] + public List<SomeType> TableList = new List<SomeType>(); + + [Serializable] + public class SomeType + { + [LabelWidth(30)] + [TableColumnWidth(130, false)] + [VerticalGroup("Combined")] + public string A; + + [LabelWidth(30)] + [VerticalGroup("Combined")] + public string B; + + [Multiline(2), Space(3)] + public string fields; + } + + + + + + + The width of the column. + + + + + Whether the column should be resizable. True by default. + + + + + Initializes a new instance of the class. + + The width of the column in pixels. + If true then the column can be resized in the inspector. + + + + Renders lists and arrays in the inspector as tables. + + + + + + + If ShowPaging is enabled, this will override the default setting specified in the Odin Preferences window. + + + + + Mark the table as read-only. This removes all editing capabilities from the list such as Add and delete, + but without disabling GUI for each element drawn as otherwise would be the case if the was used. + + + + + The default minimum column width - 40 by default. This can be overwriten by individual columns using the . + + + + + If true, a label is drawn for each element which shows the index of the element. + + + + + Whether to draw all rows in a scroll-view. + + + + + The number of pixels before a scroll view appears. 350 by default. + + + + + The number of pixels before a scroll view appears. 0 by default. + + + + + If true, expanding and collapsing the table from the table title-bar is no longer an option. + + + + + Whether to hide the toolbar containing the add button and pagin etc.s + + + + + The cell padding. + + + + + Whether paging buttons should be added to the title bar. The default value of this, can be customized from the Odin Preferences window. + + + + + Whether the ShowPaging property has been set. + + + + + Sets the Min and Max ScrollViewHeight. + + + + + The TableMatrix attribute is used to further specify how Odin should draw two-dimensional arrays. + + + + // Inheriting from SerializedMonoBehaviour is only needed if you want Odin to serialize the multi-dimensional arrays for you. + // If you prefer doing that yourself, you can still make Odin show them in the inspector using the ShowInInspector attribute. + public class TableMatrixExamples : SerializedMonoBehaviour + { + [InfoBox("Right-click and drag column and row labels in order to modify the tables."), PropertyOrder(-10), OnInspectorGUI] + private void ShowMessageAtOP() { } + + [BoxGroup("Two Dimensional array without the TableMatrix attribute.")] + public bool[,] BooleanTable = new bool[15, 6]; + + [BoxGroup("ReadOnly table")] + [TableMatrix(IsReadOnly = true)] + public int[,] ReadOnlyTable = new int[5, 5]; + + [BoxGroup("Labled table")] + [TableMatrix(HorizontalTitle = "X axis", VerticalTitle = "Y axis")] + public GameObject[,] LabledTable = new GameObject[15, 10]; + + [BoxGroup("Enum table")] + [TableMatrix(HorizontalTitle = "X axis")] + public InfoMessageType[,] EnumTable = new InfoMessageType[4,4]; + + [BoxGroup("Custom table")] + [TableMatrix(DrawElementMethod = "DrawColoredEnumElement", ResizableColumns = false)] + public bool[,] CustomCellDrawing = new bool[30,30]; + + #if UNITY_EDITOR + + private static bool DrawColoredEnumElement(Rect rect, bool value) + { + if (Event.current.type == EventType.MouseDown && rect.Contains(Event.current.mousePosition)) + { + value = !value; + GUI.changed = true; + Event.current.Use(); + } + + UnityEditor.EditorGUI.DrawRect(rect.Padding(1), value ? new Color(0.1f, 0.8f, 0.2f) : new Color(0, 0, 0, 0.5f)); + + return value; + } + + #endif + } + + + + + + If true, inserting, removing and dragging columns and rows will become unavailable. But the cells themselves will remain modifiable. + If you want to disable everything, you can use the attribute. + + + + + Whether or not columns are resizable. + + + + + The vertical title label. + + + + + The horizontal title label. + + + + + Override how Odin draws each cell. + [TableMatrix(DrawElementMethod='DrawMyElement')] + public MyType[,] myArray; + private static MyType DrawElement(Rect rect, MyType value) { return GUI.DrawMyType(rect, value); } + + + + + The height for all rows. 0 = default row height. + + + + + If true, the height of each row will be the same as the width of the first cell. + + + + + If true, no column indices drawn. + + + + + If true, no row indices drawn. + + + + + Whether the drawn table should respect the current GUI indent level. + + + + + 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. + + + + + A resolved string that should evaluate to a value that is assignable to IList; e.g, arrays and lists are compatible. + + + + + Gets or sets the title for the dropdown. Null by default. + + + + + If true, the value will be drawn normally after the type selector dropdown has been drawn. False by default. + + + + + Creates a dropdown menu for a property. + + A resolved string that should evaluate to a value that is assignable to IList; e.g, arrays and lists are compatible. + + + + The TypeInfoBox attribute adds an info box to the very top of a type in the inspector. + Use this to add an info box to the top of a class in the inspector, without having to use neither the PropertyOrder nor the OnInspectorGUI attribute. + + + The following example demonstrates the use of the TypeInfoBox attribute. + + [TypeInfoBox("This is my component and it is mine.")] + public class MyComponent : MonoBehaviour + { + // Class implementation. + } + + + + + + + + The message to display in the info box. + + + + + Draws an info box at the top of a type in the inspector. + + The message to display in the info box. + + + Specifies if the '<none>' item is shown. + + + Specifies if categories are shown. + + + + Specifies if namespaces are preferred over assembly category names for category names. + + + + + Function for filtering types displayed in the Type Selector. + + + + 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; + + + Implementation example: public bool SomeFilterMethod(Type type). + + + + + + 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 . + + + + + 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. + + + + ValueDropdown is used on any property and creates a dropdown with configurable options. + Use this to give the user a specific set of options to select from. + + + Due to a bug in Unity, enums will sometimes not work correctly. The last example shows how this can be fixed. + + + The following example shows a how the ValueDropdown can be used on an int property. + + public class MyComponent : MonoBehaviour + { + [ValueDropdown("myValues")] + public int MyInt; + + // The selectable values for the dropdown. + private int[] myValues = { 1, 2, 3 }; + } + + + + The following example shows how ValueDropdownList can be used for objects, that do not implement a usable ToString. + + public class MyComponent : MonoBehaviour + { + [ValueDropdown("myVectorValues")] + public Vector3 MyVector; + + // The selectable values for the dropdown, with custom names. + private ValueDropdownList<Vector3> myVectorValues = new ValueDropdownList<Vector3>() + { + {"Forward", Vector3.forward }, + {"Back", Vector3.back }, + {"Up", Vector3.up }, + {"Down", Vector3.down }, + {"Right", Vector3.right }, + {"Left", Vector3.left }, + }; + } + + + + The following example shows how the ValueDropdown can on any member that implements IList. + + public class MyComponent : MonoBehaviour + { + // Member field of type float[]. + private float[] valuesField; + + [ValueDropdown("valuesField")] + public float MyFloat; + + // Member property of type List<thing>. + private List<string> ValuesProperty { get; set; } + + [ValueDropdown("ValuesProperty")] + public string MyString; + + // Member function that returns an object of type IList. + private IList<ValueDropdownItem<int>> ValuesFunction() + { + return new ValueDropdownList<int> + { + { "The first option", 1 }, + { "The second option", 2 }, + { "The third option", 3 }, + }; + } + + [ValueDropdown("ValuesFunction")] + public int MyInt; + } + + + + Due to a bug in Unity, enums member arrays will in some cases appear as empty. This example shows how you can get around that. + + public class MyComponent : MonoBehaviour + { + // Make the field static. + private static MyEnum[] MyStaticEnumArray = MyEnum[] { ... }; + + // Force Unity to serialize the field, and hide the property from the inspector. + [SerializeField, HideInInspector] + private MyEnum MySerializedEnumArray = MyEnum[] { ... }; + } + + + + + + + Name of any field, property or method member that implements IList. E.g. arrays or Lists. Obsolete; use the ValuesGetter member instead. + + + + + A resolved string that should evaluate to a value that is assignable to IList; e.g, arrays and lists are compatible. + + + + + The number of items before enabling search. Default is 10. + + + + + False by default. + + + + + True by default. If the ValueDropdown attribute is applied to a list, then disabling this, + will render all child elements normally without using the ValueDropdown. The ValueDropdown will + still show up when you click the add button on the list drawer, unless is true. + + + + + False by default. + + + + + If the ValueDropdown attribute is applied to a list, and is set to true, then enabling this, + will exclude existing values, instead of rendering a checkbox indicating whether the item is already included or not. + + + + + If the dropdown renders a tree-view, then setting this to true will ensure everything is expanded by default. + + + + + If true, instead of replacing the drawer with a wide dropdown-field, the dropdown button will be a little button, drawn next to the other drawer. + + + + + Disables the the GUI for the appended drawer. False by default. + + + + + By default, a single click selects and confirms the selection. + + + + + By default, the dropdown will create a tree view. + + + + + Gets or sets the width of the dropdown. Default is zero. + + + + + Gets or sets the height of the dropdown. Default is zero. + + + + + Gets or sets the title for the dropdown. Null by default. + + + + + False by default. + + + + + Whether to draw all child properties in a foldout. + + + + + 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. + + A resolved string that should evaluate to a value that is assignable to IList; e.g, arrays and lists are compatible. + + + + + + + + + Gets the label for the dropdown item. + + The label text for the item. + + + + Gets the value of the dropdown item. + + The value for the item. + + + + Use this with to specify custom names for values. + + The type of the value. + + + + Adds the specified value with a custom name. + + The name of the item. + The value. + + + + Adds the specified value. + + The value. + + + + + + + + + The name of the item. + + + + + The value of the item. + + + + + Initializes a new instance of the class. + + The text to display for the dropdown item. + The value for the dropdown item. + + + + The name of this item. + + + + + Gets the text. + + + + + Gets the value. + + + + + + + + + + The name of the item. + + + + + The value of the item. + + + + + Initializes a new instance of the class. + + The text to display for the dropdown item. + The value for the dropdown item. + + + + Gets the text. + + + + + Gets the value. + + + + + The name of this item. + + + + + 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 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. + + + + Wrap is used on most primitive property, and allows for wrapping the value when it goes out of the defined range. + Use this when you want a value that goes around in circle, like for example an angle. + + + Currently unsigned primitives are not supported. + + + The following example show how Wrap is used on a property. + + public class MyComponent : MonoBehaviour + { + [Wrap(-100, 100)] + public float MyFloat; + } + + + + + + + The lowest value for the property. + + + + + The highest value for the property. + + + + + Wraps the value of the property round when the values goes out of range. + + 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. + + + + + Generic message box with no type. + + + + + Information message box. + + + + + Warning message box. + + + + + 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/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.xml.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.xml.meta new file mode 100644 index 00000000..ba9d6b68 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.xml.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 47a84ebde4ec47fabb620b30cc7a096f +timeCreated: 1488828285 +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.dll b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.dll new file mode 100644 index 00000000..8a16c89b Binary files /dev/null and b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.dll differ diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.dll.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.dll.meta new file mode 100644 index 00000000..57f5b0e0 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.dll.meta @@ -0,0 +1,46 @@ +fileFormatVersion: 2 +guid: a4865f1ab4504ed8a368670db22f409c +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/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.xml b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.xml new file mode 100644 index 00000000..7d29698a --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.xml @@ -0,0 +1,11312 @@ + + + + Sirenix.OdinInspector.Editor + + + + + An ActionResolver resolves a string to an action, given an InspectorProperty instance to use as context. Call to get an instance of an ActionResolver. + Action resolvers are a globally extendable system that can be hooked into and modified or changed by creating and registering an . + See Odin's tutorials for details and examples of how to use ActionResolvers. + + + + + The context of this ActionResolver, 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 delegate that executes the actual action. You should not call this manually, but instead call . + + + + + 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". + + + + + Draws an error message box if there is an error, and does nothing if there is no error. + + + + + Executes the resolved action for a given selection index. + + The selection index to execute the action on. Defaults to 0. + + + + Executes the action for all selection indices. + + + + + Creates a new action 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 action 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 action resolver instance for a given string. + + The property that is the context for the resolution to happen in. + The string that should be resolved to an action. + + + + Creates a new action resolver instance for a given string. + + The property that is the context for the resolution to happen in. + The string that should be resolved to an action. + 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 action 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 action resolvers. The returned value is null if there are no errors. + + + + + Draws error boxes for all errors in the given action 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 action resolvers, or does nothing if there are no errors. This is equivalent to calling DrawError() on all resolvers passed to this method. + + + + + This struct contains all of an ActionResolver's configurations and values it needs to function. For performance and simplicity reasons, this is a single very large struct that lives on an ActionResolver instance and is passed around by ref to anything that needs it. + + + + + The property that *provides* the context for the action 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 action resolution wasn't found, or if creation of the action resolver failed because was invalid, or if the action was executed but threw an exception. (In this last case, will be true.) + + + + + The named values that are available to the action 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 will be true if is not null and the message was caused by an exception thrown by code invoked during execution of the resolved action. + + + + + Whether exceptions thrown during action execution should be logged to the console. + + + + + The string that is resolved to perform an action. + + + + + Whether the action 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 action execution, 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 action resolution, ie, the type that is the context. This is the same as .ValueEntry.TypeOfValue. + + + + + The property that *is* the context for the action 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. + + + + + A color palette. + + + + + Name of the color palette. + + + + + The colors. + + + + + Whether to show the alpha channel. + + + + + Add, Edit or remove custom color palettes used by the . + + You can modify the configuration in the Odin Preferences window found in 'Tools -> Odin Inspector -> Preferences -> Drawers -> Color Palettes', + or by locating the configuration file stored as a serialized object in the Sirenix folder under 'Odin Inspector/Config/Editor/ColorPaletteManager'. + + + + + + Specify the amount of spacing between each color in a color palette. + + + + + Specify the width of each color in a color palette. If StretchPalette is set to true, this will become the min-width. + + + + + If true, all color in a color palette is stretch so that the entire color-palette area is filled. + + + + + If true, a toolbar with the name of the color palette is shown above each color palette. + + + + + Gives you the list of all custom color palettes. + 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. + + + + + Gets or sets a value indicating whether or not Odin should automatically configure the import settings of its DLLs in a preprocess build step. + Keep in mind that this feature is only supported by Unity version 5.6 and up. + + + + + 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. + + + + + Gets the name of the current running version of Odin Inspector. + + + + + Gets the current running version of Odin Inspector. + + + + + 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. + See Odin's tutorials for more information about usage of the state system. + + + + + If set to true, all state changes for this property will be logged to the console. + + + + + Whether the property is visible in the inspector. + + + + + Whether the Visible state was true or not during the last layout event. + + + + + Whether the property is enabled in the inspector. + + + + + Whether the Enabled state was true or not during the last layout event. + + + + + Whether the property is expanded in the inspector. + + + + + Whether the Expanded state was true or not during the last layout event. + + + + + Creates a custom state with a given name. + + + + + + + + + Determines whether a state with the given key exists. + + The key to check. + True if the state exists, otherwise, false. + + + + Determines whether a state with the given key exists. + + The key to check. + If the state exists, this out parameter will be true if the state is persistent. + True if the state exists, otherwise, false. + + + + Determines whether a state with the given key exists. + + The key to check. + If the state exists, this out parameter will contain the type of value that the state contains. + True if the state exists, otherwise, false. + + + + Determines whether a state with the given key exists. + + The key to check. + If the state exists, this out parameter will be true if the state is persistent. + If the state exists, this out parameter will contain the type of value that the state contains. + True if the state exists, otherwise, false. + + + + Gets the value of a given state as an instance of type T. + + The type to get the state value as. An will be thrown if the state's value type cannot be assigned to T. + The key of the state to get. An will be thrown if a state with the given key does not exist. + The value of the state. + + + + Gets the value that a given state contained last layout as an instance of type T. + + The type to get the state value as. An will be thrown if the state's value type cannot be assigned to T. + The key of the state to get. An will be thrown if a state with the given key does not exist. + The value of the state during the last layout event. + + + + Sets the value of a given state to a given value. + + The type to set the state value as. An will be thrown if T cannot be assigned to the state's value type. + The key of the state to set the value of. An will be thrown if a state with the given key does not exist. + The value to set. + + + + Cleans the property state and prepares it for cached reuse of its containing PropertyTree. This will also reset the state. + + + + + Resets all states to their default values. Persistent states will be updated to their persistent cached value if one exists. + + + + + 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. + + + + + This will be replaced by an IMGUIDrawingComponent in patch 3.2. + + + + + 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. + + + + + The serialization backend used to determine how to draw this property tree. Set this to control. + + + + + 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 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 + + There must be at least one target. + or + A given target is a null value. + + + + + 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. + 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. + + + + + 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. + + + + + This attribute processor will take any attribute already applied to the property with the applied to, + and take all attributes applied to the attribute (except any ) and add to them to the property. + This allows for adding attributes to attributes in the property system. + + + + + Looks for attributes in the attributes list with a applied, and adds the attribute from those attributes to the property. + + The parent of the member. + The member that is being processed. + The list of attributes currently applied to the property. + + + + Finds all attributes attached to the specified member and adds to them to attribute list. + + + + + This attribute processor can only process for members. + + The property to process. + false. + + + + Finds all attributes attached to the specified member and adds to them to the attributes list. + + The parent property of the specified member. + The member to process attributes for. + The current attributes applied to the property. + + + + Attribute processor that can add, change and remove attributes from a property. + + + + + Instanciates an OdinAttributeProcessor instance of the specified type. + + The type of processor to instanciate. The type must inherit from . + A new instance of the specified type. + + + + Checks if the processor can process attributes for the specified member. + + The parent property of the member. + The member to be processed. + true if the processor can process for the specified member. Otherwise false. + + + + Checks if the processor can process attributes for the specified property. + + The property to process. + true if the processor can process attributes for the specified property. Otherwise false. + + + + Processes attributes for the specified member. + + The parent property of the specified member. + The member to process attributes for. + The current attributes applied to the property. + + + + Processes attributes for the specified property. + + The property to process attributes for. + The current attributes applied to the property. + + + + Attribute processor that can add, change and remove attributes from a property. + + + + + Find attributes attached to the type definition of a property and adds to them to attribute list. + + + + + This attribute processor can only process for properties. + + The parent of the specified member. + The member to process. + false. + + + + This attribute processor can only process for properties with an attached value entry. + + The property to process. + true if the specified property has a value entry. Otherwise false. + + + + Finds all attributes attached to the type and base types of the specified property value and adds them to the attribute list. + + 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. + + + + + Singleton instance of . + + + + + Gets an instance for the specified property. + + 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. + + + + + Gets an instance for the specified property. + + The property to get an instance for. + An instance of to resolver the specified property. + + + + Note: this interface may be temporary, and may eventually be substituted for a public-facing way of extending the prefab modification system. + + For now, it only exists to denote which internally defined resolvers support prefab modifications being set. + + + + + 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. + + + + + Unknown collection change, the change was not specified by the invoking code. + + + + + The change is adding a value to the collection. Value and SelectionIndex will be set. + + + + + The change is inserting a value into the collection. Index, Value and SelectionIndex will be set. + + + + + The change is removing a value from the collection. Value and SelectionIndex will be set. + + + + + The change is removing a value at an index from the collection. Index and SelectionIndex will be set. + + + + + The change is clearing the collection. SelectionIndex will be set. + + + + + The change is removing a key from the collection. Key and SelectionIndex will be set. + + + + + The change is setting the value of a key in the collection. Key, Value and SelectionIndex will be set. + + + + + 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. + + + + + Gets the attribute that the OdinAttributeStateUpdater applies to. + + + + + Gets the strongly typed ValueEntry of the OdinAttributeStateUpdater's property. + + + + + 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. + + + + + Draws the property with GUILayout support. This method is called by DrawPropertyImplementation if the GUICallType is set to GUILayout, which is the default. + + + + + Odin drawer for . + + + + + Initializes the drawer. + + + + + Not yet documented. + + + + + Draws Color properties marked with . + + + + + 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 . + + + + + 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 . + Calls the properties ToString method to get the string to draw. + + + + + + + + + + + Draws the property. + + + + + Draws members marked with . + + + + + Odin drawer for the . + + + + + Returns true if the drawer can draw the type. + + + + + Draws the property. + + + + + Draws an enum in a horizontal button group instead of a dropdown. + + + + + Returns true if the drawer can draw the type. + + + + + Draws the property. + + + + + Not yet documented. + + + + + Initializes the drawer. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Initializes the drawer. + + + + + Not yet documented. + + + + + 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 + + + + + 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 . + + + + + + + + + + + + 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. + + + + + When first learning to use the Odin Inspector, it is common for people to misunderstand the OdinSerialize attribute, + and use it in places where it does not achive the deceired goal. + + + This drawer will display a warning message if the OdinSerialize attribute is potentially used in such cases. + + + + + + + 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. + + + + + + Initialized the drawer. + + + + + Draws the property. + + + + + Generic implementation of progress bar field drawing. + + + + + Converts the generic value to a double. + + The generic value to convert. + The generic value as a double. + + + + Draws values decorated with . + + + + + + + Draws a progress bar for a byte property. + + + + + Converts the generic value to a double. + + The generic value to convert. + The generic value as a double. + + + + Draws values decorated with . + + + + + + + Draws a progress bar for a sbyte property. + + + + + Converts the generic value to a double. + + The generic value to convert. + The generic value as a double. + + + + Draws values decorated with . + + + + + + + Draws a progress bar for a short property. + + + + + Converts the generic value to a double. + + The generic value to convert. + The generic value as a double. + + + + Draws values decorated with . + + + + + + + Draws a progress bar for a ushort property. + + + + + Converts the generic value to a double. + + The generic value to convert. + The generic value as a double. + + + + Draws values decorated with . + + + + + + + Draws a progress bar for an int property. + + + + + Converts the generic value to a double. + + The generic value to convert. + The generic value as a double. + + + + Draws values decorated with . + + + + + + + Draws a progress bar for a uint property. + + + + + Converts the generic value to a double. + + The generic value to convert. + The generic value as a double. + + + + Draws values decorated with . + + + + + + + Draws a progress bar for a long property. + + + + + Converts the generic value to a double. + + The generic value to convert. + The generic value as a double. + + + + Draws values decorated with . + + + + + + + Draws a progress bar for a ulong property. + + + + + Converts the generic value to a double. + + The generic value to convert. + The generic value as a double. + + + + Draws values decorated with . + + + + + + + Draws a progress bar for a float property. + + + + + Converts the generic value to a double. + + The generic value to convert. + The generic value as a double. + + + + Draws values decorated with . + + + + + + + Draws a progress bar for a double property. + + + + + Converts the generic value to a double. + + The generic value to convert. + The generic value as a double. + + + + Draws values decorated with . + + + + + + + Draws a progress bar for a decimal property. + + + + + Converts the generic value to a double. + + The generic value to convert. + The generic value as a double. + + + + Draws byte properties marked with . + + + + + + + + + + + Initialized the drawer. + + + + + Draws the property. + + + + + Draws double properties marked with . + + + + + + + + + + + Initialized the drawer. + + + + + Draws the property. + + + + + Draws float properties marked with . + + + + + + + + + + + Initialized the drawer. + + + + + Draws the property. + + + + + Draws decimal properties marked with . + + + + + Initialized the drawer. + + + + + Draws the property. + + + + + Draws short properties marked with . + + + + + + + + + + + Initialized the drawer. + + + + + Draws the property. + + + + + Draws int properties marked with . + + + + + + + + + + + Initialized the drawer. + + + + + Draws the property. + + + + + Draws long properties marked with . + + + + + + + + + + + Initialized the drawer. + + + + + Draws the property. + + + + + Draws sbyte properties marked with . + + + + + + + + + + + Initialized the drawer. + + + + + Draws the property. + + + + + Draws ushort properties marked with . + + + + + + + + + + + Initialized the drawer. + + + + + Draws the property. + + + + + Draws uint properties marked with . + + + + + + + + + + + Initialized the drawer. + + + + + Draws the property. + + + + + Draws ulong properties marked with . + + + + + + + + + + + Initialized the drawer. + + + + + Draws the property. + + + + + Draws a space for properties marked with the PropertySpace attribute. + + + + + Initializes this instance. + + + + + Draws the property. + + + + + Draws byte properties marked with . + + + + + + + + + + + Draws the property. + + + + + Draws double properties marked with . + + + + + + + + + + + Draws the property. + + + + + Draws float properties marked with . + + + + + + + + + + + Draws the property. + + + + + Draws decimal properties marked with . + + + + + Draws the property. + + + + + Draws short properties marked with . + + + + + + + + + + + Draws the property. + + + + + Draws int properties marked with . + + + + + + + + + + + Draws the property. + + + + + Draws long properties marked with . + + + + + + + + + + + Draws the property. + + + + + Draws sbyte properties marked with . + + + + + + + + + + + Draws the property. + + + + + Draws ushort properties marked with . + + + + + + + + + + + Draws the property. + + + + + Draws uint properties marked with . + + + + + + + + + + + Draws the property. + + + + + Draws ulong properties marked with . + + + + + + + + + + + Draws the property. + + + + + Show drawer chain attribute drawer. + + + + + Draws the property. + + + + + Drawer for the ShowPropertyResolver attribute. + + + + + + Draws properties marked with . + + + + + + Initializes this instance. + + + + + 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 . + + + + + + + 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 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. + + + + + Initializes the class. + + + + + 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 + + + + + + Initializes this instance. + + + + + Draws the property. + + + + + Draws all properties grouped together with the + + + + + + Draws the property. + + + + + Draws all properties grouped together with the + + + + + + Initializes this instance. + + + + + 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 + + + + + + Draws the property. + + + + + Draws properties marked with . + + + + + + + Draws the property. + + + + + Draws all properties grouped together with the + + + + + + Draws the property. + + + + + 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. + + + + + Evaluates all strings, enums and primitive types and ensures EditorGUI.showMixedValue is true if there are any value conflicts in the current selection. + + + + + Sets the drawer to only be evaluated on primitive types, strings and enums. + + + + + Draws the property. + + + + + Adds the right click area. + + + + + Adds the right click area. + + + + + Opens a context menu for any given property on right click. The context menu is populated by all relevant drawers that implements . + + + + + + Initializes the drawer. + + + + + Draws the property. + + + + + Draws all reference type properties, which has already been drawn elsewhere. This drawer adds an additional foldout to prevent infinite draw depth. + + + + + Prevents the drawer from being applied to UnityEngine.Object references since they are shown as an object field, and is not drawn in-line. + + + + + Draws the property. + + + + + Draws properties with a set. + + + + + Draws the property. + + + + + + When multiple objects are selected and inspected, this his drawer ensures UnityEditor.EditorGUI.showMixedValue + gets set to true if there are any conflicts in the selection for any given property. + Otherwise the next drawer is called. + + This drawer also implements and provides a right-click context menu item for resolving conflicts if any. + + + + + Draws the property. + + + + + Animation curve property drawer. + + + + + Bool property drawer. + + + + + Draws the property. + + + + + Byte property drawer. + + + + + 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. + + + + + Draws the property. + + + + + Color property drawer. + + + + + Draws the property. + + + + + Color palette property drawer. + + + + + Draws the property. + + + + + Drawer for composite properties. + + + + + Draws the property. + + + + + Decimal 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. + + + + + Double property drawer. + + + + + 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. + + + + + Returns true if the drawer can draw the type. + + + + + 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. + + + + + Draws the property. + + + + + Int property drawer. + + + + + Draws the property. + + + + + Long property drawer. + + + + + Draws the property. + + + + + LayerMask property 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. + + + + + 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. + + + + + Draws the property. + + + + + String property drawer. + + + + + 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. + + + + + Draws the property. + + + + + Uint property drawer. + + + + + Draws the property. + + + + + Ulong property drawer. + + + + + Draws the property. + + + + + Unity event drawer. + + + + + Draws the property. + + + + + Unity object drawer. + + + + + Initializes this instance. + + + + + Draws the property. + + + + + Vector2 proprety drawer. + + + + + Draws the property. + + + + + Populates the generic menu for the property. + + + + + Vector3 property drawer. + + + + + Draws the property. + + + + + Populates the generic menu for the property. + + + + + Vector4 property drawer. + + + + + Draws the property. + + + + + Populates the generic menu for the property. + + + + + Draws properties marked with . + + + + + + + + + Draws the property. + + + + + Draws short properties marked with . + + + + + + Not yet documented. + + + + + Draws int properties marked with . + + + + + + Not yet documented. + + + + + Draws long properties marked with . + + + + + + Not yet documented. + + + + + Draws float properties marked with . + + + + + + Not yet documented. + + + + + Draws double properties marked with . + + + + + + Not yet documented. + + + + + Draws decimal properties marked with . + + + + + + Not yet documented. + + + + + Draws Vector2 properties marked with . + + + + + + Not yet documented. + + + + + Draws Vector3 properties marked with . + + + + + + Not yet documented. + + + + + Draws Vector4 properties marked with . + + + + + + Not yet documented. + + + + + Base drawer to inherit from to draw methods. + + + + + + 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. + + + + + 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 . + + [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. + + + + + 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 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 a value indicating if the drawer has been initialized yet. + + + + + 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. + + + + 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. + + + + + Draws the default Odin inspector. + + + + + Draws the default Unity inspector. + + + + + Not yet documented. + + + + + Draws the property tree. + + + + + Called by Unity. + + + + + Called by Unity. + + + + + + Base class for all group drawers. Use this class to create your own custom group drawers. OdinGroupDrawer are used to group multiple properties together using an attribute. + + + + Note that all box group attributes needs to inherit from the + + + + Remember to provide your custom drawer with an + in order for it to be located by the . + + + + + + Checkout the manual for more information. + + + + + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method, AllowMultiple = false, Inherited = true)] + public class MyBoxGroupAttribute : PropertyGroupAttribute + { + public MyBoxGroupAttribute(string group, float order = 0) : base(group, order) + { + } + } + + // Remember to wrap your custom group drawer within a #if UNITY_EDITOR condition, or locate the file inside an Editor folder. + + public class BoxGroupAttributeDrawer : OdinGroupDrawer<MyBoxGroupAttribute> + { + protected override void DrawPropertyGroupLayout(InspectorProperty property, MyBoxGroupAttribute attribute, GUIContent label) + { + GUILayout.BeginVertical("box"); + for (int i = 0; i < property.Children.Count; i++) + { + InspectorUtilities.DrawProperty(property.Children[i]); + } + GUILayout.EndVertical(); + } + } + + // Usage: + public class MyComponent : MonoBehaviour + { + [MyBoxGroup("MyGroup")] + public int A; + + [MyBoxGroup("MyGroup")] + public int B; + + [MyBoxGroup("MyGroup")] + public int C; + } + + + + + + + + + + + + + + + + + + Draws the property with GUILayout support. + + 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. + } + } + + + + + + + + + + + + + + + + + + + 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. + + + + + + DrawerPriority is used in conjunction with + to specify the priority of any given drawer. It consists of 3 components: + Super, Wrapper, Value, where Super is the most significant component, + and Standard is the least significant component. + + + + + + + + Auto priority is defined by setting all of the components to zero. + If no is defined on a drawer, it will default to AutoPriority. + + + + + The standard priority. Mostly used by s. + + + + + The attribute priority. Mostly used by s. + + + + + The wrapper priority. Mostly used by drawers used to decorate properties. + + + + + The super priority. Mostly used by drawers that wants to wrap the entire property but don't draw the actual property. + These drawers typically don't draw the property itself, and calls CallNextDrawer. + + + + + The value priority. Mostly used by s and s. + + + + + The wrapper priority. Mostly used by drawers used to decorate properties. + + + + + The super priority. Mostly used by drawers that wants to wrap the entire property but don't draw the actual property. + These drawers typically don't draw the property itself, and calls CallNextDrawer. + + + + + Initializes a new instance of the struct. + + The priority. + + + + Initializes a new instance of the struct. + + + The super priority. Mostly used by drawers that wants to wrap the entire property but don't draw the actual property. + These drawers typically don't draw the property itself, and calls CallNextDrawer. + The wrapper priority. Mostly used by drawers used to decorate properties. + The value priority. Mostly used by s and s. + + + + Implements the operator >. + + The LHS. + The RHS. + + The result of the operator. + + + + + Implements the operator <. + + The LHS. + The RHS. + + The result of the operator. + + + + + Implements the operator <=. + + The LHS. + The RHS. + + The result of the operator. + + + + + Implements the operator >=. + + The LHS. + The RHS. + + The result of the operator. + + + + + Implements the operator +. + + The LHS. + The RHS. + + The result of the operator. + + + + + Implements the operator -. + + The LHS. + The RHS. + + The result of the operator. + + + + + Implements the operator ==. + + The LHS. + The RHS. + + The result of the operator. + + + + + Implements the operator !=. + + The LHS. + The RHS. + + The result of the operator. + + + + + Gets the priority level. + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + + A that represents this instance. + + + + + 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. + + + + + Equals the specified other. + + The other. + + + + + Compares to. + + The other. + + + + + DrawerPriority is used on inspector drawers and indicates the priority of the drawer. + Use this to make your custom drawer to come before or after other drawers, and potentially hide other drawers. + + + The following example shows how DrawerPriority could be apply to a value drawer. + + [DrawerPriority(DrawerPriorityLevel.ValuePriority)] + + public sealed class MyIntDrawer : InspectorValuePropertyDrawer<int> + { + // ... + } + + + + The following example shows how DrawerPriority is used to mark a custom int drawer as a high priority drawer. + + [DrawerPriority(1, 0, 0)] + + public sealed class MySpecialIntDrawer : InspectorValuePropertyDrawer<int> + { + // ... + } + + + + + + + + The priority of the drawer. + + + + + Indicates the priority of an inspector drawer. + + Option for priority for the inspector drawer. + + + + Indicates the priority of an inspector drawer. + + + The super priority. Mostly used by drawers that wants to wrap the entire property but don't draw the actual property. + These drawers typically don't draw the property itself, and calls CallNextDrawer. + The wrapper priority. Mostly used by drawers used to decorate properties. + The value priority. Mostly used by s and s. + + + + + DrawerPriorityLevel is used in conjunction with . + + + + + + + + Auto priority is defined by setting all of the components to zero. + If no is defined on a drawer, it will default to AutoPriority. + + + + + The value priority. Mostly used by s. + + + + + The attribute priority. Mostly used by s. + + + + + The wrapper priority. Mostly used by drawers used to decorate properties. + + + + + The super priority. Mostly used by drawers that wants to wrap the entire property but don't draw the actual property. + 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 . + + + + + The field that backs the value of this MonoBehaviour. + + + + + Sets the value contained in this scriptable object. + + + + + Gets the value contained in this scriptable object. + + + + + Strongly typed base class for emitted MonoBehaviour-derived types that have been created by the . + + + + + Sets the value contained in this scriptable object. + + + + + Gets the value contained in this scriptable object. + + + + + Sets the value contained in this scriptable object. + + + + + Gets the value contained in this scriptable object. + + + + + Base class for emitted ScriptableObject-derived types that have been created by the . + + + + + The field that backs the value of this scriptable object. + + + + + Sets the value contained in this scriptable object. + + + + + Gets the value contained in this scriptable object. + + + + + Strongly typed base class for emitted scriptable object types that have been created by the . + + + + + Sets the value contained in this scriptable object. + + + + + Gets the value contained in this scriptable object. + + + + + Sets the value contained in this scriptable object. + + + + + 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. + This is because dynamic assemblies in the current AppDomain break that method, and Unity's about window depends on it. + + + + + + If you mark any of Unity's assemblies with the [AssemblyVersion] attribute to get a rolling assembly + version that changes sometimes (or all the time), Odin's hardcoded assembly references to user types + will break. + + + To fix this case, and all other cases of references to wrongly versioned Unity types not being resolved, + we overload the app domain's type resolution and resolve Unity user assemblies properly regardless of + version. + + + + + + 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. + Changing this behavior, also changes which methods should be overridden in the drawer. + + + + + + + + + GUILayout enabled the use of GUILayout, EditorGUILayout and + + + + + Draws the property using Unity's GUI, and EditorGUI. + + + + + 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. + + + + + Provides a variety of miscellaneous utilities widely used in the inspector. + + + + + Converts an Odin property path to a deep reflection path. + + + + + Converts an Odin property path (without groups included) into a Unity property path. + + + + + Prepares a property tree for drawing, and handles management of undo, as well as marking scenes and drawn assets dirty. + + The tree to be drawn. + Whether to register undo commands for the changes made to the tree. This can only be set to true if the tree has a to represent. + tree is null + + + + Ends drawing a property tree, and handles management of undo, as well as marking scenes and drawn assets dirty. + + The tree. + + + + Draws all properties in a given property tree; must be wrapped by a and . + + The tree to be drawn. + + + + Draws a property in the inspector using a given label. + + + + + Odin property system exception. + + + + + Initializes a new instance of OdinPropertyException. + + The message for the exception. + An inner exception. + + + + Custom types used by the can choose to implement the ITemporaryContext + interface in order to be notified when the context gets reset. + + + + + Called by when the context gets reset. + + + + + Used by all InspectorProperty to tell Odin how to set or get a value on any given property. + + + + + Whether the value is readonly. + + + + + Gets the type of the owner. + + + + + Gets the type of the value. + + + + + Sets the weakly typed value on a given weakly typed owner. + + The owner. + The value. + + + + Gets the value from a given weakly typed owner. + + The weakly typed owner. + The found value. + + + + Used by all to tell Odin how to set or get a value on any given property. + + + + + Sets the value on a given owner. + + The owner. + The value. + + + + Gets the value from a given owner. + + 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. + + + Checkout the manual for more information. + + + + // Specify that this drawer must be included in the inspector; without this, it will not be drawn + public class MyCustomTypeDrawer<T> : OdinValueDrawer<T> where T : MyCustomBaseType + { + protected override void DrawPropertyLayout(IPropertyValueEntry<T> entry, GUIContent label) + { + T value = entry.SmartValue; + // Draw property here. + + // Optionally, call the next drawer in line. + this.CallNextDrawer(entry, label); + } + } + + + + + + + + + + + + Initializes a new instance of the class. + + + + + 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. + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Sirenix preferences window. + + + + + Opens the Odin inspector preferences window. + + + + + Opens the Odin inspector preferences window. + + + + + This class has been made fully obsolete, and has been replaced by . + It was a helper class to handle strings for labels and other similar purposes. + + + + + If any error occurred while looking for members, it will be stored here. + + + + + Obsolete. Use other constructor. + + + + + Obsolete. Use other constructor. + + + + + Creates a StringMemberHelper to get a display string. + + Inspector property to get string from. + The input string. If the first character is a '$', then StringMemberHelper will look for a member string field, property or method, and will try to parse it as an expression if it starts with '@'. + + + + Creates a StringMemberHelper to get a display string. + + Inspector property to get string from. + The input string. If the first character is a '$', then StringMemberHelper will look for a member string field, property or method, and will try to parse it as an expression if it starts with '@'./// The input string. If the first character is a '$', then StringMemberHelper will look for a member string field, property or method. + + + + Gets a value indicating whether or not the string is retrived from a from a member. + + + + + Gets the type of the object. + + + + + Gets the string from the StringMemberHelper. + Only updates the string buffer in Layout events. + + The property entry, to get the instance reference from. + The current display string. + + + + Gets the string from the StringMemberHelper. + Only updates the string buffer in Layout events. + + The property, to get the instance reference from. + The current string. + + + + Gets the string from the StringMemberHelper. + Only updates the string buffer in Layout events. + + The instance, for evt. member references. + The current string. + + + + Gets the string from the StringMemberHelper. + + The property entry, to get the instance reference from. + The current string. + + + + Gets the string from the StringMemberHelper. + + The property, to get the instance reference from. + The current string. + + + + Gets the string from the StringMemberHelper. + + 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. + + + + + public class MyCustomTypeDrawer<T> : OdinValueDrawer<T> where T : MyCustomBaseType + { + protected override void DrawPropertyLayout(IPropertyValueEntry<T> entry, GUIContent label) + { + var isToggled = entry.Context(this, "toggled", false); + isToggled.Value = SirenixEditorGUI.Label(isToggled.Value, label); + if (SirenixEditorGUI.BeginFadeGroup(UniqueDrawerKey.Create(entry, this), isToggled.Value)) + { + EditorGUI.indentLevel++; + this.CallNextDrawer(entry.Property, null); + EditorGUI.indentLevel--; + } + SirenixEditorGUI.EndFadeGroup(); + } + } + + + + + + Gets a unique key for any given property within a drawer. + + The property entry. + The drawer. + + + + + Gets a unique key for any given property within a drawer. + + The property. + The drawer. + + + + + Checks if two keys are identical. + + The other key. + + + + Checks if two keys are identical. + + + + + 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. + + + + + Provides utilities for emitting ScriptableObject and MonoBehaviour-derived types with specific property names and types, and providing instances of with those names and types. + + + + + A handle for a set of emitted Unity objects. When disposed (or collected by the GC) this handle will queue the emitted object instances for destruction. + + + + + The unity property to represent. + + + + + The Unity objects to represent. + + + + + Initializes a new instance of the class. + + The unity property to represent. + The objects to represent. + + + + Finalizes an instance of the class. + + + + + Creates an emitted MonoBehaviour-based . + + Name of the field to emit. + Type of the value to create a property for. + The target count of the tree to create a property for. + The game object that the MonoBehaviour of the property is located on. + + fieldName is null + or + valueType is null + + Target count must be equal to or higher than 1. + + + + Creates an emitted ScriptableObject-based . + + Name of the field to emit. + Type of the value to create a property for. + The target count of the tree to create a property for. + + fieldName is null + or + valueType is null + + 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. + + + + + Time stamp for when the persistent context value was last used. + Used for purging unused context. + + + + + Instatiates a persistent context. + + + + + Updates the time stamp to now. + + + + + Context that persists across reloading and restarting Unity. + + The type of the context value. + + + + The value of the context. + + + + + Creates a new persistent context object. + + + + + Formats a string with the time stamp, and the value. + + + + + Helper class that provides a local copy of a . + When the local value is changed, it also changed the global value, but the global value does not change the local value. + + The type of the context value. + + + + The value of the context. + Changing this value, also changes the global context value, but the global value does not change the local value. + + + + + Creates a local context object for the provided global context. + + The global context object. + + + + Updates the local value to the current global value. + + + + + Provides context objects that still persist when Unity reloads or is restarted. + + + + + Gets a GlobalPersistentContext object for the specified key. + + The type of the first key. + The type of the value stored in the context object. + The first key. + The default value, used for when the context object is first created. + + + + Gets a GlobalPersistentContext object for the specified keys. + + The type of the first key. + The type of the second key. + The type of the value stored in the context object. + The first key. + The second key. + The default value, used for when the context object is first created. + + + + Gets a GlobalPersistentContext object for the specified keys. + + The type of the first key. + The type of the second key. + The type of the third key. + The type of the value stored in the context object. + The first key. + The second key. + The third key. + The default value, used for when the context object is first created. + + + + Gets a GlobalPersistentContext object for the specified keys. + + The type of the first key. + The type of the second key. + The type of the third key. + The type of the fourth key. + The type of the value stored in the context object. + The first key. + The second key. + The third key. + The fourth key. + The default value, used for when the context object is first created. + + + + Gets a GlobalPersistentContext object for the specified keys. + + The type of the first key. + The type of the second key. + The type of the third key. + The type of the fourth key. + The type of the fifth key. + The type of the value stored in the context object. + The first key. + The second key. + The third key. + The fourth key. + The fifth key. + The default value, used for when the context object is first created. + + + + Gets a GlobalPersistentContext object for the specified key. + Returns true when the context is first created. Otherwise false. + + The type of the first key. + The type of the value stored in the context object. + The first key. + The persistent context object. + Returns true when the context is first created. Otherwise false. + + + + Gets a GlobalPersistentContext object for the specified keys. + Returns true when the context is first created. Otherwise false. + + The type of the first key. + The type of the second key. + The type of the value stored in the context object. + The first key. + The second key. + The persistent context object. + Returns true when the context is first created. Otherwise false. + + + + Gets a GlobalPersistentContext object for the specified keys. + Returns true when the context is first created. Otherwise false. + + The type of the first key. + The type of the second key. + The type of the third key. + The type of the value stored in the context object. + The first key. + The second key. + The third key. + The persistent context object. + Returns true when the context is first created. Otherwise false. + + + + Gets a GlobalPersistentContext object for the specified keys. + Returns true when the context is first created. Otherwise false. + + The type of the first key. + The type of the second key. + The type of the third key. + The type of the fourth key. + The type of the value stored in the context object. + The first key. + The second key. + The third key. + The fourth key. + The persistent context object. + Returns true when the context is first created. Otherwise false. + + + + Gets a GlobalPersistentContext object for the specified keys. + Returns true when the context is first created. Otherwise false. + + The type of the first key. + The type of the second key. + The type of the third key. + The type of the fourth key. + The type of the fifth key. + The type of the value stored in the context object. + The first key. + The second key. + The third key. + The fourth key. + The fifth key. + The persistent context object. + Returns true when the context is first created. Otherwise false. + + + + Gets a LocalPersistentContext object for the specified key. + + The type of the first key. + The type of the value stored in the context object. + The first key. + The default value, used for when the context object is first created. + + + + Gets a LocalPersistentContext object for the specified keys. + + The type of the first key. + The type of the second key. + The type of the value stored in the context object. + The first key. + The second key. + The default value, used for when the context object is first created. + + + + Gets a LocalPersistentContext object for the specified keys. + + The type of the first key. + The type of the second key. + The type of the third key. + The type of the value stored in the context object. + The first key. + The second key. + The third key. + The default value, used for when the context object is first created. + + + + Gets a LocalPersistentContext object for the specified keys. + + The type of the first key. + The type of the second key. + The type of the third key. + The type of the fourth key. + The type of the value stored in the context object. + The first key. + The second key. + The third key. + The fourth key. + The default value, used for when the context object is first created. + + + + Gets a LocalPersistentContext object for the specified keys. + + The type of the first key. + The type of the second key. + The type of the third key. + The type of the fourth key. + The type of the fifth key. + The type of the value stored in the context object. + The first key. + The second key. + The third key. + The fourth key. + The fifth key. + The default value, used for when the context object is first created. + + + + Gets a LocalPersistentContext object for the specified key. + Returns true when the context is first created. Otherwise false. + + The type of the first key. + The type of the value stored in the context object. + The first key. + The persistent context object. + Returns true when the context is first created. Otherwise false. + + + + Gets a LocalPersistentContext object for the specified keys. + Returns true when the context is first created. Otherwise false. + + The type of the first key. + The type of the second key. + The type of the value stored in the context object. + The first key. + The second key. + The persistent context object. + Returns true when the context is first created. Otherwise false. + + + + Gets a LocalPersistentContext object for the specified keys. + Returns true when the context is first created. Otherwise false. + + The type of the first key. + The type of the second key. + The type of the third key. + The type of the value stored in the context object. + The first key. + The second key. + The third key. + The persistent context object. + Returns true when the context is first created. Otherwise false. + + + + Gets a LocalPersistentContext object for the specified keys. + Returns true when the context is first created. Otherwise false. + + The type of the first key. + The type of the second key. + The type of the third key. + The type of the fourth key. + The type of the value stored in the context object. + The first key. + The second key. + The third key. + The fourth key. + The persistent context object. + Returns true when the context is first created. Otherwise false. + + + + Gets a LocalPersistentContext object for the specified keys. + Returns true when the context is first created. Otherwise false. + + The type of the first key. + The type of the second key. + The type of the third key. + The type of the fourth key. + The type of the fifth key. + The type of the value stored in the context object. + The first key. + The second key. + The third key. + The fourth key. + The fifth key. + The persistent context object. + Returns true when the context is first created. Otherwise false. + + + + Persistent Context cache object. + + + + + Estimated cache size in bytes. + + + + + The current number of context entries in the cache. + + + + + If true then persistent context is disabled entirely. + + + + + If true the context will be saved to a file in the temp directory. + + + + + The max size of the cache in bytes. + + + + + 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. + + + + + Member filter for access modifiers. + + + + + include public members. + + + + + Include Non-public members. + + + + + Include both public and non-public members. + + + + + Member filter for member types. + + + + + No members included. + + + + + Include field members. + + + + + Include property members. + + + + + Include method members. + + + + + Include group members. + + + + + Include members from the base types. + + + + + Include members marked with the Obsolete attribute. + + + + + Include all members except members marked with the Obsolete attribute. + + + + + Shows the window. + + + + + Opens a new static inspector window for the given type. + + + + + Draws the Odin Editor Window. + + + + + Draws the editor for the this.CurrentDrawingTargets[index]. + + + + + Contains references to UnityEngine.Networking types. These types have been removed in Unity 2019+, and thus may be null. + + + + + Contains configuration for generating an assembly that provides increased AOT support in Odin. + + + + + + Whether to automatically scan the project and generate an AOT dll, right before builds. This will only affect platforms that are in the list. + + + **This will only work on Unity 5.6 and higher!** + + + + + + Whether to automatically delete the generated AOT dll after a build has completed. + + + + + A list of platforms to automatically scan the project and generate an AOT dll for, right before builds. This will do nothing unless is true. + + + + + The path to the AOT folder that the AOT .dll and linker file is created in, relative to the current project folder. + + + + + Scans the entire project for types to support AOT serialization for. + + + + + Generates an AOT DLL, using the current configuration of the AOTGenerationConfig instance. + + + + + Defines the ODIN_INSPECTOR symbol. + + + + + The Odin Inspector Serialization Debugger Window. + + + + + + Opens the Serialization Debugger Window with the last debugged type. + + + + + Opens the Serialization Debugger Window and debugs the given type. + + The type to debug serialization of. + + + + Initializes the Serialization Debugger Window. + + + + diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.xml.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.xml.meta new file mode 100644 index 00000000..9015656c --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.xml.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a4865f1ab4504ed8a368670db22f096f +timeCreated: 1488828285 +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinValidator.Editor.dll b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinValidator.Editor.dll new file mode 100644 index 00000000..6c51ea7e Binary files /dev/null and b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinValidator.Editor.dll differ diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinValidator.Editor.dll.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinValidator.Editor.dll.meta new file mode 100644 index 00000000..2de0af92 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinValidator.Editor.dll.meta @@ -0,0 +1,46 @@ +fileFormatVersion: 2 +guid: afbf832bc46149f5a291e87cab63e46d +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/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinValidator.Editor.xml b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinValidator.Editor.xml new file mode 100644 index 00000000..589bb1f4 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinValidator.Editor.xml @@ -0,0 +1,39 @@ + + + + Sirenix.OdinValidator.Editor + + + + + Result can be null. + + + + + Result will be null if the object is deleted. + + + + + Defines the ODIN_VALIDATOR symbol. + + + + + + Apply this to an assembly to register validation rules for the validation system. + This enables locating of all relevant validator types very quickly. + + + Only use this to register types derived from Validator! It is important to understand + that a rule is simply a serialized Validator instance that can be enabled, disabled, + and have its contained values modified from the rules management GUI in the Odin Validator + window. + + Read our Odin Validator tutorials for more information. + + + + + diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinValidator.Editor.xml.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinValidator.Editor.xml.meta new file mode 100644 index 00000000..ca8afda4 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinValidator.Editor.xml.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: afbf832bc46149f5a291e87cab63096f +timeCreated: 1488828285 +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Reflection.Editor.dll b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Reflection.Editor.dll new file mode 100644 index 00000000..b6f735e2 Binary files /dev/null and b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Reflection.Editor.dll differ diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Reflection.Editor.dll.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Reflection.Editor.dll.meta new file mode 100644 index 00000000..5c91f298 --- /dev/null +++ b/FactoryNumeric/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/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.dll b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.dll new file mode 100644 index 00000000..ac744468 Binary files /dev/null and b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.dll differ diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.dll.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.dll.meta new file mode 100644 index 00000000..cc2b4d36 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.dll.meta @@ -0,0 +1,46 @@ +fileFormatVersion: 2 +guid: 74721b9f0af448f5ae2e91102a1a5edd +timeCreated: 1488828285 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Any: + enabled: 1 + settings: + Exclude Android: 0 + Exclude Editor: 0 + Exclude Linux: 0 + Exclude Linux64: 0 + Exclude LinuxUniversal: 0 + Exclude N3DS: 0 + Exclude OSXIntel: 0 + Exclude OSXIntel64: 0 + Exclude OSXUniversal: 0 + Exclude PS4: 0 + Exclude PSM: 0 + Exclude PSP2: 0 + Exclude SamsungTV: 0 + Exclude Tizen: 0 + Exclude WebGL: 0 + Exclude WiiU: 0 + Exclude Win: 0 + Exclude Win64: 0 + Exclude WindowsStoreApps: 0 + Exclude XboxOne: 0 + Exclude iOS: 0 + Exclude tvOS: 0 + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + WindowsStoreApps: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.xml b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.xml new file mode 100644 index 00000000..f9e16abb --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.xml @@ -0,0 +1,202 @@ + + + + Sirenix.Serialization.Config + + + + + A helper class for quickly and easily defining custom loggers. + + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Specifies a data format to read and write in. + + + + + A custom packed binary format. This format is most efficient and almost allocation-free, + but its serialized data is not human-readable. + + + + + A JSON format compliant with the json specification found at "http://www.json.org/". + + This format has rather sluggish performance and allocates frightening amounts of string garbage. + + + + + A format that does not serialize to a byte stream, but to a list of data nodes in memory + which can then be serialized by Unity. + + This format is highly inefficient, and is primarily used for ensuring that Unity assets + are mergeable by individual values when saved in Unity's text format. This makes + serialized values more robust and data recovery easier in case of issues. + + This format is *not* recommended for use in builds. + + + + + Defines default loggers for serialization and deserialization. This class and all of its loggers are thread safe. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + The policy for handling errors during serialization and deserialization. + + + + + Attempts will be made to recover from errors and continue serialization. Data may become invalid. + + + + + Exceptions will be thrown when errors are logged. + + + + + Exceptions will be thrown when warnings or errors are logged. + + + + + Not yet documented. + + + + + Text for the cautionary serialization warning shown in the inspector. + + + + + Text for the hide button for the cautionary serialization warning shown in the inspector. + + + + + Text for the hide button for the cautionary prefab warning shown in the inspector. + + + + + Whether the user has chosen to hide the cautionary serialization warning. + + + + + Whether the user has chosen to hide the warning messages related to the OdinSerialize attribute. + + + + + Whether the user has chosen to hide the warning messages related to the SerializeField and ShowInInspector attributes on non-serialized members. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Implements methods for logging warnings, errors and exceptions during serialization and deserialization. + + + + + Logs a warning. + + The warning to log. + + + + Logs an error. + + The error to log. + + + + Logs an exception. + + The exception to log. + + + + The policy for which level of logging to do during serialization and deserialization. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.xml.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.xml.meta new file mode 100644 index 00000000..4334acc8 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.xml.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 74721b9f0af448f5ae2e91102a1a096f +timeCreated: 1488828285 +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.dll b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.dll new file mode 100644 index 00000000..9401293c Binary files /dev/null and b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.dll differ diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.dll.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.dll.meta new file mode 100644 index 00000000..063427be --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.dll.meta @@ -0,0 +1,46 @@ +fileFormatVersion: 2 +guid: 5f3147f7af4c49739579b966c458f5e4 +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/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.xml b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.xml new file mode 100644 index 00000000..84808d2b --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.xml @@ -0,0 +1,9864 @@ + + + + Sirenix.Serialization + + + + + Provides basic functionality and overridable abstract methods for implementing a data reader. + + If you inherit this class, it is VERY IMPORTANT that you implement each abstract method to the *exact* specifications the documentation specifies. + + + + + + + Initializes a new instance of the class. + + The base stream of the reader. + The deserialization context to use. + The stream or context is null. + Cannot read from stream. + + + + Gets the current node id. If this is less than zero, the current node has no id. + + + The current node id. + + + + + Gets the current node depth. In other words, the current count of the node stack. + + + The current node depth. + + + + + Gets the name of the current node. + + + The name of the current node. + + + + + Gets or sets the base stream of the reader. + + + The base stream of the reader. + + value + Cannot read from stream + + + + Gets the deserialization context. + + + The deserialization context. + + + + + Tries to enter a node. This will succeed if the next entry is an . + + This call MUST (eventually) be followed by a corresponding call to + + This call will change the values of the , , and properties to the correct values for the current node. + + The type of the node. This value will be null if there was no metadata, or if the reader's serialization binder failed to resolve the type name. + true if entering a node succeeded, otherwise false + + + + Exits the current node. This method will keep skipping entries using until an is reached, or the end of the stream is reached. + + This call MUST have been preceded by a corresponding call to . + + This call will change the values of the , , and to the correct values for the node that was prior to the current node. + + true if the method exited a node, false if it reached the end of the stream. + + + + Tries to enters an array node. This will succeed if the next entry is an . + + This call MUST (eventually) be followed by a corresponding call to + + This call will change the values of the , , and properties to the correct values for the current array node. + + The length of the array that was entered. + true if an array was entered, otherwise false + + + + Exits the closest array. This method will keep skipping entries using until an is reached, or the end of the stream is reached. + + This call MUST have been preceded by a corresponding call to . + + This call will change the values of the , , and to the correct values for the node that was prior to the exited array node. + + true if the method exited an array, false if it reached the end of the stream. + + + + Reads a primitive array value. This call will succeed if the next entry is an . + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The element type of the primitive array. Valid element types can be determined using . + The resulting primitive array. + true if reading a primitive array succeeded, otherwise false + + + + Peeks ahead and returns the type of the next entry in the stream. + + The name of the next entry, if it has one. + The type of the next entry. + + + + Reads an internal reference id. This call will succeed if the next entry is an . + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The internal reference id. + true if reading the value succeeded, otherwise false + + + + Reads an external reference index. This call will succeed if the next entry is an . + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The external reference index. + true if reading the value succeeded, otherwise false + + + + Reads an external reference guid. This call will succeed if the next entry is an . + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The external reference guid. + true if reading the value succeeded, otherwise false + + + + Reads an external reference string. This call will succeed if the next entry is an . + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The external reference string. + + true if reading the value succeeded, otherwise false + + + + + Reads a value. This call will succeed if the next entry is an . + + If the string of the entry is longer than 1 character, the first character of the string will be taken as the result. + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + true if reading the value succeeded, otherwise false + + + + Reads a value. This call will succeed if the next entry is an . + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + true if reading the value succeeded, otherwise false + + + + Reads a value. This call will succeed if the next entry is an . + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + true if reading the value succeeded, otherwise false + + + + Reads an value. This call will succeed if the next entry is an . + + If the value of the stored integer is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + true if reading the value succeeded, otherwise false + + + + Reads a value. This call will succeed if the next entry is an . + + If the value of the stored integer is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + true if reading the value succeeded, otherwise false + + + + Reads an value. This call will succeed if the next entry is an . + + If the value of the stored integer is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + true if reading the value succeeded, otherwise false + + + + Reads a value. This call will succeed if the next entry is an . + + If the value of the stored integer is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + true if reading the value succeeded, otherwise false + + + + Reads a value. This call will succeed if the next entry is an . + + If the value of the stored integer is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + true if reading the value succeeded, otherwise false + + + + Reads an value. This call will succeed if the next entry is an . + + If the value of the stored integer is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + true if reading the value succeeded, otherwise false + + + + Reads an value. This call will succeed if the next entry is an . + + If the value of the stored integer is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + true if reading the value succeeded, otherwise false + + + + Reads an value. This call will succeed if the next entry is an . + + If the value of the stored integer is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + true if reading the value succeeded, otherwise false + + + + Reads a value. This call will succeed if the next entry is an or an . + + If the stored integer or floating point value is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + true if reading the value succeeded, otherwise false + + + + Reads a value. This call will succeed if the next entry is an or an . + + If the stored integer or floating point value is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + true if reading the value succeeded, otherwise false + + + + Reads a value. This call will succeed if the next entry is an or an . + + If the stored integer or floating point value is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + true if reading the value succeeded, otherwise false + + + + Reads a value. This call will succeed if the next entry is an . + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + true if reading the value succeeded, otherwise false + + + + Reads a null value. This call will succeed if the next entry is an . + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + true if reading the value succeeded, otherwise false + + + + Skips the next entry value, unless it is an or an . If the next entry value is an or an , all of its contents will be processed, deserialized and registered in the deserialization context, so that internal reference values are not lost to entries further down the stream. + + + + + Disposes all resources and streams kept by the data reader. + + + + + Tells the reader that a new serialization session is about to begin, and that it should clear all cached values left over from any prior serialization sessions. + This method is only relevant when the same reader is used to deserialize several different, unrelated values. + + + + + Gets a dump of the data being read by the writer. The format of this dump varies, but should be useful for debugging purposes. + + + + + Peeks the current entry. + + The peeked entry. + + + + Consumes the current entry, and reads to the next one. + + The next entry. + + + + Implements functionality that is shared by both data readers and data writers. + + + + + Gets or sets the context's or writer's serialization binder. + + + The reader's or writer's serialization binder. + + + + + Gets a value indicating whether the reader or writer is in an array node. + + + true if the reader or writer is in an array node; otherwise, false. + + + + + Gets the current node depth. In other words, the current count of the node stack. + + + 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. + + + The current node. + + + + + Pushes a node onto the node stack. + + The node to push. + + + + Pushes a node with the given name, id and type onto the node stack. + + The name of the node. + The id of the node. + The type of the node. + + + + Pushes an array node onto the node stack. This uses values from the current node to provide extra info about the array node. + + + + + Pops the current node off of the node stack. + + The name of the node to pop. + + There are no nodes to pop. + or + Tried to pop node with given name, but the current node's name was different. + + + + + Pops the current node if the current node is an array node. + + + + + Provides basic functionality and overridable abstract methods for implementing a data writer. + + If you inherit this class, it is VERY IMPORTANT that you implement each abstract method to the *exact* specifications the documentation specifies. + + + + + + + Initializes a new instance of the class. + + The base stream of the writer. + The serialization context to use. + The stream or context is null. + Cannot write to the stream. + + + + Gets or sets the base stream of the writer. + + + The base stream of the writer. + + value + Cannot write to stream + + + + Gets the serialization context. + + + The serialization context. + + + + + Flushes everything that has been written so far to the writer's base stream. + + + + + Writes the beginning of a reference node. + + This call MUST eventually be followed by a corresponding call to , with the same name. + + The name of the reference node. + The type of the reference node. If null, no type metadata will be written. + The id of the reference node. This id is acquired by calling . + + + + Begins a struct/value type node. This is essentially the same as a reference node, except it has no internal reference id. + + This call MUST eventually be followed by a corresponding call to , with the same name. + + The name of the struct node. + The type of the struct node. If null, no type metadata will be written. + + + + Ends the current node with the given name. If the current node has another name, an is thrown. + + The name of the node to end. This has to be the name of the current node. + + + + Begins an array node of the given length. + + The length of the array to come. + + + + Ends the current array node, if the current node is an array node. + + + + + Writes a primitive array to the stream. + + The element type of the primitive array. Valid element types can be determined using . + The primitive array to write. + + + + Writes a null value to the stream. + + The name of the value. If this is null, no name will be written. + + + + Writes an internal reference to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes an external index reference to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes an external guid reference to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes an external string reference to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes an value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes an value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes an value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes an value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes an value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Disposes all resources and streams kept by the data writer. + + + + + Tells the writer that a new serialization session is about to begin, and that it should clear all cached values left over from any prior serialization sessions. + This method is only relevant when the same writer is used to serialize several different, unrelated values. + + + + + Gets a dump of the data currently written by the writer. The format of this dump varies, but should be useful for debugging purposes. + + + + + Reads data from a stream that has been written by a . + + + + + + Initializes a new instance of the class. + + The base stream of the reader. + The deserialization context to use. + + + + Disposes all resources kept by the data reader, except the stream, which can be reused later. + + + + + Peeks ahead and returns the type of the next entry in the stream. + + The name of the next entry, if it has one. + + The type of the next entry. + + + + + Tries to enters an array node. This will succeed if the next entry is an . + + This call MUST (eventually) be followed by a corresponding call to + This call will change the values of the , , and properties to the correct values for the current array node. + + The length of the array that was entered. + + true if an array was entered, otherwise false + + + + + Tries to enter a node. This will succeed if the next entry is an . + + This call MUST (eventually) be followed by a corresponding call to + This call will change the values of the , , and properties to the correct values for the current node. + + The type of the node. This value will be null if there was no metadata, or if the reader's serialization binder failed to resolve the type name. + + true if entering a node succeeded, otherwise false + + + + + Exits the closest array. This method will keep skipping entries using until an is reached, or the end of the stream is reached. + + This call MUST have been preceded by a corresponding call to . + + This call will change the values of the , , and to the correct values for the node that was prior to the exited array node. + + + true if the method exited an array, false if it reached the end of the stream. + + + + + Exits the current node. This method will keep skipping entries using until an is reached, or the end of the stream is reached. + + This call MUST have been preceded by a corresponding call to . + + This call will change the values of the , , and to the correct values for the node that was prior to the current node. + + + true if the method exited a node, false if it reached the end of the stream. + + + + + Reads a primitive array value. This call will succeed if the next entry is an . + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The element type of the primitive array. Valid element types can be determined using . + The resulting primitive array. + + true if reading a primitive array succeeded, otherwise false + + Type + typeof(T).Name + is not a valid primitive array type. + + + + Reads a value. This call will succeed if the next entry is an . + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + + true if reading the value succeeded, otherwise false + + + + + Reads an value. This call will succeed if the next entry is an . + + If the value of the stored integer is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + + true if reading the value succeeded, otherwise false + + + + + Reads a value. This call will succeed if the next entry is an . + + If the value of the stored integer is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + + true if reading the value succeeded, otherwise false + + + + + Reads a value. This call will succeed if the next entry is an . + + If the value of the stored integer is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + + true if reading the value succeeded, otherwise false + + + + + Reads an value. This call will succeed if the next entry is an . + + If the value of the stored integer is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + + true if reading the value succeeded, otherwise false + + + + + Reads an value. This call will succeed if the next entry is an . + + If the value of the stored integer is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + + true if reading the value succeeded, otherwise false + + + + + Reads an value. This call will succeed if the next entry is an . + + If the value of the stored integer is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + + true if reading the value succeeded, otherwise false + + + + + Reads a value. This call will succeed if the next entry is an . + + If the value of the stored integer is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + + true if reading the value succeeded, otherwise false + + + + + Reads an value. This call will succeed if the next entry is an . + + If the value of the stored integer is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + + true if reading the value succeeded, otherwise false + + + + + Reads a value. This call will succeed if the next entry is an . + + If the string of the entry is longer than 1 character, the first character of the string will be taken as the result. + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + + true if reading the value succeeded, otherwise false + + + + + Reads a value. This call will succeed if the next entry is an or an . + + If the stored integer or floating point value is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + + true if reading the value succeeded, otherwise false + + + + + Reads a value. This call will succeed if the next entry is an or an . + + If the stored integer or floating point value is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + + true if reading the value succeeded, otherwise false + + + + + Reads a value. This call will succeed if the next entry is an or an . + + If the stored integer or floating point value is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + + true if reading the value succeeded, otherwise false + + + + + Reads an external reference guid. This call will succeed if the next entry is an . + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The external reference guid. + + true if reading the value succeeded, otherwise false + + + + + Reads a value. This call will succeed if the next entry is an . + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + + true if reading the value succeeded, otherwise false + + + + + Reads an external reference index. This call will succeed if the next entry is an . + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The external reference index. + + true if reading the value succeeded, otherwise false + + + + + Reads an external reference string. This call will succeed if the next entry is an . + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The external reference string. + + true if reading the value succeeded, otherwise false + + + + + Reads a null value. This call will succeed if the next entry is an . + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + + true if reading the value succeeded, otherwise false + + + + + Reads an internal reference id. This call will succeed if the next entry is an . + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The internal reference id. + + true if reading the value succeeded, otherwise false + + + + + Reads a value. This call will succeed if the next entry is an . + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + + true if reading the value succeeded, otherwise false + + + + + Tells the reader that a new serialization session is about to begin, and that it should clear all cached values left over from any prior serialization sessions. + This method is only relevant when the same reader is used to deserialize several different, unrelated values. + + + + + Peeks the current entry. + + The peeked entry. + + + + Consumes the current entry, and reads to the next one. + + The next entry. + + + + Writes data to a stream that can be read by a . + + + + + + Initializes a new instance of the class. + + The base stream of the writer. + The serialization context to use. + + + + Begins an array node of the given length. + + The length of the array to come. + + + + Writes the beginning of a reference node. + + This call MUST eventually be followed by a corresponding call to , with the same name. + + The name of the reference node. + The type of the reference node. If null, no type metadata will be written. + The id of the reference node. This id is acquired by calling . + + + + Begins a struct/value type node. This is essentially the same as a reference node, except it has no internal reference id. + + This call MUST eventually be followed by a corresponding call to , with the same name. + + The name of the struct node. + The type of the struct node. If null, no type metadata will be written. + + + + Disposes all resources kept by the data writer, except the stream, which can be reused later. + + + + + Ends the current array node, if the current node is an array node. + + + + + Ends the current node with the given name. If the current node has another name, an is thrown. + + The name of the node to end. This has to be the name of the current node. + + + + Writes a primitive array to the stream. + + The element type of the primitive array. Valid element types can be determined using . + The primitive array to write. + Type + typeof(T).Name + is not a valid primitive array type. + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes an external guid reference to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes an external index reference to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes an external string reference to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes an value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a null value to the stream. + + The name of the value. If this is null, no name will be written. + + + + Writes an internal reference to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes an value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes an value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes an value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes an value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Tells the writer that a new serialization session is about to begin, and that it should clear all cached values left over from any prior serialization sessions. + This method is only relevant when the same writer is used to serialize several different, unrelated values. + + + + + Entry types in the binary format written by . + + + + + An invalid entry. + + + + + Entry denoting a named start of a reference node. + + + + + Entry denoting an unnamed start of a reference node. + + + + + Entry denoting a named start of a struct node. + + + + + Entry denoting an unnamed start of a struct node. + + + + + Entry denoting an end of node. + + + + + Entry denoting the start of an array. + + + + + Entry denoting the end of an array. + + + + + Entry denoting a primitive array. + + + + + Entry denoting a named internal reference. + + + + + Entry denoting an unnamed internal reference. + + + + + Entry denoting a named external reference by index. + + + + + Entry denoting an unnamed external reference by index. + + + + + Entry denoting a named external reference by guid. + + + + + Entry denoting an unnamed external reference by guid. + + + + + Entry denoting a named sbyte. + + + + + Entry denoting an unnamed sbyte. + + + + + Entry denoting a named byte. + + + + + Entry denoting an unnamed byte. + + + + + Entry denoting a named short. + + + + + Entry denoting an unnamed short. + + + + + Entry denoting a named ushort. + + + + + Entry denoting an unnamed ushort. + + + + + Entry denoting a named int. + + + + + Entry denoting an unnamed int. + + + + + Entry denoting a named uint. + + + + + Entry denoting an unnamed uint. + + + + + Entry denoting a named long. + + + + + Entry denoting an unnamed long. + + + + + Entry denoting a named ulong. + + + + + Entry denoting an unnamed ulong. + + + + + Entry denoting a named float. + + + + + Entry denoting an unnamed float. + + + + + Entry denoting a named double. + + + + + Entry denoting an unnamed double. + + + + + Entry denoting a named decimal. + + + + + Entry denoting an unnamed decimal. + + + + + Entry denoting a named char. + + + + + Entry denoting an unnamed char. + + + + + Entry denoting a named string. + + + + + Entry denoting an unnamed string. + + + + + Entry denoting a named guid. + + + + + Entry denoting an unnamed guid. + + + + + Entry denoting a named boolean. + + + + + Entry denoting an unnamed boolean. + + + + + Entry denoting a named null. + + + + + Entry denoting an unnamed null. + + + + + Entry denoting a type name. + + + + + Entry denoting a type id. + + + + + Entry denoting that the end of the stream has been reached. + + + + + Entry denoting a named external reference by string. + + + + + Entry denoting an unnamed external reference by string. + + + + + Provides a set of methods for reading data stored in a format written by a corresponding class. + + If you implement this interface, it is VERY IMPORTANT that you implement each method to the *exact* specifications the documentation specifies. + + It is strongly recommended to inherit from the class if you wish to implement a new data reader. + + + + + + Gets or sets the reader's serialization binder. + + + The reader's serialization binder. + + + + + Gets or sets the base stream of the reader. + + + The base stream of the reader. + + + + + Gets a value indicating whether the reader is in an array node. + + + true if the reader is in an array node; otherwise, false. + + + + + Gets the name of the current node. + + + The name of the current node. + + + + + Gets the current node id. If this is less than zero, the current node has no id. + + + The current node id. + + + + + Gets the current node depth. In other words, the current count of the node stack. + + + The current node depth. + + + + + Gets the deserialization context. + + + The deserialization context. + + + + + Gets a dump of the data being read by the writer. The format of this dump varies, but should be useful for debugging purposes. + + + + + Tries to enter a node. This will succeed if the next entry is an . + + This call MUST (eventually) be followed by a corresponding call to + + This call will change the values of the , , and properties to the correct values for the current node. + + The type of the node. This value will be null if there was no metadata, or if the reader's serialization binder failed to resolve the type name. + true if entering a node succeeded, otherwise false + + + + Exits the current node. This method will keep skipping entries using until an is reached, or the end of the stream is reached. + + This call MUST have been preceded by a corresponding call to . + + This call will change the values of the , , and to the correct values for the node that was prior to the current node. + + true if the method exited a node, false if it reached the end of the stream. + + + + Tries to enters an array node. This will succeed if the next entry is an . + + This call MUST (eventually) be followed by a corresponding call to + + This call will change the values of the , , and properties to the correct values for the current array node. + + The length of the array that was entered. + true if an array was entered, otherwise false + + + + Exits the closest array. This method will keep skipping entries using until an is reached, or the end of the stream is reached. + + This call MUST have been preceded by a corresponding call to . + + This call will change the values of the , , and to the correct values for the node that was prior to the exited array node. + + true if the method exited an array, false if it reached the end of the stream. + + + + Reads a primitive array value. This call will succeed if the next entry is an . + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The element type of the primitive array. Valid element types can be determined using . + The resulting primitive array. + true if reading a primitive array succeeded, otherwise false + + + + Peeks ahead and returns the type of the next entry in the stream. + + The name of the next entry, if it has one. + The type of the next entry. + + + + Reads an internal reference id. This call will succeed if the next entry is an . + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The internal reference id. + true if reading the value succeeded, otherwise false + + + + Reads an external reference index. This call will succeed if the next entry is an . + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The external reference index. + true if reading the value succeeded, otherwise false + + + + Reads an external reference guid. This call will succeed if the next entry is an . + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The external reference guid. + true if reading the value succeeded, otherwise false + + + + Reads an external reference string. This call will succeed if the next entry is an . + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The external reference string. + true if reading the value succeeded, otherwise false + + + + Reads a value. This call will succeed if the next entry is an . + + If the string of the entry is longer than 1 character, the first character of the string will be taken as the result. + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + true if reading the value succeeded, otherwise false + + + + Reads a value. This call will succeed if the next entry is an . + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + true if reading the value succeeded, otherwise false + + + + Reads a value. This call will succeed if the next entry is an . + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + true if reading the value succeeded, otherwise false + + + + Reads an value. This call will succeed if the next entry is an . + + If the value of the stored integer is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + true if reading the value succeeded, otherwise false + + + + Reads a value. This call will succeed if the next entry is an . + + If the value of the stored integer is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + true if reading the value succeeded, otherwise false + + + + Reads an value. This call will succeed if the next entry is an . + + If the value of the stored integer is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + true if reading the value succeeded, otherwise false + + + + Reads a value. This call will succeed if the next entry is an . + + If the value of the stored integer is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + true if reading the value succeeded, otherwise false + + + + Reads a value. This call will succeed if the next entry is an . + + If the value of the stored integer is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + true if reading the value succeeded, otherwise false + + + + Reads an value. This call will succeed if the next entry is an . + + If the value of the stored integer is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + true if reading the value succeeded, otherwise false + + + + Reads an value. This call will succeed if the next entry is an . + + If the value of the stored integer is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + true if reading the value succeeded, otherwise false + + + + Reads an value. This call will succeed if the next entry is an . + + If the value of the stored integer is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + true if reading the value succeeded, otherwise false + + + + Reads a value. This call will succeed if the next entry is an or an . + + If the stored integer or floating point value is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + true if reading the value succeeded, otherwise false + + + + Reads a value. This call will succeed if the next entry is an or an . + + If the stored integer or floating point value is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + true if reading the value succeeded, otherwise false + + + + Reads a value. This call will succeed if the next entry is an or an . + + If the stored integer or floating point value is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + true if reading the value succeeded, otherwise false + + + + Reads a value. This call will succeed if the next entry is an . + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + true if reading the value succeeded, otherwise false + + + + Reads a null value. This call will succeed if the next entry is an . + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + true if reading the value succeeded, otherwise false + + + + Skips the next entry value, unless it is an or an . If the next entry value is an or an , all of its contents will be processed, deserialized and registered in the deserialization context, so that internal reference values are not lost to entries further down the stream. + + + + + Tells the reader that a new serialization session is about to begin, and that it should clear all cached values left over from any prior serialization sessions. + This method is only relevant when the same reader is used to deserialize several different, unrelated values. + + + + + Provides a set of methods for reading data stored in a format that can be read by a corresponding class. + + If you implement this interface, it is VERY IMPORTANT that you implement each method to the *exact* specifications the documentation specifies. + + It is strongly recommended to inherit from the class if you wish to implement a new data writer. + + + + + + Gets or sets the reader's serialization binder. + + + The reader's serialization binder. + + + + + Gets or sets the base stream of the writer. + + + The base stream of the writer. + + + + + Gets a value indicating whether the writer is in an array node. + + + true if the writer is in an array node; otherwise, false. + + + + + Gets the serialization context. + + + The serialization context. + + + + + Gets a dump of the data currently written by the writer. The format of this dump varies, but should be useful for debugging purposes. + + + + + Flushes everything that has been written so far to the writer's base stream. + + + + + Writes the beginning of a reference node. + + This call MUST eventually be followed by a corresponding call to , with the same name. + + The name of the reference node. + The type of the reference node. If null, no type metadata will be written. + The id of the reference node. This id is acquired by calling . + + + + Begins a struct/value type node. This is essentially the same as a reference node, except it has no internal reference id. + + This call MUST eventually be followed by a corresponding call to , with the same name. + + The name of the struct node. + The type of the struct node. If null, no type metadata will be written. + + + + Ends the current node with the given name. If the current node has another name, an is thrown. + + The name of the node to end. This has to be the name of the current node. + + + + Begins an array node of the given length. + + The length of the array to come. + + + + Ends the current array node, if the current node is an array node. + + + + + Writes a primitive array to the stream. + + The element type of the primitive array. Valid element types can be determined using . + The primitive array to write. + + + + Writes a null value to the stream. + + The name of the value. If this is null, no name will be written. + + + + Writes an internal reference to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes an external index reference to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes an external guid reference to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes an external string reference to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes an value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes an value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes an value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes an value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes an value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Tells the writer that a new serialization session is about to begin, and that it should clear all cached values left over from any prior serialization sessions. + This method is only relevant when the same writer is used to serialize several different, unrelated values. + + + + + Contains various string constants used by the , and classes. + + + + + The named of a node id entry. + + + + + The name of a type entry. + + + + + The name of a regular array length entry. + + + + + The name of a primitive array length entry. + + + + + The name of a regular array content entry. + + + + + The name of a primitive array content entry. + + + + + The beginning of the content of an internal reference entry. + + + + + The beginning of the content of an external reference by index entry. + + + + + The beginning of the content of an external reference by guid 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. + + + + + Reads json data from a stream that has been written by a . + + + + + + Initializes a new instance of the class. + + The base stream of the reader. + The deserialization context to use. + + + + Gets or sets the base stream of the reader. + + + The base stream of the reader. + + + + + Disposes all resources kept by the data reader, except the stream, which can be reused later. + + + + + Peeks ahead and returns the type of the next entry in the stream. + + The name of the next entry, if it has one. + + The type of the next entry. + + + + + Tries to enter a node. This will succeed if the next entry is an . + + This call MUST (eventually) be followed by a corresponding call to + This call will change the values of the , , and properties to the correct values for the current node. + + The type of the node. This value will be null if there was no metadata, or if the reader's serialization binder failed to resolve the type name. + + true if entering a node succeeded, otherwise false + + + + + Exits the current node. This method will keep skipping entries using until an is reached, or the end of the stream is reached. + + This call MUST have been preceded by a corresponding call to . + + This call will change the values of the , , and to the correct values for the node that was prior to the current node. + + + true if the method exited a node, false if it reached the end of the stream. + + + + + Tries to enters an array node. This will succeed if the next entry is an . + + This call MUST (eventually) be followed by a corresponding call to + This call will change the values of the , , and properties to the correct values for the current array node. + + The length of the array that was entered. + + true if an array was entered, otherwise false + + + + + Exits the closest array. This method will keep skipping entries using until an is reached, or the end of the stream is reached. + + This call MUST have been preceded by a corresponding call to . + + This call will change the values of the , , and to the correct values for the node that was prior to the exited array node. + + + true if the method exited an array, false if it reached the end of the stream. + + + + + Reads a primitive array value. This call will succeed if the next entry is an . + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The element type of the primitive array. Valid element types can be determined using . + The resulting primitive array. + + true if reading a primitive array succeeded, otherwise false + + Type + typeof(T).Name + is not a valid primitive array type. + + + + Reads a value. This call will succeed if the next entry is an . + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + + true if reading the value succeeded, otherwise false + + + + + Reads an internal reference id. This call will succeed if the next entry is an . + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The internal reference id. + + true if reading the value succeeded, otherwise false + + + + + Reads an external reference index. This call will succeed if the next entry is an . + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The external reference index. + + true if reading the value succeeded, otherwise false + + + + + Reads an external reference guid. This call will succeed if the next entry is an . + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The external reference guid. + + true if reading the value succeeded, otherwise false + + + + + Reads an external reference string. This call will succeed if the next entry is an . + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The external reference string. + + true if reading the value succeeded, otherwise false + + + + + Reads a value. This call will succeed if the next entry is an . + + If the string of the entry is longer than 1 character, the first character of the string will be taken as the result. + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + + true if reading the value succeeded, otherwise false + + + + + Reads a value. This call will succeed if the next entry is an . + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + + true if reading the value succeeded, otherwise false + + + + + Reads a value. This call will succeed if the next entry is an . + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + + true if reading the value succeeded, otherwise false + + + + + Reads an value. This call will succeed if the next entry is an . + + If the value of the stored integer is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + + true if reading the value succeeded, otherwise false + + + + + Reads a value. This call will succeed if the next entry is an . + + If the value of the stored integer is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + + true if reading the value succeeded, otherwise false + + + + + Reads an value. This call will succeed if the next entry is an . + + If the value of the stored integer is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + + true if reading the value succeeded, otherwise false + + + + + Reads a value. This call will succeed if the next entry is an . + + If the value of the stored integer is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + + true if reading the value succeeded, otherwise false + + + + + Reads a value. This call will succeed if the next entry is an . + + If the value of the stored integer is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + + true if reading the value succeeded, otherwise false + + + + + Reads an value. This call will succeed if the next entry is an . + + If the value of the stored integer is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + + true if reading the value succeeded, otherwise false + + + + + Reads an value. This call will succeed if the next entry is an . + + If the value of the stored integer is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + + true if reading the value succeeded, otherwise false + + + + + Reads an value. This call will succeed if the next entry is an . + + If the value of the stored integer is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + + true if reading the value succeeded, otherwise false + + + + + Reads a value. This call will succeed if the next entry is an or an . + + If the stored integer or floating point value is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + + true if reading the value succeeded, otherwise false + + + + + Reads a value. This call will succeed if the next entry is an or an . + + If the stored integer or floating point value is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + + true if reading the value succeeded, otherwise false + + + + + Reads a value. This call will succeed if the next entry is an or an . + + If the stored integer or floating point value is smaller than or larger than , the result will be default(). + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The value that has been read. + + true if reading the value succeeded, otherwise false + + + + + Reads a null value. This call will succeed if the next entry is an . + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + + true if reading the value succeeded, otherwise false + + + + + Tells the reader that a new serialization session is about to begin, and that it should clear all cached values left over from any prior serialization sessions. + This method is only relevant when the same reader is used to deserialize several different, unrelated values. + + + + + Peeks the current entry. + + The peeked entry. + + + + Consumes the current entry, and reads to the next one. + + The next entry. + + + + Writes json data to a stream that can be read by a . + + + + + + Initializes a new instance of the class. + + The base stream of the writer. + The serialization context to use.> + Whether the json should be packed, or formatted as human-readable. + + + + Gets or sets a value indicating whether the json should be packed, or formatted as human-readable. + + + true if the json should be formatted as human-readable; otherwise, false. + + + + + Whether to enable an optimization that ensures any given type name is only written once into the json stream, and thereafter kept track of by ID. + + + + + Enable the "just started" flag, causing the writer to start a new "base" json object container. + + + + + Flushes everything that has been written so far to the writer's base stream. + + + + + Writes the beginning of a reference node. + + This call MUST eventually be followed by a corresponding call to , with the same name. + + The name of the reference node. + The type of the reference node. If null, no type metadata will be written. + The id of the reference node. This id is acquired by calling . + + + + Begins a struct/value type node. This is essentially the same as a reference node, except it has no internal reference id. + + This call MUST eventually be followed by a corresponding call to , with the same name. + + The name of the struct node. + The type of the struct node. If null, no type metadata will be written. + + + + Ends the current node with the given name. If the current node has another name, an is thrown. + + The name of the node to end. This has to be the name of the current node. + + + + Begins an array node of the given length. + + The length of the array to come. + + + + Ends the current array node, if the current node is an array node. + + + + + Writes a primitive array to the stream. + + The element type of the primitive array. Valid element types can be determined using . + The primitive array to write. + Type + typeof(T).Name + is not a valid primitive array type. + array + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes an value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a null value to the stream. + + The name of the value. If this is null, no name will be written. + + + + Writes an internal reference to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes an value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes a value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes an value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes an value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes an external index reference to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes an external guid reference to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes an external string reference to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Writes an value to the stream. + + The name of the value. If this is null, no name will be written. + The value to write. + + + + Disposes all resources kept by the data writer, except the stream, which can be reused later. + + + + + Tells the writer that a new serialization session is about to begin, and that it should clear all cached values left over from any prior serialization sessions. + This method is only relevant when the same writer is used to serialize several different, unrelated values. + + + + + Parses json entries from a stream. + + + + + + The current deserialization context used by the text reader. + + + + + Initializes a new instance of the class. + + The stream to parse from. + The deserialization context to use. + The stream is null. + Cannot read from the stream. + + + + Resets the reader instance's currently peeked char and emergency playback queue. + + + + + Disposes all resources kept by the text reader, except the stream, which can be reused later. + + + + + Reads to (but not past) the beginning of the next json entry, and returns the entry name, contents and type. + + The name of the entry that was parsed. + The content of the entry that was parsed. + The type of the entry that was parsed. + + + + A serialization node as used by the format. + + + + + The name of the node. + + + + + The entry type of the node. + + + + + The data contained in the node. Depending on the entry type and name, as well as nodes encountered prior to this one, the format can vary wildly. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Tries to enters an array node. This will succeed if the next entry is an . + + This call MUST (eventually) be followed by a corresponding call to + This call will change the values of the , , and properties to the correct values for the current array node. + + The length of the array that was entered. + + true if an array was entered, otherwise false + + + + + 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. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Reads a primitive array value. This call will succeed if the next entry is an . + + If the call fails (and returns false), it will skip the current entry value, unless that entry is an or an . + + The element type of the primitive array. Valid element types can be determined using . + The resulting primitive array. + + true if reading a primitive array succeeded, otherwise false + + Type + typeof(T).Name + is not a valid primitive array type. + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Peeks the current entry. + + The peeked entry. + + + + Consumes the current entry, and reads to the next one. + + The next entry. + + + + Shared config class for and . + + + + + The string to use to separate node id's from their names. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Begins an array node of the given length. + + The length of the array to come. + + + + + 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. + + + + + 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. + + + + + 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. + + The element type of the formatted array. + + + + + 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 . + + + + + + 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 common functionality for serializing and deserializing values of type , and provides automatic support for the following common serialization conventions: + + , , , , and . + + The type which can be serialized and deserialized by the formatter. + + + + + The on serializing callbacks for type . + + + + + The on serialized callbacks for type . + + + + + The on deserializing callbacks for type . + + + + + The on deserialized callbacks for type . + + + + + Whether the serialized value is a value type. + + + + + Gets the type that the formatter can serialize. + + + The type that the formatter can serialize. + + + + + 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. + + + + + Deserializes a value of type using a specified . + + The reader to use. + + The deserialized value. + + + + + Serializes a value of type using a specified . + + The value to serialize. + 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 . + + + + 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. + + + + 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. + + + + 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. + + + + + + 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. + + + + Formatter for all delegate types. + + This formatter can handle anything but delegates for dynamic methods. + + + + + + + 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 . + + + + + Emergency hack class to support serialization of types derived from dictionary + + + + + Returns null. + + + A value of null. + + + + + 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 . + + The type of the dictionary key. + The type of the dictionary value. + + + + + Creates a new instance of . + + + + + Returns null. + + + A value of null. + + + + + 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 Odin serialization formatter for . + + Type of primary key. + Type of secondary key. + Type of value. + + + + Creates a new instance of . + + + + + Returns null. + + + + + Provides the actual implementation for serializing a value of type . + + The value to serialize. + The writer to serialize with. + + + + 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 an easy way of implementing custom formatters. + + The type which can be serialized and deserialized by the formatter. + + + + Reads through all entries in the current node one at a time, and calls for each entry. + + The uninitialized value to serialize into. This value will have been created earlier using . + The reader to deserialize with. + + + + Calls directly. + + The value to serialize. + The writer to serialize with. + + + + Reads a data entry into the value denoted by the entry name. + + The value to read into. + The name of the entry. + The type of the entry. + The reader currently used for deserialization. + + + + Write the serialized values of a value of type . + + The value to serialize. + The writer currently used for serialization. + + + + Indicates that this formatter type has been emitted. Never put this on a type! + + + + + A formatter for empty types. It writes no data, and skips all data that is to be read, deserializing a "default" value. + + + + + Skips the entry to read. + + + + + Does nothing at all. + + + + + Utility class for emitting formatters using the namespace. + + 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. + + + + + The name of the runtime-generated assembly that contains runtime-emitted formatters for use on non-AOT platforms where emitting is supported. Note that this assembly is not always present. + + + + + Base type for all AOT-emitted formatters. + + + + + Shortcut class that makes it easier to emit empty AOT formatters. + + + + + Skips the entry to read. + + + + + Does nothing at all. + + + + + Gets an emitted formatter for a given type. + + NOTE: Some platforms do not support emitting. On such platforms, this method logs an error and returns null. Check whether you can emit on the current platform using . + + The type to emit a formatter for. + The serialization policy to use to determine which members the emitted formatter should serialize. If null, is used. + The type of the emitted formatter. + The type argument is null. + + + + Emits a formatter for a given type into a given module builder, using a given serialization policy to determine which members to serialize. + + Type to create a formatter for. + The module builder to emit a formatter into. + The serialization policy to use for creating the formatter. + The fully constructed, emitted formatter type. + + + + Utility class for the class. + + + + + Determines whether the specified type can be formatted by a . + + The following criteria are checked: type implements , type is not abstract, type is not a generic type definition, type is not an interface, type has a public parameterless constructor. + + The collection type to check. + The element type of the collection. + true if the type can be formatted by a , otherwise false + The type argument is null. + + + + Formatter for all eligible types that implement the interface , and which have no other formatters specified. + + Eligibility for formatting by this class is determined by the method. + + The type of the collection. + The type of the element. + + + + Creates a new instance of . + + + + + 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. + + + + 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 . + + The element type of the formatted list. + + + + + 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. + + + + 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. + + NOTE that if you are implementing a custom formatter and registering it using the , it is not enough to implement - you have to implement . + + + + + Gets the type that the formatter can serialize. + + + The type that the formatter can serialize. + + + + + 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. + + + + + Serializes and deserializes a given type T. + + The type which can be serialized and deserialized by the formatter. + + + + Serializes a value of type using a specified . + + The value to serialize. + The writer to use. + + + + Deserializes a value of type using a specified . + + The reader to use. + + The deserialized value. + + + + + Custom generic formatter for the generic type definition . + + The type of the key. + The type of the value. + + + + + Provides the actual implementation for serializing a value of type . + + The value to serialize. + The writer to serialize with. + + + + 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. + + + + Custom generic formatter for the generic type definition . + + The element type of the formatted list. + + + + + 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 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. + Common serialization conventions aren't automatically supported, and common deserialization callbacks are not automatically invoked. + + The type which can be serialized and deserialized by the formatter. + + + + Whether the serialized value is a value type. + + + + + Gets the type that the formatter can serialize. + + + The type that the formatter can serialize. + + + + + Deserializes a value of type using a specified . + + The reader to use. + + The deserialized value. + + + + + Serializes a value of type using a specified . + + The value to serialize. + The writer to use. + + + + 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. + + + + + 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 is not a value type. + + 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. + + The type of the formatted array. + The element type of the formatted array. + + + + + 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. + + + + 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. + + The type that is nullable. + + + + + Creates a new instance of . + + + + + 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 primitive one-dimensional arrays. + + The element type of the formatted array. This type must be an eligible primitive array type, as determined by . + + + + + 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. + + + + 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. + + The type which can be serialized and deserialized by the formatter. + + + + + 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 types that implement the interface. + + + + + + + Calls on the value to deserialize. + + + + + 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. + + The type which can be serialized and deserialized by the formatter. + + + + + 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. + + + + Creates and reads into a instance using a given reader and context. + + The reader to use. + + The which was read. + + + + + Writes the given using the given writer. + + 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. + + + + + + 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. + + + + Formatter for the type which uses the reader/writer's to bind types. + + + + + + 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. + + + + Returns null. + + null. + + + + 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. + + + + + + Use this attribute to specify that a type that implements the + interface should *always* format itself regardless of other formatters being specified. + + This means that the interface will be used to format all types derived from the type that + is decorated with this attribute, regardless of custom formatters for the derived types. + + + + + + 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. + + + + + + The priority of the formatter. Of all the available custom formatters, the formatter with the highest priority is always chosen. + + + + + Initializes a new instance of the class with priority 0. + + + + + Initializes a new instance of the class. + + The priority of the formatter. Of all the available custom formatters, the formatter with the highest priority is always chosen. + + + + Attribute indicating that a generic type definition class which implements the interface somewhere in its hierarchy is a custom formatter for *any variation* of the generic type definition T. + + The formatter's generic type parameters are mapped onto the serialized type's generic type parameters. + + For example, implements , where T is . + + + + + + The generic type definition of the serialized type. + + + + + Initializes a new instance of the class. + + The generic type definition of the serialized type. + The priority of the formatter. Of all the available custom formatters, the formatter with the highest priority is always chosen. + 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, + that would result in data loss, and what to specify the new type name to avoid loss of data. + + + + + [assembly: OdinSerializer.BindTypeNameToType("Namespace.OldTypeName", typeof(Namespace.NewTypeName))] + //[assembly: OdinSerializer.BindTypeNameToType("Namespace.OldTypeName, OldFullAssemblyName", typeof(Namespace.NewTypeName))] + + namespace Namespace + { + public class SomeComponent : SerializedMonoBehaviour + { + public IInterface test; // Contains an instance of OldTypeName; + } + + public interface IInterface { } + + public class NewTypeName : IInterface { } + + //public class OldTypeName : IInterface { } + } + + + + + + Initializes a new instance of the class. + + Old old full type name. If it's moved to new a new assembly you must specify the old assembly name as well. See example code in the documentation. + The new type. + + + + 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. + + The type argument is null. + + + + Determines whether the specified type name is mapped. + + + + + Binds a name to 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. + + The typeName argument is null. + + + + The context of a given deserialization session. This class maintains all internal and external references during deserialization. + + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The streaming context to use. + + + + Initializes a new instance of the class. + + The formatter converter to use. + + + + Initializes a new instance of the class. + + The streaming context to use. + The formatter converter to use. + The formatterConverter parameter is null. + + + + Gets or sets the context's type binder. + + + The context's serialization binder. + + + + + Gets or sets the string reference resolver. + + + The string reference resolver. + + + + + Gets or sets the Guid reference resolver. + + + The Guid reference resolver. + + + + + Gets or sets the index reference resolver. + + + The index reference resolver. + + + + + Gets the streaming context. + + + The streaming context. + + + + + Gets the formatter converter. + + + The formatter converter. + + + + + Gets or sets the serialization configuration. + + + The serialization configuration. + + + + + Registers an internal reference to a given id. + + The id to register the reference with. + The reference to register. + + + + Gets an internal reference from a given id, or null if the id has not been registered. + + The id of the reference to get. + An internal reference from a given id, or null if the id has not been registered. + + + + Gets an external object reference by index, or null if the index could not be resolved. + + The index to resolve. + An external object reference by the given index, or null if the index could not be resolved. + + + + Gets an external object reference by guid, or null if the guid could not be resolved. + + The guid to resolve. + An external object reference by the given guid, or null if the guid could not be resolved. + + + + Gets an external object reference by an id string, or null if the id string could not be resolved. + + The id string to resolve. + An external object reference by an id string, or null if the id string could not be resolved. + + + + Resets the deserialization context completely to baseline status, as if its constructor has just been called. + This allows complete reuse of a deserialization context, with all of its internal reference buffers. + + + + + An entry type which is part of a stream being read by a . + + + + + Could not parse entry. + + + + + Entry is a primitive value of type string or char. + + + + + Entry is a primitive value of type guid. + + + + + Entry is a primitive value of type sbyte, byte, short, ushort, int, uint, long or ulong. + + + + + Entry is a primitive value of type float, double or decimal. + + + + + Entry is a primitive boolean value. + + + + + Entry is a null value. + + + + + Entry marks the start of a node, IE, a complex type that contains values of its own. + + + + + Entry marks the end of a node, IE, a complex type that contains values of its own. + + + + + Entry contains an ID that is a reference to a node defined previously in the stream. + + + + + Entry contains the index of an external object in the DeserializationContext. + + + + + Entry contains the guid of an external object in the DeserializationContext. + + + + + Entry marks the start of an array. + + + + + Entry marks the end of an array. + + + + + Entry marks a primitive array. + + + + + Entry indicating that the reader has reached the end of the data stream. + + + + + Entry contains the string id of an external object in the DeserializationContext. + + + + + + Causes Odin's inspector to completely ignore a given member, preventing it from even being included in an Odin PropertyTree, + and such will not cause any performance hits in the inspector. + + 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. + + + + + Gets or sets the next resolver in the chain. + + + The next resolver in the chain. + + + + + Tries to resolve a reference from a given Guid. + + The Guid to resolve. + The resolved value. + true if the value was resolved; otherwise, false. + + + + Determines whether this resolver can reference the specified value with a Guid. + + The value to check. + The Guid which references the value. + true if the value can be referenced; otherwise, false. + + + + Resolves external index references to reference objects during serialization and deserialization. + + + + + Tries to resolve the given reference index to a reference value. + + The index to resolve. + The resolved value. + true if the index could be resolved to a value, otherwise false. + + + + Determines whether the specified value can be referenced externally via this resolver. + + The value to reference. + The index of the resolved value, if it can be referenced. + true if the reference can be resolved, otherwise false. + + + + Resolves external strings references to reference objects during serialization and deserialization. + + + + + Gets or sets the next resolver in the chain. + + + The next resolver in the chain. + + + + + Tries to resolve a reference from a given Guid. + + The to resolve. + The resolved value. + true if the value was resolved; otherwise, false. + + + + Determines whether this resolver can reference the specified value with a string. + + The value to check. + The string which references the value. + true if the value can be referenced; otherwise, false. + + + + Specifies that a type is capable of serializing itself using an and an + . + + The deserialized type instance will be created without a constructor call using the + + method if it is a reference type, otherwise it will be created using default(type). + + Use to specify that a class which implements this + interface should *always* format itself regardless of other formatters being specified. + + + + + Serializes the instance's data using the given writer. + + + + + Deserializes data into the instance using the given reader. + + + + + Defines which members to serialize and deserialize when there aren't any custom formatters for a type. + Usually, it governs the behaviour of the and classes. + + + + + Gets the identifier of the policy. This can be stored in the serialization metadata, so the policy used to serialize can be recovered upon deserialization without knowing the policy ahead of time. 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. + + + + Contains information about a node during deserialization and serialization. + + + + + An empty node. + + + + + The name of the node. + + + + + The id of the node, or -1 if the node has no id. + + + + + The type of the node, or null if the node has no type metadata. + + + + + Whether the node is an array or not. + + + + + Whether the node is an empty node. + + + + + Initializes a new instance of the struct. + + The name of the node. + The id of the node. + The type of the node. + If set to true the node is an array node. + + + + Implements the operator == between and . + + The first . + The second . + + true if the nodes were equal; otherwise, false. + + + + + Implements the operator != between and . + + The first . + The second . + + true if the nodes were not equal; otherwise, false. + + + + + 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. + + + + + 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. + + This does the same as Unity's FormerlySerializedAs attribute, except it can also be applied to properties. + + + + + + The former name. + + + + + Initializes a new instance of the class. + + 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. + + + + + Initializes a new instance of the class. + + The message. + + + + Initializes a new instance of the class. + + The message. + The inner exception. + + + + Defines the configuration during serialization and deserialization. This class is thread-safe. + + + + + Initializes a new instance of the class. + + + + + + Setting this member to true indicates that in the case where, when expecting to deserialize an instance of a certain type, + 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 applying the attribute, except global + instead of specific to a single type. Note that if this member is set to false, individual types may still be deserialized + with invalid data if they are decorated with the attribute. + + + + + + Gets or sets the serialization policy. This value is never null; if set to null, it will default to . + + + The serialization policy. + + + + + Gets or sets the debug context. This value is never null; if set to null, a new default instance of will be created upon the next get. + + + The debug context. + + + + + Resets the configuration to a default configuration, as if the constructor had just been called. + + + + + Defines a context for debugging and logging during serialization and deserialization. This class is thread-safe. + + + + + The logger to use for logging messages. + + + + + The logging policy to use. + + + + + The error handling policy to use. + + + + + Log a warning. Depending on the logging policy and error handling policy, this message may be suppressed or result in an exception being thrown. + + + + + Log an error. Depending on the logging policy and error handling policy, this message may be suppressed or result in an exception being thrown. + + + + + Log an exception. Depending on the logging policy and error handling policy, this message may be suppressed or result in an exception being thrown. + + + + + The context of a given serialization session. This class maintains all internal and external references during serialization. + + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The streaming context to use. + + + + Initializes a new instance of the class. + + The formatter converter to use. + + + + Initializes a new instance of the class. + + The streaming context to use. + The formatter converter to use. + The formatterConverter parameter is null. + + + + Gets or sets the context's type binder. + + + The context's serialization binder. + + + + + Gets the streaming context. + + + The streaming context. + + + + + Gets the formatter converter. + + + The formatter converter. + + + + + Gets or sets the index reference resolver. + + + The index reference resolver. + + + + + Gets or sets the string reference resolver. + + + The string reference resolver. + + + + + Gets or sets the Guid reference resolver. + + + The Guid reference resolver. + + + + + Gets or sets the serialization configuration. + + + The serialization configuration. + + + + + Tries to get the id of an internally referenced object. + + The reference to get the id of. + The id that was found, or -1 if no id was found. + true if a reference was found, otherwise false. + + + + Tries to register an internal reference. Returns true if the reference was registered, otherwise, false when the reference has already been registered. + + The reference to register. + The id of the registered reference. + true if the reference was registered, otherwise, false when the reference has already been registered. + + + + Tries to register an external index reference. + + The object to reference. + The index of the referenced object. + true if the object could be referenced by index; otherwise, false. + + + + Tries to register an external guid reference. + + The object to reference. + The guid of the referenced object. + true if the object could be referenced by guid; otherwise, false. + + + + Tries to register an external string reference. + + The object to reference. + The id string of the referenced object. + true if the object could be referenced by string; otherwise, false. + + + + Resets the context's internal reference map. + + + + + Resets the serialization context completely to baseline status, as if its constructor has just been called. + This allows complete reuse of a serialization context, with all of its internal reference buffers. + + + + + Contains a set of default implementations of the interface. + + NOTE: Policies are not necessarily compatible with each other in intuitive ways. + Data serialized with the policy + will for example fail to deserialize auto-properties with , + even if only strict data is needed. + It is best to ensure that you always use the same policy for serialization and deserialization. + + This class and all of its policies are thread-safe. + + + + + Tries to get a serialization policy by its id, in case a serialization graph has the policy used for serialization stored by name. + + + + + All fields not marked with are serialized. If a field is marked with both and , then the field will be serialized. + + + + + Public fields, as well as fields or auto-properties marked with or and not marked with , are serialized. + + There are two exceptions: + 1) All fields in tuples, as well as in private nested types marked as compiler generated (e.g. lambda capture classes) are also serialized. + 2) Virtual auto-properties are never serialized. Note that properties specified by an implemented interface are automatically marked virtual by the compiler. + + + + + Only fields and auto-properties marked with or and not marked with are serialized. + + There are two exceptions: + 1) All fields in private nested types marked as compiler generated (e.g. lambda capture classes) are also serialized. + 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. + + + + + + Reads a value of type . + + The reader to use. + + The value which has been read. + + + + + Writes a value of type . + + The name of the value to write. + The value to write. + The writer to use. + + + + Serializer for the type. + + + + + + Reads a value of type . + + The reader to use. + + The value which has been read. + + + + + Writes a value of type . + + The name of the value to write. + The value to write. + The writer to use. + + + + Serializer for the type. + + + + + + Reads a value of type . + + The reader to use. + + The value which has been read. + + + + + Writes a value of type . + + The name of the value to write. + The value to write. + The writer to use. + + + + Serializer for all complex types; IE, types which are not primitives as determined by the method. + + The type which the can serialize and deserialize. + + + + + Reads a value of type . + + The reader to use. + + The value which has been read. + + + + + Writes a value of type . + + The name of the value to write. + The value to write. + The writer to use. + + + + Serializer for the type. + + + + + + Reads a value of type . + + The reader to use. + + The value which has been read. + + + + + Writes a value of type . + + The name of the value to write. + The value to write. + The writer to use. + + + + Serializer for the type. + + + + + + Reads a value of type . + + The reader to use. + + The value which has been read. + + + + + Writes a value of type . + + The name of the value to write. + The value to write. + The writer to use. + + + + Serializer for all enums. + + The type of the enum to serialize and deserialize. + + + + + Reads an enum value of type . + + The reader to use. + + The value which has been read. + + + + + Writes an enum value of type . + + The name of the value to write. + The value to write. + The writer to use. + + + + Serializer for the type. + + + + + + Reads a value of type . + + The reader to use. + + The value which has been read. + + + + + Writes a value of type . + + The name of the value to write. + The value to write. + The writer to use. + + + + Serializer for the type. + + + + + + Reads a value of type . + + The reader to use. + + The value which has been read. + + + + + Writes a value of type . + + The name of the value to write. + The value to write. + The writer to use. + + + + Serializer for the type. + + + + + + Reads a value of type . + + The reader to use. + + The value which has been read. + + + + + Writes a value of type . + + The name of the value to write. + The value to write. + The writer to use. + + + + Serializer for the type. + + + + + + Reads a value of type . + + The reader to use. + + The value which has been read. + + + + + Writes a value of type . + + The name of the value to write. + The value to write. + The writer to use. + + + + Serializer for the type. + + + + + + Reads a value of type . + + The reader to use. + + The value which has been read. + + + + + Writes a value of type . + + The name of the value to write. + The value to write. + The writer to use. + + + + Serializer for the type. + + + + + + Reads a value of type . + + The reader to use. + + The value which has been read. + + + + + Writes a value of type . + + The name of the value to write. + The value to write. + The writer to use. + + + + Serializes and deserializes a given type, and wraps serialization and deserialization with all the proper calls to free formatters from tedious boilerplate. + + Whenever serializing or deserializing anything, it is *strongly recommended* to use to get a proper wrapping serializer for that type. + + NOTE: This class should NOT be inherited from; it is hard-coded into the system. + + To extend the serialization system, instead create custom formatters, which are used by the class. + + + + + Editor-only event that fires whenever a serializer serializes a type. + + + + + Fires the event. + + + + + Gets a for the given value. If the value is null, it will be treated as a value of type . + + The value to get a for. + A for the given value. + + + + Gets a for type T. + + The type to get a for. + A for type T. + + + + Gets a for the given type. + + The type to get a for. + A for the given type. + The type argument is null. + + + + Reads a value weakly, casting it into object. Use this method if you don't know what type you're going to be working with at compile time. + + The reader to use. + The value which has been read. + + + + Writes a weakly typed value. Use this method if you don't know what type you're going to be working with at compile time. + + The value to write. + The writer to use. + + + + Writes a weakly typed value with a given name. Use this method if you don't know what type you're going to be working with at compile time. + + The name of the value to write. + The value to write. + The writer to use. + + + + Serializes and deserializes the type , and wraps serialization and deserialization with all the proper calls to free formatters from tedious boilerplate. + + Whenever serializing or deserializing anything, it is *strongly recommended* to use to get a proper wrapping serializer for that type. + + NOTE: This class should NOT be inherited from; it is hard-coded into the system. + + To extend the serialization system, instead create custom formatters, which are used by the class. + + The type which the can serialize and deserialize. + + + + Reads a value of type weakly, casting it into object. Use this method if you don't know what type you're going to be working with at compile time. + + The reader to use. + + The value which has been read. + + + + + Writes a weakly typed value of type with a given name. Use this method if you don't know what type you're going to be working with at compile time. + + The name of the value to write. + The value to write. + The writer to use. + + + + Reads a value of type . + + The reader to use. + + The value which has been read. + + + + + Writes a value of type . + + The value to write. + The writer to use. + + + + Writes a value of type with a given name. + + The name of the value to write. + The value to write. + The writer to use. + + + + Fires the event with the T generic argument of the serializer. + + + + + Serializer for the type. + + + + + + Reads a value of type . + + The reader to use. + + The value which has been read. + + + + + Writes a value of type . + + The name of the value to write. + The value to write. + The writer to use. + + + + Serializer for the type. + + + + + + Reads a value of type . + + The reader to use. + + The value which has been read. + + + + + Writes a value of type . + + The name of the value to write. + The value to write. + The writer to use. + + + + Serializer for the type. + + + + + + Reads a value of type . + + The reader to use. + + The value which has been read. + + + + + Writes a value of type . + + The name of the value to write. + The value to write. + The writer to use. + + + + Serializer for the type. + + + + + + Reads a value of type . + + The reader to use. + + The value which has been read. + + + + + Writes a value of type . + + The name of the value to write. + The value to write. + The writer to use. + + + + Serializer for the type. + + + + + + Reads a value of type . + + The reader to use. + + The value which has been read. + + + + + Writes a value of type . + + The name of the value to write. + The value to write. + The writer to use. + + + + Serializer for the type. + + + + + + Reads a value of type . + + The reader to use. + + The value which has been read. + + + + + Writes a value of type . + + The name of the value to write. + 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. + + + + + + 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 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. + This serializes nothing and always deserializes null, + and only exists to ensure that no coroutine instances + are ever created by the serialization system, since they + will in almost all cases be invalid instances. + + + Invalid coroutine instances crash Unity instantly when + they are garbage collected. + + + + + + Gets the type that the formatter can serialize. + + + The type that the formatter can serialize. + + + + + Returns null. + + + + + Returns null. + + + + + Does nothing. + + + + + Does nothing. + + + + + 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. + + + + 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 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. + + + + + The name of the field. + + + + + The name of the field. + + + + + The name of the field. + + + + + The data format used by the serializer. This field will be automatically set to the format specified in the global serialization config + when the Unity object gets serialized, unless the Unity object implements the interface. + + + + + The serialized data when serializing with the Binray format. + + + + + All serialized Unity references. + + + + + Whether the object contains any serialized data. + + + + + Gets a value indicating whether the struct contains any data. + If this is false, then it could mean that Unity has not yet deserialized the struct. + + + + + The serialized data when serializing with the JSON format. + + + + + The reference to the prefab this is only populated in prefab scene instances. + + + + + All serialized Unity references. + + + + + All Odin serialized prefab modifications. + + + + + The serialized data when serializing with the Nodes format. + + + + + Resets all data. + + + + + Resolves external index references to Unity objects. + + + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class with a list of Unity objects. + + The referenced Unity objects. + + + + Gets the currently referenced Unity objects. + + A list of the currently referenced Unity objects. + + + + Sets the referenced Unity objects of the resolver to a given list, or a new list if the value is null. + + The referenced Unity objects to set, or null if a new list is required. + + + + Determines whether the specified value can be referenced externally via this resolver. + + The value to reference. + The index of the resolved value, if it can be referenced. + + true if the reference can be resolved, otherwise false. + + + + + Tries to resolve the given reference index to a reference value. + + The index to resolve. + The resolved value. + + true if the index could be resolved to a value, otherwise false. + + + + + Resets this instance. + + + + + Utility class which initializes the Sirenix serialization system to be compatible with Unity. + + + + + Initializes the Sirenix serialization system to be compatible with Unity. + + + + + Provides an array of utility wrapper methods for easy serialization and deserialization of Unity objects of any type. + Note that, during serialization, it is always assumed that we are running on Unity's main thread. Deserialization can + happen on any thread, and all API's interacting with deserialization are thread-safe. + + Note that setting the IndexReferenceResolver on contexts passed into methods on this class will have no effect, as it will always + be set to a UnityReferenceResolver. + + + + + From the new scriptable build pipeline package + + + + + Note: it is assumed that code calling this is holding the DeserializePrefabCaches_LOCK lock, and will continue to hold it while the returned hashset is being modified + + + + + Whether to always force editor mode serialization. This member only exists in the editor. + + + + + Not yet documented. + + + + + Checks whether Odin will serialize a given member. + + The member to check. + Whether to allow serialization of members that will also be serialized by Unity. + The policy that Odin should be using for serialization of the given member. If this parameter is null, it defaults to . + True if Odin will serialize the member, otherwise false. + + + + Guesses whether or not Unity will serialize a given member. This is not completely accurate. + + The member to check. + True if it is guessed that Unity will serialize the member, otherwise false. + The parameter is null. + + + + Guesses whether or not Unity will serialize a given type. This is not completely accurate. + + The type to check. + True if it is guessed that Unity will serialize the type, otherwise false. + The parameter is null. + + + + 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. + + + + + Creates an object with default values initialized in the style of Unity; strings will be "", classes will be instantiated recursively with default values, and so on. + + + + + In 2020.1, Unity changed EditorApplication.delayCall from a field to an event, meaning + 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. + + + + + Invoked after deserialization has taken place. + + + + + Invoked before serialization has taken place. + + + + + A Unity Component which is serialized by the Sirenix serialization system. + + + + + Invoked after deserialization has taken place. + + + + + Invoked before serialization has taken place. + + + + + A Unity MonoBehaviour which is serialized by the Sirenix serialization system. + + + + + Invoked after deserialization has taken place. + + + + + Invoked before serialization has taken place. + + + + + A Unity ScriptableObject which is serialized by the Sirenix serialization system. + + + + + Invoked after deserialization has taken place. + + + + + Invoked before serialization has taken place. + + + + + A Unity StateMachineBehaviour which is serialized by the Sirenix serialization system. + + + + + Invoked after deserialization has taken place. + + + + + Invoked before serialization has taken place. + + + + + A Unity ScriptableObject which is serialized by the Sirenix serialization system. + + + + + Invoked after deserialization has taken place. + + + + + Invoked before serialization has taken place. + + + + diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.xml.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.xml.meta new file mode 100644 index 00000000..dc046e81 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.xml.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5f3147f7af4c49739579b966c458096f +timeCreated: 1488828285 +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.dll b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.dll new file mode 100644 index 00000000..954d4e22 Binary files /dev/null and b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.dll differ diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.dll.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.dll.meta new file mode 100644 index 00000000..66668bbb --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.dll.meta @@ -0,0 +1,46 @@ +fileFormatVersion: 2 +guid: 5c65184932ff4fd48a343e2360256baf +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/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.xml b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.xml new file mode 100644 index 00000000..970a2b1e --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.xml @@ -0,0 +1,9790 @@ + + + + Sirenix.Utilities.Editor + + + + + Icon for using in editor GUI. + + + + + Gets the raw input icon texture. + + + + + Gets the icon's highlighted texture. + + + + + Gets the icon's active texture. + + + + + Gets the icon's inactive texture. + + + + + Gets a GUIContent object with the active texture. + + + + + Gets a GUIContent object with the inactive texture. + + + + + Gets a GUIContent object with the highlighted texture. + + + + + Draws the icon in a square rect, with a custom shader that makes the icon look better when down-scaled. + This also handles mouseover effects, and linier color spacing. + + + + + Draws the icon in a square rect, with a custom shader that makes the icon look better when down-scaled. + This also handles mouseover effects, and linier color spacing. + + + + + Draws the icon in a square rect, with a custom shader that makes the icon look better when down-scaled. + This also handles mouseover effects, and linier color spacing. + + + + + Collection of EditorIcons for use in GUI drawing. + + + + + Gets an icon of an airplane symbol. + + + + + Gets an icon of an alert circle symbol. + + + + + Gets an icon of an alert triangle symbol. + + + + + Gets an icon of an arrow down symbol. + + + + + Gets an icon of an arrow left symbol. + + + + + Gets an icon of an arrow right symbol. + + + + + Gets an icon of an arrow up symbol. + + + + + Gets an icon of a bell symbol. + + + + + Gets an icon of a car symbol. + + + + + Gets an icon of a char1 symbol. + + + + + Gets an icon of a char2 symbol. + + + + + Gets an icon of a char3 symbol. + + + + + Gets an icon of a char graph symbol. + + + + + Gets an icon of a checkmark symbol. + + + + + Gets an icon of a clock symbol. + + + + + Gets an icon of a clouds symbol. + + + + + Gets an icon of a clouds rainy symbol. + + + + + Gets an icon of a clouds rainy sunny symbol. + + + + + Gets an icon of a clouds rainy thunder symbol. + + + + + Gets an icon of a clouds thunder symbol. + + + + + Gets an icon of a crosshair symbol. + + + + + Gets an icon of a cut symbol. + + + + + Gets an icon of a day calendar symbol. + + + + + Gets an icon of a download symbol. + + + + + Gets an icon of an eject symbol. + + + + + Gets an icon of an eye dropper symbol. + + + + + Gets an icon of a female symbol. + + + + + Gets an icon of a file symbol. + + + + + Gets an icon of a file cabinet symbol. + + + + + Gets an icon of a finnish banner symbol. + + + + + Gets an icon of a flag symbol. + + + + + Gets an icon of a flag finnish symbol. + + + + + Gets an icon of a folder symbol. + + + + + Gets an icon of a folder back symbol. + + + + + Gets an icon of a gKey symbol. + + + + + Gets an icon of a globe symbol. + + + + + Gets an icon of a grid blocks symbol. + + + + + Gets an icon of a grid image text symbol. + + + + + Gets an icon of a grid image text list symbol. + + + + + Gets an icon of a grid layout symbol. + + + + + Gets an icon of a hamburger menu symbol. + + + + + Gets an icon of a house symbol. + + + + + Gets an icon of an image symbol. + + + + + Gets an icon of an image collection symbol. + + + + + Gets an icon of an info symbol. + + + + + Gets an icon of a letter symbol. + + + + + Gets an icon of a light bulb symbol. + + + + + Gets an icon of a link symbol. + + + + + Gets an icon of a list symbol. + + + + + Gets an icon of a loading bar symbol. + + + + + Gets an icon of a lock locked symbol. + + + + + Gets an icon of a lock unlocked symbol. + + + + + Gets an icon of a lock unlocked symbol. Obsolete; use the correctly spelled LockUnlocked instead. + + + + + Gets an icon of a magnifying glass symbol. + + + + + Gets an icon of a male symbol. + + + + + Gets an icon of a marker symbol. + + + + + Gets an icon of a maximize symbol. + + + + + Gets an icon of a microphone symbol. + + + + + Gets an icon of a minimize symbol. + + + + + Gets an icon of a minus symbol. + + + + + Gets an icon of a mobile phone symbol. + + + + + Gets an icon of a money symbol. + + + + + Gets an icon of a move symbol. + + + + + Gets an icon of a multi user symbol. + + + + + Gets an icon of a next symbol. + + + + + Gets an icon of a pacman ghost symbol. + + + + + Gets an icon of a paperclip symbol. + + + + + Gets an icon of a pause symbol. + + + + + Gets an icon of a pen symbol. + + + + + Gets an icon of a pen add symbol. + + + + + Gets an icon of a pen minus symbol. + + + + + Gets an icon of a play symbol. + + + + + Gets an icon of a plus symbol. + + + + + Gets an icon of a podium symbol. + + + + + Gets an icon of a previous symbol. + + + + + Gets an icon of a reception signal symbol. + + + + + Gets an icon of a redo symbol. + + + + + Gets an icon of a refresh symbol. + + + + + Gets an icon of a rotate symbol. + + + + + Gets an icon of a ruler symbol. + + + + + Gets an icon of a ruler rect symbol. + + + + + Gets an icon of a settings cog symbol. + + + + + Gets an icon of a shopping basket symbol. + + + + + Gets an icon of a shopping cart symbol. + + + + + Gets an icon of a single user symbol. + + + + + Gets an icon of a smart phone symbol. + + + + + Gets an icon of a sound symbol. + + + + + Gets an icon of a speech bubble round symbol. + + + + + Gets an icon of a speech bubble square symbol. + + + + + Gets an icon of a speech bubbles round symbol. + + + + + Gets an icon of a speech bubbles square symbol. + + + + + Gets an icon of a star pointer symbol. + + + + + Gets an icon of a stop symbol. + + + + + Gets an icon of a stretch symbol. + + + + + Gets an icon of a table symbol. + + + + + Gets an icon of a tag symbol. + + + + + Gets an icon of a test tube symbol. + + + + + Gets an icon of a timer symbol. + + + + + Gets an icon of a traffic stop light symbol. + + + + + Gets an icon of a transparent symbol. + + + + + Gets an icon of a tree symbol. + + + + + Gets an icon of a triangle down symbol. + + + + + Gets an icon of a triangle left symbol. + + + + + Gets an icon of a triangle right symbol. + + + + + Gets an icon of a triangle up symbol. + + + + + Gets an icon of an undo symbol. + + + + + Gets an icon of an upload symbol. + + + + + Gets an icon of a wifi signal symbol. + + + + + Gets an icon of an x symbol. + + + + + Gets a texture of a test inconclusive symbol. + + + + + Gets a texture of a test failed symbol. + + + + + Gets a texture of a test normal symbol. + + + + + Gets a texture of a test passed symbol. + + + + + Gets a texture of a console info icon symbol. + + + + + Gets a texture of a console warnicon symbol. + + + + + Gets a texture of a console error icon symbol. + + + + + Gets a texture of an odin inspector logo symbol. + + + + + Gets a texture of a scene asset icon symbol. + + + + + Gets an icon representing a GameObject. + + + + + Gets an icon of a unity info icon. + + + + + Gets an icon of a unity warning icon. + + + + + Gets an icon of a unity error icon. + + + + + 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. + + + + + Loads an EditorIcon from the spritesheet. + + + + + Gets the icon's highlight texture. + + + + + Gets the icon's active texture. + + + + + Gets the icon's inactive texture. + + + + + 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. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted delegate if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and tries to emit a delegate method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + The parameters of the expression delegate. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted delegate if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and tries to emit a delegate method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + The parameters of the expression delegate. + The names of the expression's parameters, for use with the named parameter syntax. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted delegate if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and tries to emit a delegate method. + The expression to parse. + The emit context. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted delegate if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and tries to emit a delegate of the specified type. + The expression to parse. + The emit context. + The type of the delegate to emit. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted delegate if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionFunc method. + The expression to parse. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionFunc if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionFunc method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionFunc if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionFunc method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionFunc if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionFunc method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionFunc if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionFunc method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionFunc if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionFunc method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionFunc if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionFunc method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionFunc if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionFunc method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionFunc if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionFunc method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionFunc if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionFunc method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionFunc if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionAction method. + The expression to parse. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionAction if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionAction method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionAction if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionAction method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionAction if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionAction method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionAction if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionAction method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionAction if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionAction method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionAction if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionAction method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionAction if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionAction method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionAction if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionAction method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionAction if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionAction method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionAction if the expression is compiled successfully. Otherwise, null. + + + + 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. 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. + + + + + Gets the position from where the last drag started from in screen space. + + + + + Gets the delta position between the currrent mouse position and where the last drag originated from. + + + + + Gets the hovering accepted drop zone ID. + + + + + Gets a value indicating whether an instance is currently being dragged. + + + + + Gets the currently dragging identifier. + + + + + Gets the current hovering drop zone identifier. + + + + + Gets a more percistent id for drag and drop. + + + + + Draws a objectpicker button in the given rect. This one is designed to look good on top of DrawDropZone(). + + + + + Draws a objectpicker butter, in the given rect. This one is designed to look good on top of DrawDropZone(). + + + + + 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 both Unity and non-unity objects. + + + + + A drop zone area for bot Unity and non-unity objects. + + + + + A drop zone area for bot Unity and non-unity objects. + + + + + A drop zone area for bot Unity and non-unity objects. + + + + + A drop zone area for bot Unity and non-unity objects. + + + + + A drop zone area for bot Unity and non-unity objects. + + + + + A drop zone area for bot Unity and non-unity objects. + + + + + A drop zone area for bot Unity and non-unity objects. + + + + + Disalloweds the drop area for next drag zone. Follow this function call by a DragZone. + + + + + A draggable zone for both Unity and non-unity objects. + + + + + A draggable zone for both Unity and non-unity objects. + + + + + A draggable zone for both Unity and non-unity objects. + + + + + 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. + + The . + The mouse button the user has to press. + If true then the method will call on the event. + true on mouse down events with the specified button. Otherwise false. + + + + Returns true when the user clicks a rect with the mouse. + + The event. + The rect the user can click on. + The button the user has to press. + If true then the method will call on the event. + true on mouse down events with the specified button. Otherwise false. + + + + Returns true when the user releases the specified mouse button. + + The . + The mouse button the user has to release. + If true then the method will call on the event. + true on mouse up events, with the specified button. Otherwise false. + + + + Returns true when the user releases the specified mouse button over the specified rect. + + The . + The rect the user has to release the mouse button over. + The mouse button the user has to release. + If true then the method will call on the event. + true on mouse up events, with the specified button and over the specified rect. Otherwise false. + + + + Returns true when the user left clicks a rect. + + The . + The rect the user can click. + If true then the method will call on the event. + true on left click events, on the specified rect. Otherwise false. + + + + Returns true when the user right clicks a rect. + + The . + The rect the user can right click. + If true then the method will call on the event. + true on context click events, on the specified rect. Otherwise false. + + + + Returns true when the user presses the specified key. + + The . + The key the user has to press. + If true then the method will call on the event. + true on key down events with the specified key code. Otherwise false. + + + + Returns true when the user releases the specified key. + + The . + The key the user has to release. + If true then the method will call on the event. + true on key up events with the specified key code. Otherwise false. + + + + Returns true whene the user moves or drags the mouse. + + The . + If true then the method will call on the event. + true on mouse move or mouse drag events. Otherwise false. + + + + Returns true when the user hovers the mouse over the specified rect. + + The . + The rect the user can hover. + true on any event where the mouse is hovering the specified rect. Otherwise false. + + + + Returns true on repaint events. + + The . + true on repaint events. Otherwise false. + + + + Returns true on layout events. + + The . + true on layout events. Otherwise false. + + + + Returns true on the specified event. + + The . + The required event type. + true on the specified event. Otherwise false. + + + + Collection of extension methods for . + + + + + Removes all menu items with a given name from the GenericMenu. + + The GenericMenu to remove items from. + The name of the items to remove. + True if any items were removed, otherwise false. + + + + Replaces the first found menu item with a given name with a new menu item, or if no such element is found, adds a new one. + + The GenericMenu to replace items in. + The name of the items to remove. + The func to replace or add. + The on value to set the new menu item with. + True if an item was replaced, otherwise false. + + + + Replaces the first found menu item with a given name with a new menu item, or if no such element is found, adds a new one. + + The GenericMenu to replace items in. + The name of the items to remove. + The on value to set the new menu item with. + The func to replace or add. + The user data. + + True if an item was replaced, otherwise false. + + + + + Emitted wrapper for the internal "UnityEngine.GUIClip" class. + + + + + Not yet documented. + + + + + Gets the top most clipped rect. + + + + + Gets the visible rect. + + + + + Gets the top rect. + + + + + Unclips the specified position. + + The position. + + + + + Unclips the specified rect. + + The rect. + + + + + This class is due to undergo refactoring. + + + + + The value. + + + + + Performs an implicit conversion from to . + + + + + Various helper function for GUI. + + + + + Gets the bold default font. + + + + + An alternative to GUI.FocusControl(null), which does not take focus away from the current GUI.Window. + + + + + Whether the inspector is currently in the progress of drawing a dictionary key. + + + + + Hides the following draw calls. Remember to call when done. + + + + + Unhides the following draw calls after having called . + + + + + Determines whether the specified EditorWindow is docked. + + The editor window. + true if the editor window is docked. Otherwise false. + + + + Not yet documented. + + + + + Opens a new inspector window for the specified object. + + The unity object. + unityObj + + + + Gets or sets a value indicating whether labels are currently bold. + + + true if this instance is bold label; otherwise, false. + + + + + Gets the size of the current window border. + + + The size of the current window border. + + + + + Gets the editor screen point offset. + + + The editor screen point offset. + + + + + Gets the current editor gui context width. Only set these if you know what it does. + Setting this has been removed. Use PushContextWidth and PopContextWidth instead. + + + + + Unity EditorGUIUtility.labelWidth only works reliablly in Repaint events. + BetterLabelWidth does a better job at giving you the correct LabelWidth in non-repaint events. + + + + + Odin will set this for you whenever an Odin property tree is drawn. + But if you're using BetterLabelWidth and BetterContextWidth without Odin, then + you need to set BetterContextWidth in the beginning of each GUIEvent. + + + + + Gets the current indent amount. + + + The current indent amount. + + + + + Gets the mouse screen position. + + + The mouse screen position. + + + + + Gets the current editor window. + + + The current editor window. + + + + + Gets a value indicating whether the current editor window is focused. + + + true if the current window has focus. Otherwise, false. + + + + + Gets the ID of the current editor window. + + + The ID of the current editor window. + + + + + Gets a value indicating whether a repaint has been requested. + + + true if repaint has been requested. Otherwise false. + + + + + Gets or sets the actual EditorGUIUtility.LabelWidth, regardless of the current hierarchy mode or context width. + + + + + Requests a repaint. + + + + + Calls , if the is not NULL. + + + + + Requests a repaint. + + + + + 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 + + The measured rect. + + + + Gets the current layout rect. + + The current layout rect. + + + + Gets the current layout rect. + + The current layout rect. + + + + Gets the playmode color tint. + + The playmode color tint. + + + + Pushes a context width to the context width stack. + Remember to pop the value again with . + + The width to push. + + + + Pops a value pushed by . + + + + + Pushes a color to the GUI color stack. Remember to pop the color with . + + The color to push the GUI color.. + if set to true blend with alpha. + + + + Takes a screenshot of the GUI within the specified rect. + + The rect. + The screenshot as a render texture. + + + + Pops the GUI color pushed by . + + + + + Pushes a state to the GUI enabled stack. Remember to pop the state with . + + If set to true GUI will be enabled. Otherwise GUI will be disabled. + + + + Pops the GUI enabled pushed by + + + + + Pushes a state to the IsDrawingDictionaryKey stack. Remember to pop the state with . + + + + + Pops the state pushed by + + + + + Pushes the hierarchy mode to the stack. Remember to pop the state with . + + The hierachy mode state to push. + Changing hierachy mode also changes how label-widths are calcualted. By default, we try to keep the current label width. + + + + Pops the hierarchy mode pushed by . + + + + + Pushes bold label state to the stack. Remember to pop with . + + Value indicating if labels should be bold or not. + + + + Pops the bold label state pushed by . + + + + + Pushes the indent level to the stack. Remember to pop with . + + The indent level to push. + + + + Pops the indent level pushed by . + + + + + Pushes the content color to the stack. Remember to pop with . + + The content color to push.. + If set to true blend with alpha. + + + + Pops the content color pushed by . + + + + + Pushes the label color to the stack. Remember to pop with . + + The label color to push. + + + + Pops the label color pushed by . + + + + + Pushes the GUI position offset to the stack. Remember to pop with . + + The GUI offset. + + + + Pops the GUI position offset pushed by . + + + + + Pushes a GUI matrix to the stack. Remember to pop with . + + The GUI matrix to push. + + + + Pops the GUI matrix pushed by . + + + + + Ignores input on following GUI calls. Remember to end with . + + + + + Ends the ignore input started by . + + + + + Pushes the event type to the stack. Remember to pop with . + + The type of event to push. + + + + Pops the event type pushed by . + + + + + Pushes the width to the editor GUI label width to the stack. Remmeber to Pop with . + + The editor GUI label width to push. + + + + Pops editor gui label widths pushed by . + + + + + Pushes the value to the responsive vector component fields stack. Remeber to pop with . + + + + + Pops responsive vector component fields value pushed by . + + + + + Pushes the value to the fade group duration stack. Remeber to pop with . + + + + + Pops fade group duration value pushed by . + + + + + Pushes the value to the tab page slide animation duration stack. Remember to pop with . + + + + + + Pops tab page slide animation duration value pushed by . + + + + + Clears the repaint request. + + + + + Gets a temporary value context. + + The type of the config value. + The key for the config. + The name of the config. + GUIConfig for the specified key and name. + + + + Gets a temporary value context. + + The type of the value. + The key for the config. + The ID for the config. + GUIConfig for the specified key and ID. + + + + Gets a temporary value context. + + The type of the value. + The primary key. + The secondary key. + GUIConfig for the specified primary and secondary key. + + + + Gets a temporary value context. + + The type of the value. + The key for the context. + GUIConfig for the specified key. + + + + Gets a temporary nullable value context. + + Key for context. + Name for the context. + + + + Gets a temporary nullable value context. + + Key for context. + Id of the context. + + + + Gets a temporary nullable value context. + + Primary key for the context. + Secondary key for the context. + + + + Gets a temporary nullable value context. + + Key for the context. + + + + Gets a temporary context. + + Key for the context. + Name for the context. + Default value of the context. + + + + Gets a temporary context. + + Key for the context. + Id for the context. + Default value of the context. + + + + Gets a temporary context. + + Primary key for the context. + Secondary key for the context. + Default value of the context. + + + + Gets a temporary context. + + Key for the context. + Default value of the context. + + + + Gets a temporary GUIContent with the specified text. + + The text for the GUIContent. + Temporary GUIContent instance. + + + + Gets a temporary GUIContent with the specified text and tooltip. + + The text for the GUIContent. + The tooltip for the GUIContent. + Temporary GUIContent instance. + + + + Gets a temporary GUIContent with the specified image and tooltip. + + The image for the GUIContent. + The tooltip for the GUIContent. + Temporary GUIContent instance. + + + + Gets a temporary GUIContent with the specified text, image and tooltip. + + The text for the GUIContent. + The image for the GUIContent. + The tooltip for the GUIContent. + Temporary GUIContent instance. + + + + Indents the rect by the current indent amount. + + The rect to indent. + Indented rect. + + + + Indents the rect by the current indent amount. + + The rect to indent. + + + + Repaints the EditorWindow if a repaint has been requested. + + The window to repaint. + + + + Repaints the editor if a repaint has been requested. If the currently rendering window is not an InspectorWindow, Repaint() will be called on the current window as well. + + The editor to repaint. + + + + Gets the best thumbnail icon given the provided arguments provided. + + + + + + + + + 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. + + + + + The height of the progress bar field. Default 12 pixel. + + + + + The foreground color of the progress bar field. + + + + + The background color of the progress bar field. + + + + + If true the progress bar field will draw a label ontop to show the current value. + + + + + Alignment of the progress bar field overlay. + + + + + Default configuration. + + + + + Creates a copy of the configuration. + + The configuration to copy. + + + + Creates a progress bar configuration. + + The height of the progress bar. + The foreground color of the progress bar. + The background color of the progress bar. + If true there will be drawn a overlay on top of the field. + The alignment of the text overlay. + + + + Draw mode of quaternion fields. + + + + + + + Draw the quaterion as euler angles. + + + + + Draw the quaterion in as an angle and an axis. + + + + + 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. + + + + + The width of the X, Y and Z labels in structs. + + + + + When true the component labels, for vector fields, will be hidden when the field is too narrow. + + + + + 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. + Wheather or not to allow scene objects. + + + + 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. + Wheather or not to allow scene objects. + + + + 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 Unity object. + The Unity object type. This supports inheritance. + Wheather or not to allow scene objects. + + + + 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. + + The label to use, or null if no label should be used. + The Unity object. + The Unity object type. This supports inheritance. + Wheather or not to allow scene objects. + Layout options. + + + + 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. + + The label to use, or null if no label should be used. + The Unity object. + The Unity object type. This supports inheritance. + Wheather or not to allow scene objects. + Layout options. + + + + 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. + + The Unity object. + The Unity object type. This supports inheritance. + Wheather or not to allow scene objects. + Layout options. + + + + 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. + 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. + 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. + 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. + 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. + 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 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. + 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. + 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 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. + 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 Unity object. + 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. + 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 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. + 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. + 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 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. + 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 Unity object. + 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 polymorphic ObjectField. + + The label to use, or null if no label should be used. + The value. + The object type. This supports inheritance. + 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. + + + + + Draws a polymorphic ObjectField. + + + + + Draws a polymorphic ObjectField. + + The label to use, or null if no label should be used. + The value. + The object type. This supports inheritance. + Wheather or not to allow scene objects. + Layout options. + + + + Draws a polymorphic ObjectField. + + The value. + The object type. This supports inheritance. + 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. + + Position and size of the field. + The label to use, or null if no label should be used. + The layer mask to draw. + + + + Draws a field for a layer mask. + + Position and size of the field. + The label to use, or null if no label should be used. + The layer mask to draw. + + + + Draws a field for a layer mask. + + Position and size of the field. + The layer mask to draw. + + + + Draws a field for a layer mask. + + The label to use, or null if no label should be used. + The layer mask to draw. + Layout options. + + + + Draws a field for a layer mask. + + The label to use, or null if no label should be used. + The layer mask to draw. + Layout options. + + + + Draws a field for a layer mask. + + The layer mask to draw. + Layout options. + + + + Draws a Guid field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a Guid field. + + Position and size of the field. + Current value. + Value assigned to the field. + + + + Draws a Guid field. + + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a Guid field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a Guid field. + + 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 Guid field. + + 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 an int field. + + 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 an int field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws an int field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws an int field. + + Position and size of the field. + Current value. + Value assigned to the field. + + + + Draws an int field. + + 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 an int field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws an int field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws an int field. + + Current value. + Layout options. + Value assigned to the field. + + + + Draws a delayed int field. + + 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 delayed int field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a delayed int field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a delayed int field. + + Position and size of the field. + Current value. + Value assigned to the field. + + + + Draws a delayed int field. + + 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 delayed int field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a delayed int field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a delayed int field. + + Current value. + Layout options. + Value assigned to the field. + + + + Draws a range field for ints. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Minimum value. + Maximum value. + GUIStyle for drawing the field. Set to null for default. + Value assigned to the field. + + + + Draws a range field for ints. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Minimum value. + Maximum value. + Value assigned to the field. + + + + Draws a range field for ints. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Minimum value. + Maximum value. + Value assigned to the field. + + + + Draws a range field for ints. + + Position and size of the field. + Current value. + Minimum value. + Maximum value. + Value assigned to the field. + + + + Drwas a range field for ints. + + Label of field. Set to null for no label. + Current value. + Minimum value. + Maximum value. + GUIStyle for drawing the field. Set to null for default. + Layout options. + Value assigned to the field. + + + + Draws a range field for ints. + + Label of field. Set to null for no label. + Current value. + Minimum value. + Maximum value. + Layout options. + Value assigned to the field. + + + + Draws a range field for ints. + + Label of field. Set to null for no label. + Current value. + Minimum value. + Maximum value. + Layout options. + Value assigned to the field. + + + + Draws a range field for ints. + + Current value. + Minimum value. + Maximum value. + Layout options. + Value assigned to the field. + + + + Draws a colored progress bar field. + + Position and size of the field. + The label to use, or null if no label should be used. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + The configuration for the progress bar field. + Optional text for label to be drawn ontop of the progress bar. This value is only used if the DrawValueLabel option is enabled in the ProgressBarConfig. + + + + Draws a colored progress bar field. + + Position and size of the field. + The label to use, or null if no label should be used. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + The configuration for the progress bar field. + + + + Draws a colored progress bar field. + + Position and size of the field. + The label to use, or null if no label should be used. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + The configuration for the progress bar field. + + + + Draws a colored progress bar field. + + Position and size of the field. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + The configuration for the progress bar field. + + + + Draws a colored progress bar field. + + Position and size of the field. + The label to use, or null if no label should be used. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + + + + Draws a colored progress bar field. + + Position and size of the field. + The label to use, or null if no label should be used. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + + + + Draws a colored progress bar field. + + Position and size of the field. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + + + + Draws a colored progress bar field. + + The label to use, or null if no label should be used. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + The configuration for the progress bar field. + Layout options. + + + + Draws a colored progress bar field. + + The label to use, or null if no label should be used. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + The configuration for the progress bar field. + Layout options. + + + + Draws a colored progress bar field. + + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + The configuration for the progress bar field. + Layout options. + + + + Draws a colored progress bar field. + + The label to use, or null if no label should be used. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + Layout options. + + + + Draws a colored progress bar field. + + The label to use, or null if no label should be used. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + Layout options. + + + + Draws a colored progress bar field. + + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + Layout options. + + + + Draws a colored segmented progress bar field. + + Position and size of the field. + The label to use, or null if no label should be used. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + The configuration for the progress bar field. + Optional text for label to be drawn ontop of the progress bar. This value is only used if the DrawValueLabel option is enabled in the ProgressBarConfig. + + + + Draws a colored segmented progress bar field. + + Position and size of the field. + The label to use, or null if no label should be used. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + The configuration for the progress bar field. + + + + Draws a colored segmented progress bar field. + + Position and size of the field. + The label to use, or null if no label should be used. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + The configuration for the progress bar field. + + + + Draws a colored segmented progress bar field. + + Position and size of the field. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + The configuration for the progress bar field. + + + + Draws a colored segmented progress bar field. + + Position and size of the field. + The label to use, or null if no label should be used. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + + + + Draws a colored segmented progress bar field. + + Position and size of the field. + The label to use, or null if no label should be used. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + + + + Draws a colored segmented progress bar field. + + Position and size of the field. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + + + + Draws a colored segmented progress bar field. + + The label to use, or null if no label should be used. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + The configuration for the progress bar field. + Layout options. + + + + Draws a colored segmented progress bar field. + + The label to use, or null if no label should be used. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + The configuration for the progress bar field. + Layout options. + + + + Draws a colored segmented progress bar field. + + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + The configuration for the progress bar field. + Layout options. + + + + Draws a colored segmented progress bar field. + + The label to use, or null if no label should be used. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + Layout options. + + + + Draws a colored segmented progress bar field. + + The label to use, or null if no label should be used. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + Layout options. + + + + Draws a colored segmented progress bar field. + + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + Layout options. + + + + Draws an overlay on top of a progress bar field. + + The rect used to draw the progress bar field with. (Minus the Rect for the prefix label, if any.) + The label to draw ontop of the progress bar field. + The relative value of the progress bar, from 0 to 1. + The configuration used to draw the progress bar field. + + + + Draws an overlay on top of a progress bar field. + + The rect used to draw the progress bar field with. (Minus the Rect for the prefix label, if any.) + The label to draw ontop of the progress bar field. + The relative value of the progress bar, from 0 to 1. + The configuration used to draw the progress bar field. + + + + Draws an long field. + + 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 an long field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws an long field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws an long field. + + Position and size of the field. + Current value. + Value assigned to the field. + + + + Draws an long field. + + 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 an long field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws an long field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws an long field. + + Current value. + Layout options. + Value assigned to the field. + + + + Draws a delayed long field. + + 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 delayed long field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a delayed long field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a delayed long field. + + Position and size of the field. + Current value. + Value assigned to the field. + + + + Draws a delayed long field. + + 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 delayed long field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a delayed long field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a delayed long field. + + Current value. + Layout options. + Value assigned to the field. + + + + Draws a float field. + + 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. + + 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. + + 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. + + Position and size of the field. + Current value. + Value assigned to the field. + + + + Draws a float field. + + 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 float field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a float field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a float field. + + Current value. + Layout options. + Value assigned to the field. + + + + Draws a delayed float field. + + 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 delayed float field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a delayed float field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a delayed float field. + + Position and size of the field. + Current value. + Value assigned to the field. + + + + Draws a delayed float field. + + 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 delayed float field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a delayed float field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a delayed float field. + + Current value. + Layout options. + Value assigned to the field. + + + + Draws a range field for floats. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Minimum value. + Maximum value. + GUIStyle for drawing the field. Set to null for default. + Value assigned to the field. + + + + Draws a range field for floats. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Minimum value. + Maximum value. + Value assigned to the field. + + + + Draws a range field for floats. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Minimum value. + Maximum value. + Value assigned to the field. + + + + Draws a range field for floats. + + Position and size of the field. + Current value. + Minimum value. + Maximum value. + Value assigned to the field. + + + + Draws a range field for floats. + + Label of field. Set to null for no label. + Current value. + Minimum value. + Maximum value. + GUIStyle for drawing the field. Set to null for default. + Layout options. + Value assigned to the field. + + + + Draws a range field for floats. + + Label of field. Set to null for no label. + Current value. + Minimum value. + Maximum value. + Layout options. + Value assigned to the field. + + + + Draws a range field for floats. + + Label of field. Set to null for no label. + Current value. + Minimum value. + Maximum value. + Layout options. + Value assigned to the field. + + + + Draws a range field for floats. + + Current value. + Minimum value. + Maximum value. + Layout options. + Value assigned to the field. + + + + Draws a double field. + + 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. + + 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. + + 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. + + Position and size of the field. + Current value. + Value assigned to the field. + + + + Draws a double field. + + 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 double field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a double field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a double field. + + Current value. + Layout options. + Value assigned to the field. + + + + Draws a delayed double field. + + 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 delayed double field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a delayed double field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a delayed double field. + + Position and size of the field. + Current value. + Value assigned to the field. + + + + Draws a delayed double field. + + 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 delayed double field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a delayed double field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a delayed double field. + + Current value. + Layout options. + Value assigned to the field. + + + + Draws a decimal field. + + 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. + + 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. + + 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. + + Position and size of the field. + Current value. + Value assigned to the field. + + + + Draws a decimal field. + + 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. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a decimal field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a decimal field. + + Current value. + Layout options. + Value assigned to the field. + + + + Draws a text field for strings. + + 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 text field for strings. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a text field for strings. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a text field for strings. + + Position and size of the field. + Current value. + Value assigned to the field. + + + + Draws a text field for strings. + + 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 text field for strings. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a text field for strings. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a text field for strings. + + Current value. + Layout options. + Value assigned to the field. + + + + Draws a delayed text field. + + 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 delayed text field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a delayed text field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a delayed text field. + + Position and size of the field. + Current value. + Value assigned to the field. + + + + Draws a delayed text field. + + 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 delayed text field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a delayed text field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a delayed text field. + + Current value. + Layout options. + Value assigned to the field. + + + + Draws a field that lets the user select a path to a file. + + Position and size of the field. + 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. + 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. + + Position and size of the field. + 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. + 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. + + 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. + 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. + + 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. + A path to a file. + + + + Draws a field that lets the user select a path to a folder. + + Position and size of the field. + 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. + 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. + A path to a folder. + + + + Draws a field that lets the user select a path to a folder. + + Position and size of the field. + The current value. + A parent path the path needs to be relative to. Use null for Unity project directory. + 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. + A path to a folder. + + + + Draws a field that lets the user select a path to a folder. + + 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. + 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. + A path to a folder. + + + + Draws a field that lets the user select a path to a folder. + + The current value. + A parent path the path needs to be relative to. Use null for Unity project directory. + 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. + A path to a folder. + + + + Draws a prefix label for a vector field, that implements label dragging. + + + + + Draws a prefix label for a vector field, that implements label dragging. + + The position and total size of the field. + The label content. If null this function does nothing. + The value for the vector field. + The vector scaled by label dragging. + + + + Draws a prefix label for a vector field, that implements label dragging. + + The position and total size of the field. + The label content. If null this function does nothing. + The value for the vector field. + The vector scaled by label dragging. + + + + Draws a prefix label for a vector field, that implements label dragging. + + The label content. If null this function does nothing. + The value for the vector field. + The vector scaled by label dragging. + + + + Draws a prefix label for a vector field, that implements label dragging. + + The label content. If null this function does nothing. + The value for the vector field. + The vector scaled by label dragging. + + + + Draws a Vector2 field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a Vector2 field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a Vector2 field. + + Position and size of the field. + Current value. + Value assigned to the field. + + + + Draws a Vector2 field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a Vector2 field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a Vector2 field. + + Current value. + Layout options. + Value assigned to the field. + + + + Draws a Vector3 field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a Vector3 field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a Vector3 field. + + Position and size of the field. + Current value. + Value assigned to the field. + + + + Draws a Vector3 field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a Vector3 field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a Vector3 field. + + Current value. + Layout options. + Value assigned to the field. + + + + Draws a Vector4 field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a Vector4 field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a Vector4 field. + + Position and size of the field. + Current value. + Value assigned to the field. + + + + Draws a Vector4 field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a Vector4 field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a Vector4 field. + + Current value. + Layout options. + Value assigned to the field. + + + + Draws a Color field. + + Position and size of the field. + Label of field. Set to null for no label. + + Value assigned to the field. + + + + Draws a Color field. + + Position and size of the field. + Label of field. Set to null for no label. + + Value assigned to the field. + + + + Draws a Color field. + + Position and size of the field. + + Value assigned to the field. + + + + Draws a Color field. + + Label of field. Set to null for no label. + + Layout options. + Value assigned to the field. + + + + Draws a Color field. + + Label of field. Set to null for no label. + + Layout options. + Value assigned to the field. + + + + Draws a Color field. + + + Layout options. + Value assigned to the field. + + + + Draws a slider for setting two values between a min and a max limit. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + The min and max limit for the value. + Show fields for min and max value. + A Vector2 with X set as min value, and Y to set as max value. + + + + Draws a slider for setting two values between a min and a max limit. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + The min and max limit for the value. + Show fields for min and max value. + A Vector2 with X set as min value, and Y to set as max value. + + + + Draws a slider for setting two values between a min and a max limit. + + Position and size of the field. + Current value. + The min and max limit for the value. + Show fields for min and max value. + A Vector2 with X set as min value, and Y to set as max value. + + + + Draws a slider for setting two values between a min and a max limit. + + Label of field. Set to null for no label. + Current value. + The min and max limit for the value. + Show fields for min and max value. + Layout options. + A Vector2 with X set as min value, and Y to set as max value. + + + + Draws a slider for setting two values between a min and a max limit. + + Label of field. Set to null for no label. + Current value. + The min and max limit for the value. + Show fields for min and max value. + Layout options. + A Vector2 with X set as min value, and Y to set as max value. + + + + Draws a slider for setting two values between a min and a max limit. + + Current value. + The min and max limit for the value. + Show fields for min and max value. + Layout options. + A Vector2 with X set as min value, and Y to set as max value. + + + + Draws a slider for setting two values between a min and a max limit. + + Position and size of the field. + Label of field. Set to null for no label. + Current min value. + Current max value. + The min limit for the value. + The max limit for the value. + Show fields for min and max value. + + + + Draws a slider for setting two values between a min and a max limit. + + Position and size of the field. + Label of field. Set to null for no label. + Current min value. + Current max value. + The min limit for the value. + The max limit for the value. + Show fields for min and max value. + + + + Draws a slider for setting two values between a min and a max limit. + + Position and size of the field. + Current min value. + Current max value. + The min limit for the value. + The max limit for the value. + Show fields for min and max value. + + + + Draws a slider for setting two values between a min and a max limit. + + Label of field. Set to null for no label. + Current min value. + Current max value. + The min limit for the value. + The max limit for the value. + Show fields for min and max value. + Layout options. + + + + Draws a slider for setting two values between a min and a max limit. + + Label of field. Set to null for no label. + Current min value. + Current max value. + The min limit for the value. + The max limit for the value. + Show fields for min and max value. + Layout options. + + + + Draws a slider for setting two values between a min and a max limit. + + Current min value. + Current max value. + The min limit for the value. + The max limit for the value. + Show fields for min and max value. + Layout options. + + + + Draws a rotation field for a quaternion. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Draw mode for rotation field. + Value assigned to the field. + + + + Draws a rotation field for a quaternion. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Draw mode for rotation field. + Value assigned to the field. + + + + Draws a rotation field for a quaternion. + + Position and size of the field. + Current value. + Draw mode for rotation field. + Value assigned to the field. + + + + Draws a rotation field for a quaternion. + + Label of field. Set to null for no label. + Current value. + Draw mode for rotation field. + Layout options. + Value assigned to the field. + + + + Draws a rotation field for a quaternion. + + Label of field. Set to null for no label. + Current value. + Draw mode for rotation field. + Layout options. + Value assigned to the field. + + + + Draws a rotation field for a quaternion. + + Current value. + Draw mode for rotation field. + Layout options. + Value assigned to the field. + + + + Draws an euler field for a quaternion. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws an euler field for a quaternion. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws an euler field for a quaternion. + + Position and size of the field. + Current value. + Value assigned to the field. + + + + Draws an euler field for a quaternion. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws an euler field for a quaternion. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws an euler field for a quaternion. + + Current value. + Layout options. + Value assigned to the field. + + + + Draws an angle axis field for a quaternion. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws an angle axis field for a quaternion. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws an angle axis field for a quaternion. + + Position and size of the field. + Current value. + Value assigned to the field. + + + + Draws an angle axis field for a quaternion. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws an angle axis field for a quaternion. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws an angle axis field for a quaternion. + + Current value. + Layout options. + Value assigned to the field. + + + + Draws a quaternion field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a quaternion field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a quaternion field. + + Position and size of the field. + Current value. + Value assigned to the field. + + + + Draws a quaternion field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a quaternion field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a quaternion field. + + Current value. + Layout options. + Value assigned to the field. + + + + Draws a dropdown. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Names of selectable items. + GUIStyle for drawing the field. Set to null for default. + Value assigned to the field. + + + + Draws a dropdown. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Names of selectable items. + Value assigned to the field. + + + + Draws a dropdown. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Names of selectable items. + Value assigned to the field. + + + + Draws a dropdown. + + Position and size of the field. + Current value. + Names of selectable items. + Value assigned to the field. + + + + Draws a dropdown. + + Label of field. Set to null for no label. + Current value. + Names of selectable items. + GUIStyle for drawing the field. Set to null for default. + Layout options. + Value assigned to the field. + + + + Draws a dropdown. + + Label of field. Set to null for no label. + Current value. + Names of selectable items. + Layout options. + Value assigned to the field. + + + + Draws a dropdown. + + Label of field. Set to null for no label. + Current value. + Names of selectable items. + Layout options. + Value assigned to the field. + + + + Draws a dropdown. + + Current value. + Names of selectable items. + Layout options. + Value assigned to the field. + + + + Draws a generic dropdown. + + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Selectable items. + Value assigned to the field. + + + + Draws a generic dropdown. + + + Label of field. Set to null for no label. + Current value. + Selectable items. + Value assigned to the field. + + + + Draws a generic dropdown. + + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Selectable items. + Names of selectable items. If null ToString() will be used instead. + GUIStyle for drawing the field. Set to null for default. + Value assigned to the field. + + + + Draws a generic dropdown. + + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + + Names of selectable items. If null ToString() will be used instead. + Value assigned to the field. + + + + Draws a generic dropdown. + + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + + Names of selectable items. If null ToString() will be used instead. + Value assigned to the field. + + + + Draws a generic dropdown. + + + Position and size of the field. + Current value. + + Names of selectable items. If null ToString() will be used instead. + Value assigned to the field. + + + + Draws a generic dropdown. + + + Label of field. Set to null for no label. + Current value. + + Names of selectable items. If null ToString() will be used instead. + GUIStyle for drawing the field. Set to null for default. + Layout options. + Value assigned to the field. + + + + Draws a generic dropdown. + + + Label of field. Set to null for no label. + Current value. + + Names of selectable items. If null ToString() will be used instead. + Layout options. + Value assigned to the field. + + + + Draws a generic dropdown. + + + Label of field. Set to null for no label. + Current value. + + Names of selectable items. If null ToString() will be used instead. + Layout options. + Value assigned to the field. + + + + Draws a generic dropdown. + + + Current value. + + Names of selectable items. If null ToString() will be used instead. + Layout options. + Value assigned to the field. + + + + Draws a dropdown for an enum or an enum mask. + + 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 dropdown for an enum or an enum mask. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a dropdown for an enum or an enum mask. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a dropdown for an enum or an enum mask. + + Position and size of the field. + Current value. + Value assigned to the field. + + + + Draws a dropdown for an enum or an enum mask. + + 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 dropdown for an enum or an enum mask. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a dropdown for an enum or an enum mask. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a dropdown for an enum or an enum mask. + + Current value. + Layout options. + Value assigned to the field. + + + + Draws a dropdown. + + + Position and size of the field. + Label of field. Set to null for no label. + Current selection. + Avaible items in the dropdown. + If true then the user can select multiple items. Otherwise the user can only select one item. + true when the user has changed the selection. Otherwise false. + + + + Draws a dropdown. + + + Position and size of the field. + Label of field. Set to null for no label. + Current selection. + Avaible items in the dropdown. + If true then the user can select multiple items. Otherwise the user can only select one item. + true when the user has changed the selection. Otherwise false. + + + + Draws a dropdown. + + + Position and size of the field. + Current selection. + Avaible items in the dropdown. + If true then the user can select multiple items. Otherwise the user can only select one item. + true when the user has changed the selection. Otherwise false. + + + + Draws a dropdown. + + + Label of field. Set to null for no label. + Current selection. + Avaible items in the dropdown. + If true then the user can select multiple items. Otherwise the user can only select one item. + Layout options. + true when the user has changed the selection. Otherwise false. + + + + Draws a dropdown. + + + Label of field. Set to null for no label. + Current selection. + Avaible items in the dropdown. + If true then the user can select multiple items. Otherwise the user can only select one item. + Layout options. + true when the user has changed the selection. Otherwise false. + + + + Draws a dropdown. + + + Current selection. + Avaible items in the dropdown. + If true then the user can select multiple items. Otherwise the user can only select one item. + 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. + + Position and size of the field. + Label of field. Set to null for no label. + Current selection. + GUIStyle for drawing the field. Set to null for default. + Value assigned to the field. + + + + Draws a dropdown field for enum masks. + + Position and size of the field. + Label of field. Set to null for no label. + Current selection. + Value assigned to the field. + + + + Draws a dropdown field for enum masks. + + Position and size of the field. + Label of field. Set to null for no label. + Current selection. + Value assigned to the field. + + + + Draws a dropdown field for enum masks. + + Position and size of the field. + Current selection. + Value assigned to the field. + + + + Draws a dropdown field for enum masks. + + Label of field. Set to null for no label. + Current selection. + GUIStyle for drawing the field. Set to null for default. + Layout options. + Value assigned to the field. + + + + Draws a dropdown field for enum masks. + + Label of field. Set to null for no label. + Current selection. + Layout options. + Value assigned to the field. + + + + Draws a dropdown field for enum masks. + + Label of field. Set to null for no label. + Current selection. + Layout options. + Value assigned to the field. + + + + Draws a dropdown field for enum masks. + + Current selection. + 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. + + + + + The mixed value dash character, to show when something has mixed values; + + + + + Default fade group animation duration. + + + + + Tab page slide animation duration. + + + + + Shaking animation duration. + + + + + Expand foldouts by default. + + + + + Show buttons results by default. + + + + + Draws a GUI field for objects. + + The rect to draw the field in. + The label of the field. + The value of the field. + The object type for the field. + If set to true then allow scene objects to be assigned to the field. + If set to true the field is readonly. + The object assigned to the field. + + + + Draws an GUI field for objects. + + The label for the field. + The value of the field. + The object type for the field. + If set to true then allow scene objects to be assigned to the field. + If set to true the field is readonly. + The object assigned to the field. + + + + Draws a GUI field for objects. + + The key for the field. + The type. + The label for the field. + The current value for the field. + If set to true then allow scene objects to be assigned to the field. + + The object assigned to the field. + + + + + Draws a nicely formatted title with an optinal sub-title and horizontal ruler. + + + + + Draws a GUI color field. + + The rect to draw the field in. + The color of the field. + If set to true then use alpha in the preview. + If set to true then show alpha bar in the preview. + The color assigned to the field. + + + + Draws a warning message box. + + + Also triggers a warning during validation checks done by + + The message. + If set to true the message box will be wide. + + + + Draws a thick horizontal seperator. + + + + + Draws a thick horizontal seperator. + + + + + Draws a thick horizontal seperator. + + + + + Draws a thick horizontal seperator. + + + + + Draws a horizontal line seperator. + + + + + Draws a vertical line seperator. + + + + + Draws an error message box. + + + Also triggers an error during validation checks done by + + The message. + If set to true the message box will be wide. + + + + Draws a info message box. + + The message. + If set to true the message box will be wide. + + + + Draws a message box. + + The message. + If set to true the message box will be wide. + + + + Draws a message box. + + The message. + 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. + + The message. + Type of the message. + The style of the message box. + If set to true the message box will be wide. + + + + Draws a message box that can be expanded to show more details. + + The message of the message box. + The detailed message of the message box. + Type of the message box. + If set to true the detailed message is hidden. + 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. + + Width of the line. + + + + Draws a horizontal line separator. + + The color of the line. + The size of the line. + + + + Draws a vertical line separator. + + Width of the line. + + + + Draws a vertical line separator. + + The color of the line. + Width of the line. + + + + Draws a GUI button with an icon. + + The editor icon for the button. + The width of the button. + The height of the button. + The tooltip of the button. + true if the button was pressed. Otherwise false. + + + + Draws a GUI button with an icon. + + The editor icon for the button. + The GUI style for the button. + The width of the button. + The height of the button. + The tooltip of the button. + true if the button was pressed. Otherwise false. + + + + Draws a GUI button with an icon. + + The rect to draw the button in. + The editor icon for the button. + true if the button was pressed. Otherwise false. + + + + Draws a GUI button with an icon. + + The rect to draw the button in. + The editor icon for the button. + The tooltip of the button. + true if the button was pressed. Otherwise false. + + + + Draws a GUI button with an icon. + + The rect to draw the button in. + The editor icon for the button. + The GUI style for the button. + The tooltip of the button. + true if the button was pressed. Otherwise false. + + + + Draws a GUI button with an icon. + + The rect to draw the button in. + The icon texture. + The tooltip for the button. + true when the button is pressed. + + + + Draws a GUI button with an icon. + + The rect to draw the button in. + The icon texture. + Style for the button. + The tooltip for the button. + true when the button is pressed. + + + + Draws a GUI button with an icon. + + The icon texture. + Width of the button in pixels. + Height of the button in pixels. + The tooltip for the button. + true when the button is pressed. + + + + Draws a GUI button with an icon. + + The icon texture. + Style for the button. + Width of the button in pixels. + Height of the button in pixels. + The tooltip for the button. + true when the button is pressed. + + + + Draws a repeating icon button. + + The icon for the button. + true while the button is active. Otherwise false. + + + + Draws a repeating icon button. + + The icon for the button. + The size. + true while the button is active. Otherwise false. + + + + Draws a repeating icon button. + + The icon for the button. + The width of the button. + 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. + + 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. + + 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. + + The GUI content for the button. + Whether the button state is selected or not + true if the button was pressed. Otherwise false. + + + + Draws a toolbar icon button. + + The label for the button. + Whether the button state is selected or not + true if the button was pressed. Otherwise false. + + + + Draws a toolbar toggle. + + Current state of the toggle. + The icon for the toggle. + The state of the toggle. + + + + Draws a toolbar toggle. + + Current state of the toggle. + The icon for the toggle. + The state of the toggle. + + + + Draws a toolbar toggle. + + Current state of the toggle. + The GUI content for the button. + The state of the toggle. + + + + Draws a toolbar toggle. + + Current state of the toggle. + The text for the toggle. + The state of the toggle. + + + + Draws a toolbar tab. + + If true the tab will be the active tab. + Name for the tab. + State of isActive. + + + + Draws a toolbar tab. + + If true the tab will be the active tab. + Label for the tab. + State of isActive. + + + + Draws a solid color rectangle. + + The rect. + The color. + If true applies the user's playmdoe tint to the rect in playmode. + + + + Draws a solid color rectangle. + + The width. + The height. + The color. + If true applies the user's playmdoe tint to the rect in playmode. + The rect created. + + + + Draws borders around a rect. + + The rect. + The width of the border on all sides. + If true applies the user's playmdoe tint to the rect in playmode. + + + + Draws borders around a rect. + + The rect. + The width of the border on all sides. + The color of the border. + If true applies the user's playmdoe tint to the rect in playmode. + + + + Draws borders around a rect. + + The rect. + The left size. + The right size. + The top size. + The bottom size. + If true applies the user's playmdoe tint to the rect in playmode. + + + + Draws borders around a rect. + + The rect. + The left size. + The right size. + The top size. + The bottom size. + The color of the borders. + If true applies the user's playmdoe tint to the rect in playmode. + + + + Draws a toolbar search field. + + The current search text. + If set to true the force focus on the field. + The left and right margin. + The current search text. + + + + Draws a search field. + + + + + Begins a horizontal toolbar. Remember to end with . + + The height of the toolbar. + Padding for the top of the toolbar. + The rect of the horizontal toolbar. + + + + Begins a horizontal toolbar. Remember to end with . + + The style for the toolbar. + The height of the toolbar. + The top padding. + + The rect of the horizontal toolbar. + + + + + Ends a horizontal toolbar started by . + + + + + Begins a horizontal indentation. Remember to end with . + + The GUI layout options. + + + + Begins a horizontal indentation. Remember to end with . + + The style of the indentation. + The GUI layout options. + + + + Ends a identation horizontal layout group started by . + + + + + Begins a vertical indentation. Remember to end with . + + The GUI layout options. + + + + Begins a vertical indentation. Remember to end with . + + The style of the indentation. + The GUI layout options. + + + + Ends a identation vertical layout group started by . + + + + + Indents by the current indent value, . + + + + + Draws a menu button. + + The indent of the button. + The text of the button. + The current state of the button. + The texture icon for the button. + The current state of the button. + + + + Begins a fade group. Remember to end with . + + The key for the fade group. + Current state of the fade group. + + + + Begins a fade group. Remember to end with . + + The key for the fade group. + Current state of the fade group. + A value between 0 and 1 indicating how expanded the fade group is. + + + + Begins a fade group. Remember to end with . + + The primary key for the fade group. + The secondly key for the fade group. + Current state of the fade group. + + + + Begins a fade group. Remember to end with . + + The key for the fade group. + The name of the fade group. + Current state of the fade group. + + + + Begins a fade group. Remember to end with . + + The key for the fade group. + Current state of the fade group. + The duration of fade in and out. + + + + Begins a fade group. Remember to end with . + + The key for the fade group. + Current state of the fade group. + A value between 0 and 1 indicating how expanded the fade group is. + The duration of fade in and out. + + + + Begins a fade group. Remember to end with . + + The primary key for the fade group. + The secondly key for the fade group. + Current state of the fade group. + The duration of fade in and out. + + + + Begins a fade group. Remember to end with . + + The key for the fade group. + The name of the fade group. + Current state of the fade group. + The duration of fade in and out. + + + + Begins a fade group. Remember to end with . + + The current fading value between 0 and 1. + + + + Ends a fade group started by any BeginFadeGroup. + + + + + Draws a foldout field where clicking on the label toggles to the foldout too. + + The current state of the foldout. + The label of the foldout. + The GUI style. + + The current state of the foldout. + + + + + Draws a foldout field where clicking on the label toggles to the foldout too. + + The current state of the foldout. + The label of the foldout. + The GUI style. + + + + Draws a foldout field where clicking on the label toggles to the foldout too. + + The current state of the foldout. + The label of the foldout. + 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. + + The rect to draw the foldout field in. + The current state of the foldout. + The label of the foldout. + The style. + + + + Begins drawing a box. Remember to end with . + + The label of the box. + If set to true then center label. + The GUI layout options. + + + + Begins drawing a box. Remember to end with . + + The label of the box. + If set to true then center label. + The GUI layout options. + The rect of the box. + + + + Begins drawing a box. Remember to end with . + + The GUI layout options. + + + + Ends drawing a box started by any BeginBox. + + + + + Begins drawing a box header. Remember to end with . + + + + + Ends drawing a box header started by , + + + + + Begins drawing a box with toolbar style header. Remember to end with . + + Label for box header. + If true the label will be drawn in the center of the box header. + GUILayout options. + The rect of the box. + + + + Begins drawing a box with toolbar style header. Remember to end with . + + Label for box header. + If true the label will be drawn in the center of the box header. + GUILayout options. + The rect of the box. + + + + Begins drawing a box with toolbar style header. Remember to end with . + + GUILayout options. + The rect of the box. + + + + Ends the drawing a box with a toolbar style header started by . + + + + + Begins drawing a toolbar style box header. Remember to end with . + + The rect of the box. + + + + Ends the drawing of a toolbar style box header started by . + + + + + Begins drawing a legend style box. Remember to end with . + + The label for the legend style box. + If true the label will be drawn in the center of the box. + GUILayout options. + The rect of the box. + + + + Begins drawing a legend style box. Remember to end with . + + The label for the legend style box. + If true the label will be drawn in the center of the box. + GUILayout options. + The rect of the box. + + + + Begins drawing a legend style box. Remember to end with . + + GUILayout options. + The rect of the box. + + + + Ends the drawing of a legend style box started by + + + + + Begins drawing an inline box. Remember to end with . + + The GUI layout options. + The rect of the box. + + + + Ends drawing an inline box started by any BeginInlineBox. + + + + + Starts the shaking animation of a shaking group. + + + + + Starts the shaking animation of a shaking group. + + + + + Begins a shakeable group. + + + + + 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. + + The key for the menu list. + The rect created. + + + + Begins drawing a menu list item. Remember to end with + + Value indicating whether the item is selected. + Value indicating if the mouse is pressed on the item. + If set to true the item is set as selected.. + The rect used for the item. + + + + Ends drawing a menu list item started by + + + + + Ends drawing a vertical menu list started by + + + + + Begins drawing a vertical list. + + If set to true borders will be drawn around the vertical list. + If set to true a dark background will be drawn. + The GUI layout options. + The rect used for the list. + + + + Ends drawing a vertical list started by . + + + + + Begins drawing a list item. + + If set to true the item can be hovered with the mouse. + The style for the vertical list item. + The GUI layout options. + The rect used for the item. + + + + Begins drawing a list item. + + If set to true the item can be hovered with the mouse. + The style for the vertical list item. + The GUI layout options. + The color for even elements. + The color for odd elements. + The color for even elements when hovered. + The color for odd elements when hovered. + The rect used for the item. + + + + Ends drawing a list item started by . + + + + + Creates a animated tab group. + + The key for the tab group.. + An animated tab group. + + + + Begins drawing a toggle group. Remember to end with . + + The key of the group. + Value indicating if the group is enabled. + Value indicating if the group is visible. + The title of the group. + Value indicating if the group is toggled. + + + + Begins drawing a toggle group. Remember to end with . + + The key of the group. + Value indicating if the group is enabled. + Value indicating if the group is visible. + The title of the group. + Duration of the animation. + Value indicating if the group is toggled. + + + + Ends drawing a toggle group started by . + + + + + Begins drawing a horizontal auto scroll box. Remember to end with . + + The for the field. + The GUILayout options. + The rect used for the field. + + + + Ends drawing a horizontal auto scroll box started by . + + + + + Creates a rect that can be grabbed and pulled to change a value up or down. + + The grabbable rect. + The control ID for the sliding. + The current value. + + The current value. + + + + + Creates a rect that can be grabbed and pulled to change a value up or down. + + The grabbable rect. + The control ID for the sliding. + The current value. + + The current value. + + + + + Creates a rect that can be grabbed and pulled to change a value up or down. + + The grabbable rect. + The control ID for the sliding. + The current value. + + The current value. + + + + + Creates a rect that can be grabbed and pulled to change a value up or down. + + The grabbable rect. + The control ID for the sliding. + The current value. + + The current value. + + + + + Creates a rect that can be grabbed and pulled + + The grabbable rect. + The cursor. + + The the mouse delta position. + + + + + Creates a rect that can be grabbed and pulled + + The position. + The grabbable rect. + + The the mouse delta position. + + + + + Draws a field for a value of type T - dynamically choosing an appropriate drawer for the type. + Currently supported are: char, string, sbyte, byte, short, ushort, int, uint, long, ulong, float, double, decimal, Guid and all enums. + + The type of the value to draw. + The label of the fields. + The value to draw. + The layout options. + The possibly changed value. + + + + Checks whether a given type can be drawn as a dynamic field by + + The type to check. + True if the type can be drawn, otherwise false. + + + + Gets the feature rich control rect. + + + + + Gets the feature rich control rect. + + + + + Creates a control ID that handles keyboard control, focused editor window, indentation and prefix label correctly. + + The rect to make a feature rich control for. + The label for the control. Leave null for no label. + The created control ID. + A value indicating whether or not the control has keyboard focus. + + + + Creates a control ID that handles keyboard control, focused editor window, indentation and prefix label correctly. + + The rect to make a feature rich control for. + 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. + + + + + Box background color. + + + + + Dark editor background color. + + + + + Editor window background color. + + + + + Menu background color. + + + + + Header box background color. + + + + + Highlighted Button Color. + + + + + Highlight text color. + + + + + Highlight property color. + + + + + List item hover color for every other item. + + + + + List item hover color for every other item. + + + + + List item drag background color. + + + + + List item drag background color. + + + + + 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. + + + + + List item background color for every other item. OBSOLETE: Use ListItemColorOdd instead. + + + + + List item color for every other item. + + + + + List item color for every other item. + + + + + Menu button active background color. + + + + + Menu button border color. + + + + + Menu button color. + + + + + Menu button hover color. + + + + + A light border color. + + + + + Bold label style. + + + + + Tag Button style. + + + + + Bold label style. + + + + + Centered bold label style. + + + + + Box container style. + + + + + Popup style. + + + + + Box header style. + + + + + Button style. + + + + + Button selected style. + + + + + Left button style. + + + + + Left button selected style. + + + + + Mid button style. + + + + + Mid button selected style. + + + + + Right button style. + + + + + Right button selected style. + + + + + Pane Options Button + + + + + Left button style. + + + + + Left button selected style. + + + + + Left button style. + + + + + Left button selected style. + + + + + Mid button style. + + + + + Mid button selected style. + + + + + Right button style. + + + + + Right button selected style. + + + + + Color field background style. + + + + + Foldout style. + + + + + Icon button style. + + + + + Label style. + + + + + Highlighted label style. + + + + + White label style. + + + + + Black label style. + + + + + Centered label style. + + + + + Centered label style. + + + + + White centered label style. + + + + + Black centered label style. + + + + + Centered mini label style. + + + + + Left Aligned Centered Label + + + + + Left aligned grey mini label style. + + + + + Left aligned grey label style. + + + + + Centered grey mini label + + + + + Left right aligned white mini label style. + + + + + Centered white mini label style. + + + + + Centered black mini label style. + + + + + List item style. + + + + + Menu button background style. + + + + + No style. + + + + + Odin Editor Wrapper. + + + + + Padding less box style. + + + + + Content Padding + + + + + Property padding. + + + + + Property margin. + + + + + Rich text label style. + + + + + Right aligned grey mini label style. + + + + + Right aligned white mini label style. + + + + + Section header style. + + + + + Section header style. + + + + + Toggle group background style. + + + + + Toggle group checkbox style. + + + + + Toggle group padding style. + + + + + Toggle group title background style. + + + + + Toolbar background style. + + + + + Toolbar button style. + + + + + Toolbar button selected style. + + + + + Toolbar search cancel button style. + + + + + Toolbar search field style. + + + + + Toolbar tab style. + + + + + Title style. + + + + + Bold title style. + + + + + Centered bold title style. + + + + + Right aligned bold title style. + + + + + Centered title style. + + + + + Right aligned title style. + + + + + Subtitle style. + + + + + Centered sub-title style. + + + + + Right aligned sub-title style. + + + + + Message box style. + + + + + Detailed Message box style. + + + + + Multiline white label style. + + + + + Multiline Label + + + + + Centered Multiline Label + + + + + Centered Text Field + + + + + Gets the bottom box padding. + + + + + Unitys PaneOptions GUIStyle. + + + + + Unitys ProjectBrowserTextureIconDropShadow GUIStyle. + + + + + Unitys TL SelectionButton PreDropGlow GUIStyle. + + + + + Unitys ShurikenModuleTitle GUIStyle. + + + + + Draw this one manually with: new Color(1, 1, 1, EditorGUIUtility.isProSkin ? 0.25f : 0.45f) + + + + + SDFIconButton Label. + + + + + 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. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Utility functions for Unity assets. + + + + + Gets all assets of the specified type. + + + + + Gets all assets of the specified type. + + The type of assets to find. + The asset folder path. + + + + Gets all assets of the specified type. + + The type of assets to find. + The asset folder path. + + + + Asset search helper. + + + + + The asset object. + + + + + Current index. + + + + + Search result count. + + + + + Tests if an asset can be created from a type. + + The type to test. + true if an asset can be created. Otherwise false. + + + + Tests if an asset can be created from a type. + + The type to test. + The base asset type. + true if an asset can be created. Otherwise false. + + + + Gets project path to the specified asset. + + The asset object. + The path to the asset. + + + + Creates a new asset of the specified type. + + The type of the asset. + Project path to the new asset. + The name of the asset. + + + + Functions for accessing the clipboard. + + + + + Gets the current copy mode. + + + + + Copies the specified object. + + + The object. + The copy mode. + + + + Copies the specified object. + + + + + Clears this instance. + + + + + Determines whether this instance can paste the specified type. + + + + + Determines whether this instance can paste the specified type. + + + + + Determines whether or not the Clipboard contains any instance. + + + + + Tries the paste. + + + + + Copies or gets the current object in the clipboard. + + + + + Copies or gets the current object in the clipboard. + + + + + The various modes of copying an object to the clipboard. + + + + + Deep copy. + + + + + Shallow Copy. + + + + + Reference Copy. + + + + + A utility class for getting delta time for the GUI editor. + + + + + A utility class for getting delta time for the GUI editor. + + + + + Compare strings and produce a distance score between them. + + + + + Determines whether if the source is within the search. + + The source string. + The target string. + Should the algorithm ignore letter case?. + Should the algorithm attempt to search on an abbreviation of the source?. + Threshold for what is considered to be within the search. 0 will return everything and 1 will only return exact matches. + True if the source is within the search. Otherwise false. + + + + Compares the target to the source and returns a distance score. + + The source string. + The target string. + + + Distance score. 0 is no match, and 1 is exact match. + + + + A utility class for properly counting frames and helps determine when a frame has started in an editor window. + + + + + Gets the frame count. + + + + + Gets a value indicating whether this instance is new frame. + + + + + Updates the frame counter and returns itself. + + + + + Hides the ObjectMembers in Visual Studio IntelliSense + + + + + Determines whether the specified , is equal to this instance. + + + + + Returns a hash code for this instance. + + + + + Gets the type. + + + + + Returns a that represents this instance. + + + + + Collection of texture functions. + + + + + 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. + + + + + 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. + + + + + + + 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. + + + + + + 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. + + + + + UserEditorTypes includes all custom user scripts that are located in an editor folder but not in a plugins folder. + + + + + PluginEditorTypes includes all editor types located in the plugins folder. + + + + + UnityEditorTypes includes all editor types that are not user editor types nor plugin editor types. + + + + + OtherTypes includes all other types that are not depended on UnityEngine or UnityEditor. + + + + + CustomTypes includes includes all types manually added to the Unity project. + This includes UserTypes, UserEditorTypes, PluginTypes and PluginEditorTypes. + + + + + GameTypes includes all assemblies that are likely to be included in builds. + This includes UserTypes, PluginTypes, UnityTypes and OtherTypes. + + + + + EditorTypes includes UserEditorTypes, PluginEditorTypes and UnityEditorTypes. + + + + + All includes UserTypes, PluginTypes, UnityTypes, UserEditorTypes, PluginEditorTypes, UnityEditorTypes and OtherTypes. + + + + + A utility class for finding types in various asssembly. + + + + + Gets an of all assemblies in the current . + + An of all assemblies in the current . + + + + Gets the for a given assembly. + + The assembly. + The for a given assembly. + is null. + + + + Determines whether an assembly is depended on another assembly. + + The assembly. + The other assembly. + + true if has a reference in or is the same as . + + is null. + is null. + + + + Determines whether the assembly module is a of type . + + The assembly. + + true if the specified assembly of type ; otherwise, false. + + assembly + + + + Gets the full file path to a given assembly's containing directory. + + The assembly. + The full file path to a given assembly's containing directory, or Null if no file path was found. + is Null. + + + + Gets the full directory path to a given assembly. + + 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. + + The filters. + Types from the current AppDomain with the specified filters. + + + + Find members of the given type, while providing good error messages based on the following search filters provided. + See for more information. + + + + + MemberFinder is obsolete, and has been replacted by and . + Use cases that do not fit those utlities should use manual reflection that is hand-optimized for the best performance in the given case. + + MemberFinder was a utility class often used by Odin drawers to find fields, methods, and + properties while providing good user-friendly error messages based on the search criteria. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Find members of the given type, while providing good error messages based on the following search filters provided. + + + + + Find members of the given type, while providing good error messages based on the following search filters provided. + + + + + Can be true for both fields, properties and methods. + + + + + + Exclude members found in base-types. + + + + + Only include methods with the following parameter. + Calling this will also exclude fields and properties. + Parameter type inheritance is supported. + + + + + Only include methods with the following parameters. + Calling this will also exclude fields and properties. + Parameter type inheritance is supported. + + + + + Only include methods with the following parameters. + Calling this will also exclude fields and properties. + Parameter type inheritance is supported. + + + + + Only include methods with the following parameters. + Calling this will also exclude fields and properties. + Parameter type inheritance is supported. + + + + + Only include methods with the following parameters. + Calling this will also exclude fields and properties. + Parameter type inheritance is supported. + + + + + Only include methods with the following parameters. + Calling this will also exclude fields and properties. + Parameter type inheritance is supported. + + + + + Only include methods with the following parameters. + Calling this will also exclude fields and properties. + Parameter type inheritance is supported. + + + + + Only include methods with the following parameters. + Calling this will also exclude fields and properties. + Parameter type inheritance is supported. + + + + + Determines whether [has return type] [the specified return type]. + + + + + Can be true for both fields, properties and methods. + + + + + Calls IsField() and IsProperty(). + + + + + Only include static members. By default, both static and non-static members are included. + + + + + Only include non-static members. By default, both static and non-static members are included. + + + + + Specify the name of the member. + + + + + Excludes fields and methods if nether IsField() or IsMethod() is called. Otherwise includes properties. + By default, all member types are included. + + + + + Excludes fields and properties if nether IsField() or IsProperty() is called. Otherwise includes methods. + By default, all member types are included. + + + + + Excludes properties and methods if nether IsProperty() or IsMethod() is called. Otherwise includes fields. + By default, all member types are included. + + + + + Excludes non-public members if IsNonPublic() has not yet been called. Otherwise includes public members. + By default, both public and non-public members are included. + + + + + Excludes public members if IsPublic() has not yet been called. Otherwise includes non-public members. + By default, both public and non-public members are included. + + + + + Excludes fields and properties, and only includes methods with a return type of void. + + + + + Gets the member based on the search filters provided + Returns null if no member was found. + + + + + Gets the member based on the search filters provided, and provides a proper error message if no members was found. + + + + + Gets the member based on the search filters provided, and provides a proper error message if no members was found. + + + + + Try gets the member based on the search filters provided, and provides a proper error message if no members was found. + + + + + Try gets the member based on the search filters provided, and provides a proper error message if no members was found. + + + + + Try gets all members based on the search filters provided, and provides a proper error message if no members was found. + + + + + Gets or sets the width of the col. + + + + + Gets or sets the minimum width. + + + + + Gets a value indicating whether the width should be preserved when the table itself gets resiszed. + + + + + Gets a value indicating whether this is resizable. + + + + + This class contains utility methods for subscribing to various UnityEditor events reliably and safely across all Odin-supported versions of Unity. + + + + + Sometimes, someone accidentally overrides a delay action subscription to + by setting the value instead of using the += operator as should be done, + which can be done because in many versions of Unity it is a field, and not an event. + (In some versions of Unity it is an event, though, and in this case, this method acts as a wrapper + to subscribe reliably, no matter the nature of the backing event.) + This method subscribes to a lot of different callbacks, in the hopes of catching at least one. + + As opposed to , this method is safe to call from any thread, and will + delay the actual subscription to a safe time. + + + + + 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. + + + + + 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 + we now have to use reflection to access it consistently across all versions of Unity. + + + + diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.xml.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.xml.meta new file mode 100644 index 00000000..03f29c1b --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.xml.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5c65184932ff4fd48a343e236025096f +timeCreated: 1488828285 +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.dll b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.dll new file mode 100644 index 00000000..fe2f2bc1 Binary files /dev/null and b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.dll differ diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.dll.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.dll.meta new file mode 100644 index 00000000..44c2d221 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.dll.meta @@ -0,0 +1,46 @@ +fileFormatVersion: 2 +guid: 4873f2a8bdae42baa0406e8a61366ca1 +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/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.xml b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.xml new file mode 100644 index 00000000..84cb6c5d --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.xml @@ -0,0 +1,3713 @@ + + + + Sirenix.Utilities + + + + + Extension methods for the UnityEngine.Color type. + + + + + Lerps between multiple colors. + + The colors. + The t. + + + + + Moves the towards implementation for Color. + + From color. + To color. + The maximum delta. + + + + Tries to parse a string to a Color. The following formats are supported: + "new Color(0.4, 0, 0, 1)", "#FFEEBBFF", "#FFEECC", "FFEEBBFF", "FFEECC" + + The color string. + The color. + Returns true if the parse was a success. + + + + Converts a color to a string formatted to c# + + The color. + new Color(r, g, b, a) + + + + Pows the color with the specified factor. + + The color. + The factor. + + + + Normalizes the RGB values of the color ignoring the alpha value. + + 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. + + + + + Memoizes the specified func - returns the memoized version + + + + + Memoizes the specified func - returns the memoized version + + + + + 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. + + + + + Calls an action on each item before yielding them. + + The collection. + The action to call for each item. + + + + Perform an action on each item. + + The source. + The action to perform. + + + + Perform an action on each item. + + The source. + The action to perform. + + + + Convert each item in the collection. + + The collection. + Func to convert the items. + + + + Convert a collection to an immutable list. + + The collection. + + + + Add an item to the beginning of a collection. + + The collection. + Func to create the item to prepend. + + + + Add an item to the beginning of a collection. + + The collection. + The item to prepend. + + + + Add a collection to the beginning of another collection. + + The collection. + The collection to prepend. + + + + Add an item to the beginning of another collection, if a condition is met. + + The collection. + The condition. + Func to create the item to prepend. + + + + Add an item to the beginning of another collection, if a condition is met. + + The collection. + The condition. + The item to prepend. + + + + Add a collection to the beginning of another collection, if a condition is met. + + The collection. + The condition. + The collection to prepend. + + + + Add an item to the beginning of another collection, if a condition is met. + + The collection. + The condition. + Func to create the item to prepend. + + + + Add an item to the beginning of another collection, if a condition is met. + + The collection. + The condition. + The item to prepend. + + + + Add a collection to the beginning of another collection, if a condition is met. + + The collection. + The condition. + The collection to prepend. + + + + Add an item to the beginning of another collection, if a condition is met. + + The collection. + The condition. + Func to create the item to prepend. + + + + Add an item to the beginning of another collection, if a condition is met. + + The collection. + The condition. + The item to prepend. + + + + Add a collection to the beginning of another collection, if a condition is met. + + The collection. + The condition. + The collection to prepend. + + + + Add an item to the end of a collection. + + The collection. + Func to create the item to append. + + + + Add an item to the end of a collection. + + The collection. + The item to append. + + + + Add a collection to the end of another collection. + + The collection. + The collection to append. + + + + Add an item to the end of a collection if a condition is met. + + The collection. + The condition. + Func to create the item to append. + + + + Add an item to the end of a collection if a condition is met. + + The collection. + The condition. + The item to append. + + + + Add a collection to the end of another collection if a condition is met. + + The collection. + The condition. + The collection to append. + + + + Add an item to the end of a collection if a condition is met. + + The collection. + The condition. + Func to create the item to append. + + + + Add an item to the end of a collection if a condition is met. + + The collection. + The condition. + The item to append. + + + + Add a collection to the end of another collection if a condition is met. + + The collection. + The condition. + The collection to append. + + + + Returns and casts only the items of type . + + The collection. + + + + Adds a collection to a hashset. + + The hashset. + The collection. + + + + Returns true if the list is either null or empty. Otherwise false. + + The list. + + + + Sets all items in the list to the given value. + + The list. + The value. + + + + Adds the elements of the specified collection to the end of the IList<T>. + + + + + Sorts an IList + + + + + 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. + + + + + 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. + + + + + Gets the name of the directory. Always returns forward slash seperators as opposed to Path.GetDirectoryName(). + + + + + Determines whether the directory has a given directory in its hierarchy of children. + + The parent directory. + The sub directory. + + + + Finds a parent directory with a given name, or null if no such parent directory exists. + + + + + Returns a value indicating whether or not a path can be made relative to another. + + The parent path. + The path to make relative to the parent path. + A value indicating if the path can be made relative to the parent path. + + + + Returns a path string to path that is relative to the parent path. + + The parent path. + The path to make relative to the parent path. + A relative path from parent path to path. + + + + Tries to make a path that is relative from parent path to path. + + The parent path. + The path to make relative to the parent path. + A relative path from parent path to path. null if no relative path could be made. + A value indicating if the method succeeded in making a relative path. + + + + Combines two paths, and replaces all backslases with forward slash. + + + + + PropertyInfo method extensions. + + + + + Determines whether a property is an auto property. + + + + + 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. + + + + Defines a collection of handy Rect transformation methods, that can chained together for complex behaviour. + Note that only the TakeX method defined here actually change the original Rect; the rest instead return a new transformed Rect. + + + + + Returns a Rect with the specified width. + + The original Rect. + The desired width of the new Rect. + + + + Returns a Rect with the specified height. + + The original Rect. + The desired height of the new Rect. + + + + Returns a Rect with the specified size. + + The original Rect. + 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. + + The original Rect. + The desired size of the new Rect. + + + + Returns a Rect that has been inserted by the specified amount on the X-axis. + + The original Rect. + The desired padding. + + + + Returns a Rect that has been inserted by the specified amount on the X-axis. + + The original Rect. + Desired padding on the left side. + Desired padding on the right side. + + + + Returns a Rect that has been inserted by the specified amount on the Y-axis. + + The original Rect. + The desired padding. + + + + Returns a Rect that has been inserted by the specified amount on the Y-axis. + + The original Rect. + The desired padding on the top. + The desired padding on the bottom. + + + + Returns a Rect that has been inserted by the specified amount. + + The original Rect. + The desired padding. + + + + Returns a Rect that has been inserted by the specified amount. + + The original Rect. + The desired horizontal padding. + The desired vertical padding. + + + + Returns a Rect that has been inserted by the specified amount. + + The original Rect. + The desired padding on the left. + The desired padding on the right. + The desired padding on the top. + The desired padding on the bottom. + + + + Returns a Rect, with the specified width, that has been aligned to the left of the original Rect. + + The original Rect. + The desired width of the new Rect. + + + + Returns a Rect, with the specified width, that has been aligned to horizontal center of the original Rect. + + The original Rect. + The desired width of the new Rect. + + + + Returns a Rect, with the specified width and height in the center of the provided rect. + + The original Rect. + The desired width of the new Rect. + The desired height of the new Rect. + + + + Returns a Rect, with the specified width, that has been aligned to the right of the original Rect. + + The original Rect. + The desired width of the new Rect. + + + + Returns a Rect, with the specified width, that has been aligned to the right of the original Rect. + + + + + Returns a Rect, with the specified height, that has been aligned to the top of the original Rect. + + The original Rect. + The desired height of the new Rect. + + + + Returns a Rect, with the specified height, that has been aligned to the vertical middle of the original Rect. + + The original Rect. + The desired height of the new Rect. + + + + Returns a Rect, with the specified height, that has been aligned to the bottom of the original Rect. + + The original Rect. + The desired height of the new Rect. + + + + Returns a Rect, with the specified width, that has been aligned horizontally to the center of the original rect. + + The original Rect. + The desired width of the new Rect. + + + + Returns a Rect, with the specified height, that has been aligned vertically to the center of the original rect. + + The original Rect. + The desired height of the new Rect. + + + + Returns a Rect, with the specified width and height, that has been aligned horizontally and vertically to the center of the original rect. + + The original Rect. + The desired width and height of the new Rect. + + + + Returns a Rect, with the specified width and height, that has been aligned horizontally and vertically to the center of the original rect. + + The original Rect. + The desired width of the new Rect. + The desired height of the new Rect. + + + + Returns a Rect that has been expanded by the specified amount. + + The original Rect. + The desired expansion. + + + + Returns a Rect that has been expanded by the specified amount. + + The original Rect. + The desired expansion on the X-axis. + The desired expansion on the Y-axis. + + + + Returns a Rect that has been expanded by the specified amount. + + The original Rect. + The desired expansion on the left. + The desired expansion on the right. + The desired expansion on the top. + The desired expansion on the bottom. + + + + Splits a Rect horizontally into the specified number of sub-rects, and returns a sub-rect for the specified index. + + The original Rect. + The index for the subrect. Includes 0, and excludes count. + The amount of subrects the Rect should be split into. + + + + Splits a Rect vertically into the specified number of sub-rects, and returns a sub-rect for the specified index. + + The original Rect. + The index for the subrect. Includes 0, and excludes count. + The amount of subrects the Rect should be split into. + + + + Splits a Rect into a grid from left to right and then down. + + The original rect. + The width of a grid cell. + The height of a grid cell. + The index of the grid cell. + + + + + Splits a Rect into a grid from left to right and then down. + + + + + Moves a Rect to the specified center X position. + + The original Rect. + The desired center x position. + + + + Moves a Rect to the specified center Y position. + + The desired original Rect. + The desired desired center y position. + + + + Moves a Rect to the specified center position. + + The original Rect. + The desired center X position. + The desired center Y position. + + + + Moves a Rect to the specified center position. + + The original Rect. + The desired center position. + + + + Moves a Rect to the specified position. + + The orignal Rect. + The desired position. + + + + Resets a Rect's position to zero. + + The original Rect. + + + + Moves a Rect's position by the specified amount. + + The original Rect. + The change in position. + + + + Moves a Rect's position by the specified amount. + + The original Rect. + The x. + The y. + + + + Sets a Rect's X position. + + The original Rect. + The desired X position. + + + + Adds to a Rect's X position. + + The original Rect. + The value to add. + + + + Subtracts from a Rect's X position. + + The original Rect. + The value to subtract. + + + + Sets a Rect's Y position. + + The original Rect. + The desired Y position. + + + + Adds to a Rect's Y position. + + The original Rect. + The value to add. + + + + Subtracts a Rect's Y position. + + The original Rect. + The value to subtract. + + + + Sets the min position of a Rect. + + The original Rect. + The desired min position. + + + + Adds to a Rect's min position. + + The original rect. + The value to add. + + + + Subtracts a Rect's min position. + + The original Rect. + The vlaue to subtract. + + + + Sets a Rect's max position. + + The original Rect. + The desired max position. + + + + Adds to a Rect's max position. + + The original Rect. + The value to add. + + + + Subtracts a Rect's max position. + + The original Rect. + The value to add. + + + + Sets a Rect's X min position. + + The original Rect. + The desired min X position. + + + + Adds to a Rect's X min position. + + The original Rect. + The value to add. + + + + Subtracts from a Rect's X min position. + + The original Rect. + The value to subtract. + + + + Sets a Rect's X max position. + + The original Rect. + The desired X max position. + + + + Adds to a Rect's X max position. + + The original Rect. + The value to add. + + + + Subtracts a Rect's X max position. + + The original Rect. + The value to subtract. + + + + Sets a Rect's Y min position. + + The original Rect. + The desired Y min. + + + + Adds to a Rect's Y min position. + + The original Rect. + The value to add. + + + + Subtracts a Rect's Y min position. + + The original Rect. + The value to subtract. + + + + + Sets a Rect's Y max position. + + The original Rect. + The desired Y max position. + + + + Adds to a Rect's Y max position. + + The original Rect. + The value to add. + + + + Subtracts from a Rect's Y max position. + + The original Rect. + The value to subtract. + + + + Sets a Rect's width, if it is less than the specified value. + + The original Rect. + The desired min width. + + + + Sets a Rect's width, if it is greater than the specified value. + + The original Rect. + The desired max width. + + + + Sets a Rect's height, if it is less than the specified value. + + The original Rect. + The desired min height. + + + + Sets a Rect's height, if it is greater than the specified value. + + The original Rect. + The desired max height. + + + + Expands a rect to contain a given position. + + 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. + + + + + Eg MY_INT_VALUE => MyIntValue + + + + + Returns whether or not the specified string is contained with this string + + + + + Ex: "thisIsCamelCase" -> "This Is Camel Case" + + + + + 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. + + + + O(n*m) - Use with care. + + + + + Type method extensions. + + + + + Type name alias lookup. + + + + + 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 + + + + + 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 + + + + Gets a value indicating if the string is a reserved C# keyword. + + 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. + + + + + 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. + + + + Contains utilities for operating on arrays. + + + + + Creates a new array with an added element. + + The element type of the array. + The array. + The value to add. + The new array. + The given array was null. + + + + Creates a new array with an element inserted at a given index. + + The element type of the array. + The array. + The index to insert at. + The value to insert. + The given array was null. + The index to insert at was out of range. + + + + Creates a new array with an element removed. + + The element type of the array. + The array. + The index to remove an element at. + + The given array was null. + The given index to remove an element at was out of range. + + + + Utility class for asset Guid script + + + + + Tries to update the Guid of a specified asset with the Guid from a specified script type. + + + + + 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. + + + + + 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. + + 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. + + 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. + + + + 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. + + + + + + A GlobalConfig singleton, automatically created and saved as a ScriptableObject in the project at the specified path. + This only happens if the UnityEditor is present. If it's not, a non-persistent ScriptableObject is created at run-time. + + + Remember to locate the path within a resources folder if you want the config file to be loaded at runtime without the Unity editor being present. + + + The asset path is specified by defining a . If no attribute is defined it will be saved in the root assets folder. + + + + + [GlobalConfig("Assets/Resources/MyConfigFiles/")] + public class MyGlobalConfig : GlobalConfig<MyGlobalConfig> + { + public int MyGlobalVariable; + } + + void SomeMethod() + { + int value = MyGlobalConfig.Instance.MyGlobalVariable; + } + + + + + + Gets a value indicating whether this instance has instance loaded. + + + + + Gets the singleton instance. + + + + + Tries to load the singleton instance. + + + + + 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. + + + + + + + Gets the full asset path including Application.dataPath. Only relevant if IsInResourcesFolder is false. + + + + + Gets the relative asset path. Only relevant if IsInResourcesFolder is false. + + + + + Gets the resources path. Only relevant if IsInResourcesFolder is true. + + + + + Whether the config should be associated with an asset in the project. If false, no config asset will be generated or loaded, and a new "temporary" config instance will be created for every reload. This is true by default. + + + + + Gets a value indicating whether this asset is located within a resource folder. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The relative asset. Remember to locate the path within a resources folder if you want the config file to be loaded at runtime without the Unity Editor. + + + + + GUILayoutOptions is a handy utility that provides cached GUILayoutOpion arrays based on the wanted parameters. + + + + + Most GUILayout and EditorGUILayout methods takes an optional "params GUILayoutOption[]" parameter. + Each time you call this, an array is allocated generating garbage. + + + // Generates garbage: + GUILayout.Label(label, GUILayout.Label(label, GUILayout.Width(20), GUILayout.ExpandHeight(), GUILayout.MaxWidth(300))); + + // Does not generate garbage: + GUILayout.Label(label, GUILayout.Label(label, GUILayoutOptions.Width(20).ExpandHeight().MaxWidth(300))); + + + + + + An EmptyGUIOption[] array with a length of 0. + + + + + A GUILayoutOptions instance with an implicit operator to be converted to a GUILayoutOption[] array. + + + + + + Gets or creates the cached GUILayoutOption array based on the layout options specified. + + + + + Option passed to a control to give it an absolute width. + + + + + Option passed to a control to give it an absolute height. + + + + + Option passed to a control to specify a maximum height. + + + + + Option passed to a control to specify a maximum width. + + + + + Option passed to a control to specify a minimum height. + + + + + Option passed to a control to specify a minimum width. + + + + + Option passed to a control to allow or disallow vertical expansion. + + + + + Option passed to a control to allow or disallow horizontal expansion. + + + + + Determines whether the instance is equals another instance. + + + + + Returns a hash code for this instance. + + + + + Option passed to a control to give it an absolute width. + + + + + Option passed to a control to give it an absolute height. + + + + + Option passed to a control to specify a maximum height. + + + + + Option passed to a control to specify a maximum width. + + + + + Option passed to a control to specify a minimum width. + + + + + Option passed to a control to specify a minimum height. + + + + + Option passed to a control to allow or disallow vertical expansion. + + + + + Option passed to a control to allow or disallow horizontal expansion. + + + + + Immutable hashset wraps another hashset, and allows for reading the inner hashset, without the ability to change it. + + + + + Creates an immutable hashset around another hashset. + + + + + Returns true if the item is contained in the list. + + The item's value. + + + + Gets the enumerator. + + + + + Gets the enumerator. + + + + + 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. + + + + + Collection of math function. + + + + + Distance from a point to a line. + + + + + Returns a smooth value between start and end based on t. + + First point. + Second point. + Position between 0 and 1. + + + + Returns a smooth value between start and end based on t. + + First point. + Second point. + Position between 0 and 1. + Number of interpolations to make. + + + + Returns the fractional of the value. + + The value to get the fractional of. + + + + Returns the fractional of the value. + + The value to get the fractional of. + + + + Returns the fractional of the value. + + The value to get the fractional of. + + + + Returns a value based on t, that bounces faster and faster. + + The value to bounce. + + + + Returns a smooth value between 0 and 1 based on t. + + Position between 0 and 1. + + + + Returns a smooth value between 0 and 1 based on t. + + Position between 0 and 1. + Number of interpolations to make. + + + + Returns an unclamped linear interpolation of two vectors. + + The first vector. + The second vector. + The interpolation factor. + + + + Returns an unclamped linear interpolation of two vectors. + + The first vector. + The second vector. + The interpolation factor. + + + + Returns a value that bounces between 0 and 1 based on value. + + The value to bounce. + + + + Returns a value that eases in elasticly. + + The value to ease in elasticly. + The amplitude. + The length. + + + + Pows each element of the vector. + + The vector. + The power. + + + + Returns a Vector2 with each element set to their respective sign. + + The vector to sign. + + + + Returns a Vector3 with each element set to their respective sign. + + The vector to sign. + + + + Returns a value that eases out elasticly. + + The value to ease out elasticly. + The amplitude. + The length. + + + + Returns a smooth value betweeen that peaks at t=0.5 and then comes back down again. + + A value between 0 and 1. + + + + Clamps the value of a Vector3. + + The vector to clamp. + The min value. + The max value. + + + + Clamps the value of a Vector2. + + The vector to clamp. + The min value. + The max value. + + + + Computes a hash for a byte array. + + The byte array. + + + + Gives a smooth path between a collection of points. + + The collection of point. + The current position in the path. 0 is at the start of the path, 1 is at the end of the path. + + + + Checks if two given lines intersect with one another and returns the intersection point (if + any) in an out parameter. + Source: http://stackoverflow.com/questions/3746274/line-intersection-with-aabb-rectangle. + Edited to implement Cohen-Sutherland type pruning for efficiency. + + Starting point of line a. + Ending point of line a. + Starting point of line b. + Ending point of line b. + + The out parameter which contains the intersection point if there was any. + + True if the two lines intersect, otherwise false. + + + + Returns the collision point between two infinite lines. + + + + + Distance from line to plane. + + Position of the plane. + Surface normal of the plane. + Origin of the line. + Line direction normal. + + + + Distance from ray to plane. + + The ray. + The plane. + + + + Rotates a Vector2 by an angle. + + The point to rotate. + The angle to rotate. + + + + Rotates a Vector2 around a point by an angle.. + + The point to rotate. + The point to rotate around. + The angle to rotate. + + + + Interpolates t between a and b to a value between 0 and 1 using a Hermite polynomial. + + The first value. + The second value. + The position value. + A smoothed value between 0 and 1. + + + + Interpolates t between a and b to a value between 0 and 1. + + The first value. + The second value. + The position value. + Linear value between 0 and 1. + + + + Wraps a value between min and max. + + The value to wrap. + The minimum value. + The maximum value. + + + + Wraps a value between min and max. + + The value to wrap. + The minimum value. + The maximum value. + + + + Wraps a value between min and max. + + The value to wrap. + The minimum value. + The maximum value. + + + + Rounds a number based on a mininum difference. + + The value to round. + The min difference. + The rounded value. + + + + Discards the least significant demicals. + + The value of insignificant decimals. + Value with significant decimals. + + + + Clamps and wraps an angle between two values. + + + + + 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. + + + + Not yet documented. + + + + + 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. + + + + 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. + + + + + Path to Odin Inspector folder. + + + + + Path to Sirenix assets folder. + + + + + Path to Sirenix folder. + + + + + Path to Sirenix assemblies. + + + + + Path to Odin Inspector resources folder. + + + + + Path to Odin Inspector configuration folder. + + + + + Path to Odin Inspector resources configuration folder. + + + + + Path to Odin Inspector temporary folder. + + + + + This attribute is used by classes deriving from GlobalConfig and specifies the menu item path for the preference window and the asset path for the generated config file. + The scriptable object created will be located at the OdinEditorConfigs path unless other is specified. + Classes implementing this attribute will be part of the Odin Preferences window. + + + + + + Initializes a new instance of the class. + + + + + This attribute is used by classes deriving from GlobalConfig and specifies the menu item path for the preference window and the asset path for the generated config file. + The scriptable object created will be located at the OdinResourcesConigs path unless other is specified. + Classes implementing this attribute will be part of the Odin Preferences window. + + + + + + Initializes a new instance of the class. + + + + + Not yet documented. + + + + + Not yet documented. + + Not yet documented. + Not yet documented. + Not yet documented. + + + + Compares two strings in a number-aware manner, IE, "[2] Foo" is considered to come before "[10] Bar". + + + + + 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. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.xml.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.xml.meta new file mode 100644 index 00000000..cc14132c --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.xml.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4873f2a8bdae42baa0406e8a6136096f +timeCreated: 1488828285 +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/link.xml b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/link.xml new file mode 100644 index 00000000..1df8f847 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/link.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/link.xml.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/link.xml.meta new file mode 100644 index 00000000..27e066d5 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Assemblies/link.xml.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1bec01331befdea4d9ed9033eabd68f8 +timeCreated: 1613046886 +TextScriptImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Demos.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Demos.meta new file mode 100644 index 00000000..bdb22ec9 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Demos.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 39584688cfac6ff44bd94124e5bc1ca7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Demos/Custom Attribute Processors.unitypackage.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Demos/Custom Attribute Processors.unitypackage.meta new file mode 100644 index 00000000..92a6ac5a --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Demos/Custom Attribute Processors.unitypackage.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f597f19f656ba56eae4f6a3a7cc528f4 +timeCreated: 1488828285 +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Demos/Custom Drawers.unitypackage.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Demos/Custom Drawers.unitypackage.meta new file mode 100644 index 00000000..71af8df2 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Demos/Custom Drawers.unitypackage.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 48e08dc33330d11e9d4a1b246c52e4f6 +timeCreated: 1488828285 +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Demos/Editor Windows.unitypackage.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Demos/Editor Windows.unitypackage.meta new file mode 100644 index 00000000..cc5570c5 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Demos/Editor Windows.unitypackage.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ed09910c0094cb27be8f3ca264680da3 +timeCreated: 1488828285 +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Demos/Sample - RPG Editor.unitypackage.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Demos/Sample - RPG Editor.unitypackage.meta new file mode 100644 index 00000000..26bd5b8a --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Demos/Sample - RPG Editor.unitypackage.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: cc355dd4cf1e6173beaeb22c2858cbe1 +timeCreated: 1488828285 +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector.meta new file mode 100644 index 00000000..afb70e81 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fe4970195facd664dbd38d1cbf2100c3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets.meta new file mode 100644 index 00000000..fcb0c3e6 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 52c0fd243c6c01e4d9efa03616b655d5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor.meta new file mode 100644 index 00000000..f482d7bf --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 85e532eecf67ab545b2a5a28f1a22894 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Bootstrap License.txt b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Bootstrap License.txt new file mode 100644 index 00000000..2b637b2d --- /dev/null +++ b/FactoryNumeric/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/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Bootstrap License.txt.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Bootstrap License.txt.meta new file mode 100644 index 00000000..e3864a0f --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Bootstrap License.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3fdc67fad3e362e47b5dd365a0bbdd7f +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/ConfigData.bytes b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/ConfigData.bytes new file mode 100644 index 00000000..1a63707e Binary files /dev/null and b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/ConfigData.bytes differ diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/ConfigData.bytes.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/ConfigData.bytes.meta new file mode 100644 index 00000000..6ad740b0 --- /dev/null +++ b/FactoryNumeric/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/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden.meta new file mode 100644 index 00000000..70c7c0b0 --- /dev/null +++ b/FactoryNumeric/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/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/ExtractSpriteShader.shader b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/ExtractSpriteShader.shader new file mode 100644 index 00000000..85ad00de --- /dev/null +++ b/FactoryNumeric/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/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/ExtractSpriteShader.shader.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/ExtractSpriteShader.shader.meta new file mode 100644 index 00000000..4ce11e97 --- /dev/null +++ b/FactoryNumeric/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/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/GUIUtilShader.shader b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/GUIUtilShader.shader new file mode 100644 index 00000000..ff3f8435 --- /dev/null +++ b/FactoryNumeric/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/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/GUIUtilShader.shader.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/GUIUtilShader.shader.meta new file mode 100644 index 00000000..977b3025 --- /dev/null +++ b/FactoryNumeric/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/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/LazyEditorIconShader.shader b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/LazyEditorIconShader.shader new file mode 100644 index 00000000..9ea2f1ba --- /dev/null +++ b/FactoryNumeric/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/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/LazyEditorIconShader.shader.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/LazyEditorIconShader.shader.meta new file mode 100644 index 00000000..eb145b53 --- /dev/null +++ b/FactoryNumeric/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/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/SdfIconShader.shader b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/SdfIconShader.shader new file mode 100644 index 00000000..206d73d7 --- /dev/null +++ b/FactoryNumeric/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/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/SdfIconShader.shader.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Hidden/SdfIconShader.shader.meta new file mode 100644 index 00000000..7634f127 --- /dev/null +++ b/FactoryNumeric/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/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/OdinPathLookup.asset b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/OdinPathLookup.asset new file mode 100644 index 00000000..3a82383c --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/OdinPathLookup.asset @@ -0,0 +1,13 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -262940062, guid: a4865f1ab4504ed8a368670db22f409c, type: 3} + m_Name: OdinPathLookup + m_EditorClassIdentifier: \ No newline at end of file diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/OdinPathLookup.asset.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/OdinPathLookup.asset.meta new file mode 100644 index 00000000..4d528ebb --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/OdinPathLookup.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 08379ccefc05200459f90a1c0711a340 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/SdfIconAtlas.png b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/SdfIconAtlas.png new file mode 100644 index 00000000..6d255d58 Binary files /dev/null and b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/SdfIconAtlas.png differ diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/SdfIconAtlas.png.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/SdfIconAtlas.png.meta new file mode 100644 index 00000000..0c039332 --- /dev/null +++ b/FactoryNumeric/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/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Config.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Config.meta new file mode 100644 index 00000000..51edcabc --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Config.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6033bb3cb5a394c45b85307f21d99315 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor.meta new file mode 100644 index 00000000..9e6a39e8 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d9b73dd1cc096804a9ab3e9a5c481041 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/GeneralDrawerConfig.asset b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/GeneralDrawerConfig.asset new file mode 100644 index 00000000..b36513af --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/GeneralDrawerConfig.asset @@ -0,0 +1,25 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -645759843, guid: a4865f1ab4504ed8a368670db22f409c, type: 3} + m_Name: GeneralDrawerConfig + m_EditorClassIdentifier: + enableUIToolkitSupport: 1 + useOldUnityObjectField: 0 + useOldUnityPreviewField: 0 + useOldTypeSelector: 0 + useNewObjectSelector: 1 + showNoneItem: 1 + showCategoriesByDefault: 0 + preferNamespacesOverAssemblyCategories: 1 + useOldPolymorphicField: 0 + showBaseType: 1 + nonDefaultConstructorPreference: 0 diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/GeneralDrawerConfig.asset.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/GeneralDrawerConfig.asset.meta new file mode 100644 index 00000000..340b81b7 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/GeneralDrawerConfig.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f2167cd74db86ea4ba969543835c44c4 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/InspectorConfig.asset b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/InspectorConfig.asset new file mode 100644 index 00000000..5b650431 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/InspectorConfig.asset @@ -0,0 +1,19 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1137305049, guid: a4865f1ab4504ed8a368670db22f409c, type: 3} + m_Name: InspectorConfig + m_EditorClassIdentifier: + enableOdinInInspector: 1 + defaultEditorBehaviour: 11 + processMouseMoveInInspector: 1 + drawingConfig: + configs: [] diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/InspectorConfig.asset.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/InspectorConfig.asset.meta new file mode 100644 index 00000000..727db657 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/InspectorConfig.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c84c93e012f275a48ad2293388e8c6a0 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/OdinModuleConfig.asset b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/OdinModuleConfig.asset new file mode 100644 index 00000000..65024b91 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/OdinModuleConfig.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -228747253, guid: a4865f1ab4504ed8a368670db22f409c, type: 3} + m_Name: OdinModuleConfig + m_EditorClassIdentifier: + configurations: [] + ModuleTogglingSettings: 1 + ModuleUpdateSettings: 1 diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/OdinModuleConfig.asset.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/OdinModuleConfig.asset.meta new file mode 100644 index 00000000..64ba1281 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/OdinModuleConfig.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a704e6d1ecfb6a94b9b35922a72e0275 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/TypeRegistryUserConfig.asset b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/TypeRegistryUserConfig.asset new file mode 100644 index 00000000..18bf0217 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/TypeRegistryUserConfig.asset @@ -0,0 +1,24 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 2050440665, guid: a4865f1ab4504ed8a368670db22f409c, type: 3} + m_Name: TypeRegistryUserConfig + m_EditorClassIdentifier: + shownTypes: + serializedCollection: [] + hiddenTypes: + serializedCollection: [] + addedIllegalTypes: + serializedCollection: [] + typeSettings: + serializedDictionary: [] + typePriorities: + serializedDictionary: [] diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/TypeRegistryUserConfig.asset.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/TypeRegistryUserConfig.asset.meta new file mode 100644 index 00000000..0c5b9415 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/TypeRegistryUserConfig.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: da1a9520ec76247428f280120aa67cb1 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Modules.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Modules.meta new file mode 100644 index 00000000..40fd9213 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Modules.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 356a67db9bc6244428bcd2aad1eefbda +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables.data b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables.data new file mode 100644 index 00000000..f0a13660 Binary files /dev/null and b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables.data differ diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables.data.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables.data.meta new file mode 100644 index 00000000..38859a12 --- /dev/null +++ b/FactoryNumeric/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/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Entities.data b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Entities.data new file mode 100644 index 00000000..d86c063d Binary files /dev/null and b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Entities.data differ diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Entities.data.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Entities.data.meta new file mode 100644 index 00000000..965c525f --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Entities.data.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 728df0e3465c1a148b83053a3f31d489 +timeCreated: 1573836981 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization.data b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization.data new file mode 100644 index 00000000..551ada8d Binary files /dev/null and b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization.data differ diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization.data.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization.data.meta new file mode 100644 index 00000000..8b4ef823 --- /dev/null +++ b/FactoryNumeric/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/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Mathematics.data b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Mathematics.data new file mode 100644 index 00000000..f3de456c Binary files /dev/null and b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Mathematics.data differ diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Mathematics.data.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Mathematics.data.meta new file mode 100644 index 00000000..ee5dc74a --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Mathematics.data.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4866e740a22eb1e49b1603b051e4d92c +timeCreated: 1573836980 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator.meta new file mode 100644 index 00000000..361b0489 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 01e289bcf61698f4e8c838ed6b54d204 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Assets.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Assets.meta new file mode 100644 index 00000000..cf1d5bad --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Assets.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3ae26f9049e271f44ba34f58cdd5af92 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Assets/Editor.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Assets/Editor.meta new file mode 100644 index 00000000..45d7e76b --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Assets/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f34cfb08e2b9f2a4b8a688b7a6898039 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Assets/Editor/Hidden.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Assets/Editor/Hidden.meta new file mode 100644 index 00000000..8082c9c1 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Assets/Editor/Hidden.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9def66d32efcb034dac45a963f29d5f5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Assets/Editor/Hidden/ValidatorSpinningShader.shader b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Assets/Editor/Hidden/ValidatorSpinningShader.shader new file mode 100644 index 00000000..2505b816 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Assets/Editor/Hidden/ValidatorSpinningShader.shader @@ -0,0 +1,282 @@ +Shader "Hidden/Sirenix/SpinningShader" +{ + 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; + }; + + uniform bool _ManualTex2SRGB; + float4 _SirenixOdinSpinner_Shape; + float _SirenixOdinSpinner_SpinDir; + float _SirenixOdinSpinner_Spin; + float4 _SirenixOdinSpinner_Color; + float _SirenixOdinSpinner_SpinTime; + float _SirenixOdinSpinner_T; + + v2f vert(appdata v) { + v2f o; + o.vertex = UnityObjectToClipPos(v.vertex); + o.uv = v.uv; + return o; + } + + #define SPINSPEED 20.0 + #define TIME _SirenixOdinSpinner_SpinTime * 0.3 + #define SPIN (TIME * SPINSPEED) + #define PI 3.1415926535 + #define RADIUS 0.5 + + float easeOutSine(float x) { return sin((x * PI) / 2.); } + float ease(float x) { return x * x * (3.0 - 2.0 * x); } + float anim(float x) { return pow(ease(x), 1.0); } + + float2 rotate(in float2 p, float r) { + float c = cos(r); + float s = sin(r); + float2x2 m = float2x2(c, -s, s, c); + p = mul(m, p); + return p; + } + + float sdOctogon(in float2 p, in float r) { + float3 k = float3(-0.9238795325, 0.3826834323, 0.4142135623); + p = abs(p); + p -= 2.0 * min(dot(float2(k.x, k.y), p), 0.0) * float2(k.x, k.y); + p -= 2.0 * min(dot(float2(-k.x, k.y), p), 0.0) * float2(-k.x, k.y); + p -= float2(clamp(p.x, -k.z * r, k.z * r), r); + return length(p) * sign(p.y); + } + + float sdUnevenCapsule(float2 p, float r1, float r2, float h) { + p.x = abs(p.x); + float b = (r1 - r2) / h; + float a = sqrt(1.0 - b * b); + float k = dot(p, float2(-b, a)); + if (k < 0.0) return length(p) - r1; + if (k > a * h) return length(p - float2(0.0, h)) - r2; + return dot(p, float2(a, b)) - r1; + } + + float sdArc(in float2 p, in float2 sc, in float ra, float rb) { + p.x = abs(p.x); + return ((sc.y * p.x > sc.x * p.y) ? length(p - sc * ra) : abs(length(p) - ra)) - rb; + } + + float sdBox(in float2 p, in float2 b) { + float2 d = abs(p) - b; + return length(max(d, 0.0)) + min(max(d.x, d.y), 0.0); + } + + float sdEquilateralTriangle(in float2 p) { + const float k = sqrt(3.0); + p.x = abs(p.x) - 1.0; + p.y = p.y + 1.0 / k; + if (p.x + k * p.y > 0.0) p = float2(p.x - k * p.y, -k * p.x - p.y) / 2.0; + p.x -= clamp(p.x, -2.0, 0.0); + return -length(p) * sign(p.y); + } + + float sdTriangleIsosceles(in float2 p, in float2 q) { + p.x = abs(p.x); + float2 a = p - q * clamp(dot(p, q) / dot(q, q), 0.0, 1.0); + float2 b = p - q * float2(clamp(p.x / q.x, 0.0, 1.0), 1.0); + float s = -sign(q.y); + float2 d = min(float2(dot(a, a), s * (p.x * q.y - p.y * q.x)), + float2(dot(b, b), s * (p.y - q.y))); + return -sqrt(d.x) * sign(d.y); + } + + float sdExclamationPoint(in float2 p, float t) { + float a = anim(t); + + float r1 = RADIUS * 0.08 * a; + float r2 = RADIUS * 0.16 * a; + float h = RADIUS * 0.45 * a; + + float t1 = length(p) - RADIUS * 0.1; + float t2 = length(p) - RADIUS * 0.1; + + p.y += h * 0.2; + + t1 = sdUnevenCapsule(p, r1, r2, h); + + t2 = length(p + float2(0., h * 0.8)) - r2; + + return min(t1, t2); + } + + float sdEquilateralTriangle(in float2 p, float r) { + float2 p1 = float2(0., 1.); + float2 p2 = float2(0.866, -.5); + float2 p3 = float2(-0.866, -.5); + p.y -= 0.99 * r; + return sdTriangleIsosceles(p, float2(r * 0.85, -r * 1.48)); + } + + + // SPINNER + float spinnerDist(float2 p) { + float rad = RADIUS * 0.9; + p = rotate(p, SPIN); + + float t = PI * 1.57; + float c = cos(t); + float s = sin(t); + float f = RADIUS * 0.25 * _SirenixOdinSpinner_T; + return sdArc(p, float2(c, s), rad - 0.15 * RADIUS - f, 0.15 * RADIUS + f); + } + + float spinnerAlpha(float2 p) { + p = rotate(p, SPIN); + return (atan2(p.x, p.y) + PI) / (PI * 2.0); + } + + // Animate from/to spin util + void spinAnimate(inout float2 p) { + float t = 0.0; + + if (_SirenixOdinSpinner_SpinDir > 0.0) + t = -pow(_SirenixOdinSpinner_Spin, 2.0); + else + t = pow(_SirenixOdinSpinner_Spin, 2.0); + + p = rotate(p, t * SPINSPEED * 0.2); + } + + // CHECK + float validDist(float2 p, float t) { + float a = anim(t); + + float cr = 1.25 * a; + float th = RADIUS * 0.00 * cr; + float a1 = RADIUS * 0.15 * cr; + float a2 = RADIUS * 0.32 * cr; + + float2 p1 = p - float2(RADIUS * cr * -0.2, RADIUS * cr * -0.15); + float2 offset1 = float2(0, 0); + float2 offset2 = float2(-a1 + th, -a2 + th); + + float t1 = sdBox(rotate(p1, PI * -0.25) + offset1, float2(th, a1)) - RADIUS * 0.095; + float t2 = sdBox(rotate(p1, PI * +0.25) + offset2, float2(th, a2)) - RADIUS * 0.095; + float t3 = length(p) - RADIUS; + + return max(t3, -min(t1, t2)); + } + + // WARNING + float warningDist(float2 p, float t) { + float s = 0.9; + float t1 = sdExclamationPoint(p, t); + float t2 = sdTriangleIsosceles(float2(p.x, -p.y + RADIUS * 0.9 * s), float2(RADIUS, RADIUS * 1.6) * s) - 0.2 * RADIUS; + float t3 = length(p) - RADIUS; + + t2 = lerp(t2, t3, easeOutSine(_SirenixOdinSpinner_Spin)); + + //t2 = length(p) - RADIUS; + return max(t2, -t1); + } + + // ERROR + float errorDist(float2 p, float t) { + float s = 0.9; + float t1 = sdExclamationPoint(p, t); + float t2 = sdOctogon(p, RADIUS); + return max(t2, -t1); + } + + // Odin + float2 rotateArm(inout float2 uv) { + float r = PI * -0.7428; + float c = cos(PI * r); + float s = sin(PI * r); + float2x2 m = float2x2(c, -s, s, c); + uv = mul(m, uv); + uv.x = -uv.x; + uv.y = -uv.y; + return uv; + } + + float sdTri(in float2 p, float size) { + return sdEquilateralTriangle(p) + 0.6199999 - size; + } + + float sdTriArm(in float2 p, float t) { + float spacing = 0.9; + float thickness = 0.6 * spacing; + float s = 0.22; + p.y -= s * 0.33 * 0.7 * spacing; + p.x -= s * 0.6 * 0.7 * spacing; + float outerTri = sdTri(p, s); + float innerTri = -sdTri(p, s * spacing * 0.6); + float sideTri1 = -sdTri(p - float2(s * -0.7, s * 0.656), s * 0.82); + float sideTri2 = -sdTri((mul(p, float2x2(-1.0, 0, 0, -1.0))) - float2(s * 1.2, s * 0.4), s * 0.8); + + float f = outerTri; + + f = max(f, innerTri); + f = max(f, sideTri1); + f = max(f, sideTri2); + return f + 0.00; + } + + float odinDist(float2 p, float t) { + p.y += 0.04; + float arm1 = sdTriArm(rotateArm(p), t); + float arm2 = sdTriArm(rotateArm(p), t); + float arm3 = sdTriArm(rotateArm(p), t); + return min(min(arm1, arm2), arm3) - 0.02; + } + + float4 frag(v2f i) : SV_Target { + float2 p1 = (i.uv - float2(0.5, 0.5)) * 1.0; + float2 p2 = p1; + + spinAnimate(p2); + + float4 s = _SirenixOdinSpinner_Shape; + + float dValid = validDist(p2, s.y) * s.y; + float dWarning = warningDist(p2, s.z) * s.z; + float dError = errorDist(p2, s.w) * s.w; + float d = dValid + dWarning + dError; + float spin = _SirenixOdinSpinner_Spin; + + d = lerp(d, spinnerDist(p1), spin); + d = lerp(d, odinDist(p1 * 0.75, s.x), s.x); + + float spinAlpha = spinnerAlpha(p1) * spin; + float4 col = _SirenixOdinSpinner_Color; + col.a *= lerp(1, spinAlpha, spin); + col.a *= smoothstep(0., -abs(ddx(i.uv.x + i.uv.y)) * 1.0, d); + col.r = clamp(0, 1, col.r); + col.g = clamp(0, 1, col.g); + col.b = clamp(0, 1, col.b); + + //if (_ManualTex2SRGB) col.rgb = LinearToGammaSpace(col.rgb); + + return col * col.a; + } + ENDCG + } + } +} \ No newline at end of file diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Assets/Editor/Hidden/ValidatorSpinningShader.shader.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Assets/Editor/Hidden/ValidatorSpinningShader.shader.meta new file mode 100644 index 00000000..0268e925 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Assets/Editor/Hidden/ValidatorSpinningShader.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 4df145ea9bd404e449891032fa9179dc +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Editor.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Editor.meta new file mode 100644 index 00000000..132c9560 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b734b08b6094b724ba9db1668c9d385d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Editor/Config.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Editor/Config.meta new file mode 100644 index 00000000..365b9ad2 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Editor/Config.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f038aec9f705f8a43a6e2038b8119bb4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Editor/Config/AutomationConfig.asset b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Editor/Config/AutomationConfig.asset new file mode 100644 index 00000000..a995c2fd --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Editor/Config/AutomationConfig.asset @@ -0,0 +1,38 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -1671962818, guid: afbf832bc46149f5a291e87cab63e46d, type: 3} + m_Name: AutomationConfig + m_EditorClassIdentifier: + OnPlayMode: 0 + OnPlayModeIfWarnings: 0 + OnPlayModeIfErrors: 3 + OnPlayModeAlwaysCompleteValidationFully: 0 + OnPlayModeFlashScreen: 0 + OnPlayModeSetup: + Profile: 0 + ProfileAsset: {fileID: 0} + OnBuild: 0 + OnBuildIfWarnings: 0 + OnBuildIfErrors: 3 + OnBuildAlwaysCompleteValidationFully: 0 + OnBuildFlashScreen: 0 + OnBuildSetup: + Profile: 0 + ProfileAsset: {fileID: 0} + OnProjectStartup: 0 + OnProjectStartupIfWarnings: 0 + OnProjectStartupIfErrors: 1 + OnProjectStartupAlwaysCompleteValidationFully: 0 + OnProjectStartupFlashScreen: 0 + OnProjectStartupSetup: + Profile: 0 + ProfileAsset: {fileID: 0} diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Editor/Config/AutomationConfig.asset.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Editor/Config/AutomationConfig.asset.meta new file mode 100644 index 00000000..65ac73e2 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Editor/Config/AutomationConfig.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c31297cbb9cd2464aa3e60793cdddbd4 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Editor/Config/GlobalValidationConfig.asset b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Editor/Config/GlobalValidationConfig.asset new file mode 100644 index 00000000..2d17d3c6 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Editor/Config/GlobalValidationConfig.asset @@ -0,0 +1,87 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1426575000, guid: afbf832bc46149f5a291e87cab63e46d, type: 3} + m_Name: GlobalValidationConfig + m_EditorClassIdentifier: + ValidateScenesOnSceneLoad: + serializedValue: 0 + changedFromDefault: 0 + ValidateMainProfileOnLoad: + serializedValue: 0 + changedFromDefault: 0 + QueueAssetsOnLoad: + serializedValue: 0 + changedFromDefault: 0 + QueueScenesOnLoad: + serializedValue: 0 + changedFromDefault: 0 + PopulateQueueOnAssetDeleted: + serializedValue: 0 + changedFromDefault: 0 + PopulateQueueOnGameObjectDeleted: + serializedValue: 0 + changedFromDefault: 0 + RunMainValidationSessionOnLoad: + serializedValue: 0 + changedFromDefault: 0 + DeepValidation: + serializedValue: 0 + changedFromDefault: 0 + ContinuouslyValidateVisibleIssues: + serializedValue: 0 + changedFromDefault: 0 + PauseValidationWhileWorkingInSceneView: + serializedValue: 0 + changedFromDefault: 0 + PingOnDoubleClick: + serializedValue: 0 + changedFromDefault: 0 + FocusObjectOnDoubleClick: + serializedValue: 0 + changedFromDefault: 0 + FrameSelection: + serializedValue: 0 + changedFromDefault: 0 + SelectNextIssueOnFix: + serializedValue: 0 + changedFromDefault: 0 + SkipFirstSample: + serializedValue: 0 + changedFromDefault: 0 + ShowWidget: + serializedValue: 0 + changedFromDefault: 0 + DebugMode: + serializedValue: 0 + changedFromDefault: 0 + ShowWidgetOnlyWhenErrorOrWarnings: + serializedValue: 0 + changedFromDefault: 0 + EnableLeakDetection: + serializedValue: 0 + changedFromDefault: 0 + SupressAssetLoadErrorsFromUnityLogger: + serializedValue: 0 + changedFromDefault: 0 + OpenComponentInInspectorAndCloseOthers: + serializedValue: 0 + changedFromDefault: 0 + WatchForChanges: + serializedValue: 0 + changedFromDefault: 0 + ValidateInBackground: + serializedValue: 0 + changedFromDefault: 0 + KeepMainValidationSessionAliveInBackground: + serializedValue: 0 + changedFromDefault: 0 + HasShownValidationConfig: 0 diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Editor/Config/GlobalValidationConfig.asset.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Editor/Config/GlobalValidationConfig.asset.meta new file mode 100644 index 00000000..6571a1d6 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Editor/Config/GlobalValidationConfig.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3fd111188c6fe154c9b8492f65e8dc2b +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Editor/Config/RuleConfig.asset b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Editor/Config/RuleConfig.asset new file mode 100644 index 00000000..c27f00ec --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Editor/Config/RuleConfig.asset @@ -0,0 +1,15 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1434321088, guid: afbf832bc46149f5a291e87cab63e46d, type: 3} + m_Name: RuleConfig + m_EditorClassIdentifier: + projectRules: [] diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Editor/Config/RuleConfig.asset.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Editor/Config/RuleConfig.asset.meta new file mode 100644 index 00000000..d6edaaac --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Editor/Config/RuleConfig.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1e4d3a54c92218a488fd8b79520ac681 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Editor/Profiles.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Editor/Profiles.meta new file mode 100644 index 00000000..5bc17904 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Editor/Profiles.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 63c5f57382a05c64ca94b26d9289e40e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Editor/Profiles/Main Profile.asset b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Editor/Profiles/Main Profile.asset new file mode 100644 index 00000000..fc3fc255 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Editor/Profiles/Main Profile.asset @@ -0,0 +1,65 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 217257422, guid: afbf832bc46149f5a291e87cab63e46d, type: 3} + m_Name: Main Profile + m_EditorClassIdentifier: + Include: + - Enabled: 1 + Type: 2 + Asset: + Path: + Filter: + Object: {fileID: 0} + Scene: + Type: 2 + Value: + IncludeAssetDependencies: 1 + AssetBundle: + AddressableGroup: + - Enabled: 1 + Type: 2 + Asset: + Path: + Filter: + Object: {fileID: 0} + Scene: + Type: 1 + Value: + IncludeAssetDependencies: 1 + AssetBundle: + AddressableGroup: + - Enabled: 1 + Type: 2 + Asset: + Path: + Filter: + Object: {fileID: 0} + Scene: + Type: 0 + Value: Assets + IncludeAssetDependencies: 0 + AssetBundle: + AddressableGroup: + - Enabled: 1 + Type: 0 + Asset: + Path: Assets + Filter: + Object: {fileID: 0} + Scene: + Type: 0 + Value: + IncludeAssetDependencies: 0 + AssetBundle: + AddressableGroup: + Exclude: [] + icon: 391 diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Editor/Profiles/Main Profile.asset.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Editor/Profiles/Main Profile.asset.meta new file mode 100644 index 00000000..2b83f2d5 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Editor/Profiles/Main Profile.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a6a5ee7d2cc06ee44aeaa5a79cae485c +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/EnsureCorrectOdinVersion.cs b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/EnsureCorrectOdinVersion.cs new file mode 100644 index 00000000..25044006 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/EnsureCorrectOdinVersion.cs @@ -0,0 +1,195 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- +#if UNITY_EDITOR + +namespace Sirenix.OdinValidator.Editor +{ + using System; + using System.IO; + using System.Reflection; + using UnityEditor; + using UnityEngine; + + internal static class EnsureCorrectOdinVersion + { + private const string validatorVersion = "3.3.1.11"; + + private static bool IsHeadlessOrBatchMode { get { return SystemInfo.graphicsDeviceType == UnityEngine.Rendering.GraphicsDeviceType.Null || UnityEditorInternal.InternalEditorUtility.inBatchMode; } } + + [InitializeOnLoadMethod] + private static void Init() + { +#if SIRENIX_INTERNAL + return; +#endif + + if (EditorPrefs.HasKey("PREVENT_SIRENIX_FILE_GENERATION")) + return; + + if (IsHeadlessOrBatchMode) + return; + + if (TryGetOdinInspectorVersion(out var inspectorVersion)) + { + var iVer = Version.Parse(inspectorVersion); + var vVer = Version.Parse(validatorVersion); + + if (iVer.Major == vVer.Major && iVer.Minor == vVer.Minor && iVer.Build == vVer.Build) // Ignore Revision + { + TryInstall(); + } + else + { + var latestVersion = iVer > vVer ? inspectorVersion : validatorVersion; + var oldestProduct = iVer > vVer ? "Odin Validator" : "Odin Inspector"; + var misMatchText = inspectorVersion + " : " + validatorVersion; + + if (TryGetOdinInstallPath(out var path)) + { + var versionMismatchFile = path + "Odin Validator/ignoreVersionMismatch.txt"; + + if (File.Exists(versionMismatchFile)) + { + var misMatch = File.ReadAllText(versionMismatchFile).Trim(); + if (misMatch == misMatchText) + return; + } + } + + if (!EditorUtility.DisplayDialog( + "Odin Version Mismatch", + + "Odin Inspector and Odin Validator need to be on the same version to function correctly.\n" + + $"\n" + + $"Current Odin Inspector: {inspectorVersion}\n" + + $"Current Odin Validator: {validatorVersion}\n" + + $"\n" + + $"Please install {oldestProduct} {latestVersion}", + + "OK", "Ignore until next version mismatch")) + { + var versionMismatchFile = path + "Odin Validator/ignoreVersionMismatch.txt"; + File.WriteAllText(versionMismatchFile, misMatchText); + }; + } + } + else + { + EditorUtility.DisplayDialog( + "Odin Validator requires Odin Inspector", + $"Please install Odin Inspector {validatorVersion}", + + "OK"); + } + } + + private static void TryInstall() + { + if (TryGetOdinInstallPath(out var path)) + { + var tmp_extension = "_tmp"; + var assemblyFiles = new string[] + { + path + "Assemblies/Sirenix.OdinValidator.Editor.dll", + path + "Assemblies/Sirenix.OdinValidator.Editor.dll.meta", + path + "Assemblies/Sirenix.OdinValidator.Editor.xml", + path + "Assemblies/Sirenix.OdinValidator.Editor.xml.meta", + path + "Assemblies/Sirenix.OdinValidator.Editor.pdb", + path + "Assemblies/Sirenix.OdinValidator.Editor.pdb.meta", + }; + + var requireUpdate = File.Exists(assemblyFiles[0] + tmp_extension); + + if (requireUpdate) + { + // Install / update Odin Validator. + AssetDatabase.StartAssetEditing(); + + foreach (var item in assemblyFiles) + { + var oldFile = item; + var newFile = item + tmp_extension; + + if (File.Exists(newFile)) + { + if (File.Exists(oldFile)) + File.Delete(oldFile); + + File.Move(newFile, oldFile); + } + } + + AssetDatabase.StopAssetEditing(); + AssetDatabase.Refresh(ImportAssetOptions.ForceUpdate); + EditorPrefs.SetBool("ODIN_VALIDATOR_SHOW_GETTING_STARTED", true); + } +#if ODIN_INSPECTOR + else if (EditorPrefs.GetBool("ODIN_VALIDATOR_SHOW_GETTING_STARTED", false)) + { + EditorPrefs.SetBool("ODIN_VALIDATOR_SHOW_GETTING_STARTED", false); + EditorApplication.delayCall += () => + { + var t = Sirenix.Serialization.TwoWaySerializationBinder.Default.BindToType("Sirenix.OdinInspector.Editor.GettingStarted.GettingStartedWindow"); + if (t != null) + { + var action = Utilities.Editor.Expressions.ExpressionUtility.ParseAction("ShowWindow(false, true)", true, t, out var _); + action.Invoke(false, true); + } + }; + } +#endif + } + else + { + Debug.LogError("Odin Validator was unable to find Sirenix.Utilities.SirenixAssetPaths.SirenixPluginPath"); + } + } + + private static bool TryGetOdinInstallPath(out string path) + { + var t = Type.GetType("Sirenix.Utilities.SirenixAssetPaths, Sirenix.Utilities"); + + if (t == null) + { + path = null; + return false; + } + + var v = t.GetField("SirenixPluginPath", BindingFlags.Public | BindingFlags.Static); + if (v == null) + { + path = null; + return false; + } + + path = v.GetValue(null) as string; + return true; + } + + private static bool TryGetOdinInspectorVersion(out string version) + { + var t = Type.GetType("Sirenix.OdinInspector.Editor.OdinInspectorVersion, Sirenix.OdinInspector.Editor"); + + if (t == null) + { + version = null; + return false; + } + + var v = t.GetProperty("Version", BindingFlags.Public | BindingFlags.Static); + if (v == null) + { + version = null; + return false; + } + + version = v.GetValue(null) as string; + return true; + } + } +} + +#endif diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/EnsureCorrectOdinVersion.cs.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/EnsureCorrectOdinVersion.cs.meta new file mode 100644 index 00000000..f9ee6287 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/EnsureCorrectOdinVersion.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 9454f64e8640a944ca8605d5b465d784 +timeCreated: 1514513487 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Readme.txt b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Readme.txt new file mode 100644 index 00000000..5c0862f7 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Readme.txt @@ -0,0 +1,19 @@ +----------------------------------------------------------------------------------------- + +Thank you for using Odin Validator. + +If there is anything we can help you with, or if you have any feedback, please don't hesitate to reach out! + +----------------------------------------------------------------------------------------- + +Getting Started: https://odininspector.com/tutorials/odin-project-validator/getting-started-with-odin-project-validator +Support: https://odininspector.com/support +Discord: https://discord.gg/AgDmStu + +----------------------------------------------------------------------------------------- + +Odin Validator is published and developed by Sirenix. + +Sirenix: Https://sirenix.net + +----------------------------------------------------------------------------------------- \ No newline at end of file diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Readme.txt.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Readme.txt.meta new file mode 100644 index 00000000..b43996e5 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Odin Validator/Readme.txt.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 151ca3ac64d79f9478810af1f27c4c57 +timeCreated: 1556895130 +licenseType: Store +TextScriptImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Readme.txt b/FactoryNumeric/Assets/Plugins/Sirenix/Readme.txt new file mode 100644 index 00000000..bd8b1f89 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Readme.txt @@ -0,0 +1,35 @@ +------------------------------------ Getting Started ------------------------------------ + +Open up the Getting Started guide from "Tools > Odin Inspector > Getting Started." + + +------------------------------------- Helpful Links ------------------------------------- + +Tutorials: https://odininspector.com/tutorials +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 + + +--------------------------------- Community and Support --------------------------------- + +If you have any issues, suggestions or want advice, then you're more than welcome +to join us on Discord, or reach out to us by any other means. + +Support: https://odininspector.com/support +Community Addons: https://odininspector.com/community-tools +Discord: https://discord.gg/AgDmStu + + +-------------------------------------- Thank you! --------------------------------------- + +We really hope you like using Odin. Be sure to leave a review on the Asset Store, +that helps us out a lot! + +Leave a review: https://assetstore.unity.com/packages/tools/utilities/odin-inspector-and-serializer-89041 + + +Odin Inspector is published and developed by Sirenix. + +Sirenix: Https://sirenix.net \ No newline at end of file diff --git a/FactoryNumeric/Assets/Plugins/Sirenix/Readme.txt.meta b/FactoryNumeric/Assets/Plugins/Sirenix/Readme.txt.meta new file mode 100644 index 00000000..71cef777 --- /dev/null +++ b/FactoryNumeric/Assets/Plugins/Sirenix/Readme.txt.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e957a9e8b4f4bce4b8a34e504a8c39d7 +timeCreated: 1533815770 +licenseType: Store +TextScriptImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework).meta b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework).meta new file mode 100644 index 00000000..ea5c201d --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework).meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1f5ae5d4cc1e26747833e76dd11016ec +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/AttachEntityInfo.cs b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/AttachEntityInfo.cs new file mode 100644 index 00000000..0cfc42a8 --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/AttachEntityInfo.cs @@ -0,0 +1,34 @@ +using UnityEngine; + +namespace TEngine +{ + internal sealed class AttachEntityInfo : IMemory + { + private Transform _parentTransform; + private object _userData; + + public AttachEntityInfo() + { + _parentTransform = null; + _userData = null; + } + + public Transform ParentTransform => _parentTransform; + + public object UserData => _userData; + + public static AttachEntityInfo Create(Transform parentTransform, object userData) + { + AttachEntityInfo attachEntityInfo = MemoryPool.Acquire(); + attachEntityInfo._parentTransform = parentTransform; + attachEntityInfo._userData = userData; + return attachEntityInfo; + } + + public void Clear() + { + _parentTransform = null; + _userData = null; + } + } +} diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/AttachEntityInfo.cs.meta b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/AttachEntityInfo.cs.meta new file mode 100644 index 00000000..15fee8cd --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/AttachEntityInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 93ee8133074b5234da08e1308a55efb2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/Component.meta b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/Component.meta new file mode 100644 index 00000000..058a8fb7 --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/Component.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 8a1bc5e99edc4f76a90b5386db03e616 +timeCreated: 1698053954 \ No newline at end of file diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/Component/EntityComponent.cs b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/Component/EntityComponent.cs new file mode 100644 index 00000000..702c7b35 --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/Component/EntityComponent.cs @@ -0,0 +1,197 @@ +using System; +using System.Diagnostics; + +namespace TEngine +{ + /// + /// 实体组件基类。 + /// + public abstract class EntityComponent : IMemory + { + private EntityLogic _owner; + + public virtual int Priority => 0; + + public virtual bool NeedUpdate => false; + + /// + /// 组件持有者。 + /// + public EntityLogic Owner => _owner; + + protected internal void OnAwake(EntityLogic owner) + { + _owner = owner; + OnAttach(_owner); + AddDebug(); + } + + public void Clear() + { + OnDetach(_owner); + ClearAllListener(); + RmvDebug(); + _owner = null; + } + + /// + /// 附加到实体上。 + /// After Awake() + /// + /// 实体逻辑类。 + protected virtual void OnAttach(EntityLogic entityLogic) + { + } + + /// + /// 从实体上移除。 + /// Before OnDestroy() + /// + /// 实体逻辑类。 + protected virtual void OnDetach(EntityLogic entityLogic) + { + } + + /// + /// 实体组件轮询。 + /// + /// 逻辑流逝时间,以秒为单位。 + /// 真实流逝时间,以秒为单位。 + protected internal virtual void OnUpdate(float elapseSeconds, float realElapseSeconds) + { + } + + #region 事件相关。 + + /// + /// 增加事件监听。 + /// + /// 事件Id。 + /// 事件回调。 + public void AddEventListener(int eventId, Action eventCallback) + { + _owner.Event.AddEventListener(eventId, eventCallback, this); + } + + /// + /// 增加事件监听。 + /// + /// 事件Id。 + /// 事件回调。 + /// 事件参数类型1。 + public void AddEventListener(int eventId, Action eventCallback) + { + _owner.Event.AddEventListener(eventId, eventCallback, this); + } + + /// + /// 增加事件监听。 + /// + /// 事件Id。 + /// 事件回调。 + /// 事件参数类型1。 + /// 事件参数类型2。 + public void AddEventListener(int eventId, Action eventCallback) + { + _owner.Event.AddEventListener(eventId, eventCallback, this); + } + + /// + /// 增加事件监听。 + /// + /// 事件Id。 + /// 事件回调。 + /// 事件参数类型1。 + /// 事件参数类型2。 + /// 事件参数类型3。 + public void AddEventListener(int eventId, Action eventCallback) + { + _owner.Event.AddEventListener(eventId, eventCallback, this); + } + + /// + /// 增加事件监听。 + /// + /// 事件Id。 + /// 事件回调。 + /// 事件参数类型1。 + /// 事件参数类型2。 + /// 事件参数类型3。 + /// 事件参数类型4。 + public void AddEventListener(int eventId, Action eventCallback) + { + _owner.Event.AddEventListener(eventId, eventCallback, this); + } + + /// + /// 清除本组件所有事件监听。 + /// + public void ClearAllListener() + { + if (_owner != null && _owner.Event != null) + { + _owner.Event.RemoveAllListenerByOwner(this); + } + } + + #endregion + + #region 编辑器Debug相关 + + [Conditional("UNITY_EDITOR")] + protected void AddDebug() + { +#if UNITY_EDITOR + if (_owner == null) + { + return; + } + + var debugData = _owner.gameObject.GetComponent(); + if (debugData == null) + { + debugData = _owner.gameObject.AddComponent(); + } + debugData.AddDebugCmpt(GetType().Name); +#endif + } + + [Conditional("UNITY_EDITOR")] + protected void RmvDebug() + { +#if UNITY_EDITOR + if (_owner == null) + { + return; + } + + var debugData = _owner.gameObject.GetComponent(); + if (debugData == null) + { + debugData = _owner.gameObject.AddComponent(); + } + debugData.RmvDebugCmpt(GetType().Name); +#endif + } + + [Conditional("UNITY_EDITOR")] + public void SetDebugInfo(string key, string val) + { +#if UNITY_EDITOR + if (_owner == null) + { + return; + } + + var debugData = _owner.gameObject.GetComponent(); + if (debugData == null) + { + debugData = _owner.gameObject.AddComponent(); + } + debugData.SetDebugInfo(GetType().Name, key, val); +#endif + } + + #endregion + } +} \ No newline at end of file diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/Component/EntityComponent.cs.meta b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/Component/EntityComponent.cs.meta new file mode 100644 index 00000000..3111a479 --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/Component/EntityComponent.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 976852b75792415c8d8dd898b2b24a8a +timeCreated: 1698053967 \ No newline at end of file diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/Component/EntityDebugBehaviour.cs b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/Component/EntityDebugBehaviour.cs new file mode 100644 index 00000000..df517620 --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/Component/EntityDebugBehaviour.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace TEngine +{ + [Serializable] + public class ComponentDebugKeyInfo + { + public string name; + public string val; + } + + [Serializable] + public class ComponentDebugInfo + { + public string name; + public List infoList = new List(); + } + + /// + /// 用来调试查看Entity信息。 + /// + public class EntityDebugBehaviour : MonoBehaviour + { + public List cmptInfoList = new List(); + + public event Action OnGizmosSelect; + public event Action OnGizmos; + + public ComponentDebugInfo AddDebugCmpt(string cmptName) + { + var cmptInfo = cmptInfoList.Find(item => item.name == cmptName); + if (cmptInfo == null) + { + cmptInfo = new ComponentDebugInfo(); + cmptInfo.name = cmptName; + this.cmptInfoList.Add(cmptInfo); + } + + return cmptInfo; + } + + public void RmvDebugCmpt(string cmptName) + { + cmptInfoList.RemoveAll(item => item.name == cmptName); + } + + public void SetDebugInfo(string cmptName, string key, string val) + { + var cmptInfo = AddDebugCmpt(cmptName); + var entry = cmptInfo.infoList.Find(t => t.name == key); + if (entry == null) + { + entry = new ComponentDebugKeyInfo(); + entry.name = key; + cmptInfo.infoList.Add(entry); + } + + entry.val = val; + } + +#if UNITY_EDITOR + void OnDrawGizmosSelected() + { + if (OnGizmosSelect != null) + { + OnGizmosSelect(); + } + } + + void OnDrawGizmos() + { + if (OnGizmos != null) + { + OnGizmos(); + } + } +#endif + } +} \ No newline at end of file diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/Component/EntityDebugBehaviour.cs.meta b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/Component/EntityDebugBehaviour.cs.meta new file mode 100644 index 00000000..c3dd960a --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/Component/EntityDebugBehaviour.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 366e1f213d994fd2b5fa42d33a2e9020 +timeCreated: 1698058998 \ No newline at end of file diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/DefaultEntityGroupHelper.cs b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/DefaultEntityGroupHelper.cs new file mode 100644 index 00000000..5ffbe57e --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/DefaultEntityGroupHelper.cs @@ -0,0 +1,9 @@ +namespace TEngine +{ + /// + /// 默认实体组辅助器。 + /// + public class DefaultEntityGroupHelper : EntityGroupHelperBase + { + } +} diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/DefaultEntityGroupHelper.cs.meta b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/DefaultEntityGroupHelper.cs.meta new file mode 100644 index 00000000..c56b6395 --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/DefaultEntityGroupHelper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2eae0b22de94ba442b482bff7fab17ff +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/DefaultEntityHelper.cs b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/DefaultEntityHelper.cs new file mode 100644 index 00000000..031cce54 --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/DefaultEntityHelper.cs @@ -0,0 +1,69 @@ +using UnityEngine; + +namespace TEngine +{ + /// + /// 默认实体辅助器。 + /// + public class DefaultEntityHelper : EntityHelperBase + { + private IResourceModule _resourceModule = null; + + /// + /// 实例化实体。 + /// + /// 要实例化的实体资源。 + /// 实例化后的实体。 + public override object InstantiateEntity(object entityAsset) + { + return Instantiate((Object)entityAsset); + } + + /// + /// 创建实体。 + /// + /// 实体实例。 + /// 实体所属的实体组。 + /// 用户自定义数据。 + /// 实体。 + public override IEntity CreateEntity(object entityInstance, IEntityGroup entityGroup, object userData) + { + GameObject entityGameObject = entityInstance as GameObject; + if (entityGameObject == null) + { + Log.Error("Entity instance is invalid."); + return null; + } + + Transform entityTransform = entityGameObject.transform; + entityTransform.SetParent(((MonoBehaviour)entityGroup.Helper).transform); + + var entity = entityGameObject.GetComponent(); + if (entity == null) + { + entity = entityGameObject.AddComponent(); + } + return entity; + } + + /// + /// 释放实体。 + /// + /// 要释放的实体资源。 + /// 要释放的实体实例。 + public override void ReleaseEntity(object entityAsset, object entityInstance) + { + Destroy((Object)entityInstance); + } + + private void Start() + { + _resourceModule = ModuleSystem.GetModule(); + if (_resourceModule == null) + { + Log.Fatal("Resource component is invalid."); + return; + } + } + } +} diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/DefaultEntityHelper.cs.meta b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/DefaultEntityHelper.cs.meta new file mode 100644 index 00000000..76a3eea1 --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/DefaultEntityHelper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5b0ffb61c68e948498fa57c1901f0001 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/Entity.cs b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/Entity.cs new file mode 100644 index 00000000..deb62e84 --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/Entity.cs @@ -0,0 +1,245 @@ +using System; +using UnityEngine; + +namespace TEngine +{ + /// + /// 实体。 + /// + public sealed class Entity : MonoBehaviour, IEntity + { + [SerializeField] + private int _id; + private string _entityAssetName; + private IEntityGroup _entityGroup; + private EntityLogic _entityLogic; + + /// + /// 获取实体编号。 + /// + public int Id => _id; + + /// + /// 获取实体资源名称。 + /// + public string EntityAssetName => _entityAssetName; + + /// + /// 获取实体实例。 + /// + public object Handle => gameObject; + + /// + /// 获取实体所属的实体组。 + /// + public IEntityGroup EntityGroup => _entityGroup; + + /// + /// 获取实体逻辑。 + /// + public EntityLogic Logic => _entityLogic; + + /// + /// 实体初始化。 + /// + /// 实体编号。 + /// 实体资源名称。 + /// 实体所属的实体组。 + /// 是否是新实例。 + /// 用户自定义数据。 + public void OnInit(int entityId, string entityAssetName, IEntityGroup entityGroup, bool isNewInstance, object userData) + { + _id = entityId; + _entityAssetName = entityAssetName; + if (isNewInstance) + { + _entityGroup = entityGroup; + } + else if (_entityGroup != entityGroup) + { + Log.Error("Entity group is inconsistent for non-new-instance entity."); + return; + } + + ShowEntityInfo showEntityInfo = (ShowEntityInfo)userData; + Type entityLogicType = showEntityInfo.EntityLogicType; + if (entityLogicType == null) + { + Log.Error("Entity logic type is invalid."); + return; + } + + if (_entityLogic != null) + { + if (_entityLogic.GetType() == entityLogicType) + { + _entityLogic.enabled = true; + return; + } + + Destroy(_entityLogic); + _entityLogic = null; + } + + _entityLogic = gameObject.AddComponent(entityLogicType) as EntityLogic; + if (_entityLogic == null) + { + Log.Error("Entity '{0}' can not add entity logic.", entityAssetName); + return; + } + + try + { + _entityLogic.OnInit(showEntityInfo.UserData); + } + catch (Exception exception) + { + Log.Error("Entity '[{0}]{1}' OnInit with exception '{2}'.", _id, _entityAssetName, exception); + } + } + + /// + /// 实体回收。 + /// + public void OnRecycle() + { + try + { + _entityLogic.OnRecycle(); + _entityLogic.enabled = false; + } + catch (Exception exception) + { + Log.Error("Entity '[{0}]{1}' OnRecycle with exception '{2}'.", _id, _entityAssetName, exception); + } + + _id = 0; + } + + /// + /// 实体显示。 + /// + /// 用户自定义数据。 + public void OnShow(object userData) + { + ShowEntityInfo showEntityInfo = (ShowEntityInfo)userData; + try + { + _entityLogic.OnShow(showEntityInfo.UserData); + } + catch (Exception exception) + { + Log.Error("Entity '[{0}]{1}' OnShow with exception '{2}'.", _id, _entityAssetName, exception); + } + } + + /// + /// 实体隐藏。 + /// + /// 是否是关闭实体管理器时触发。 + /// 用户自定义数据。 + public void OnHide(bool isShutdown, object userData) + { + try + { + if (_entityLogic) + { + _entityLogic.OnHide(isShutdown, userData); + } + } + catch (Exception exception) + { + Log.Error("Entity '[{0}]{1}' OnHide with exception '{2}'.", _id, _entityAssetName, exception); + } + } + + /// + /// 实体附加子实体。 + /// + /// 附加的子实体。 + /// 用户自定义数据。 + public void OnAttached(IEntity childEntity, object userData) + { + AttachEntityInfo attachEntityInfo = (AttachEntityInfo)userData; + try + { + _entityLogic.OnAttached(((Entity)childEntity).Logic, attachEntityInfo.ParentTransform, attachEntityInfo.UserData); + } + catch (Exception exception) + { + Log.Error("Entity '[{0}]{1}' OnAttached with exception '{2}'.", _id, _entityAssetName, exception); + } + } + + /// + /// 实体解除子实体。 + /// + /// 解除的子实体。 + /// 用户自定义数据。 + public void OnDetached(IEntity childEntity, object userData) + { + try + { + _entityLogic.OnDetached(((Entity)childEntity).Logic, userData); + } + catch (Exception exception) + { + Log.Error("Entity '[{0}]{1}' OnDetached with exception '{2}'.", _id, _entityAssetName, exception); + } + } + + /// + /// 实体附加子实体。 + /// + /// 被附加的父实体。 + /// 用户自定义数据。 + public void OnAttachTo(IEntity parentEntity, object userData) + { + AttachEntityInfo attachEntityInfo = (AttachEntityInfo)userData; + try + { + _entityLogic.OnAttachTo(((Entity)parentEntity).Logic, attachEntityInfo.ParentTransform, attachEntityInfo.UserData); + } + catch (Exception exception) + { + Log.Error("Entity '[{0}]{1}' OnAttachTo with exception '{2}'.", _id, _entityAssetName, exception); + } + + MemoryPool.Release(attachEntityInfo); + } + + /// + /// 实体解除子实体。 + /// + /// 被解除的父实体。 + /// 用户自定义数据。 + public void OnDetachFrom(IEntity parentEntity, object userData) + { + try + { + _entityLogic.OnDetachFrom(((Entity)parentEntity).Logic, userData); + } + catch (Exception exception) + { + Log.Error("Entity '[{0}]{1}' OnDetachFrom with exception '{2}'.", _id, _entityAssetName, exception); + } + } + + /// + /// 实体轮询。 + /// + /// 逻辑流逝时间,以秒为单位。 + /// 真实流逝时间,以秒为单位。 + public void OnUpdate(float elapseSeconds, float realElapseSeconds) + { + try + { + _entityLogic.OnExecuteUpdate(elapseSeconds, realElapseSeconds); + } + catch (Exception exception) + { + Log.Error("Entity '[{0}]{1}' OnUpdate with exception '{2}'.", _id, _entityAssetName, exception); + } + } + } +} diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/Entity.cs.meta b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/Entity.cs.meta new file mode 100644 index 00000000..85e287dc --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/Entity.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bac1e67b934ef0944b6de46554cf5042 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityGroupHelperBase.cs b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityGroupHelperBase.cs new file mode 100644 index 00000000..20f5e8a0 --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityGroupHelperBase.cs @@ -0,0 +1,11 @@ +using UnityEngine; + +namespace TEngine +{ + /// + /// 实体组辅助器基类。 + /// + public abstract class EntityGroupHelperBase : MonoBehaviour, IEntityGroupHelper + { + } +} diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityGroupHelperBase.cs.meta b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityGroupHelperBase.cs.meta new file mode 100644 index 00000000..d85d80dc --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityGroupHelperBase.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bb8122bd1a1ff7d4cb0a9806d5b3f065 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityHelperBase.cs b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityHelperBase.cs new file mode 100644 index 00000000..d9d865b0 --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityHelperBase.cs @@ -0,0 +1,33 @@ +using UnityEngine; + +namespace TEngine +{ + /// + /// 实体辅助器基类。 + /// + public abstract class EntityHelperBase : MonoBehaviour, IEntityHelper + { + /// + /// 实例化实体。 + /// + /// 要实例化的实体资源。 + /// 实例化后的实体。 + public abstract object InstantiateEntity(object entityAsset); + + /// + /// 创建实体。 + /// + /// 实体实例。 + /// 实体所属的实体组。 + /// 用户自定义数据。 + /// 实体。 + public abstract IEntity CreateEntity(object entityInstance, IEntityGroup entityGroup, object userData); + + /// + /// 释放实体。 + /// + /// 要释放的实体资源。 + /// 要释放的实体实例。 + public abstract void ReleaseEntity(object entityAsset, object entityInstance); + } +} diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityHelperBase.cs.meta b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityHelperBase.cs.meta new file mode 100644 index 00000000..fea74fd5 --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityHelperBase.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8992f89de70519047ba31e6383445cca +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityLogic.cs b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityLogic.cs new file mode 100644 index 00000000..455c3010 --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityLogic.cs @@ -0,0 +1,328 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace TEngine +{ + /// + /// 实体逻辑基类。 + /// + public abstract class EntityLogic : MonoBehaviour + { + private bool _available = false; + private bool _visible = false; + private Entity _entity = null; + private Transform _cachedTransform = null; + private int _originalLayer = 0; + private Transform _originalTransform = null; + + /// + /// 获取实体。 + /// + public Entity Entity => _entity; + + /// + /// 获取或设置实体名称。 + /// + public string Name + { + get => gameObject.name; + set => gameObject.name = value; + } + + /// + /// 获取实体是否可用。 + /// + public bool Available => _available; + + /// + /// 获取或设置实体是否可见。 + /// + public bool Visible + { + get => _available && _visible; + set + { + if (!_available) + { + Log.Warning("Entity '{0}' is not available.", Name); + return; + } + + if (_visible == value) + { + return; + } + + _visible = value; + InternalSetVisible(value); + } + } + + /// + /// 获取已缓存的 Transform。 + /// + public Transform CachedTransform => _cachedTransform; + + private ActorEventDispatcher _event; + + /// + /// 事件分发器。 + /// + public ActorEventDispatcher Event => _event ??= MemoryPool.Acquire(); + + /// + /// 实体初始化。 + /// + /// 用户自定义数据。 + protected internal virtual void OnInit(object userData) + { + if (_cachedTransform == null) + { + _cachedTransform = transform; + } + + _entity = GetComponent(); + _originalLayer = gameObject.layer; + _originalTransform = CachedTransform.parent; + } + + /// + /// 实体回收。 + /// + protected internal virtual void OnRecycle() + { + } + + /// + /// 实体显示。 + /// + /// 用户自定义数据。 + protected internal virtual void OnShow(object userData) + { + _available = true; + Visible = true; + } + + /// + /// 实体隐藏。 + /// + /// 是否是关闭实体管理器时触发。 + /// 用户自定义数据。 + protected internal virtual void OnHide(bool isShutdown, object userData) + { + if (_event != null) + { + MemoryPool.Release(_event); + _event = null; + } + if (gameObject != null) + { + // gameObject.SetLayerRecursively(_originalLayer); + } + Visible = false; + _available = false; + var iter = _componentMap.GetEnumerator(); + while (iter.MoveNext()) + { + EntityComponent component = iter.Current.Value; + if (component == null) + { + continue; + } + + if (gameObject != null) + { + MemoryPool.Release(component); + } + } + iter.Dispose(); + _componentMap.Clear(); + _updateComponents.Clear(); + } + + /// + /// 实体附加子实体。 + /// + /// 附加的子实体。 + /// 被附加父实体的位置。 + /// 用户自定义数据。 + protected internal virtual void OnAttached(EntityLogic childEntity, Transform parentTransform, object userData) + { + } + + /// + /// 实体解除子实体。 + /// + /// 解除的子实体。 + /// 用户自定义数据。 + protected internal virtual void OnDetached(EntityLogic childEntity, object userData) + { + } + + /// + /// 实体附加子实体。 + /// + /// 被附加的父实体。 + /// 被附加父实体的位置。 + /// 用户自定义数据。 + protected internal virtual void OnAttachTo(EntityLogic parentEntity, Transform parentTransform, object userData) + { + CachedTransform.SetParent(parentTransform); + } + + /// + /// 实体解除子实体。 + /// + /// 被解除的父实体。 + /// 用户自定义数据。 + protected internal virtual void OnDetachFrom(EntityLogic parentEntity, object userData) + { + CachedTransform.SetParent(_originalTransform); + } + + /// + /// 实体轮询。 + /// + /// 逻辑流逝时间,以秒为单位。 + /// 真实流逝时间,以秒为单位。 + protected virtual void OnUpdate(float elapseSeconds, float realElapseSeconds) + { + } + + /// + /// 实体轮询。 + /// + /// 逻辑流逝时间,以秒为单位。 + /// 真实流逝时间,以秒为单位。 + internal void OnExecuteUpdate(float elapseSeconds, float realElapseSeconds) + { + OnUpdate(elapseSeconds, realElapseSeconds); + var iter = _updateComponents.GetEnumerator(); + while (iter.MoveNext()) + { + var current = iter.Current; + if (current != null) + { + current.OnUpdate(elapseSeconds, realElapseSeconds); + } + } + iter.Dispose(); + } + + /// + /// 设置实体的可见性。 + /// + /// 实体的可见性。 + protected virtual void InternalSetVisible(bool visible) + { + gameObject.SetActive(visible); + } + + private readonly Dictionary _componentMap = new Dictionary(); + private static readonly GameFrameworkLinkedList _updateComponents = new GameFrameworkLinkedList(); + + /// + /// 添加实体组件。 + /// + /// 实体组件类型。 + /// 实体组件。 + public T AddEntityComponent() where T : EntityComponent + { + T ret = MemoryPool.Acquire(typeof(T)) as T; + + if (ret == null) + { + Log.Fatal($"add entityComponent failed"); + return null; + } + + _componentMap.Add(typeof(T),ret); + + if (ret.NeedUpdate) + { + LinkedListNode current = _updateComponents.First; + while (current != null) + { + if (ret.Priority > current.Value.Priority) + { + break; + } + + current = current.Next; + } + + if (current != null) + { + _updateComponents.AddBefore(current, ret); + } + else + { + _updateComponents.AddLast(ret); + } + } + + ret?.OnAwake(this); + + return ret; + } + + /// + /// 获取实体组件。 + /// + /// 实体组件类型。 + /// 实体组件。 + public T GetEntityComponent() where T : EntityComponent + { + _componentMap.TryGetValue(typeof(T), out EntityComponent component); + return component as T; + } + + /// + /// 获取或者添加实体组件。 + /// + /// 实体组件类型。 + /// 实体组件。 + public T GetOrAddEntityComponent() where T : EntityComponent + { + T ret = GetEntityComponent() ?? AddEntityComponent(); + return ret; + } + + /// + /// 移除实体组件。 + /// + /// 实体组件类型。 + /// 实体组件。 + public void RemoveEntityComponent() where T : EntityComponent + { + Type key = typeof(T); + RemoveEntityComponentImp(key); + } + + /// + /// 移除实体组件。 + /// + /// 实体组件。 + /// 实体组件。 + public void RemoveEntityComponent(EntityComponent component) + { + Type key = component.GetType(); + RemoveEntityComponentImp(key); + } + + private void RemoveEntityComponentImp(Type type) + { + if (_componentMap.ContainsKey(type)) + { + EntityComponent component = _componentMap[type]; + if (component.NeedUpdate) + { + _updateComponents.Remove(component); + } + MemoryPool.Release(component); + _componentMap.Remove(type); + } + } + } +} diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityLogic.cs.meta b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityLogic.cs.meta new file mode 100644 index 00000000..82446b8a --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityLogic.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 699dd149c0a53234e8f76e6d6c1b5545 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityManager.EntityGroup.cs b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityManager.EntityGroup.cs new file mode 100644 index 00000000..75a20dea --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityManager.EntityGroup.cs @@ -0,0 +1,344 @@ +using System.Collections.Generic; + +namespace TEngine +{ + internal sealed partial class EntityManager + { + /// + /// 实体组。 + /// + private sealed class EntityGroup : IEntityGroup + { + private readonly string _name; + private readonly IEntityGroupHelper _entityGroupHelper; + private readonly IObjectPool _instancePool; + private readonly GameFrameworkLinkedList _entities; + private LinkedListNode _cachedNode; + + /// + /// 初始化实体组的新实例。 + /// + /// 实体组名称。 + /// 实体实例对象池自动释放可释放对象的间隔秒数。 + /// 实体实例对象池容量。 + /// 实体实例对象池对象过期秒数。 + /// 实体实例对象池的优先级。 + /// 实体组辅助器。 + /// 对象池管理器。 + public EntityGroup(string name, float instanceAutoReleaseInterval, int instanceCapacity, float instanceExpireTime, int instancePriority, IEntityGroupHelper entityGroupHelper, IObjectPoolModule objectPoolManager) + { + if (string.IsNullOrEmpty(name)) + { + throw new GameFrameworkException("Entity group name is invalid."); + } + + if (entityGroupHelper == null) + { + throw new GameFrameworkException("Entity group helper is invalid."); + } + + _name = name; + _entityGroupHelper = entityGroupHelper; + _instancePool = objectPoolManager.CreateSingleSpawnObjectPool(Utility.Text.Format("Entity Instance Pool ({0})", name), instanceCapacity, instanceExpireTime, instancePriority); + _instancePool.AutoReleaseInterval = instanceAutoReleaseInterval; + _entities = new GameFrameworkLinkedList(); + _cachedNode = null; + } + + /// + /// 获取实体组名称。 + /// + public string Name => _name; + + /// + /// 获取实体组中实体数量。 + /// + public int EntityCount => _entities.Count; + + /// + /// 获取或设置实体组实例对象池自动释放可释放对象的间隔秒数。 + /// + public float InstanceAutoReleaseInterval + { + get => _instancePool.AutoReleaseInterval; + set => _instancePool.AutoReleaseInterval = value; + } + + /// + /// 获取或设置实体组实例对象池的容量。 + /// + public int InstanceCapacity + { + get => _instancePool.Capacity; + set => _instancePool.Capacity = value; + } + + /// + /// 获取或设置实体组实例对象池对象过期秒数。 + /// + public float InstanceExpireTime + { + get => _instancePool.ExpireTime; + set => _instancePool.ExpireTime = value; + } + + /// + /// 获取或设置实体组实例对象池的优先级。 + /// + public int InstancePriority + { + get => _instancePool.Priority; + set => _instancePool.Priority = value; + } + + /// + /// 获取实体组辅助器。 + /// + public IEntityGroupHelper Helper => _entityGroupHelper; + + /// + /// 实体组轮询。 + /// + /// 逻辑流逝时间,以秒为单位。 + /// 真实流逝时间,以秒为单位。 + public void Update(float elapseSeconds, float realElapseSeconds) + { + LinkedListNode current = _entities.First; + while (current != null) + { + _cachedNode = current.Next; + current.Value.OnUpdate(elapseSeconds, realElapseSeconds); + current = _cachedNode; + _cachedNode = null; + } + } + + /// + /// 实体组中是否存在实体。 + /// + /// 实体序列编号。 + /// 实体组中是否存在实体。 + public bool HasEntity(int entityId) + { + foreach (IEntity entity in _entities) + { + if (entity.Id == entityId) + { + return true; + } + } + + return false; + } + + /// + /// 实体组中是否存在实体。 + /// + /// 实体资源名称。 + /// 实体组中是否存在实体。 + public bool HasEntity(string entityAssetName) + { + if (string.IsNullOrEmpty(entityAssetName)) + { + throw new GameFrameworkException("Entity asset name is invalid."); + } + + foreach (IEntity entity in _entities) + { + if (entity.EntityAssetName == entityAssetName) + { + return true; + } + } + + return false; + } + + /// + /// 从实体组中获取实体。 + /// + /// 实体序列编号。 + /// 要获取的实体。 + public IEntity GetEntity(int entityId) + { + foreach (IEntity entity in _entities) + { + if (entity.Id == entityId) + { + return entity; + } + } + + return null; + } + + /// + /// 从实体组中获取实体。 + /// + /// 实体资源名称。 + /// 要获取的实体。 + public IEntity GetEntity(string entityAssetName) + { + if (string.IsNullOrEmpty(entityAssetName)) + { + throw new GameFrameworkException("Entity asset name is invalid."); + } + + foreach (IEntity entity in _entities) + { + if (entity.EntityAssetName == entityAssetName) + { + return entity; + } + } + + return null; + } + + /// + /// 从实体组中获取实体。 + /// + /// 实体资源名称。 + /// 要获取的实体。 + public IEntity[] GetEntities(string entityAssetName) + { + if (string.IsNullOrEmpty(entityAssetName)) + { + throw new GameFrameworkException("Entity asset name is invalid."); + } + + List results = new List(); + foreach (IEntity entity in _entities) + { + if (entity.EntityAssetName == entityAssetName) + { + results.Add(entity); + } + } + + return results.ToArray(); + } + + /// + /// 从实体组中获取实体。 + /// + /// 实体资源名称。 + /// 要获取的实体。 + public void GetEntities(string entityAssetName, List results) + { + if (string.IsNullOrEmpty(entityAssetName)) + { + throw new GameFrameworkException("Entity asset name is invalid."); + } + + if (results == null) + { + throw new GameFrameworkException("Results is invalid."); + } + + results.Clear(); + foreach (IEntity entity in _entities) + { + if (entity.EntityAssetName == entityAssetName) + { + results.Add(entity); + } + } + } + + /// + /// 从实体组中获取所有实体。 + /// + /// 实体组中的所有实体。 + public IEntity[] GetAllEntities() + { + List results = new List(); + foreach (IEntity entity in _entities) + { + results.Add(entity); + } + + return results.ToArray(); + } + + /// + /// 从实体组中获取所有实体。 + /// + /// 实体组中的所有实体。 + public void GetAllEntities(List results) + { + if (results == null) + { + throw new GameFrameworkException("Results is invalid."); + } + + results.Clear(); + foreach (IEntity entity in _entities) + { + results.Add(entity); + } + } + + /// + /// 往实体组增加实体。 + /// + /// 要增加的实体。 + public void AddEntity(IEntity entity) + { + _entities.AddLast(entity); + } + + /// + /// 从实体组移除实体。 + /// + /// 要移除的实体。 + public void RemoveEntity(IEntity entity) + { + if (_cachedNode != null && _cachedNode.Value == entity) + { + _cachedNode = _cachedNode.Next; + } + + if (!_entities.Remove(entity)) + { + throw new GameFrameworkException(Utility.Text.Format("Entity group '{0}' not exists specified entity '[{1}]{2}'.", _name, entity.Id, entity.EntityAssetName)); + } + } + + public void RegisterEntityInstanceObject(EntityInstanceObject obj, bool spawned) + { + _instancePool.Register(obj, spawned); + } + + public EntityInstanceObject SpawnEntityInstanceObject(string name) + { + return _instancePool.Spawn(name); + } + + public void UnspawnEntity(IEntity entity) + { + _instancePool.Unspawn(entity.Handle); + } + + public void SetEntityInstanceLocked(object entityInstance, bool locked) + { + if (entityInstance == null) + { + throw new GameFrameworkException("Entity instance is invalid."); + } + + _instancePool.SetLocked(entityInstance, locked); + } + + public void SetEntityInstancePriority(object entityInstance, int priority) + { + if (entityInstance == null) + { + throw new GameFrameworkException("Entity instance is invalid."); + } + + _instancePool.SetPriority(entityInstance, priority); + } + } + } +} diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityManager.EntityGroup.cs.meta b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityManager.EntityGroup.cs.meta new file mode 100644 index 00000000..24440ede --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityManager.EntityGroup.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fed22a00e76a9e04db988de4744325f3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityManager.EntityInfo.cs b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityManager.EntityInfo.cs new file mode 100644 index 00000000..d97748c2 --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityManager.EntityInfo.cs @@ -0,0 +1,105 @@ +using System.Collections.Generic; + +namespace TEngine +{ + internal sealed partial class EntityManager + { + /// + /// 实体信息。 + /// + private sealed class EntityInfo : IMemory + { + private IEntity _entity; + private EntityStatus _status; + private IEntity _parentEntity; + private readonly List _childEntities; + + public EntityInfo() + { + _entity = null; + _status = EntityStatus.Unknown; + _parentEntity = null; + _childEntities = new List(); + } + + public IEntity Entity => _entity; + + public EntityStatus Status + { + get => _status; + set => _status = value; + } + + public IEntity ParentEntity + { + get => _parentEntity; + set => _parentEntity = value; + } + + public int ChildEntityCount => _childEntities.Count; + + public static EntityInfo Create(IEntity entity) + { + if (entity == null) + { + throw new GameFrameworkException("Entity is invalid."); + } + + EntityInfo entityInfo = MemoryPool.Acquire(); + entityInfo._entity = entity; + entityInfo._status = EntityStatus.WillInit; + return entityInfo; + } + + public void Clear() + { + _entity = null; + _status = EntityStatus.Unknown; + _parentEntity = null; + _childEntities.Clear(); + } + + public IEntity GetChildEntity() + { + return _childEntities.Count > 0 ? _childEntities[0] : null; + } + + public IEntity[] GetChildEntities() + { + return _childEntities.ToArray(); + } + + public void GetChildEntities(List results) + { + if (results == null) + { + throw new GameFrameworkException("Results is invalid."); + } + + results.Clear(); + foreach (IEntity childEntity in _childEntities) + { + results.Add(childEntity); + } + } + + public void AddChildEntity(IEntity childEntity) + { + if (_childEntities.Contains(childEntity)) + { + throw new GameFrameworkException("Can not add child entity which is already exist."); + } + + _childEntities.Add(childEntity); + } + + public void RemoveChildEntity(IEntity childEntity) + { + if (!_childEntities.Remove(childEntity)) + { + throw new GameFrameworkException("Can not remove child entity which is not exist."); + } + } + } + } +} diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityManager.EntityInfo.cs.meta b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityManager.EntityInfo.cs.meta new file mode 100644 index 00000000..dcf808a1 --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityManager.EntityInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 587d8d02d9b5b8341a17bcc88ec0946b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityManager.EntityInstanceObject.cs b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityManager.EntityInstanceObject.cs new file mode 100644 index 00000000..97e09cdf --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityManager.EntityInstanceObject.cs @@ -0,0 +1,53 @@ +using YooAsset; + +namespace TEngine +{ + internal sealed partial class EntityManager + { + /// + /// 实体实例对象。 + /// + private sealed class EntityInstanceObject : ObjectBase + { + private object _entityAsset; + private IEntityHelper _entityHelper; + + public EntityInstanceObject() + { + _entityAsset = null; + _entityHelper = null; + } + + public static EntityInstanceObject Create(string name, object entityAsset, object entityInstance, IEntityHelper entityHelper) + { + if (entityAsset == null) + { + throw new GameFrameworkException("Entity asset is invalid."); + } + + if (entityHelper == null) + { + throw new GameFrameworkException("Entity helper is invalid."); + } + + EntityInstanceObject entityInstanceObject = MemoryPool.Acquire(); + entityInstanceObject.Initialize(name, entityInstance); + entityInstanceObject._entityAsset = entityAsset; + entityInstanceObject._entityHelper = entityHelper; + return entityInstanceObject; + } + + public override void Clear() + { + base.Clear(); + _entityAsset = null; + _entityHelper = null; + } + + protected internal override void Release(bool isShutdown) + { + _entityHelper.ReleaseEntity(_entityAsset, Target); + } + } + } +} diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityManager.EntityInstanceObject.cs.meta b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityManager.EntityInstanceObject.cs.meta new file mode 100644 index 00000000..352ef155 --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityManager.EntityInstanceObject.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 464693e273ba27847b89b8d2bc1a6cca +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityManager.EntityStatus.cs b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityManager.EntityStatus.cs new file mode 100644 index 00000000..6589f4d6 --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityManager.EntityStatus.cs @@ -0,0 +1,48 @@ +namespace TEngine +{ + internal sealed partial class EntityManager + { + /// + /// 实体状态。 + /// + private enum EntityStatus : byte + { + /// + /// 未知状态。 + /// + Unknown = 0, + /// + /// 即将初始化。 + /// + WillInit, + /// + /// 已经初始化。 + /// + Inited, + /// + /// 即将显示。 + /// + WillShow, + /// + /// 已经显示。 + /// + Showed, + /// + /// 即将隐藏。 + /// + WillHide, + /// + /// 已经隐藏。 + /// + Hidden, + /// + /// 即将回收。 + /// + WillRecycle, + /// + /// 已经回收。 + /// + Recycled + } + } +} diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityManager.EntityStatus.cs.meta b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityManager.EntityStatus.cs.meta new file mode 100644 index 00000000..4c26628c --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityManager.EntityStatus.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ab0b205f77830b74486b0d2ae91da934 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityManager.ShowEntityInfo.cs b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityManager.ShowEntityInfo.cs new file mode 100644 index 00000000..0e482c05 --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityManager.ShowEntityInfo.cs @@ -0,0 +1,47 @@ +namespace TEngine +{ + internal sealed partial class EntityManager : Module, IEntityManager + { + private sealed class ShowEntityInfo : IMemory + { + private int _serialId; + private int _entityId; + private EntityGroup _entityGroup; + private object _userData; + + public ShowEntityInfo() + { + _serialId = 0; + _entityId = 0; + _entityGroup = null; + _userData = null; + } + + public int SerialId => _serialId; + + public int EntityId => _entityId; + + public EntityGroup EntityGroup => _entityGroup; + + public object UserData => _userData; + + public static ShowEntityInfo Create(int serialId, int entityId, EntityGroup entityGroup, object userData) + { + ShowEntityInfo showEntityInfo = MemoryPool.Acquire(); + showEntityInfo._serialId = serialId; + showEntityInfo._entityId = entityId; + showEntityInfo._entityGroup = entityGroup; + showEntityInfo._userData = userData; + return showEntityInfo; + } + + public void Clear() + { + _serialId = 0; + _entityId = 0; + _entityGroup = null; + _userData = null; + } + } + } +} diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityManager.ShowEntityInfo.cs.meta b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityManager.ShowEntityInfo.cs.meta new file mode 100644 index 00000000..52926878 --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityManager.ShowEntityInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 55d530e796e407c4fa1cddfef9a1c780 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityManager.cs b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityManager.cs new file mode 100644 index 00000000..c4aa0df7 --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityManager.cs @@ -0,0 +1,1354 @@ +using System; +using System.Collections.Generic; +using System.Threading; +using Cysharp.Threading.Tasks; +using YooAsset; + +namespace TEngine +{ + /// + /// 实体管理器。 + /// + internal sealed partial class EntityManager : Module, IEntityManager, IUpdateModule + { + private readonly Dictionary _entityInfos; + private readonly Dictionary _entityGroups; + private readonly Dictionary _entitiesBeingLoaded; + private readonly HashSet _entitiesToReleaseOnLoad; + private readonly Queue _recycleQueue; + private IObjectPoolModule _objectPoolModule; + private IResourceModule _resourceModule; + private IEntityHelper _entityHelper; + private int _serial; + private bool _isShutdown; + private Action _showEntitySuccessEventHandler; + private Action _showEntityFailureEventHandler; + private Action _hideEntityCompleteEventHandler; + + /// + /// 初始化实体管理器的新实例。 + /// + public EntityManager() + { + _entityInfos = new Dictionary(); + _entityGroups = new Dictionary(StringComparer.Ordinal); + _entitiesBeingLoaded = new Dictionary(); + _entitiesToReleaseOnLoad = new HashSet(); + _recycleQueue = new Queue(); + _objectPoolModule = null; + _resourceModule = null; + _entityHelper = null; + _serial = 0; + _isShutdown = false; + _showEntitySuccessEventHandler = null; + _showEntityFailureEventHandler = null; + _hideEntityCompleteEventHandler = null; + } + + /// + /// 获取实体数量。 + /// + public int EntityCount => _entityInfos.Count; + + /// + /// 获取实体组数量。 + /// + public int EntityGroupCount => _entityGroups.Count; + + /// + /// 显示实体成功事件。 + /// + public event Action ShowEntitySuccess + { + add => _showEntitySuccessEventHandler += value; + remove => _showEntitySuccessEventHandler -= value; + } + + /// + /// 显示实体失败事件。 + /// + public event Action ShowEntityFailure + { + add => _showEntityFailureEventHandler += value; + remove => _showEntityFailureEventHandler -= value; + } + + /// + /// 隐藏实体完成事件。 + /// + public event Action HideEntityComplete + { + add => _hideEntityCompleteEventHandler += value; + remove => _hideEntityCompleteEventHandler -= value; + } + + /// + /// 实体管理器轮询。 + /// + /// 逻辑流逝时间,以秒为单位。 + /// 真实流逝时间,以秒为单位。 + public void Update(float elapseSeconds, float realElapseSeconds) + { + while (_recycleQueue.Count > 0) + { + EntityInfo entityInfo = _recycleQueue.Dequeue(); + IEntity entity = entityInfo.Entity; + EntityGroup entityGroup = (EntityGroup)entity.EntityGroup; + if (entityGroup == null) + { + throw new GameFrameworkException("Entity group is invalid."); + } + + entityInfo.Status = EntityStatus.WillRecycle; + entity.OnRecycle(); + entityInfo.Status = EntityStatus.Recycled; + entityGroup.UnspawnEntity(entity); + MemoryPool.Release(entityInfo); + } + + foreach (KeyValuePair entityGroup in _entityGroups) + { + entityGroup.Value.Update(elapseSeconds, realElapseSeconds); + } + } + + public override void OnInit() + { + + } + + /// + /// 关闭并清理实体管理器。 + /// + public override void Shutdown() + { + _isShutdown = true; + HideAllLoadedEntities(); + _entityGroups.Clear(); + _entitiesBeingLoaded.Clear(); + _entitiesToReleaseOnLoad.Clear(); + _recycleQueue.Clear(); + } + + /// + /// 设置对象池管理器。 + /// + /// 对象池管理器。 + public void SetObjectPoolManager(IObjectPoolModule objectPoolManager) + { + _objectPoolModule = objectPoolManager ?? throw new GameFrameworkException("Object pool manager is invalid."); + } + + /// + /// 设置资源管理器。 + /// + /// 资源管理器。 + public void SetResourceManager(IResourceModule resourceManager) + { + _resourceModule = resourceManager ?? throw new GameFrameworkException("Resource manager is invalid."); + } + + /// + /// 设置实体辅助器。 + /// + /// 实体辅助器。 + public void SetEntityHelper(IEntityHelper entityHelper) + { + _entityHelper = entityHelper ?? throw new GameFrameworkException("Entity helper is invalid."); + } + + /// + /// 是否存在实体组。 + /// + /// 实体组名称。 + /// 是否存在实体组。 + public bool HasEntityGroup(string entityGroupName) + { + if (string.IsNullOrEmpty(entityGroupName)) + { + throw new GameFrameworkException("Entity group name is invalid."); + } + + return _entityGroups.ContainsKey(entityGroupName); + } + + /// + /// 获取实体组。 + /// + /// 实体组名称。 + /// 要获取的实体组。 + public IEntityGroup GetEntityGroup(string entityGroupName) + { + if (string.IsNullOrEmpty(entityGroupName)) + { + throw new GameFrameworkException("Entity group name is invalid."); + } + + if (_entityGroups.TryGetValue(entityGroupName, out var entityGroup)) + { + return entityGroup; + } + + return null; + } + + /// + /// 获取所有实体组。 + /// + /// 所有实体组。 + public IEntityGroup[] GetAllEntityGroups() + { + int index = 0; + IEntityGroup[] results = new IEntityGroup[_entityGroups.Count]; + foreach (KeyValuePair entityGroup in _entityGroups) + { + results[index++] = entityGroup.Value; + } + + return results; + } + + /// + /// 获取所有实体组。 + /// + /// 所有实体组。 + public void GetAllEntityGroups(List results) + { + if (results == null) + { + throw new GameFrameworkException("Results is invalid."); + } + + results.Clear(); + foreach (KeyValuePair entityGroup in _entityGroups) + { + results.Add(entityGroup.Value); + } + } + + /// + /// 增加实体组。 + /// + /// 实体组名称。 + /// 实体实例对象池自动释放可释放对象的间隔秒数。 + /// 实体实例对象池容量。 + /// 实体实例对象池对象过期秒数。 + /// 实体实例对象池的优先级。 + /// 实体组辅助器。 + /// 是否增加实体组成功。 + public bool AddEntityGroup(string entityGroupName, float instanceAutoReleaseInterval, int instanceCapacity, float instanceExpireTime, int instancePriority, IEntityGroupHelper entityGroupHelper) + { + if (string.IsNullOrEmpty(entityGroupName)) + { + throw new GameFrameworkException("Entity group name is invalid."); + } + + if (entityGroupHelper == null) + { + throw new GameFrameworkException("Entity group helper is invalid."); + } + + if (_objectPoolModule == null) + { + throw new GameFrameworkException("You must set object pool manager first."); + } + + if (HasEntityGroup(entityGroupName)) + { + return false; + } + + _entityGroups.Add(entityGroupName, new EntityGroup(entityGroupName, instanceAutoReleaseInterval, instanceCapacity, instanceExpireTime, instancePriority, entityGroupHelper, _objectPoolModule)); + + return true; + } + + /// + /// 是否存在实体。 + /// + /// 实体编号。 + /// 是否存在实体。 + public bool HasEntity(int entityId) + { + return _entityInfos.ContainsKey(entityId); + } + + /// + /// 是否存在实体。 + /// + /// 实体资源名称。 + /// 是否存在实体。 + public bool HasEntity(string entityAssetName) + { + if (string.IsNullOrEmpty(entityAssetName)) + { + throw new GameFrameworkException("Entity asset name is invalid."); + } + + foreach (KeyValuePair entityInfo in _entityInfos) + { + if (entityInfo.Value.Entity.EntityAssetName == entityAssetName) + { + return true; + } + } + + return false; + } + + /// + /// 获取实体。 + /// + /// 实体编号。 + /// 要获取的实体。 + public IEntity GetEntity(int entityId) + { + EntityInfo entityInfo = GetEntityInfo(entityId); + if (entityInfo == null) + { + return null; + } + + return entityInfo.Entity; + } + + /// + /// 获取实体。 + /// + /// 实体资源名称。 + /// 要获取的实体。 + public IEntity GetEntity(string entityAssetName) + { + if (string.IsNullOrEmpty(entityAssetName)) + { + throw new GameFrameworkException("Entity asset name is invalid."); + } + + foreach (KeyValuePair entityInfo in _entityInfos) + { + if (entityInfo.Value.Entity.EntityAssetName == entityAssetName) + { + return entityInfo.Value.Entity; + } + } + + return null; + } + + /// + /// 获取实体。 + /// + /// 实体资源名称。 + /// 要获取的实体。 + public IEntity[] GetEntities(string entityAssetName) + { + if (string.IsNullOrEmpty(entityAssetName)) + { + throw new GameFrameworkException("Entity asset name is invalid."); + } + + List results = new List(); + foreach (KeyValuePair entityInfo in _entityInfos) + { + if (entityInfo.Value.Entity.EntityAssetName == entityAssetName) + { + results.Add(entityInfo.Value.Entity); + } + } + + return results.ToArray(); + } + + /// + /// 获取实体。 + /// + /// 实体资源名称。 + /// 要获取的实体。 + public void GetEntities(string entityAssetName, List results) + { + if (string.IsNullOrEmpty(entityAssetName)) + { + throw new GameFrameworkException("Entity asset name is invalid."); + } + + if (results == null) + { + throw new GameFrameworkException("Results is invalid."); + } + + results.Clear(); + foreach (KeyValuePair entityInfo in _entityInfos) + { + if (entityInfo.Value.Entity.EntityAssetName == entityAssetName) + { + results.Add(entityInfo.Value.Entity); + } + } + } + + /// + /// 获取所有已加载的实体。 + /// + /// 所有已加载的实体。 + public IEntity[] GetAllLoadedEntities() + { + int index = 0; + IEntity[] results = new IEntity[_entityInfos.Count]; + foreach (KeyValuePair entityInfo in _entityInfos) + { + results[index++] = entityInfo.Value.Entity; + } + + return results; + } + + /// + /// 获取所有已加载的实体。 + /// + /// 所有已加载的实体。 + public void GetAllLoadedEntities(List results) + { + if (results == null) + { + throw new GameFrameworkException("Results is invalid."); + } + + results.Clear(); + foreach (KeyValuePair entityInfo in _entityInfos) + { + results.Add(entityInfo.Value.Entity); + } + } + + /// + /// 获取所有正在加载实体的编号。 + /// + /// 所有正在加载实体的编号。 + public int[] GetAllLoadingEntityIds() + { + int index = 0; + int[] results = new int[_entitiesBeingLoaded.Count]; + foreach (KeyValuePair entityBeingLoaded in _entitiesBeingLoaded) + { + results[index++] = entityBeingLoaded.Key; + } + + return results; + } + + /// + /// 获取所有正在加载实体的编号。 + /// + /// 所有正在加载实体的编号。 + public void GetAllLoadingEntityIds(List results) + { + if (results == null) + { + throw new GameFrameworkException("Results is invalid."); + } + + results.Clear(); + foreach (KeyValuePair entityBeingLoaded in _entitiesBeingLoaded) + { + results.Add(entityBeingLoaded.Key); + } + } + + /// + /// 是否正在加载实体。 + /// + /// 实体编号。 + /// 是否正在加载实体。 + public bool IsLoadingEntity(int entityId) + { + return _entitiesBeingLoaded.ContainsKey(entityId); + } + + /// + /// 是否是合法的实体。 + /// + /// 实体。 + /// 实体是否合法。 + public bool IsValidEntity(IEntity entity) + { + if (entity == null) + { + return false; + } + + return HasEntity(entity.Id); + } + + /// + /// 显示实体。 + /// + /// 实体编号。 + /// 实体资源名称。 + /// 实体组名称。 + public void ShowEntity(int entityId, string entityAssetName, string entityGroupName) + { + ShowEntity(entityId, entityAssetName, entityGroupName, EntityModule.DefaultPriority, null); + } + + /// + /// 显示实体。 + /// + /// 实体编号。 + /// 实体资源名称。 + /// 实体组名称。 + /// 加载实体资源的优先级。 + public void ShowEntity(int entityId, string entityAssetName, string entityGroupName, int priority) + { + ShowEntity(entityId, entityAssetName, entityGroupName, priority, null); + } + + /// + /// 显示实体。 + /// + /// 实体编号。 + /// 实体资源名称。 + /// 实体组名称。 + /// 用户自定义数据。 + public void ShowEntity(int entityId, string entityAssetName, string entityGroupName, object userData) + { + ShowEntity(entityId, entityAssetName, entityGroupName, EntityModule.DefaultPriority, userData); + } + + /// + /// 同步显示实体。 + /// + /// 实体编号。 + /// 实体资源名称。 + /// 实体组名称。 + /// 加载实体资源的优先级。 + /// 用户自定义数据。 + public T ShowEntitySync(int entityId, string entityAssetName, string entityGroupName, int priority = 0, object userData = null) where T : class + { + if (_resourceModule == null) + { + throw new GameFrameworkException("You must set resource manager first."); + } + + if (_entityHelper == null) + { + throw new GameFrameworkException("You must set entity helper first."); + } + + if (string.IsNullOrEmpty(entityAssetName)) + { + throw new GameFrameworkException("Entity asset name is invalid."); + } + + if (string.IsNullOrEmpty(entityGroupName)) + { + throw new GameFrameworkException("Entity group name is invalid."); + } + + if (HasEntity(entityId)) + { + throw new GameFrameworkException(Utility.Text.Format("Entity id '{0}' is already exist.", entityId)); + } + + if (IsLoadingEntity(entityId)) + { + throw new GameFrameworkException(Utility.Text.Format("Entity '{0}' is already being loaded.", entityId)); + } + + EntityGroup entityGroup = (EntityGroup)GetEntityGroup(entityGroupName); + if (entityGroup == null) + { + throw new GameFrameworkException(Utility.Text.Format("Entity group '{0}' is not exist.", entityGroupName)); + } + + EntityInstanceObject entityInstanceObject = entityGroup.SpawnEntityInstanceObject(entityAssetName); + if (entityInstanceObject == null) + { + int serialId = ++_serial; + _entitiesBeingLoaded.Add(entityId, serialId); + var assetInfo = _resourceModule.GetAssetInfo(entityAssetName); + if (!string.IsNullOrEmpty(assetInfo.Error)) + { + LoadAssetFailureCallback(entityAssetName,assetInfo.Error,null); + return default; + } + float duration = GameTime.time; + UnityEngine.GameObject gameObject = _resourceModule.LoadAsset(assetInfo.Address); + duration = GameTime.time - duration; + Entity entity = (Entity)LoadAssetSuccessCallback(entityAssetName, gameObject, duration, ShowEntityInfo.Create(serialId, entityId, entityGroup, userData)); + return entity.Logic as T; + } + return InternalShowEntity(entityId, entityAssetName, entityGroup, entityInstanceObject.Target, false, 0f, userData) as T; + } + + /// + /// 异步显示实体。 + /// + /// 实体编号。 + /// 实体资源名称。 + /// 实体组名称。 + /// 加载实体资源的优先级。 + /// 用户自定义数据。 + public async UniTask ShowEntityAsync(int entityId, string entityAssetName, string entityGroupName, int priority = 0, object userData = null) where T : class + { + if (_resourceModule == null) + { + throw new GameFrameworkException("You must set resource manager first."); + } + + if (_entityHelper == null) + { + throw new GameFrameworkException("You must set entity helper first."); + } + + if (string.IsNullOrEmpty(entityAssetName)) + { + throw new GameFrameworkException("Entity asset name is invalid."); + } + + if (string.IsNullOrEmpty(entityGroupName)) + { + throw new GameFrameworkException("Entity group name is invalid."); + } + + if (HasEntity(entityId)) + { + throw new GameFrameworkException(Utility.Text.Format("Entity id '{0}' is already exist.", entityId)); + } + + if (IsLoadingEntity(entityId)) + { + throw new GameFrameworkException(Utility.Text.Format("Entity '{0}' is already being loaded.", entityId)); + } + + EntityGroup entityGroup = (EntityGroup)GetEntityGroup(entityGroupName); + if (entityGroup == null) + { + throw new GameFrameworkException(Utility.Text.Format("Entity group '{0}' is not exist.", entityGroupName)); + } + + EntityInstanceObject entityInstanceObject = entityGroup.SpawnEntityInstanceObject(entityAssetName); + if (entityInstanceObject == null) + { + int serialId = ++_serial; + _entitiesBeingLoaded.Add(entityId, serialId); + var assetInfo = _resourceModule.GetAssetInfo(entityAssetName); + if (!string.IsNullOrEmpty(assetInfo.Error)) + { + LoadAssetFailureCallback(entityAssetName,assetInfo.Error,null); + return default; + } + float duration = GameTime.time; + UnityEngine.GameObject gameObject = await _resourceModule.LoadAssetAsync(assetInfo.Address,CancellationToken.None); + duration = GameTime.time - duration; + Entity entity = (Entity)LoadAssetSuccessCallback(entityAssetName, gameObject, duration, ShowEntityInfo.Create(serialId, entityId, entityGroup, userData)); + return entity.Logic as T; + } + return InternalShowEntity(entityId, entityAssetName, entityGroup, entityInstanceObject.Target, false, 0f, userData) as T; + } + + /// + /// 显示实体。 + /// + /// 实体编号。 + /// 实体资源名称。 + /// 实体组名称。 + /// 加载实体资源的优先级。 + /// 用户自定义数据。 + public void ShowEntity(int entityId, string entityAssetName, string entityGroupName, int priority, object userData) + { + if (_resourceModule == null) + { + throw new GameFrameworkException("You must set resource manager first."); + } + + if (_entityHelper == null) + { + throw new GameFrameworkException("You must set entity helper first."); + } + + if (string.IsNullOrEmpty(entityAssetName)) + { + throw new GameFrameworkException("Entity asset name is invalid."); + } + + if (string.IsNullOrEmpty(entityGroupName)) + { + throw new GameFrameworkException("Entity group name is invalid."); + } + + if (HasEntity(entityId)) + { + throw new GameFrameworkException(Utility.Text.Format("Entity id '{0}' is already exist.", entityId)); + } + + if (IsLoadingEntity(entityId)) + { + throw new GameFrameworkException(Utility.Text.Format("Entity '{0}' is already being loaded.", entityId)); + } + + EntityGroup entityGroup = (EntityGroup)GetEntityGroup(entityGroupName); + if (entityGroup == null) + { + throw new GameFrameworkException(Utility.Text.Format("Entity group '{0}' is not exist.", entityGroupName)); + } + + EntityInstanceObject entityInstanceObject = entityGroup.SpawnEntityInstanceObject(entityAssetName); + if (entityInstanceObject == null) + { + int serialId = ++_serial; + _entitiesBeingLoaded.Add(entityId, serialId); + var assetInfo = _resourceModule.GetAssetInfo(entityAssetName); + if (!string.IsNullOrEmpty(assetInfo.Error)) + { + LoadAssetFailureCallback(entityAssetName,assetInfo.Error,null); + return; + } + float duration = GameTime.time; + _resourceModule.LoadAsset(assetInfo.Address, gameObject => + { + duration = GameTime.time - duration; + LoadAssetSuccessCallback(entityAssetName, gameObject, duration, ShowEntityInfo.Create(serialId, entityId, entityGroup, userData)); + }).Forget(); + return; + } + + InternalShowEntity(entityId, entityAssetName, entityGroup, entityInstanceObject.Target, false, 0f, userData); + } + + /// + /// 隐藏实体。 + /// + /// 实体编号。 + public void HideEntity(int entityId) + { + HideEntity(entityId, null); + } + + /// + /// 隐藏实体。 + /// + /// 实体编号。 + /// 用户自定义数据。 + public void HideEntity(int entityId, object userData) + { + if (IsLoadingEntity(entityId)) + { + _entitiesToReleaseOnLoad.Add(_entitiesBeingLoaded[entityId]); + _entitiesBeingLoaded.Remove(entityId); + return; + } + + EntityInfo entityInfo = GetEntityInfo(entityId); + if (entityInfo == null) + { + throw new GameFrameworkException(Utility.Text.Format("Can not find entity '{0}'.", entityId)); + } + + InternalHideEntity(entityInfo, userData); + } + + /// + /// 隐藏实体。 + /// + /// 实体。 + public void HideEntity(IEntity entity) + { + HideEntity(entity, null); + } + + /// + /// 隐藏实体。 + /// + /// 实体。 + /// 用户自定义数据。 + public void HideEntity(IEntity entity, object userData) + { + if (entity == null) + { + throw new GameFrameworkException("Entity is invalid."); + } + + HideEntity(entity.Id, userData); + } + + /// + /// 隐藏所有已加载的实体。 + /// + public void HideAllLoadedEntities() + { + HideAllLoadedEntities(null); + } + + /// + /// 隐藏所有已加载的实体。 + /// + /// 用户自定义数据。 + public void HideAllLoadedEntities(object userData) + { + while (_entityInfos.Count > 0) + { + foreach (KeyValuePair entityInfo in _entityInfos) + { + InternalHideEntity(entityInfo.Value, userData); + break; + } + } + } + + /// + /// 隐藏所有正在加载的实体。 + /// + public void HideAllLoadingEntities() + { + foreach (KeyValuePair entityBeingLoaded in _entitiesBeingLoaded) + { + _entitiesToReleaseOnLoad.Add(entityBeingLoaded.Value); + } + + _entitiesBeingLoaded.Clear(); + } + + /// + /// 获取父实体。 + /// + /// 要获取父实体的子实体的实体编号。 + /// 子实体的父实体。 + public IEntity GetParentEntity(int childEntityId) + { + EntityInfo childEntityInfo = GetEntityInfo(childEntityId); + if (childEntityInfo == null) + { + throw new GameFrameworkException(Utility.Text.Format("Can not find child entity '{0}'.", childEntityId)); + } + + return childEntityInfo.ParentEntity; + } + + /// + /// 获取父实体。 + /// + /// 要获取父实体的子实体。 + /// 子实体的父实体。 + public IEntity GetParentEntity(IEntity childEntity) + { + if (childEntity == null) + { + throw new GameFrameworkException("Child entity is invalid."); + } + + return GetParentEntity(childEntity.Id); + } + + /// + /// 获取子实体数量。 + /// + /// 要获取子实体数量的父实体的实体编号。 + /// 子实体数量。 + public int GetChildEntityCount(int parentEntityId) + { + EntityInfo parentEntityInfo = GetEntityInfo(parentEntityId); + if (parentEntityInfo == null) + { + throw new GameFrameworkException(Utility.Text.Format("Can not find parent entity '{0}'.", parentEntityId)); + } + + return parentEntityInfo.ChildEntityCount; + } + + /// + /// 获取子实体。 + /// + /// 要获取子实体的父实体的实体编号。 + /// 子实体。 + public IEntity GetChildEntity(int parentEntityId) + { + EntityInfo parentEntityInfo = GetEntityInfo(parentEntityId); + if (parentEntityInfo == null) + { + throw new GameFrameworkException(Utility.Text.Format("Can not find parent entity '{0}'.", parentEntityId)); + } + + return parentEntityInfo.GetChildEntity(); + } + + /// + /// 获取子实体。 + /// + /// 要获取子实体的父实体。 + /// 子实体。 + public IEntity GetChildEntity(IEntity parentEntity) + { + if (parentEntity == null) + { + throw new GameFrameworkException("Parent entity is invalid."); + } + + return GetChildEntity(parentEntity.Id); + } + + /// + /// 获取所有子实体。 + /// + /// 要获取所有子实体的父实体的实体编号。 + /// 所有子实体。 + public IEntity[] GetChildEntities(int parentEntityId) + { + EntityInfo parentEntityInfo = GetEntityInfo(parentEntityId); + if (parentEntityInfo == null) + { + throw new GameFrameworkException(Utility.Text.Format("Can not find parent entity '{0}'.", parentEntityId)); + } + + return parentEntityInfo.GetChildEntities(); + } + + /// + /// 获取所有子实体。 + /// + /// 要获取所有子实体的父实体的实体编号。 + /// 所有子实体。 + public void GetChildEntities(int parentEntityId, List results) + { + EntityInfo parentEntityInfo = GetEntityInfo(parentEntityId); + if (parentEntityInfo == null) + { + throw new GameFrameworkException(Utility.Text.Format("Can not find parent entity '{0}'.", parentEntityId)); + } + + parentEntityInfo.GetChildEntities(results); + } + + /// + /// 获取所有子实体。 + /// + /// 要获取所有子实体的父实体。 + /// 所有子实体。 + public IEntity[] GetChildEntities(IEntity parentEntity) + { + if (parentEntity == null) + { + throw new GameFrameworkException("Parent entity is invalid."); + } + + return GetChildEntities(parentEntity.Id); + } + + /// + /// 获取所有子实体。 + /// + /// 要获取所有子实体的父实体。 + /// 所有子实体。 + public void GetChildEntities(IEntity parentEntity, List results) + { + if (parentEntity == null) + { + throw new GameFrameworkException("Parent entity is invalid."); + } + + GetChildEntities(parentEntity.Id, results); + } + + /// + /// 附加子实体。 + /// + /// 要附加的子实体的实体编号。 + /// 被附加的父实体的实体编号。 + public void AttachEntity(int childEntityId, int parentEntityId) + { + AttachEntity(childEntityId, parentEntityId, null); + } + + /// + /// 附加子实体。 + /// + /// 要附加的子实体的实体编号。 + /// 被附加的父实体的实体编号。 + /// 用户自定义数据。 + public void AttachEntity(int childEntityId, int parentEntityId, object userData) + { + if (childEntityId == parentEntityId) + { + throw new GameFrameworkException(Utility.Text.Format("Can not attach entity when child entity id equals to parent entity id '{0}'.", parentEntityId)); + } + + EntityInfo childEntityInfo = GetEntityInfo(childEntityId); + if (childEntityInfo == null) + { + throw new GameFrameworkException(Utility.Text.Format("Can not find child entity '{0}'.", childEntityId)); + } + + if (childEntityInfo.Status >= EntityStatus.WillHide) + { + throw new GameFrameworkException(Utility.Text.Format("Can not attach entity when child entity status is '{0}'.", childEntityInfo.Status)); + } + + EntityInfo parentEntityInfo = GetEntityInfo(parentEntityId); + if (parentEntityInfo == null) + { + throw new GameFrameworkException(Utility.Text.Format("Can not find parent entity '{0}'.", parentEntityId)); + } + + if (parentEntityInfo.Status >= EntityStatus.WillHide) + { + throw new GameFrameworkException(Utility.Text.Format("Can not attach entity when parent entity status is '{0}'.", parentEntityInfo.Status)); + } + + IEntity childEntity = childEntityInfo.Entity; + IEntity parentEntity = parentEntityInfo.Entity; + DetachEntity(childEntity.Id, userData); + childEntityInfo.ParentEntity = parentEntity; + parentEntityInfo.AddChildEntity(childEntity); + parentEntity.OnAttached(childEntity, userData); + childEntity.OnAttachTo(parentEntity, userData); + } + + /// + /// 附加子实体。 + /// + /// 要附加的子实体的实体编号。 + /// 被附加的父实体。 + public void AttachEntity(int childEntityId, IEntity parentEntity) + { + AttachEntity(childEntityId, parentEntity, null); + } + + /// + /// 附加子实体。 + /// + /// 要附加的子实体的实体编号。 + /// 被附加的父实体。 + /// 用户自定义数据。 + public void AttachEntity(int childEntityId, IEntity parentEntity, object userData) + { + if (parentEntity == null) + { + throw new GameFrameworkException("Parent entity is invalid."); + } + + AttachEntity(childEntityId, parentEntity.Id, userData); + } + + /// + /// 附加子实体。 + /// + /// 要附加的子实体。 + /// 被附加的父实体的实体编号。 + public void AttachEntity(IEntity childEntity, int parentEntityId) + { + AttachEntity(childEntity, parentEntityId, null); + } + + /// + /// 附加子实体。 + /// + /// 要附加的子实体。 + /// 被附加的父实体的实体编号。 + /// 用户自定义数据。 + public void AttachEntity(IEntity childEntity, int parentEntityId, object userData) + { + if (childEntity == null) + { + throw new GameFrameworkException("Child entity is invalid."); + } + + AttachEntity(childEntity.Id, parentEntityId, userData); + } + + /// + /// 附加子实体。 + /// + /// 要附加的子实体。 + /// 被附加的父实体。 + public void AttachEntity(IEntity childEntity, IEntity parentEntity) + { + AttachEntity(childEntity, parentEntity, null); + } + + /// + /// 附加子实体。 + /// + /// 要附加的子实体。 + /// 被附加的父实体。 + /// 用户自定义数据。 + public void AttachEntity(IEntity childEntity, IEntity parentEntity, object userData) + { + if (childEntity == null) + { + throw new GameFrameworkException("Child entity is invalid."); + } + + if (parentEntity == null) + { + throw new GameFrameworkException("Parent entity is invalid."); + } + + AttachEntity(childEntity.Id, parentEntity.Id, userData); + } + + /// + /// 解除子实体。 + /// + /// 要解除的子实体的实体编号。 + public void DetachEntity(int childEntityId) + { + DetachEntity(childEntityId, null); + } + + /// + /// 解除子实体。 + /// + /// 要解除的子实体的实体编号。 + /// 用户自定义数据。 + public void DetachEntity(int childEntityId, object userData) + { + EntityInfo childEntityInfo = GetEntityInfo(childEntityId); + if (childEntityInfo == null) + { + throw new GameFrameworkException(Utility.Text.Format("Can not find child entity '{0}'.", childEntityId)); + } + + IEntity parentEntity = childEntityInfo.ParentEntity; + if (parentEntity == null) + { + return; + } + + EntityInfo parentEntityInfo = GetEntityInfo(parentEntity.Id); + if (parentEntityInfo == null) + { + throw new GameFrameworkException(Utility.Text.Format("Can not find parent entity '{0}'.", parentEntity.Id)); + } + + IEntity childEntity = childEntityInfo.Entity; + childEntityInfo.ParentEntity = null; + parentEntityInfo.RemoveChildEntity(childEntity); + parentEntity.OnDetached(childEntity, userData); + childEntity.OnDetachFrom(parentEntity, userData); + } + + /// + /// 解除子实体。 + /// + /// 要解除的子实体。 + public void DetachEntity(IEntity childEntity) + { + DetachEntity(childEntity, null); + } + + /// + /// 解除子实体。 + /// + /// 要解除的子实体。 + /// 用户自定义数据。 + public void DetachEntity(IEntity childEntity, object userData) + { + if (childEntity == null) + { + throw new GameFrameworkException("Child entity is invalid."); + } + + DetachEntity(childEntity.Id, userData); + } + + /// + /// 解除所有子实体。 + /// + /// 被解除的父实体的实体编号。 + public void DetachChildEntities(int parentEntityId) + { + DetachChildEntities(parentEntityId, null); + } + + /// + /// 解除所有子实体。 + /// + /// 被解除的父实体的实体编号。 + /// 用户自定义数据。 + public void DetachChildEntities(int parentEntityId, object userData) + { + EntityInfo parentEntityInfo = GetEntityInfo(parentEntityId); + if (parentEntityInfo == null) + { + throw new GameFrameworkException(Utility.Text.Format("Can not find parent entity '{0}'.", parentEntityId)); + } + + while (parentEntityInfo.ChildEntityCount > 0) + { + IEntity childEntity = parentEntityInfo.GetChildEntity(); + DetachEntity(childEntity.Id, userData); + } + } + + /// + /// 解除所有子实体。 + /// + /// 被解除的父实体。 + public void DetachChildEntities(IEntity parentEntity) + { + DetachChildEntities(parentEntity, null); + } + + /// + /// 解除所有子实体。 + /// + /// 被解除的父实体。 + /// 用户自定义数据。 + public void DetachChildEntities(IEntity parentEntity, object userData) + { + if (parentEntity == null) + { + throw new GameFrameworkException("Parent entity is invalid."); + } + + DetachChildEntities(parentEntity.Id, userData); + } + + /// + /// 获取实体信息。 + /// + /// 实体编号。 + /// 实体信息。 + private EntityInfo GetEntityInfo(int entityId) + { + if (_entityInfos.TryGetValue(entityId, out var entityInfo)) + { + return entityInfo; + } + + return null; + } + + private IEntity InternalShowEntity(int entityId, string entityAssetName, EntityGroup entityGroup, object entityInstance, bool isNewInstance, float duration, object userData) + { + try + { + IEntity entity = _entityHelper.CreateEntity(entityInstance, entityGroup, userData); + if (entity == null) + { + throw new GameFrameworkException("Can not create entity in entity helper."); + } + + EntityInfo entityInfo = EntityInfo.Create(entity); + _entityInfos.Add(entityId, entityInfo); + entityInfo.Status = EntityStatus.WillInit; + entity.OnInit(entityId, entityAssetName, entityGroup, isNewInstance, userData); + entityInfo.Status = EntityStatus.Inited; + entityGroup.AddEntity(entity); + entityInfo.Status = EntityStatus.WillShow; + entity.OnShow(userData); + entityInfo.Status = EntityStatus.Showed; + + if (_showEntitySuccessEventHandler != null) + { + TEngine.ShowEntityInfo showEntityInfo = (TEngine.ShowEntityInfo)userData; + Type entityLogicType = showEntityInfo.EntityLogicType; + _showEntitySuccessEventHandler.Invoke(entityLogicType, entity, duration, userData); + } + return entity; + } + catch (Exception exception) + { + if (_showEntityFailureEventHandler != null) + { + TEngine.ShowEntityInfo showEntityInfo = (TEngine.ShowEntityInfo)userData; + Type entityLogicType = showEntityInfo.EntityLogicType; + _showEntityFailureEventHandler.Invoke(entityId,entityLogicType,entityAssetName, entityGroup.Name, exception.ToString(), userData); + return null; + } + + throw; + } + } + + private void InternalHideEntity(EntityInfo entityInfo, object userData) + { + while (entityInfo.ChildEntityCount > 0) + { + IEntity childEntity = entityInfo.GetChildEntity(); + HideEntity(childEntity.Id, userData); + } + + if (entityInfo.Status == EntityStatus.Hidden) + { + return; + } + + IEntity entity = entityInfo.Entity; + DetachEntity(entity.Id, userData); + entityInfo.Status = EntityStatus.WillHide; + entity.OnHide(_isShutdown, userData); + entityInfo.Status = EntityStatus.Hidden; + + EntityGroup entityGroup = (EntityGroup)entity.EntityGroup; + if (entityGroup == null) + { + throw new GameFrameworkException("Entity group is invalid."); + } + + entityGroup.RemoveEntity(entity); + if (!_entityInfos.Remove(entity.Id)) + { + throw new GameFrameworkException("Entity info is unmanaged."); + } + + if (_hideEntityCompleteEventHandler != null) + { + _hideEntityCompleteEventHandler.Invoke(entity.Id, entity.EntityAssetName, entityGroup.Name, userData); + } + + _recycleQueue.Enqueue(entityInfo); + } + + private IEntity LoadAssetSuccessCallback(string entityAssetName, object entityAsset, float duration, object userData) + { + ShowEntityInfo showEntityInfo = (ShowEntityInfo)userData; + if (showEntityInfo == null) + { + throw new GameFrameworkException("Show entity info is invalid."); + } + + if (_entitiesToReleaseOnLoad.Contains(showEntityInfo.SerialId)) + { + _entitiesToReleaseOnLoad.Remove(showEntityInfo.SerialId); + MemoryPool.Release(showEntityInfo); + _entityHelper.ReleaseEntity(entityAsset, null); + return null; + } + + _entitiesBeingLoaded.Remove(showEntityInfo.EntityId); + EntityInstanceObject entityInstanceObject = EntityInstanceObject.Create(entityAssetName, entityAsset, _entityHelper.InstantiateEntity(entityAsset), _entityHelper); + showEntityInfo.EntityGroup.RegisterEntityInstanceObject(entityInstanceObject, true); + + IEntity entity = InternalShowEntity(showEntityInfo.EntityId, entityAssetName, showEntityInfo.EntityGroup, entityInstanceObject.Target, true, duration, showEntityInfo.UserData); + MemoryPool.Release(showEntityInfo); + return entity; + } + + private void LoadAssetFailureCallback(string entityAssetName, string errorMessage, object userData) + { + ShowEntityInfo showEntityInfo = (ShowEntityInfo)userData; + if (showEntityInfo == null) + { + throw new GameFrameworkException("Show entity info is invalid."); + } + + if (_entitiesToReleaseOnLoad.Contains(showEntityInfo.SerialId)) + { + _entitiesToReleaseOnLoad.Remove(showEntityInfo.SerialId); + return; + } + + _entitiesBeingLoaded.Remove(showEntityInfo.EntityId); + string appendErrorMessage = Utility.Text.Format("Load entity failure, asset name '{0}', error message '{1}'.", entityAssetName, errorMessage); + if (_showEntityFailureEventHandler != null) + { + TEngine.ShowEntityInfo info = (TEngine.ShowEntityInfo)showEntityInfo.UserData; + Type entityLogicType = info.EntityLogicType; + _showEntityFailureEventHandler.Invoke(showEntityInfo.EntityId, entityLogicType, entityAssetName, showEntityInfo.EntityGroup.Name, appendErrorMessage, showEntityInfo.UserData); + return; + } + + throw new GameFrameworkException(appendErrorMessage); + } + } +} diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityManager.cs.meta b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityManager.cs.meta new file mode 100644 index 00000000..23658b98 --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 153f54549cf84ed4ab2b72d9f32bbd63 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityModule.EntityGroup.cs b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityModule.EntityGroup.cs new file mode 100644 index 00000000..19b850e5 --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityModule.EntityGroup.cs @@ -0,0 +1,37 @@ +using System; +using UnityEngine; + +namespace TEngine +{ + public sealed partial class EntityModule + { + [Serializable] + private sealed class EntityGroup + { + [SerializeField] + private string m_Name = null; + + [SerializeField] + private float m_InstanceAutoReleaseInterval = 60f; + + [SerializeField] + private int m_InstanceCapacity = 16; + + [SerializeField] + private float m_InstanceExpireTime = 60f; + + [SerializeField] + private int m_InstancePriority = 0; + + public string Name => m_Name; + + public float InstanceAutoReleaseInterval => m_InstanceAutoReleaseInterval; + + public int InstanceCapacity => m_InstanceCapacity; + + public float InstanceExpireTime => m_InstanceExpireTime; + + public int InstancePriority => m_InstancePriority; + } + } +} diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityModule.EntityGroup.cs.meta b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityModule.EntityGroup.cs.meta new file mode 100644 index 00000000..c12b4fb5 --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityModule.EntityGroup.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d93d1ae840acb2f449ac5f5cad2d0259 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityModule.cs b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityModule.cs new file mode 100644 index 00000000..42d04428 --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityModule.cs @@ -0,0 +1,1110 @@ +using System; +using System.Collections.Generic; +using Cysharp.Threading.Tasks; +using UnityEngine; + +namespace TEngine +{ + /// + /// 实体组件。 + /// + [DisallowMultipleComponent] + public sealed partial class EntityModule : MonoBehaviour + { + public const int DefaultPriority = 0; + + private IEntityManager m_EntityManager = null; + + private readonly List m_InternalEntityResults = new List(); + + [SerializeField] + private Transform m_InstanceRoot = null; + + [SerializeField] + private string m_EntityHelperTypeName = "TEngine.DefaultEntityHelper"; + + [SerializeField] + private EntityHelperBase m_CustomEntityHelper = null; + + [SerializeField] + private string m_EntityGroupHelperTypeName = "TEngine.DefaultEntityGroupHelper"; + + [SerializeField] + private EntityGroupHelperBase m_CustomEntityGroupHelper = null; + + [SerializeField] + private EntityGroup[] m_EntityGroups = null; + + /// + /// 获取实体数量。 + /// + public int EntityCount => m_EntityManager.EntityCount; + + /// + /// 获取实体组数量。 + /// + public int EntityGroupCount => m_EntityManager.EntityGroupCount; + + /// + /// 游戏框架组件初始化。 + /// + private void Awake() + { + m_EntityManager = ModuleSystem.GetModule(); + if (m_EntityManager == null) + { + Log.Fatal("Entity manager is invalid."); + return; + } + + m_EntityManager.ShowEntitySuccess += OnShowEntitySuccess; + m_EntityManager.ShowEntityFailure += OnShowEntityFailure; + m_EntityManager.HideEntityComplete += OnHideEntityComplete; + } + + private void Start() + { + m_EntityManager.SetResourceManager(ModuleSystem.GetModule()); + + m_EntityManager.SetObjectPoolManager(ModuleSystem.GetModule()); + + GameObject defaultEntityHelper = new GameObject("Default Entity Helper"); + defaultEntityHelper.transform.SetParent(this.transform); + defaultEntityHelper.AddComponent(); + + EntityHelperBase entityHelper = defaultEntityHelper.AddComponent();//Helper.CreateHelper(m_EntityHelperTypeName, m_CustomEntityHelper); + if (entityHelper == null) + { + Log.Error("Can not create entity helper."); + return; + } + + entityHelper.name = "Entity Helper"; + Transform entityHelperTransform = entityHelper.transform; + entityHelperTransform.SetParent(this.transform); + entityHelperTransform.localScale = Vector3.one; + + m_EntityManager.SetEntityHelper(entityHelper); + + if (m_InstanceRoot == null) + { + m_InstanceRoot = new GameObject("Entity Instances").transform; + m_InstanceRoot.SetParent(gameObject.transform); + m_InstanceRoot.localScale = Vector3.one; + } + DontDestroyOnLoad(m_InstanceRoot); + + for (int i = 0; i < m_EntityGroups.Length; i++) + { + if (!AddEntityGroup(m_EntityGroups[i].Name, m_EntityGroups[i].InstanceAutoReleaseInterval, m_EntityGroups[i].InstanceCapacity, m_EntityGroups[i].InstanceExpireTime, m_EntityGroups[i].InstancePriority)) + { + Log.Warning("Add entity group '{0}' failure.", m_EntityGroups[i].Name); + continue; + } + } + } + + /// + /// 是否存在实体组。 + /// + /// 实体组名称。 + /// 是否存在实体组。 + public bool HasEntityGroup(string entityGroupName) + { + return m_EntityManager.HasEntityGroup(entityGroupName); + } + + /// + /// 获取实体组。 + /// + /// 实体组名称。 + /// 要获取的实体组。 + public IEntityGroup GetEntityGroup(string entityGroupName) + { + return m_EntityManager.GetEntityGroup(entityGroupName); + } + + /// + /// 获取所有实体组。 + /// + /// 所有实体组。 + public IEntityGroup[] GetAllEntityGroups() + { + return m_EntityManager.GetAllEntityGroups(); + } + + /// + /// 获取所有实体组。 + /// + /// 所有实体组。 + public void GetAllEntityGroups(List results) + { + m_EntityManager.GetAllEntityGroups(results); + } + + /// + /// 增加实体组。 + /// + /// 实体组名称。 + /// 实体实例对象池自动释放可释放对象的间隔秒数。 + /// 实体实例对象池容量。 + /// 实体实例对象池对象过期秒数。 + /// 实体实例对象池的优先级。 + /// 是否增加实体组成功。 + public bool AddEntityGroup(string entityGroupName, float instanceAutoReleaseInterval, int instanceCapacity, float instanceExpireTime, int instancePriority) + { + if (m_EntityManager.HasEntityGroup(entityGroupName)) + { + return false; + } + + GameObject defaultEntityGroupHelper = new GameObject("Default Entity GroupHelper"); + defaultEntityGroupHelper.transform.SetParent(this.transform); + + EntityGroupHelperBase entityGroupHelper = defaultEntityGroupHelper.AddComponent();//Helper.CreateHelper(m_EntityGroupHelperTypeName, m_CustomEntityGroupHelper, EntityGroupCount); + if (entityGroupHelper == null) + { + Log.Error("Can not create entity group helper."); + return false; + } + + entityGroupHelper.name = Utility.Text.Format("Entity Group - {0}", entityGroupName); + Transform entityTransform = entityGroupHelper.transform; + entityTransform.SetParent(m_InstanceRoot); + entityTransform.localScale = Vector3.one; + + return m_EntityManager.AddEntityGroup(entityGroupName, instanceAutoReleaseInterval, instanceCapacity, instanceExpireTime, instancePriority, entityGroupHelper); + } + + /// + /// 是否存在实体。 + /// + /// 实体编号。 + /// 是否存在实体。 + public bool HasEntity(int entityId) + { + return m_EntityManager.HasEntity(entityId); + } + + /// + /// 是否存在实体。 + /// + /// 实体资源名称。 + /// 是否存在实体。 + public bool HasEntity(string entityAssetName) + { + return m_EntityManager.HasEntity(entityAssetName); + } + + /// + /// 获取实体。 + /// + /// 实体编号。 + /// 实体。 + public Entity GetEntity(int entityId) + { + return (Entity)m_EntityManager.GetEntity(entityId); + } + + /// + /// 获取实体。 + /// + /// 实体资源名称。 + /// 要获取的实体。 + public Entity GetEntity(string entityAssetName) + { + return (Entity)m_EntityManager.GetEntity(entityAssetName); + } + + /// + /// 获取实体。 + /// + /// 实体资源名称。 + /// 要获取的实体。 + public Entity[] GetEntities(string entityAssetName) + { + IEntity[] entities = m_EntityManager.GetEntities(entityAssetName); + Entity[] entityImpls = new Entity[entities.Length]; + for (int i = 0; i < entities.Length; i++) + { + entityImpls[i] = (Entity)entities[i]; + } + + return entityImpls; + } + + /// + /// 获取实体。 + /// + /// 实体资源名称。 + /// 要获取的实体。 + public void GetEntities(string entityAssetName, List results) + { + if (results == null) + { + Log.Error("Results is invalid."); + return; + } + + results.Clear(); + m_EntityManager.GetEntities(entityAssetName, m_InternalEntityResults); + foreach (IEntity entity in m_InternalEntityResults) + { + results.Add((Entity)entity); + } + } + + /// + /// 获取所有已加载的实体。 + /// + /// 所有已加载的实体。 + public Entity[] GetAllLoadedEntities() + { + IEntity[] entities = m_EntityManager.GetAllLoadedEntities(); + Entity[] entityImpls = new Entity[entities.Length]; + for (int i = 0; i < entities.Length; i++) + { + entityImpls[i] = (Entity)entities[i]; + } + + return entityImpls; + } + + /// + /// 获取所有已加载的实体。 + /// + /// 所有已加载的实体。 + public void GetAllLoadedEntities(List results) + { + if (results == null) + { + Log.Error("Results is invalid."); + return; + } + + results.Clear(); + m_EntityManager.GetAllLoadedEntities(m_InternalEntityResults); + foreach (IEntity entity in m_InternalEntityResults) + { + results.Add((Entity)entity); + } + } + + /// + /// 获取所有正在加载实体的编号。 + /// + /// 所有正在加载实体的编号。 + public int[] GetAllLoadingEntityIds() + { + return m_EntityManager.GetAllLoadingEntityIds(); + } + + /// + /// 获取所有正在加载实体的编号。 + /// + /// 所有正在加载实体的编号。 + public void GetAllLoadingEntityIds(List results) + { + m_EntityManager.GetAllLoadingEntityIds(results); + } + + /// + /// 是否正在加载实体。 + /// + /// 实体编号。 + /// 是否正在加载实体。 + public bool IsLoadingEntity(int entityId) + { + return m_EntityManager.IsLoadingEntity(entityId); + } + + /// + /// 是否是合法的实体。 + /// + /// 实体。 + /// 实体是否合法。 + public bool IsValidEntity(Entity entity) + { + return m_EntityManager.IsValidEntity(entity); + } + + /// + /// 显示实体。 + /// + /// 实体逻辑类型。 + /// 实体编号。 + /// 实体资源名称。 + /// 实体组名称。 + public void ShowEntity(int entityId, string entityAssetName, string entityGroupName) where T : EntityLogic + { + ShowEntity(entityId, typeof(T), entityAssetName, entityGroupName, DefaultPriority, null); + } + + /// + /// 显示实体。 + /// + /// 实体编号。 + /// 实体逻辑类型。 + /// 实体资源名称。 + /// 实体组名称。 + public void ShowEntity(int entityId, Type entityLogicType, string entityAssetName, string entityGroupName) + { + ShowEntity(entityId, entityLogicType, entityAssetName, entityGroupName, DefaultPriority, null); + } + + /// + /// 显示实体。 + /// + /// 实体逻辑类型。 + /// 实体编号。 + /// 实体资源名称。 + /// 实体组名称。 + /// 加载实体资源的优先级。 + public void ShowEntity(int entityId, string entityAssetName, string entityGroupName, int priority) where T : EntityLogic + { + ShowEntity(entityId, typeof(T), entityAssetName, entityGroupName, priority, null); + } + + /// + /// 显示实体。 + /// + /// 实体编号。 + /// 实体逻辑类型。 + /// 实体资源名称。 + /// 实体组名称。 + /// 加载实体资源的优先级。 + public void ShowEntity(int entityId, Type entityLogicType, string entityAssetName, string entityGroupName, int priority) + { + ShowEntity(entityId, entityLogicType, entityAssetName, entityGroupName, priority, null); + } + + /// + /// 显示实体。 + /// + /// 实体逻辑类型。 + /// 实体编号。 + /// 实体资源名称。 + /// 实体组名称。 + /// 用户自定义数据。 + public void ShowEntity(int entityId, string entityAssetName, string entityGroupName, object userData) where T : EntityLogic + { + ShowEntity(entityId, typeof(T), entityAssetName, entityGroupName, DefaultPriority, userData); + } + + /// + /// 显示实体。 + /// + /// 实体编号。 + /// 实体逻辑类型。 + /// 实体资源名称。 + /// 实体组名称。 + /// 用户自定义数据。 + public void ShowEntity(int entityId, Type entityLogicType, string entityAssetName, string entityGroupName, object userData) + { + ShowEntity(entityId, entityLogicType, entityAssetName, entityGroupName, DefaultPriority, userData); + } + + /// + /// 显示实体。 + /// + /// 实体逻辑类型。 + /// 实体编号。 + /// 实体资源名称。 + /// 实体组名称。 + /// 加载实体资源的优先级。 + /// 用户自定义数据。 + public void ShowEntity(int entityId, string entityAssetName, string entityGroupName, int priority, object userData) where T : EntityLogic + { + ShowEntity(entityId, typeof(T), entityAssetName, entityGroupName, priority, userData); + } + + /// + /// 显示实体。 + /// + /// 实体编号。 + /// 实体逻辑类型。 + /// 实体资源名称。 + /// 实体组名称。 + /// 加载实体资源的优先级。 + /// 用户自定义数据。 + public void ShowEntity(int entityId, Type entityLogicType, string entityAssetName, string entityGroupName, int priority, object userData) + { + if (entityLogicType == null) + { + Log.Error("Entity type is invalid."); + return; + } + + m_EntityManager.ShowEntity(entityId, entityAssetName, entityGroupName, priority, ShowEntityInfo.Create(entityLogicType, userData)); + } + + /// + /// 同步显示实体。 + /// + /// 实体编号。 + /// 实体资源名称。 + /// 实体组名称。 + /// 加载实体资源的优先级。 + /// 用户自定义数据。 + public T ShowEntitySync(int entityId, string entityAssetName, string entityGroupName, int priority = 0, object userData = null) where T : class + { + return m_EntityManager.ShowEntitySync(entityId, entityAssetName, entityGroupName, priority, ShowEntityInfo.Create(typeof(T), userData)); + } + + /// + /// 异步显示实体。 + /// + /// 实体编号。 + /// 实体资源名称。 + /// 实体组名称。 + /// 加载实体资源的优先级。 + /// 用户自定义数据。 + public async UniTask ShowEntityAsync(int entityId, string entityAssetName, string entityGroupName, int priority = 0, object userData = null) where T : class + { + return await m_EntityManager.ShowEntityAsync(entityId, entityAssetName, entityGroupName, priority, ShowEntityInfo.Create(typeof(T), userData)); + } + + /// + /// 隐藏实体。 + /// + /// 实体编号。 + public void HideEntity(int entityId) + { + m_EntityManager.HideEntity(entityId); + } + + /// + /// 隐藏实体。 + /// + /// 实体编号。 + /// 用户自定义数据。 + public void HideEntity(int entityId, object userData) + { + m_EntityManager.HideEntity(entityId, userData); + } + + /// + /// 隐藏实体。 + /// + /// 实体。 + public void HideEntity(Entity entity) + { + m_EntityManager.HideEntity(entity); + } + + /// + /// 隐藏实体。 + /// + /// 实体。 + /// 用户自定义数据。 + public void HideEntity(Entity entity, object userData) + { + m_EntityManager.HideEntity(entity, userData); + } + + /// + /// 隐藏所有已加载的实体。 + /// + public void HideAllLoadedEntities() + { + m_EntityManager.HideAllLoadedEntities(); + } + + /// + /// 隐藏所有已加载的实体。 + /// + /// 用户自定义数据。 + public void HideAllLoadedEntities(object userData) + { + m_EntityManager.HideAllLoadedEntities(userData); + } + + /// + /// 隐藏所有正在加载的实体。 + /// + public void HideAllLoadingEntities() + { + m_EntityManager.HideAllLoadingEntities(); + } + + /// + /// 获取父实体。 + /// + /// 要获取父实体的子实体的实体编号。 + /// 子实体的父实体。 + public Entity GetParentEntity(int childEntityId) + { + return (Entity)m_EntityManager.GetParentEntity(childEntityId); + } + + /// + /// 获取父实体。 + /// + /// 要获取父实体的子实体。 + /// 子实体的父实体。 + public Entity GetParentEntity(Entity childEntity) + { + return (Entity)m_EntityManager.GetParentEntity(childEntity); + } + + /// + /// 获取子实体数量。 + /// + /// 要获取子实体数量的父实体的实体编号。 + /// 子实体数量。 + public int GetChildEntityCount(int parentEntityId) + { + return m_EntityManager.GetChildEntityCount(parentEntityId); + } + + /// + /// 获取子实体。 + /// + /// 要获取子实体的父实体的实体编号。 + /// 子实体。 + public Entity GetChildEntity(int parentEntityId) + { + return (Entity)m_EntityManager.GetChildEntity(parentEntityId); + } + + /// + /// 获取子实体。 + /// + /// 要获取子实体的父实体。 + /// 子实体。 + public Entity GetChildEntity(IEntity parentEntity) + { + return (Entity)m_EntityManager.GetChildEntity(parentEntity); + } + + /// + /// 获取所有子实体。 + /// + /// 要获取所有子实体的父实体的实体编号。 + /// 所有子实体。 + public Entity[] GetChildEntities(int parentEntityId) + { + IEntity[] entities = m_EntityManager.GetChildEntities(parentEntityId); + Entity[] entityImpls = new Entity[entities.Length]; + for (int i = 0; i < entities.Length; i++) + { + entityImpls[i] = (Entity)entities[i]; + } + + return entityImpls; + } + + /// + /// 获取所有子实体。 + /// + /// 要获取所有子实体的父实体的实体编号。 + /// 所有子实体。 + public void GetChildEntities(int parentEntityId, List results) + { + if (results == null) + { + Log.Error("Results is invalid."); + return; + } + + results.Clear(); + m_EntityManager.GetChildEntities(parentEntityId, m_InternalEntityResults); + foreach (IEntity entity in m_InternalEntityResults) + { + results.Add((Entity)entity); + } + } + + /// + /// 获取所有子实体。 + /// + /// 要获取所有子实体的父实体。 + /// 所有子实体。 + public Entity[] GetChildEntities(Entity parentEntity) + { + IEntity[] entities = m_EntityManager.GetChildEntities(parentEntity); + Entity[] entityImpls = new Entity[entities.Length]; + for (int i = 0; i < entities.Length; i++) + { + entityImpls[i] = (Entity)entities[i]; + } + + return entityImpls; + } + + /// + /// 获取所有子实体。 + /// + /// 要获取所有子实体的父实体。 + /// 所有子实体。 + public void GetChildEntities(IEntity parentEntity, List results) + { + if (results == null) + { + Log.Error("Results is invalid."); + return; + } + + results.Clear(); + m_EntityManager.GetChildEntities(parentEntity, m_InternalEntityResults); + foreach (IEntity entity in m_InternalEntityResults) + { + results.Add((Entity)entity); + } + } + + /// + /// 附加子实体。 + /// + /// 要附加的子实体的实体编号。 + /// 被附加的父实体的实体编号。 + public void AttachEntity(int childEntityId, int parentEntityId) + { + AttachEntity(GetEntity(childEntityId), GetEntity(parentEntityId), string.Empty, null); + } + + /// + /// 附加子实体。 + /// + /// 要附加的子实体的实体编号。 + /// 被附加的父实体。 + public void AttachEntity(int childEntityId, Entity parentEntity) + { + AttachEntity(GetEntity(childEntityId), parentEntity, string.Empty, null); + } + + /// + /// 附加子实体。 + /// + /// 要附加的子实体。 + /// 被附加的父实体的实体编号。 + public void AttachEntity(Entity childEntity, int parentEntityId) + { + AttachEntity(childEntity, GetEntity(parentEntityId), string.Empty, null); + } + + /// + /// 附加子实体。 + /// + /// 要附加的子实体。 + /// 被附加的父实体。 + public void AttachEntity(Entity childEntity, Entity parentEntity) + { + AttachEntity(childEntity, parentEntity, string.Empty, null); + } + + /// + /// 附加子实体。 + /// + /// 要附加的子实体的实体编号。 + /// 被附加的父实体的实体编号。 + /// 相对于被附加父实体的位置。 + public void AttachEntity(int childEntityId, int parentEntityId, string parentTransformPath) + { + AttachEntity(GetEntity(childEntityId), GetEntity(parentEntityId), parentTransformPath, null); + } + + /// + /// 附加子实体。 + /// + /// 要附加的子实体的实体编号。 + /// 被附加的父实体。 + /// 相对于被附加父实体的位置。 + public void AttachEntity(int childEntityId, Entity parentEntity, string parentTransformPath) + { + AttachEntity(GetEntity(childEntityId), parentEntity, parentTransformPath, null); + } + + /// + /// 附加子实体。 + /// + /// 要附加的子实体。 + /// 被附加的父实体的实体编号。 + /// 相对于被附加父实体的位置。 + public void AttachEntity(Entity childEntity, int parentEntityId, string parentTransformPath) + { + AttachEntity(childEntity, GetEntity(parentEntityId), parentTransformPath, null); + } + + /// + /// 附加子实体。 + /// + /// 要附加的子实体。 + /// 被附加的父实体。 + /// 相对于被附加父实体的位置。 + public void AttachEntity(Entity childEntity, Entity parentEntity, string parentTransformPath) + { + AttachEntity(childEntity, parentEntity, parentTransformPath, null); + } + + /// + /// 附加子实体。 + /// + /// 要附加的子实体的实体编号。 + /// 被附加的父实体的实体编号。 + /// 相对于被附加父实体的位置。 + public void AttachEntity(int childEntityId, int parentEntityId, Transform parentTransform) + { + AttachEntity(GetEntity(childEntityId), GetEntity(parentEntityId), parentTransform, null); + } + + /// + /// 附加子实体。 + /// + /// 要附加的子实体的实体编号。 + /// 被附加的父实体。 + /// 相对于被附加父实体的位置。 + public void AttachEntity(int childEntityId, Entity parentEntity, Transform parentTransform) + { + AttachEntity(GetEntity(childEntityId), parentEntity, parentTransform, null); + } + + /// + /// 附加子实体。 + /// + /// 要附加的子实体。 + /// 被附加的父实体的实体编号。 + /// 相对于被附加父实体的位置。 + public void AttachEntity(Entity childEntity, int parentEntityId, Transform parentTransform) + { + AttachEntity(childEntity, GetEntity(parentEntityId), parentTransform, null); + } + + /// + /// 附加子实体。 + /// + /// 要附加的子实体。 + /// 被附加的父实体。 + /// 相对于被附加父实体的位置。 + public void AttachEntity(Entity childEntity, Entity parentEntity, Transform parentTransform) + { + AttachEntity(childEntity, parentEntity, parentTransform, null); + } + + /// + /// 附加子实体。 + /// + /// 要附加的子实体的实体编号。 + /// 被附加的父实体的实体编号。 + /// 用户自定义数据。 + public void AttachEntity(int childEntityId, int parentEntityId, object userData) + { + AttachEntity(GetEntity(childEntityId), GetEntity(parentEntityId), string.Empty, userData); + } + + /// + /// 附加子实体。 + /// + /// 要附加的子实体的实体编号。 + /// 被附加的父实体。 + /// 用户自定义数据。 + public void AttachEntity(int childEntityId, Entity parentEntity, object userData) + { + AttachEntity(GetEntity(childEntityId), parentEntity, string.Empty, userData); + } + + /// + /// 附加子实体。 + /// + /// 要附加的子实体。 + /// 被附加的父实体的实体编号。 + /// 用户自定义数据。 + public void AttachEntity(Entity childEntity, int parentEntityId, object userData) + { + AttachEntity(childEntity, GetEntity(parentEntityId), string.Empty, userData); + } + + /// + /// 附加子实体。 + /// + /// 要附加的子实体。 + /// 被附加的父实体。 + /// 用户自定义数据。 + public void AttachEntity(Entity childEntity, Entity parentEntity, object userData) + { + AttachEntity(childEntity, parentEntity, string.Empty, userData); + } + + /// + /// 附加子实体。 + /// + /// 要附加的子实体的实体编号。 + /// 被附加的父实体的实体编号。 + /// 相对于被附加父实体的位置。 + /// 用户自定义数据。 + public void AttachEntity(int childEntityId, int parentEntityId, string parentTransformPath, object userData) + { + AttachEntity(GetEntity(childEntityId), GetEntity(parentEntityId), parentTransformPath, userData); + } + + /// + /// 附加子实体。 + /// + /// 要附加的子实体的实体编号。 + /// 被附加的父实体。 + /// 相对于被附加父实体的位置。 + /// 用户自定义数据。 + public void AttachEntity(int childEntityId, Entity parentEntity, string parentTransformPath, object userData) + { + AttachEntity(GetEntity(childEntityId), parentEntity, parentTransformPath, userData); + } + + /// + /// 附加子实体。 + /// + /// 要附加的子实体。 + /// 被附加的父实体的实体编号。 + /// 相对于被附加父实体的位置。 + /// 用户自定义数据。 + public void AttachEntity(Entity childEntity, int parentEntityId, string parentTransformPath, object userData) + { + AttachEntity(childEntity, GetEntity(parentEntityId), parentTransformPath, userData); + } + + /// + /// 附加子实体。 + /// + /// 要附加的子实体。 + /// 被附加的父实体。 + /// 相对于被附加父实体的位置。 + /// 用户自定义数据。 + public void AttachEntity(Entity childEntity, Entity parentEntity, string parentTransformPath, object userData) + { + if (childEntity == null) + { + Log.Warning("Child entity is invalid."); + return; + } + + if (parentEntity == null) + { + Log.Warning("Parent entity is invalid."); + return; + } + + Transform parentTransform = null; + if (string.IsNullOrEmpty(parentTransformPath)) + { + parentTransform = parentEntity.Logic.CachedTransform; + } + else + { + parentTransform = parentEntity.Logic.CachedTransform.Find(parentTransformPath); + if (parentTransform == null) + { + Log.Warning("Can not find transform path '{0}' from parent entity '{1}'.", parentTransformPath, parentEntity.Logic.Name); + parentTransform = parentEntity.Logic.CachedTransform; + } + } + + AttachEntity(childEntity, parentEntity, parentTransform, userData); + } + + /// + /// 附加子实体。 + /// + /// 要附加的子实体的实体编号。 + /// 被附加的父实体的实体编号。 + /// 相对于被附加父实体的位置。 + /// 用户自定义数据。 + public void AttachEntity(int childEntityId, int parentEntityId, Transform parentTransform, object userData) + { + AttachEntity(GetEntity(childEntityId), GetEntity(parentEntityId), parentTransform, userData); + } + + /// + /// 附加子实体。 + /// + /// 要附加的子实体的实体编号。 + /// 被附加的父实体。 + /// 相对于被附加父实体的位置。 + /// 用户自定义数据。 + public void AttachEntity(int childEntityId, Entity parentEntity, Transform parentTransform, object userData) + { + AttachEntity(GetEntity(childEntityId), parentEntity, parentTransform, userData); + } + + /// + /// 附加子实体。 + /// + /// 要附加的子实体。 + /// 被附加的父实体的实体编号。 + /// 相对于被附加父实体的位置。 + /// 用户自定义数据。 + public void AttachEntity(Entity childEntity, int parentEntityId, Transform parentTransform, object userData) + { + AttachEntity(childEntity, GetEntity(parentEntityId), parentTransform, userData); + } + + /// + /// 附加子实体。 + /// + /// 要附加的子实体。 + /// 被附加的父实体。 + /// 相对于被附加父实体的位置。 + /// 用户自定义数据。 + public void AttachEntity(Entity childEntity, Entity parentEntity, Transform parentTransform, object userData) + { + if (childEntity == null) + { + Log.Warning("Child entity is invalid."); + return; + } + + if (parentEntity == null) + { + Log.Warning("Parent entity is invalid."); + return; + } + + if (parentTransform == null) + { + parentTransform = parentEntity.Logic.CachedTransform; + } + + m_EntityManager.AttachEntity(childEntity, parentEntity, AttachEntityInfo.Create(parentTransform, userData)); + } + + /// + /// 解除子实体。 + /// + /// 要解除的子实体的实体编号。 + public void DetachEntity(int childEntityId) + { + m_EntityManager.DetachEntity(childEntityId); + } + + /// + /// 解除子实体。 + /// + /// 要解除的子实体的实体编号。 + /// 用户自定义数据。 + public void DetachEntity(int childEntityId, object userData) + { + m_EntityManager.DetachEntity(childEntityId, userData); + } + + /// + /// 解除子实体。 + /// + /// 要解除的子实体。 + public void DetachEntity(Entity childEntity) + { + m_EntityManager.DetachEntity(childEntity); + } + + /// + /// 解除子实体。 + /// + /// 要解除的子实体。 + /// 用户自定义数据。 + public void DetachEntity(Entity childEntity, object userData) + { + m_EntityManager.DetachEntity(childEntity, userData); + } + + /// + /// 解除所有子实体。 + /// + /// 被解除的父实体的实体编号。 + public void DetachChildEntities(int parentEntityId) + { + m_EntityManager.DetachChildEntities(parentEntityId); + } + + /// + /// 解除所有子实体。 + /// + /// 被解除的父实体的实体编号。 + /// 用户自定义数据。 + public void DetachChildEntities(int parentEntityId, object userData) + { + m_EntityManager.DetachChildEntities(parentEntityId, userData); + } + + /// + /// 解除所有子实体。 + /// + /// 被解除的父实体。 + public void DetachChildEntities(Entity parentEntity) + { + m_EntityManager.DetachChildEntities(parentEntity); + } + + /// + /// 解除所有子实体。 + /// + /// 被解除的父实体。 + /// 用户自定义数据。 + public void DetachChildEntities(Entity parentEntity, object userData) + { + m_EntityManager.DetachChildEntities(parentEntity, userData); + } + + /// + /// 设置实体是否被加锁。 + /// + /// 实体。 + /// 实体是否被加锁。 + public void SetEntityInstanceLocked(Entity entity, bool locked) + { + if (entity == null) + { + Log.Warning("Entity is invalid."); + return; + } + + IEntityGroup entityGroup = entity.EntityGroup; + if (entityGroup == null) + { + Log.Warning("Entity group is invalid."); + return; + } + + entityGroup.SetEntityInstanceLocked(entity.gameObject, locked); + } + + /// + /// 设置实体的优先级。 + /// + /// 实体。 + /// 实体优先级。 + public void SetInstancePriority(Entity entity, int priority) + { + if (entity == null) + { + Log.Warning("Entity is invalid."); + return; + } + + IEntityGroup entityGroup = entity.EntityGroup; + if (entityGroup == null) + { + Log.Warning("Entity group is invalid."); + return; + } + + entityGroup.SetEntityInstancePriority(entity.gameObject, priority); + } + + public static readonly int OnShowEntitySuccessEvent = RuntimeId.ToRuntimeId("OnShowEntitySuccessEvent"); + public static readonly int OnShowEntityFailureEvent = RuntimeId.ToRuntimeId("OnShowEntityFailureEvent"); + public static readonly int OnHideEntityCompleteEvent = RuntimeId.ToRuntimeId("OnHideEntityCompleteEvent"); + + private void OnShowEntitySuccess(Type entityLogicType, IEntity entity, float duration, object userData) + { + GameEvent.Send(EntityModule.OnShowEntitySuccessEvent, entityLogicType, entity, duration, userData); + } + + private void OnShowEntityFailure(int entityId, Type entityLogicType, string entityAssetName, string entityGroupName, string errorMessage, object userData) + { + Log.Warning("Show entity failure, entity id '{0}', asset name '{1}', entity group name '{2}', error message '{3}'.", entityId, entityAssetName, entityGroupName, errorMessage); + GameEvent.Send(EntityModule.OnShowEntityFailureEvent, entityId, entityLogicType, entityAssetName, entityGroupName, errorMessage, userData); + } + + private void OnHideEntityComplete(int entityId, string entityAssetName, string entityGroupName, object userData) + { + GameEvent.Send(EntityModule.OnHideEntityCompleteEvent, entityId, entityAssetName, entityGroupName, userData); + } + } +} diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityModule.cs.meta b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityModule.cs.meta new file mode 100644 index 00000000..63e55aa0 --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/EntityModule.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 58aa63e99dabf9c4fb61a9ec4ac4d8ca +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/Event.meta b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/Event.meta new file mode 100644 index 00000000..3d0d91ec --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/Event.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: b14b038f3e184ccb92a107e7ff2134d0 +timeCreated: 1696952336 \ No newline at end of file diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/Event/ActorEventHelper.cs b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/Event/ActorEventHelper.cs new file mode 100644 index 00000000..a32c22bf --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/Event/ActorEventHelper.cs @@ -0,0 +1,30 @@ +namespace TEngine +{ + public static partial class ActorEventHelper + { + public static void Send(EntityLogic actor, int eventId) + { + actor.Event.SendEvent(eventId); + } + + public static void Send(EntityLogic actor, int eventId, TArg1 info) + { + actor.Event.SendEvent(eventId, info); + } + + public static void Send(EntityLogic actor, int eventId, TArg1 info1, TU info2) + { + actor.Event.SendEvent(eventId, info1, info2); + } + + public static void Send(EntityLogic actor, int eventId, TArg1 info1, TU info2, TV info3) + { + actor.Event.SendEvent(eventId, info1, info2, info3); + } + + public static void Send(EntityLogic actor, int eventId, TArg1 info1, TU info2, TV info3, TW info4) + { + actor.Event.SendEvent(eventId, info1, info2, info3, info4); + } + } +} \ No newline at end of file diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/Event/ActorEventHelper.cs.meta b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/Event/ActorEventHelper.cs.meta new file mode 100644 index 00000000..5586283f --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/Event/ActorEventHelper.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: eef2c05ec78746369e52e9b23dc1e9ab +timeCreated: 1673512481 \ No newline at end of file diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/IEntity.cs b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/IEntity.cs new file mode 100644 index 00000000..1ce0dfad --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/IEntity.cs @@ -0,0 +1,103 @@ +namespace TEngine +{ + /// + /// 实体接口。 + /// + public interface IEntity + { + /// + /// 获取实体编号。 + /// + int Id + { + get; + } + + /// + /// 获取实体资源名称。 + /// + string EntityAssetName + { + get; + } + + /// + /// 获取实体实例。 + /// + object Handle + { + get; + } + + /// + /// 获取实体所属的实体组。 + /// + IEntityGroup EntityGroup + { + get; + } + + /// + /// 实体初始化。 + /// + /// 实体编号。 + /// 实体资源名称。 + /// 实体所属的实体组。 + /// 是否是新实例。 + /// 用户自定义数据。 + void OnInit(int entityId, string entityAssetName, IEntityGroup entityGroup, bool isNewInstance, object userData); + + /// + /// 实体回收。 + /// + void OnRecycle(); + + /// + /// 实体显示。 + /// + /// 用户自定义数据。 + void OnShow(object userData); + + /// + /// 实体隐藏。 + /// + /// 是否是关闭实体管理器时触发。 + /// 用户自定义数据。 + void OnHide(bool isShutdown, object userData); + + /// + /// 实体附加子实体。 + /// + /// 附加的子实体。 + /// 用户自定义数据。 + void OnAttached(IEntity childEntity, object userData); + + /// + /// 实体解除子实体。 + /// + /// 解除的子实体。 + /// 用户自定义数据。 + void OnDetached(IEntity childEntity, object userData); + + /// + /// 实体附加子实体。 + /// + /// 被附加的父实体。 + /// 用户自定义数据。 + void OnAttachTo(IEntity parentEntity, object userData); + + /// + /// 实体解除子实体。 + /// + /// 被解除的父实体。 + /// 用户自定义数据。 + void OnDetachFrom(IEntity parentEntity, object userData); + + /// + /// 实体轮询。 + /// + /// 逻辑流逝时间,以秒为单位。 + /// 真实流逝时间,以秒为单位。 + void OnUpdate(float elapseSeconds, float realElapseSeconds); + } +} diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/IEntity.cs.meta b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/IEntity.cs.meta new file mode 100644 index 00000000..e57879aa --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/IEntity.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 88bfaad20a8f9434aba486ffa68ba761 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/IEntityGroup.cs b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/IEntityGroup.cs new file mode 100644 index 00000000..a5d2de4c --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/IEntityGroup.cs @@ -0,0 +1,138 @@ +using System.Collections.Generic; + +namespace TEngine +{ + /// + /// 实体组接口。 + /// + public interface IEntityGroup + { + /// + /// 获取实体组名称。 + /// + string Name + { + get; + } + + /// + /// 获取实体组中实体数量。 + /// + int EntityCount + { + get; + } + + /// + /// 获取或设置实体组实例对象池自动释放可释放对象的间隔秒数。 + /// + float InstanceAutoReleaseInterval + { + get; + set; + } + + /// + /// 获取或设置实体组实例对象池的容量。 + /// + int InstanceCapacity + { + get; + set; + } + + /// + /// 获取或设置实体组实例对象池对象过期秒数。 + /// + float InstanceExpireTime + { + get; + set; + } + + /// + /// 获取或设置实体组实例对象池的优先级。 + /// + int InstancePriority + { + get; + set; + } + + /// + /// 获取实体组辅助器。 + /// + IEntityGroupHelper Helper + { + get; + } + + /// + /// 实体组中是否存在实体。 + /// + /// 实体序列编号。 + /// 实体组中是否存在实体。 + bool HasEntity(int entityId); + + /// + /// 实体组中是否存在实体。 + /// + /// 实体资源名称。 + /// 实体组中是否存在实体。 + bool HasEntity(string entityAssetName); + + /// + /// 从实体组中获取实体。 + /// + /// 实体序列编号。 + /// 要获取的实体。 + IEntity GetEntity(int entityId); + + /// + /// 从实体组中获取实体。 + /// + /// 实体资源名称。 + /// 要获取的实体。 + IEntity GetEntity(string entityAssetName); + + /// + /// 从实体组中获取实体。 + /// + /// 实体资源名称。 + /// 要获取的实体。 + IEntity[] GetEntities(string entityAssetName); + + /// + /// 从实体组中获取实体。 + /// + /// 实体资源名称。 + /// 要获取的实体。 + void GetEntities(string entityAssetName, List results); + + /// + /// 从实体组中获取所有实体。 + /// + /// 实体组中的所有实体。 + IEntity[] GetAllEntities(); + + /// + /// 从实体组中获取所有实体。 + /// + /// 实体组中的所有实体。 + void GetAllEntities(List results); + + /// + /// 设置实体实例是否被加锁。 + /// + /// 实体实例。 + /// 实体实例是否被加锁。 + void SetEntityInstanceLocked(object entityInstance, bool locked); + + /// + /// 设置实体实例的优先级。 + /// + /// 实体实例。 + /// 实体实例优先级。 + void SetEntityInstancePriority(object entityInstance, int priority); + } +} diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/IEntityGroup.cs.meta b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/IEntityGroup.cs.meta new file mode 100644 index 00000000..8e089a1e --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/IEntityGroup.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f7093136c22354c4e8a18dccfd1bf9c6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/IEntityGroupHelper.cs b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/IEntityGroupHelper.cs new file mode 100644 index 00000000..c9622495 --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/IEntityGroupHelper.cs @@ -0,0 +1,9 @@ +namespace TEngine +{ + /// + /// 实体组辅助器接口。 + /// + public interface IEntityGroupHelper + { + } +} diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/IEntityGroupHelper.cs.meta b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/IEntityGroupHelper.cs.meta new file mode 100644 index 00000000..3dc16cc7 --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/IEntityGroupHelper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 17e6e9bab15e7bf43a56b8acb83b2a23 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/IEntityHelper.cs b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/IEntityHelper.cs new file mode 100644 index 00000000..0e1d12eb --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/IEntityHelper.cs @@ -0,0 +1,31 @@ +namespace TEngine +{ + /// + /// 实体辅助器接口。 + /// + public interface IEntityHelper + { + /// + /// 实例化实体。 + /// + /// 要实例化的实体资源。 + /// 实例化后的实体。 + object InstantiateEntity(object entityAsset); + + /// + /// 创建实体。 + /// + /// 实体实例。 + /// 实体所属的实体组。 + /// 用户自定义数据。 + /// 实体。 + IEntity CreateEntity(object entityInstance, IEntityGroup entityGroup, object userData); + + /// + /// 释放实体。 + /// + /// 要释放的实体资源。 + /// 要释放的实体实例。 + void ReleaseEntity(object entityAsset, object entityInstance); + } +} diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/IEntityHelper.cs.meta b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/IEntityHelper.cs.meta new file mode 100644 index 00000000..f536c86d --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/IEntityHelper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 71330d58707d3404b9812391d90be67f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/IEntityManager.cs b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/IEntityManager.cs new file mode 100644 index 00000000..2b3b5ba1 --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/IEntityManager.cs @@ -0,0 +1,447 @@ +using System; +using System.Collections.Generic; +using Cysharp.Threading.Tasks; + +namespace TEngine +{ + /// + /// 实体管理器接口。 + /// + public interface IEntityManager + { + /// + /// 获取实体数量。 + /// + int EntityCount { get; } + + /// + /// 获取实体组数量。 + /// + int EntityGroupCount { get; } + + /// + /// 显示实体成功事件。 + /// + event Action ShowEntitySuccess; + + /// + /// 显示实体失败事件。 + /// + event Action ShowEntityFailure; + + /// + /// 隐藏实体完成事件。 + /// + event Action HideEntityComplete; + + /// + /// 设置对象池管理器。 + /// + /// 对象池管理器。 + void SetObjectPoolManager(IObjectPoolModule objectPoolManager); + + /// + /// 设置资源管理器。 + /// + /// 资源管理器。 + void SetResourceManager(IResourceModule resourceManager); + + /// + /// 设置实体辅助器。 + /// + /// 实体辅助器。 + void SetEntityHelper(IEntityHelper entityHelper); + + /// + /// 是否存在实体组。 + /// + /// 实体组名称。 + /// 是否存在实体组。 + bool HasEntityGroup(string entityGroupName); + + /// + /// 获取实体组。 + /// + /// 实体组名称。 + /// 要获取的实体组。 + IEntityGroup GetEntityGroup(string entityGroupName); + + /// + /// 获取所有实体组。 + /// + /// 所有实体组。 + IEntityGroup[] GetAllEntityGroups(); + + /// + /// 获取所有实体组。 + /// + /// 所有实体组。 + void GetAllEntityGroups(List results); + + /// + /// 增加实体组。 + /// + /// 实体组名称。 + /// 实体实例对象池自动释放可释放对象的间隔秒数。 + /// 实体实例对象池容量。 + /// 实体实例对象池对象过期秒数。 + /// 实体实例对象池的优先级。 + /// 实体组辅助器。 + /// 是否增加实体组成功。 + bool AddEntityGroup(string entityGroupName, float instanceAutoReleaseInterval, int instanceCapacity, float instanceExpireTime, int instancePriority, + IEntityGroupHelper entityGroupHelper); + + /// + /// 是否存在实体。 + /// + /// 实体编号。 + /// 是否存在实体。 + bool HasEntity(int entityId); + + /// + /// 是否存在实体。 + /// + /// 实体资源名称。 + /// 是否存在实体。 + bool HasEntity(string entityAssetName); + + /// + /// 获取实体。 + /// + /// 实体编号。 + /// 要获取的实体。 + IEntity GetEntity(int entityId); + + /// + /// 获取实体。 + /// + /// 实体资源名称。 + /// 要获取的实体。 + IEntity GetEntity(string entityAssetName); + + /// + /// 获取实体。 + /// + /// 实体资源名称。 + /// 要获取的实体。 + IEntity[] GetEntities(string entityAssetName); + + /// + /// 获取实体。 + /// + /// 实体资源名称。 + /// 要获取的实体。 + void GetEntities(string entityAssetName, List results); + + /// + /// 获取所有已加载的实体。 + /// + /// 所有已加载的实体。 + IEntity[] GetAllLoadedEntities(); + + /// + /// 获取所有已加载的实体。 + /// + /// 所有已加载的实体。 + void GetAllLoadedEntities(List results); + + /// + /// 获取所有正在加载实体的编号。 + /// + /// 所有正在加载实体的编号。 + int[] GetAllLoadingEntityIds(); + + /// + /// 获取所有正在加载实体的编号。 + /// + /// 所有正在加载实体的编号。 + void GetAllLoadingEntityIds(List results); + + /// + /// 是否正在加载实体。 + /// + /// 实体编号。 + /// 是否正在加载实体。 + bool IsLoadingEntity(int entityId); + + /// + /// 是否是合法的实体。 + /// + /// 实体。 + /// 实体是否合法。 + bool IsValidEntity(IEntity entity); + + /// + /// 显示实体。 + /// + /// 实体编号。 + /// 实体资源名称。 + /// 实体组名称。 + void ShowEntity(int entityId, string entityAssetName, string entityGroupName); + + /// + /// 显示实体。 + /// + /// 实体编号。 + /// 实体资源名称。 + /// 实体组名称。 + /// 加载实体资源的优先级。 + void ShowEntity(int entityId, string entityAssetName, string entityGroupName, int priority); + + /// + /// 显示实体。 + /// + /// 实体编号。 + /// 实体资源名称。 + /// 实体组名称。 + /// 用户自定义数据。 + void ShowEntity(int entityId, string entityAssetName, string entityGroupName, object userData); + + /// + /// 显示实体。 + /// + /// 实体编号。 + /// 实体资源名称。 + /// 实体组名称。 + /// 加载实体资源的优先级。 + /// 用户自定义数据。 + void ShowEntity(int entityId, string entityAssetName, string entityGroupName, int priority, object userData); + + /// + /// 同步显示实体。 + /// + /// 实体编号。 + /// 实体资源名称。 + /// 实体组名称。 + /// 加载实体资源的优先级。 + /// 用户自定义数据。 + public T ShowEntitySync(int entityId, string entityAssetName, string entityGroupName, int priority, object userData) where T : class; + + /// + /// 异步显示实体。 + /// + /// 实体编号。 + /// 实体资源名称。 + /// 实体组名称。 + /// 加载实体资源的优先级。 + /// 用户自定义数据。 + public UniTask ShowEntityAsync(int entityId, string entityAssetName, string entityGroupName, int priority, object userData) where T : class; + + /// + /// 隐藏实体。 + /// + /// 实体编号。 + void HideEntity(int entityId); + + /// + /// 隐藏实体。 + /// + /// 实体编号。 + /// 用户自定义数据。 + void HideEntity(int entityId, object userData); + + /// + /// 隐藏实体。 + /// + /// 实体。 + void HideEntity(IEntity entity); + + /// + /// 隐藏实体。 + /// + /// 实体。 + /// 用户自定义数据。 + void HideEntity(IEntity entity, object userData); + + /// + /// 隐藏所有已加载的实体。 + /// + void HideAllLoadedEntities(); + + /// + /// 隐藏所有已加载的实体。 + /// + /// 用户自定义数据。 + void HideAllLoadedEntities(object userData); + + /// + /// 隐藏所有正在加载的实体。 + /// + void HideAllLoadingEntities(); + + /// + /// 获取父实体。 + /// + /// 要获取父实体的子实体的实体编号。 + /// 子实体的父实体。 + IEntity GetParentEntity(int childEntityId); + + /// + /// 获取父实体。 + /// + /// 要获取父实体的子实体。 + /// 子实体的父实体。 + IEntity GetParentEntity(IEntity childEntity); + + /// + /// 获取子实体数量。 + /// + /// 要获取子实体数量的父实体的实体编号。 + /// 子实体数量。 + int GetChildEntityCount(int parentEntityId); + + /// + /// 获取子实体。 + /// + /// 要获取子实体的父实体的实体编号。 + /// 子实体。 + IEntity GetChildEntity(int parentEntityId); + + /// + /// 获取子实体。 + /// + /// 要获取子实体的父实体。 + /// 子实体。 + IEntity GetChildEntity(IEntity parentEntity); + + /// + /// 获取所有子实体。 + /// + /// 要获取所有子实体的父实体的实体编号。 + /// 所有子实体。 + IEntity[] GetChildEntities(int parentEntityId); + + /// + /// 获取所有子实体。 + /// + /// 要获取所有子实体的父实体的实体编号。 + /// 所有子实体。 + void GetChildEntities(int parentEntityId, List results); + + /// + /// 获取所有子实体。 + /// + /// 要获取所有子实体的父实体。 + /// 所有子实体。 + IEntity[] GetChildEntities(IEntity parentEntity); + + /// + /// 获取所有子实体。 + /// + /// 要获取所有子实体的父实体。 + /// 所有子实体。 + void GetChildEntities(IEntity parentEntity, List results); + + /// + /// 附加子实体。 + /// + /// 要附加的子实体的实体编号。 + /// 被附加的父实体的实体编号。 + void AttachEntity(int childEntityId, int parentEntityId); + + /// + /// 附加子实体。 + /// + /// 要附加的子实体的实体编号。 + /// 被附加的父实体的实体编号。 + /// 用户自定义数据。 + void AttachEntity(int childEntityId, int parentEntityId, object userData); + + /// + /// 附加子实体。 + /// + /// 要附加的子实体的实体编号。 + /// 被附加的父实体。 + void AttachEntity(int childEntityId, IEntity parentEntity); + + /// + /// 附加子实体。 + /// + /// 要附加的子实体的实体编号。 + /// 被附加的父实体。 + /// 用户自定义数据。 + void AttachEntity(int childEntityId, IEntity parentEntity, object userData); + + /// + /// 附加子实体。 + /// + /// 要附加的子实体。 + /// 被附加的父实体的实体编号。 + void AttachEntity(IEntity childEntity, int parentEntityId); + + /// + /// 附加子实体。 + /// + /// 要附加的子实体。 + /// 被附加的父实体的实体编号。 + /// 用户自定义数据。 + void AttachEntity(IEntity childEntity, int parentEntityId, object userData); + + /// + /// 附加子实体。 + /// + /// 要附加的子实体。 + /// 被附加的父实体。 + void AttachEntity(IEntity childEntity, IEntity parentEntity); + + /// + /// 附加子实体。 + /// + /// 要附加的子实体。 + /// 被附加的父实体。 + /// 用户自定义数据。 + void AttachEntity(IEntity childEntity, IEntity parentEntity, object userData); + + /// + /// 解除子实体。 + /// + /// 要解除的子实体的实体编号。 + void DetachEntity(int childEntityId); + + /// + /// 解除子实体。 + /// + /// 要解除的子实体的实体编号。 + /// 用户自定义数据。 + void DetachEntity(int childEntityId, object userData); + + /// + /// 解除子实体。 + /// + /// 要解除的子实体。 + void DetachEntity(IEntity childEntity); + + /// + /// 解除子实体。 + /// + /// 要解除的子实体。 + /// 用户自定义数据。 + void DetachEntity(IEntity childEntity, object userData); + + /// + /// 解除所有子实体。 + /// + /// 被解除的父实体的实体编号。 + void DetachChildEntities(int parentEntityId); + + /// + /// 解除所有子实体。 + /// + /// 被解除的父实体的实体编号。 + /// 用户自定义数据。 + void DetachChildEntities(int parentEntityId, object userData); + + /// + /// 解除所有子实体。 + /// + /// 被解除的父实体。 + void DetachChildEntities(IEntity parentEntity); + + /// + /// 解除所有子实体。 + /// + /// 被解除的父实体。 + /// 用户自定义数据。 + void DetachChildEntities(IEntity parentEntity, object userData); + } +} \ No newline at end of file diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/IEntityManager.cs.meta b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/IEntityManager.cs.meta new file mode 100644 index 00000000..a5021778 --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/IEntityManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c2f6adec7e3a17d47a8d818190db8d71 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/ShowEntityInfo.cs b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/ShowEntityInfo.cs new file mode 100644 index 00000000..f42feeab --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/ShowEntityInfo.cs @@ -0,0 +1,34 @@ +using System; + +namespace TEngine +{ + internal sealed class ShowEntityInfo : IMemory + { + private Type _entityLogicType; + private object _userData; + + public ShowEntityInfo() + { + _entityLogicType = null; + _userData = null; + } + + public Type EntityLogicType => _entityLogicType; + + public object UserData => _userData; + + public static ShowEntityInfo Create(Type entityLogicType, object userData) + { + ShowEntityInfo showEntityInfo = MemoryPool.Acquire(); + showEntityInfo._entityLogicType = entityLogicType; + showEntityInfo._userData = userData; + return showEntityInfo; + } + + public void Clear() + { + _entityLogicType = null; + _userData = null; + } + } +} diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/ShowEntityInfo.cs.meta b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/ShowEntityInfo.cs.meta new file mode 100644 index 00000000..26b3a5b1 --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/EntityModule(GameFramework)/ShowEntityInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5535dde509ba87b42912084f30591779 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/PrimeTweenHelper.meta b/FactoryNumeric/Assets/TEngine/Runtime/Extension/PrimeTweenHelper.meta new file mode 100644 index 00000000..ac9666ab --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/PrimeTweenHelper.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7efd05069744b2f40b5d4456b0fc9840 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/PrimeTweenHelper/PrimeTweenHelperImp.cs b/FactoryNumeric/Assets/TEngine/Runtime/Extension/PrimeTweenHelper/PrimeTweenHelperImp.cs new file mode 100644 index 00000000..c56bf73a --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/PrimeTweenHelper/PrimeTweenHelperImp.cs @@ -0,0 +1,980 @@ +using System; +using System.Collections.Generic; +using PrimeTween; +using UnityEngine; +using UnityEngine.UI; + +namespace TEngine +{ + public class TweenManager + { + private static TweenManager _instance = null; + + public static TweenManager Instance + { + get + { + if (_instance == null) + { + _instance = new TweenManager(); + } + return _instance; + } + } + + public TweenManager() + { + Utility.Unity.AddUpdateListener(Update); + } + + private const float CheckInterval = 60f; + + private float m_CheckInterval = CheckInterval; + + private void Update() + { + m_CheckInterval -= Time.deltaTime; + // 如果时间间隔小于等于0 + if (m_CheckInterval <= 0) + { + // 释放未使用的Tween + PrimeTweenHelperImp.ReleaseUnusedTween(); + // 重置时间间隔 + m_CheckInterval = CheckInterval; + } + } + } + + /// + /// Tween实现类。 + /// 需要PrimeTween新增 public long Id => id; + /// + /// + public class PrimeTweenHelperImp : Utility.Tween.ITweenHelper + { + // 缓存Tween的字典,键为Tween的ID,值为Tween对象 + private static readonly Dictionary m_cacheTweenDic = new Dictionary(); + + // 临时列表,用于存储需要释放的Tween的ID + private static readonly List m_tempList = new List(); + + // 缓存Sequence的字典,键为Sequence的ID,值为Sequence对象 + private static readonly Dictionary m_cacheSequenceDic = new Dictionary(); + + // 临时列表,用于存储需要释放的Sequence的ID + private static readonly List m_tempSequenceList = new List(); + + // Tween的最大容量 + private const int TweenCapacity = 128; + + /// + /// 构造函数,初始化Tween配置。 + /// + public PrimeTweenHelperImp() + { + PrimeTweenConfig.SetTweensCapacity(TweenCapacity); + PrimeTweenConfig.warnEndValueEqualsCurrent = false; + var t = TweenManager.Instance; + Debug.Log($"Init PrimeTweenConfig."); + } + + /// + /// 将TEngine的Ease枚举转换为PrimeTween的Ease枚举。 + /// + /// TEngine的Ease枚举值。 + /// 对应的PrimeTween的Ease枚举值。 + private PrimeTween.Ease GetEase(TEngine.Ease ease) + { + return (PrimeTween.Ease)(int)ease; + } + + /// + /// 将TEngine的CycleMode枚举转换为PrimeTween的CycleMode枚举。 + /// + /// TEngine的CycleMode枚举值。 + /// 对应的PrimeTween的CycleType枚举值。 + private PrimeTween.CycleMode GetCycleMode(TEngine.CycleMode cycleMode) + { + return (PrimeTween.CycleMode)(int)cycleMode; + } + + /// + /// 缓存Tween对象。 + /// + /// 需要缓存的Tween对象。 + private void CacheTween(Tween tween) + { + if (tween.Id <= 0) + { + return; + } + + m_cacheTweenDic.TryAdd(tween.Id, tween); + } + + /// + /// 根据Tween的ID获取Tween对象。 + /// + /// Tween的ID。 + /// 对应的Tween对象,如果不存在则返回null。 + public static Tween GetTween(long tweenId) + { + return m_cacheTweenDic.GetValueOrDefault(tweenId); + } + + /// + /// 根据Sequence的ID获取Sequence对象。 + /// + /// Sequence的ID。 + /// 对应的Sequence对象,如果不存在则返回null。 + public static Sequence GetSequence(long Id) + { + return m_cacheSequenceDic.GetValueOrDefault(Id); + } + + /// + /// 判断指定对象是否正在执行Tween动画。 + /// + /// 需要检查的对象。 + /// 如果正在执行Tween动画则返回true,否则返回false。 + public bool IsTweening(object onTarget) + { + return GetTweenCount(onTarget) > 0; + } + + /// + /// 获取指定对象正在执行的Tween动画数量。 + /// + /// 需要检查的对象。 + /// 正在执行的Tween动画数量。 + public int GetTweenCount(object onTarget) + { + return Tween.GetTweensCount(onTarget); + } + + /// + /// 判断指定ID的Tween是否还存活。 + /// + /// Tween的ID。 + /// 如果Tween还存活则返回true,否则返回false。 + public bool IsAlive(long tweenId) + { + if (m_cacheTweenDic.TryGetValue(tweenId, out var tween)) + { + return tween.isAlive; + } + + return false; + } + + /// + /// 释放未使用的Tween对象。 + /// + public static void ReleaseUnusedTween() + { + m_tempList.Clear(); + using var iter = m_cacheTweenDic.GetEnumerator(); + while (iter.MoveNext()) + { + var tween = iter.Current.Value; + var tempId = iter.Current.Key; + // 如果Tween自己的Id为0,且缓存的Id不等于0; + if (tween.Id == 0 && tempId != 0) + { + m_tempList.Add(tempId); + } + else + { + if (!tween.isAlive) + { + m_tempList.Add(tween.Id); + } + } + } + + var removeCnt = m_tempList.Count; + for (int i = 0; i < removeCnt; i++) + { + m_cacheTweenDic.Remove(m_tempList[i]); + } + + m_tempList.Clear(); + } + + public void StopTween(long tweenId) + { + if (m_cacheTweenDic.TryGetValue(tweenId, out var tween)) + { + tween.Stop(); + } + } + + public void CompleteTween(long tweenId) + { + if (m_cacheTweenDic.TryGetValue(tweenId, out var tween)) + { + tween.Complete(); + } + } + + public void Stop(long tweenId) + { + if (m_cacheTweenDic.TryGetValue(tweenId, out var tween)) + { + tween.Stop(); + } + } + + public void Complete(long tweenId) + { + if (m_cacheTweenDic.TryGetValue(tweenId, out var tween)) + { + tween.Complete(); + } + } + + public int StopAll(object onTarget = null) + { + return Tween.StopAll(onTarget); + } + + public int CompleteAll(object onTarget = null) + { + return Tween.CompleteAll(onTarget); + } + + public void OnComplete(long tweenId, Action onComplete) + { + if (m_cacheTweenDic.TryGetValue(tweenId, out var tween)) + { + if (tween.isAlive) + { + tween.OnComplete(onComplete: onComplete); + } + } + } + + public long Delay(float duration, Action onComplete = null, bool useUnscaledTime = false, bool warnIfTargetDestroyed = true) + { + Tween tween = Tween.Delay(duration, onComplete, useUnscaledTime, warnIfTargetDestroyed); + CacheTween(tween); + return tween.Id; + } + + public long Delay(object target, float duration, Action onComplete = null, bool useUnscaledTime = false, bool warnIfTargetDestroyed = true) + { + Tween tween = Tween.Delay(target, duration, onComplete, useUnscaledTime, warnIfTargetDestroyed); + CacheTween(tween); + return tween.Id; + } + + public long LocalRotation(Transform target, Vector3 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, float endDelay = 0, + bool useUnscaledTime = false) + { + Tween tween = Tween.LocalRotation(target, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long LocalRotation(Transform target, Vector3 startValue, Vector3 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, + CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, + float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.LocalRotation(target, startValue, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long Scale(Transform target, float endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, + float endDelay = 0, + bool useUnscaledTime = false) + { + Tween tween = Tween.Scale(target, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long Scale(Transform target, float startValue, float endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, + float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.Scale(target, startValue, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long Rotation(Transform target, Vector3 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, float endDelay = 0, + bool useUnscaledTime = false) + { + Tween tween = Tween.Rotation(target, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long Rotation(Transform target, Vector3 startValue, Vector3 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, + CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, + float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.Rotation(target, startValue, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long Position(Transform target, Vector3 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, float endDelay = 0, + bool useUnscaledTime = false) + { + Tween tween = Tween.Position(target, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long Position(Transform target, Vector3 startValue, Vector3 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, + CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, + float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.Position(target, startValue, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long PositionX(Transform target, float endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, float endDelay = 0, + bool useUnscaledTime = false) + { + Tween tween = Tween.PositionX(target, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long PositionX(Transform target, float startValue, float endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, + float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.PositionX(target, startValue, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long PositionY(Transform target, float endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, float endDelay = 0, + bool useUnscaledTime = false) + { + Tween tween = Tween.PositionY(target, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long PositionY(Transform target, float startValue, float endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, + float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.PositionY(target, startValue, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long PositionZ(Transform target, float endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, float endDelay = 0, + bool useUnscaledTime = false) + { + Tween tween = Tween.PositionZ(target, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long PositionZ(Transform target, float startValue, float endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, + float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.PositionZ(target, startValue, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long LocalPosition(Transform target, Vector3 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, float endDelay = 0, + bool useUnscaledTime = false) + { + Tween tween = Tween.LocalPosition(target, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long LocalPosition(Transform target, Vector3 startValue, Vector3 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, + CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, + float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.LocalPosition(target, startValue, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long LocalPositionX(Transform target, float endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, float endDelay = 0, + bool useUnscaledTime = false) + { + Tween tween = Tween.LocalPositionX(target, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long LocalPositionX(Transform target, float startValue, float endValue, float duration, Ease ease = Ease.Default, int cycles = 1, + CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, + float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.LocalPositionX(target, startValue, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long LocalPositionY(Transform target, float endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, float endDelay = 0, + bool useUnscaledTime = false) + { + Tween tween = Tween.LocalPositionY(target, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long LocalPositionY(Transform target, float startValue, float endValue, float duration, Ease ease = Ease.Default, int cycles = 1, + CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, + float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.LocalPositionY(target, startValue, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long LocalPositionZ(Transform target, float endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, float endDelay = 0, + bool useUnscaledTime = false) + { + Tween tween = Tween.LocalPositionZ(target, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long LocalPositionZ(Transform target, float startValue, float endValue, float duration, Ease ease = Ease.Default, int cycles = 1, + CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, + float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.LocalPositionZ(target, startValue, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long Rotation(Transform target, Quaternion endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, float endDelay = 0, + bool useUnscaledTime = false) + { + Tween tween = Tween.Rotation(target, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long Rotation(Transform target, Quaternion startValue, Quaternion endValue, float duration, Ease ease = Ease.Default, int cycles = 1, + CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.Rotation(target, startValue, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long LocalRotation(Transform target, Quaternion endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, + float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.LocalRotation(target, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long LocalRotation(Transform target, Quaternion startValue, Quaternion endValue, float duration, Ease ease = Ease.Default, int cycles = 1, + CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.LocalRotation(target, startValue, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long Scale(Transform target, Vector3 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, float endDelay = 0, + bool useUnscaledTime = false) + { + Tween tween = Tween.Scale(target, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long Scale(Transform target, Vector3 startValue, Vector3 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, + float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.Scale(target, startValue, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long ScaleX(Transform target, float endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, float endDelay = 0, + bool useUnscaledTime = false) + { + Tween tween = Tween.ScaleX(target, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long ScaleX(Transform target, float startValue, float endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, + float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.ScaleX(target, startValue, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long ScaleY(Transform target, float endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, float endDelay = 0, + bool useUnscaledTime = false) + { + Tween tween = Tween.ScaleY(target, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long ScaleY(Transform target, float startValue, float endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, + float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.ScaleY(target, startValue, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long ScaleZ(Transform target, float endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, float endDelay = 0, + bool useUnscaledTime = false) + { + Tween tween = Tween.ScaleZ(target, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long ScaleZ(Transform target, float startValue, float endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, + float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.ScaleZ(target, startValue, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long Color(SpriteRenderer target, Color endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, float endDelay = 0, + bool useUnscaledTime = false) + { + Tween tween = Tween.Color(target, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long Color(SpriteRenderer target, Color startValue, Color endValue, float duration, Ease ease = Ease.Default, int cycles = 1, + CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, + float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.Color(target, startValue, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long Alpha(SpriteRenderer target, float endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, float endDelay = 0, + bool useUnscaledTime = false) + { + Tween tween = Tween.Alpha(target, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long Alpha(SpriteRenderer target, float startValue, float endValue, float duration, Ease ease = Ease.Default, int cycles = 1, + CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, + float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.Alpha(target, startValue, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long UISliderValue(Slider target, float endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, float endDelay = 0, + bool useUnscaledTime = false) + { + Tween tween = Tween.UISliderValue(target, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long UISliderValue(Slider target, float startValue, float endValue, float duration, Ease ease = Ease.Default, int cycles = 1, + CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, + float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.UISliderValue(target, startValue, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long UINormalizedPosition(ScrollRect target, Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, + float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.UINormalizedPosition(target, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long UINormalizedPosition(ScrollRect target, Vector2 startValue, Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, + CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.UINormalizedPosition(target, startValue, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long UIHorizontalNormalizedPosition(ScrollRect target, float endValue, float duration, Ease ease = Ease.Default, int cycles = 1, + CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, + float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.UIHorizontalNormalizedPosition(target, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long UIHorizontalNormalizedPosition(ScrollRect target, float startValue, float endValue, float duration, Ease ease = Ease.Default, int cycles = 1, + CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.UIHorizontalNormalizedPosition(target, startValue, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, + useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long UIAnchoredPosition(RectTransform target, Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, + float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.UIAnchoredPosition(target, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long UIAnchoredPosition(RectTransform target, Vector2 startValue, Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, + CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.UIAnchoredPosition(target, startValue, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long UIAnchoredPositionX(RectTransform target, float endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, + float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.UIAnchoredPositionX(target, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long UIAnchoredPositionX(RectTransform target, float startValue, float endValue, float duration, Ease ease = Ease.Default, int cycles = 1, + CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.UIAnchoredPositionX(target, startValue, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long UIAnchoredPositionY(RectTransform target, float endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, + float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.UIAnchoredPositionY(target, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long UIAnchoredPositionY(RectTransform target, float startValue, float endValue, float duration, Ease ease = Ease.Default, int cycles = 1, + CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.UIAnchoredPositionY(target, startValue, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long UIVerticalNormalizedPosition(ScrollRect target, float endValue, float duration, Ease ease = Ease.Default, int cycles = 1, + CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, + float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.UIVerticalNormalizedPosition(target, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long UIVerticalNormalizedPosition(ScrollRect target, float startValue, float endValue, float duration, Ease ease = Ease.Default, int cycles = 1, + CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.UIVerticalNormalizedPosition(target, startValue, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, + useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long UIAnchoredPosition3D(RectTransform target, Vector3 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, + float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.UIAnchoredPosition3D(target, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long UIAnchoredPosition3D(RectTransform target, Vector3 startValue, Vector3 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, + CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.UIAnchoredPosition3D(target, startValue, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long UISizeDelta(RectTransform target, Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, + float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.UISizeDelta(target, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long UISizeDelta(RectTransform target, Vector2 startValue, Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, + CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.UISizeDelta(target, startValue, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long Color(Graphic target, Color endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, + float endDelay = 0, + bool useUnscaledTime = false) + { + Tween tween = Tween.Color(target, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long Color(Graphic target, Color startValue, Color endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, + float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.Color(target, startValue, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long Alpha(CanvasGroup target, float endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, float endDelay = 0, + bool useUnscaledTime = false) + { + Tween tween = Tween.Alpha(target, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long Alpha(CanvasGroup target, float startValue, float endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, + float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.Alpha(target, startValue, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long Alpha(Graphic target, float endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, + float endDelay = 0, + bool useUnscaledTime = false) + { + Tween tween = Tween.Alpha(target, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long Alpha(Graphic target, float startValue, float endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, + float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.Alpha(target, startValue, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long UIFillAmount(Image target, float endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, float endDelay = 0, + bool useUnscaledTime = false) + { + Tween tween = Tween.UIFillAmount(target, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long UIFillAmount(Image target, float startValue, float endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, + float endDelay = 0, bool useUnscaledTime = false) + { + Tween tween = Tween.UIFillAmount(target, startValue, endValue, duration, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long MoveBezierPath(Transform target, Vector3[] path, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, float endDelay = 0, + bool useUnscaledTime = false) + { + if (target == null) + { + throw new ArgumentNullException(nameof(target)); + } + + if (path.Length < 2) + { + throw new ArgumentException("Path must have at least 2 points."); + } + + Tween tween = Tween.Custom(target, 0f, 1f, duration, (transform, t) => + { + // 计算贝塞尔曲线上的点 + Vector3 position = CalculateBezierPoint(t, path); + transform.position = position; + + if (Mathf.Approximately(t, 1f)) + { + transform.position = path[^1]; + } + }, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, + useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + #region BezierPathHelper + + /// + /// N 阶贝塞尔曲线的计算。 + /// + /// + /// + /// + private static Vector3 CalculateBezierPoint(float t, Vector3[] points) + { + int n = points.Length - 1; + Vector3 point = Vector3.zero; + + // 计算贝塞尔点 + for (int i = 0; i <= n; i++) + { + float coefficient = BinomialCoefficient(n, i) * Mathf.Pow(1 - t, n - i) * Mathf.Pow(t, i); + point += coefficient * points[i]; + } + + return point; + } + + /// + /// 计算二项式系数。 + /// + /// + /// + /// + private static int BinomialCoefficient(int n, int k) + { + if (k < 0 || k > n) + { + return 0; + } + + if (k == 0 || k == n) + { + return 1; + } + + int result = 1; + for (int i = 0; i < k; i++) + { + result *= (n - i); + result /= (i + 1); + } + + return result; + } + + #endregion + + public long Custom(T target, Vector3 startValue, Vector3 endValue, float duration, Action onValueChange, Ease ease = Ease.Default, int cycles = 1, + CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) where T : class + { + Tween tween = Tween.Custom(target, startValue, endValue, duration, onValueChange, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, + useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long Custom(T target, uint startValue, uint endValue, float duration, Action onValueChange, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) where T : class + { + throw new NotImplementedException(); + } + + public long Custom(T target, int startValue, int endValue, float duration, Action onValueChange, Ease ease = Ease.Default, int cycles = 1, + CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) where T : class + { + Tween tween = Tween.Custom(target, startValue, endValue, duration, (arg1, f) => { onValueChange?.Invoke(arg1, (int)f); }, GetEase(ease), cycles, + GetCycleMode(cycleMode), startDelay, endDelay, + useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long Custom(T target, long startValue, long endValue, float duration, Action onValueChange, Ease ease = Ease.Default, int cycles = 1, + CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) where T : class + { + Tween tween = Tween.Custom(target, startValue, endValue, duration, (arg1, f) => { onValueChange?.Invoke(arg1, (long)f); }, GetEase(ease), cycles, + GetCycleMode(cycleMode), startDelay, endDelay, + useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + + public long Custom(T target, float startValue, float endValue, float duration, Action onValueChange, Ease ease = Ease.Default, int cycles = 1, + CycleMode cycleMode = CycleMode.Restart, + float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) where T : class + { + Tween tween = Tween.Custom(target, startValue, endValue, duration, onValueChange, GetEase(ease), cycles, GetCycleMode(cycleMode), startDelay, endDelay, + useUnscaledTime); + CacheTween(tween); + return tween.Id; + } + } +} \ No newline at end of file diff --git a/FactoryNumeric/Assets/TEngine/Runtime/Extension/PrimeTweenHelper/PrimeTweenHelperImp.cs.meta b/FactoryNumeric/Assets/TEngine/Runtime/Extension/PrimeTweenHelper/PrimeTweenHelperImp.cs.meta new file mode 100644 index 00000000..1aae4b11 --- /dev/null +++ b/FactoryNumeric/Assets/TEngine/Runtime/Extension/PrimeTweenHelper/PrimeTweenHelperImp.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 7c0eb5d7a268303449a36d36acace71d \ No newline at end of file diff --git a/FactoryNumeric/Assets/TEngine/Runtime/TEngine.Runtime.asmdef b/FactoryNumeric/Assets/TEngine/Runtime/TEngine.Runtime.asmdef index 6e4772da..3f448391 100644 --- a/FactoryNumeric/Assets/TEngine/Runtime/TEngine.Runtime.asmdef +++ b/FactoryNumeric/Assets/TEngine/Runtime/TEngine.Runtime.asmdef @@ -7,7 +7,8 @@ "GUID:6055be8ebefd69e48b49212b09b47b2f", "GUID:5efd170ecd8084500bed5692932fe14e", "GUID:d7fc4d49301802c4d997d63a24928ab3", - "GUID:75469ad4d38634e559750d17036d5f7c" + "GUID:75469ad4d38634e559750d17036d5f7c", + "GUID:80ecb87cae9c44d19824e70ea7229748" ], "includePlatforms": [], "excludePlatforms": [], diff --git a/FactoryNumeric/Packages/PrimeTween/Documentation.md b/FactoryNumeric/Packages/PrimeTween/Documentation.md new file mode 100644 index 00000000..98cfc6f0 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Documentation.md @@ -0,0 +1,583 @@ + +PrimeTween +=== + +PrimeTween is a high-performance, **allocation-free** animation library for Unity. **Animate anything** with just one line of code, tweak all animation properties directly from the Inspector, and create complex animation sequences. No runtime memory allocations, ever. + +[**Performance comparison with other tween libraries.**](https://github.com/KyryloKuzyk/PrimeTween/discussions/10) + +**[Asset Store](https://assetstore.unity.com/packages/slug/252960)** | **[Forum](https://discussions.unity.com/t/primetween-high-performance-animations-and-sequences/926420)** | **[FAQ](https://github.com/KyryloKuzyk/PrimeTween/discussions)** | **[YouTube](https://www.youtube.com/watch?v=MuMKwxOzc3M)** + +Table of Contents +--- +- [Getting started](#getting-started) + * [Animations](#animations) + * [Shakes](#shakes) + * [Callbacks](#callbacks) + * [Delays](#delays) + * [Cycles](#cycles) +- [Sequencing tweens](#sequencing-tweens) + + [Sequence](#sequence) + + [Coroutines](#coroutines) + + [Async/await](#asyncawait) +- [Controlling tweens](#controlling-tweens) +- [Inspector integration](#inspector-integration) +- [Custom tweens](#custom-tweens) +- [Advanced](#advanced) + + [Timescale](#timescale) + + [OnUpdate](#onupdate) + + [Speed-based animations](#speed-based-animations) + + [Custom easing](#custom-easing) + + [LateUpdate/FixedUpdate](#lateupdatefixedupdate) +- [Zero allocations with delegates](#zero-allocations-with-delegates) +- [Debugging tweens](#debugging-tweens) +- [Migrating from DOTween to PrimeTween](#migrating-from-dotween-to-primetween) + + [Performance comparison](#performance-comparison) + + [DOTween adapter](#dotween-adapter) + + [Tween.PlayForward/PlayBackwards](#tweenplayforwardplaybackwardsrestart) + + [Migration cheatsheet](#migration-cheatsheet) +- [Support](#support) + +Getting started +--- + +### Installation +Import PrimeTween from [Asset Store](https://assetstore.unity.com/packages/slug/252960). + +### Animations +Without further ado, let's jump straight to the code! +```csharp +using PrimeTween; + +// Animate 'transform.position.y' from the current value to 10 in 1 second using the Ease.InOutSine +Tween.PositionY(transform, endValue: 10, duration: 1, ease: Ease.InOutSine); + +// Rotate 'transform' from the current rotation to (0, 90, 0) in 1 second +Tween.Rotation(transform, endValue: Quaternion.Euler(0, 90, 0), duration: 1); + +// Rotate 'transform' around the y-axis by 360 degrees in 1 second +Tween.EulerAngles(transform, startValue: Vector3.zero, endValue: new Vector3(0, 360), duration: 1); +``` +That's it! + +Simply type **`Tween.`** and let your IDE suggest all supported animations. Out of the box, PrimeTween can animate almost everything: UI, UI Toolkit, Materials, Camera properties, Transforms, AudioSource, and whatnot. + +Didn't find what you're looking for? No problem, use [`Tween.Custom()`](#custom-tweens) to animate **anything**. +> To view PrimeTween's XML documentation in your IDE, enable this setting: _'Unity Preferences/External Tools/Generate .csproj files for/**Local tarball**'_ and press the _'Regenerate project files'_ button. + +### Shakes +```csharp +// Shake the camera with medium strength (0.5f) +Tween.ShakeCamera(camera, strengthFactor: 0.5f); + +// Shake the camera with heavy strength (1.0f) for a duration of 0.5f seconds and a frequency of 10 shakes per second +Tween.ShakeCamera(camera, strengthFactor: 1.0f, duration: 0.5f, frequency: 10); + +// Shake the y-axis position with an amplitude of 1 unit +Tween.ShakeLocalPosition(transform, strength: new Vector3(0, 1), duration: 1, frequency: 10); + +// Shake the z-axis rotation with an amplitude of 15 degrees +Tween.ShakeLocalRotation(transform, strength: new Vector3(0, 0, 15), duration: 1, frequency: 10); + +// Punch localPosition in the direction of 'punchDir' +var punchDir = transform.up; +Tween.PunchLocalPosition(transform, strength: punchDir, duration: 0.5f, frequency: 10); +``` + +### Callbacks +Use **`.OnComplete()`** to execute custom code on tween's completion. +```csharp +// Call SomeMethod() when the animation completes +Tween.Position(transform, endValue: new Vector3(10, 0), duration: 1) + .OnComplete(() => SomeMethod()); + +// After the animation completes, wait for 0.5 seconds, then destroy the GameObject +Tween.Scale(transform, endValue: 0, duration: 1, endDelay: 0.5f) + .OnComplete(() => Destroy(gameObject)); +``` + +>"But wait! There is a **memory allocation** in the example above" you would say. And you would be right: calling `SomeMethod()` or `Destroy()` captures `this` reference in a closure and allocates heap memory. See how to address this in the [zero allocations](#zero-allocations-with-delegates) section. + +### Delays +Creating delays is by far the most useful feature in game development. Delays in PrimeTween behave like normal tweens and can be used with sequences, coroutines, and async/await methods. All while being completely [allocation-free](#zero-allocations-with-delegates). +```csharp +Tween.Delay(duration: 1f, () => Debug.Log("Delay completed")); +``` + +### Cycles +Animations can be repeated with the help of cycles. To apply cycles to an animation, pass the `int cycles` and `CycleMode cycleMode` parameters to a `Tween.` method. Setting cycles to -1 will repeat the tween indefinitely. +```csharp +Tween.PositionY(transform, endValue: 10, duration: 0.5f, cycles: 2, cycleMode: CycleMode.Yoyo); +``` + +To apply cycles to a Sequence, use the `Sequence.Create(cycles: numCycles, cycleMode: CycleMode.Yoyo)` method. +```csharp +Sequence.Create(cycles: 2, CycleMode.Yoyo) + .Chain(Tween.PositionX(transform, 10, duration)) + .Chain(Tween.PositionY(transform, 20, duration)); +``` + + +#### enum CycleMode +- Restart (default): restarts the tween from the beginning. +- Yoyo: animates forth and back, like a yoyo. Easing is the same on the backward cycle. +- Incremental: at the end of a cycle increments the `endValue` by the difference between `startValue` and `endValue`. For example, if a tween moves position.x from 0 to 1, then after the first cycle, the tween will move the position.x from 1 to 2, and so on. +- Rewind: rewinds the tween as if time was reversed. Easing is reversed on the backward cycle. + + +#### SetRemainingCycles(int cycles) +Sets the number of remaining cycles to an animation. This method modifies the `cyclesTotal` so that the animation will complete after the number of cycles. + +#### SetRemainingCycles(bool stopAtEndValue) +Stops an animation when it reaches 'startValue' or 'endValue' for the next time. +For example, if you have an infinite animation (`cycles == -1`) with CycleMode.Yoyo/Rewind, and you wish to stop it when it reaches the 'endValue', then set `stopAtEndValue` to true. To stop the animation at the 'startValue' set `stopAtEndValue` to false. + +Sequencing tweens +--- +### Sequence +There are several sequencing methods in PrimeTween. Let's start with the most common one: grouping tweens in **Sequences**. + +**Sequence** is a group of tweens, callbacks, and other sequences. Animations in a sequence can **overlap**, run **sequentially** or in **parallel**, or any combination of those. You can control a Sequence the same way as individual tweens, see [controlling tweens](#controlling-tweens) section. + +```csharp +Sequence.Create(cycles: 10, CycleMode.Yoyo) + // PositionX and Scale tweens are 'grouped', so they will run in parallel + .Group(Tween.PositionX(transform, endValue: 10f, duration: 1.5f)) + .Group(Tween.Scale(transform, endValue: 2f, duration: 0.5f, startDelay: 1)) + // Rotation tween is 'chained' so it will start when both previous tweens are finished (after 1.5 seconds) + .Chain(Tween.Rotation(transform, endValue: new Vector3(0f, 0f, 45f), duration: 1f)) + .ChainDelay(1) + .ChainCallback(() => Debug.Log("Sequence cycle completed")) + // Insert color animation at time of '0.5' seconds + // Inserted animations overlap with other animations in the sequence + .Insert(atTime: 0.5f, Tween.Color(image, Color.red, duration: 0.5f)); +``` + +#### Insert(float atTime, Tween/Sequence animation) +Places `animation` inside this sequence at the specified time, **overlapping** with other animations. The total sequence duration is increased if the inserted animation doesn't fit inside the current sequence duration. + +#### Chain(Tween/Sequence animation) +Places `animation` after all previously added animations in this sequence. Chained animations run **sequentially** after one another. + +#### Group(Tween/Sequence animation) +Groups `animation` with the 'previous' animation in this Sequence. The 'previous' animation is the animation used in the preceding Group/Chain/Insert() method call. Grouped animations start at the same time and run in **parallel**. + +### Coroutines +Another sequencing method is waiting for animations in **coroutines** by calling **`.ToYieldInstruction()`**. +```csharp +IEnumerator Coroutine() { + Tween.PositionX(transform, endValue: 10f, duration: 1.5f); + yield return Tween.Scale(transform, 2f, 0.5f, startDelay: 1).ToYieldInstruction(); + yield return Tween.Rotation(transform, new Vector3(0f, 0f, 45f), 1f).ToYieldInstruction(); + // Non-allocating alternative to 'yield return new WaitForSeconds(1f)' + yield return Tween.Delay(1).ToYieldInstruction(); + Debug.Log("Sequence completed"); +} +``` + +### Async/await +And the last method is awaiting animations using the **async/await** pattern. Async/await is a great tool to prevent the callback hell in your code. PrimeTween doesn't use threads, so tweens can be awaited on all platforms, even on WebGL. +```csharp +async void AsyncMethod() { + Tween.PositionX(transform, endValue: 10f, duration: 1.5f); + await Tween.Scale(transform, endValue: 2f, duration: 0.5f, startDelay: 1); + await Tween.Rotation(transform, endValue: new Vector3(0f, 0f, 45f), duration: 1f); + // Non-allocating alternative to 'await Task.Delay(1000)' that doesn't use 'System.Threading' + // Animations can be awaited on all platforms, even on WebGL + await Tween.Delay(1); + Debug.Log("Sequence completed"); +} +``` + +> While PrimeTween never allocates memory at runtime, the async/await feature in C# is allocating: awaiting an async method allocates a small amount of garbage. Likewise, StartCoroutine() also allocates GC. +> For performance-intensive code paths, use Sequence instead of async methods and Coroutines. + + +Controlling tweens +--- +All static **`Tween.`** methods return a **`Tween`** struct. While the **`tween.isAlive`** you can control it and access its properties such as duration, elapsedTime, progress, interpolationFactor, etc. + +After completion, the tween becomes 'dead' and can't be reused. This ensures that completed tweens don't eat computing resources and prevents the common performance pitfalls encountered in other tween libraries. +```csharp +Tween tween = Tween.LocalPositionX(transform, endValue: 1.5f, duration: 1f); +// ... + +if (tween.isAlive) { + // '.isAlive' means the tween was created and not completed (or manually stopped) yet. + // While the tween '.isAlive' you can access its properties such as duration, + // elapsedTime, progress, interpolationFactor, etc. + Debug.Log($"Animation is still running, elapsed time: {tween.elapsedTime}."); +} + +tween.Stop(); // Interrupt the tween, leaving the animated value at the current value +Tween.StopAll(onTarget: transform); // Alternative way to stop the tween by its target + +tween.Complete(); // Instantly complete the running tween and set the animated value to the endValue +Tween.CompleteAll(onTarget: transform); // Alternative way to complete the tween by its target + +tween.isPaused = true; // Pause the tween +Tween.PausedAll(true, onTarget: transform); // Alternative way to pause the tween by its target + +tween.elapsedTime = 0.5f; // Manually set the elapsed time of the tween. Use 'elapsedTimeTotal' to set the elapsed time of all cycles. + +tween.progress = 0.5f; // Manually set the normalized progress of the current cycle. This property is similar to the 'normalizedTime' property of the Animation component. + +tween.timeScale = 2f; // Apply a custom timeScale to the tween +``` + +As you can see, there is no way to change the direction of the currently running tween, it can only be **stopped** and **completed**. But how to play an animation **forward** and **backward**, for example, to show or hide a window? Easy! Just start a new Tween in the desired direction. +```csharp +[SerializeField] RectTransform window; + +public void SetWindowOpened(bool isOpened) { + Tween.UIAnchoredPositionY(window, endValue: isOpened ? 0 : -500, duration: 0.5f); +} +``` +In this example, the `SetWindowOpened()` can be called again while the previous animation is still running. Generally, there is no need to stop the previously running tween in such cases. The new tween will seamlessly start from the current position and **overwrite** all previously running tweens on the `window`. Several duplicated tweens are fine, but if your code can potentially create duplicated tweens every frame, then consider stopping the previous tween with the help of `tween.Stop()` or `Tween.StopAll(onTarget: target)`. + +Inspector integration +--- +Inspector integration is the cornerstone of PrimeTween's design. It lets you tweak all animation properties from the Inspector without changing the code. It **saves time** and gives **creative freedom**. All animation settings can be **serialized** in MonoBehaviour or ScriptableObject and passed to the corresponding Tween methods. +```csharp +// Tweak all animation properties from the Inspector: +// startValue, endValue, duration, ease (or custom ease curve), etc. +[SerializeField] TweenSettings yPositionTweenSettings; +// Then pass tween settings to the animation method +Tween.PositionY(transform, yPositionTweenSettings); + +[SerializeField] TweenSettings rotationTweenSettings; +Tween.Rotation(transform, rotationTweenSettings); + +[SerializeField] TweenSettings eulerAnglesTweenSettings; +Tween.EulerAngles(transform, eulerAnglesTweenSettings); + +[SerializeField] ShakeSettings cameraShakeSettings; +Tween.ShakeLocalPosition(Camera.main.transform, cameraShakeSettings); +``` +The neat thing about setting up animation properties in the Inspector is that you can any time switch to a custom **animation curve** without touching the code. + + + +Now let's revisit the window example from the [Controlling tweens](#controlling-tweens) section and improve it by removing all magic variables from the code. Notice how the **`isOpened`** parameter is passed to the **`WithDirection(bool toEndValue)`** method. This helper method selects the target position based on the `isOpened` parameter. Nice and simple! + +
+Old window example (click to expand) + +```csharp +[SerializeField] RectTransform window; + +public void SetWindowOpened(bool isOpened) { + Tween.UIAnchoredPositionY(window, endValue: isOpened ? 0 : -500, duration: 0.5f); +} +``` +
+ + +Window example with Inspector Integration: +```csharp +[SerializeField] RectTransform window; +[SerializeField] TweenSettings windowAnimationSettings; + +public void SetWindowOpened(bool isOpened) { + Tween.UIAnchoredPositionY(window, windowAnimationSettings.WithDirection(toEndValue: isOpened)); +} +``` + +> The generic TweenSettings can be serialized and tweaked from the Inspector in Unity 2020.1+. If you're using an older version of Unity, use the non-generic TweenSetting and serialize `startValue/endValue` separately. + +Custom tweens +--- +Use **`Tween.Custom()`** to animate literary anything. The supported types for custom tweens are `float, Color, Vector2/3/4, Quaternion, and Rect`. +```csharp +float floatField; +Color colorField; + +// Animate 'floatField' from 0 to 10 in 1 second +Tween.Custom(0, 10, duration: 1, onValueChange: newVal => floatField = newVal); + +// Animate 'colorField' from white to black in 1 second +Tween.Custom(Color.white, Color.black, duration: 1, onValueChange: newVal => colorField = newVal); +``` + +As you may expect, custom tweens work with [inspector integration](#inspector-integration) the same way as regular tweens do. +```csharp +[SerializeField] TweenSettings tweenSettings; +float floatField; + +Tween.Custom(tweenSettings, onValueChange: newVal => floatField = newVal); +``` + +Advanced +--- + +### Timescale +You can apply a custom timeScale to each individual animation with the help of the `timeScale` property. + +To smoothly animate the timeScale, use `Tween.TweenTimeScale(Tween/Sequence tween, ...)` method. +To animate the global Unity's Time.timeScale, use `Tween.GlobalTimeScale(...)` method. + +### OnUpdate +Use `tween.OnUpdate()` callback to execute a custom callback when the animated value is updated. +```csharp +// Rotate the transform around the y-axis as the animation progresses +Tween.PositionY(transform, endValue, duration) + .OnUpdate(target: transform, (target, tween) => target.rotation = Quaternion.Euler(0, tween.interpolationFactor * 90f, 0)); + +// Call the OnPositionUpdated() method on every position change +Tween.PositionY(transform, endValue, duration) + .OnUpdate(target: this, (target, tween) => target.OnPositionUpdated(tween.progress)); +``` + +### Speed-based animations +Tween._**AtSpeed**(transform, endValue, **speed**, ...) methods allow to create animations based on the speed instead of duration. When the speed-based tween is created, PrimeTween will calculate the duration with the help of a simple formula: `duration = distance(startValue, endValue) / speed`. Because the duration is calculated immediately, to chain speed-based tweens to one another, you have to specify the `startValue` for all subsequent tweens: +```csharp +Tween.LocalPositionAtSpeed(transform, endValue: midPos, speed) + // Set 'startValue: midPos' to continue the movement from the 'midPos' instead of the initial 'transform.position' + .Chain(Tween.LocalPositionAtSpeed(transform, startValue: midPos, endValue: endPos, speed)); +``` + +### Custom easing +#### Animation curves +It's possible to pass AnimationCurve instead of Ease enum to tweening methods: +```csharp +AnimationCurve animationCurve = AnimationCurve.EaseInOut(0, 0, 1, 1); +Tween.PositionY(transform, endValue, duration, animationCurve); +``` +#### Parametric easing +Parametric easing gives the ability to customize the standard ease types. For example: +```csharp +// Regardless of the current position and endValue, the bounce will have the exact amplitude of 1 meter +Tween.PositionY(transform, endValue, duration, Easing.BounceExact(1)); +``` + +Available parametric eases: +- Easing.Overshoot(float strength): customizes the overshoot strength of Ease.OutBack. +- Easing.Bounce(float strength): customizes the bounce strength of Ease.OutBounce. +- Easing.BounceExact(float amplitude): customizes the exact amplitude of the first bounce in meters/angles. +- Easing.Elastic(float strength, float period = 0.3f): customizes the strength and oscillation period of Ease.OutElastic. + +### LateUpdate/FixedUpdate +Use `updateType` parameter to chose which Unity even function will update the animation. The available options are Update, LateUpdate, and FixedUpdate. +```csharp +// Use TweenSettings or TweenSettings struct to pass the 'lateUpdate' parameter to static 'Tween.' methods +Tween.PositionX(transform, endValue: 10f, new TweenSettings(duration: 1f, updateType: UpdateType.LateUpdate)); + +var tweenSettingsFloat = new TweenSettings(endValue: 10f, duration: 1f, updateType: UpdateType.FixedUpdate); +Tween.PositionX(transform, tweenSettingsFloat); + +// To update the Sequence in FixedUpdate(), pass the 'updateType' parameter to Sequence.Create() +Sequence.Create(updateType: UpdateType.FixedUpdate); +``` + +Zero allocations with delegates +--- +C# delegates is a powerful language feature essential for game development. It gives us the ability to receive callbacks and pass methods to other methods. But when delegates are used in hot code paths carelessly, they can create [performance issues](https://www.jacksondunstan.com/articles/3765). + +Let's review the code from earlier. If SomeMethod() is an instance method, then calling it from the callback will implicitly capture **`this`** reference, allocating heap memory. +```csharp +Tween.Position(transform, new Vector3(10, 0), duration: 1) + .OnComplete(() => SomeMethod()); // delegate allocation! +``` + +Here is how to fix the above code to be non-allocating. Notice how **`this`** reference is passed to the `OnComplete` method, then the **`target`** parameter is used instead of calling `SomeMethod()` directly. +```csharp +Tween.Position(transform, new Vector3(10, 0), duration: 1) + .OnComplete(target: this, target => target.SomeMethod()); // no allocation +``` + +That's it! The same non-allocating approach can be used in all places where PrimeTween uses delegates. +```csharp +Tween.Delay(this, duration: 1f, target => target.SomeMethod()); + +Tween.Custom(this, 0, 10, duration: 1, (target, newVal) => target.floatField = newVal); + +var shakeSettings = new ShakeSettings(frequency: 10, strength: Vector3.one, duration: 1); +Tween.ShakeCustom(this, startValue: vector3Field, shakeSettings, (target, val) => target.vector3Field = val); +``` + +Debugging tweens +--- +To debug tweens select the **PrimeTweenManager** object under the DontDestroyOnLoad foldout in the scene Hierarchy. Here you can inspect all currently running tweens and their properties. + +If the tween's `target` is `UnityEngine.Object`, you can quickly show it in the Hierarchy by clicking on the `Unity Target` field. This is a good reason to supply the target even when it's optional, like in the case of `Tween.Delay()` and `Tween.Custom()`. + + + +Also, the Inspector shows the '**Max alive tweens**' for the current session. Use this number to estimate the maximum number of tweens required for your game and pass it to the `PrimeTweenConfig.SetTweensCapacity(int capacity)` method at the launch of your game. This will ensure PrimeTween doesn't allocate any additional memory at runtime. + +Migrating from DOTween to PrimeTween +--- +PrimeTween and DOTween don't conflict with each other and can be used in one project. You can check out all PrimeTween's performance benefits in your current DOTween project without breaking anything. + +What are the reasons to try PrimeTween? +* See [performance](https://github.com/KyryloKuzyk/PrimeTween/discussions/10) comparison. +* **Seamless installation** that never produces compilation errors regardless of what other packages or plugins your project already uses. +* PrimeTween is extremely easy to learn. It has only 8 top-level concepts, and you can learn the API even without the documentation by simply typing `PrimeTween` and pressing `.` +* PrimeTween is extensively covered by more than **250 automatic tests** that ensure that every bit works perfectly. +* With PrimeTween it's safe to [destroy objects](https://github.com/KyryloKuzyk/PrimeTween/discussions/4) with running animations. +* PrimeTween is truly multiplatform with no exceptions. Awaiting tweens in async methods works even on WebGL! + +#### Performance comparison + +Please visit the full performance comparison [article](https://github.com/KyryloKuzyk/PrimeTween/discussions/10). + +#### DOTween adapter + +PrimeTween comes with a built-in migration adapter that can help you migrate even big projects relatively quickly. The adapter can also be used if you're missing extension methods you've gotten used to. + +The Adapter is an **optional** feature designed to speed up PrimeTween's adoption. The migrated code may still be allocating because of the [delegate allocations](#zero-allocations-with-delegates). +> Please **back up** your project before proceeding. You should **test** the migrated code thoroughly before releasing it to production. + + +First, to enable the adapter, add the **`PRIME_TWEEN_DOTWEEN_ADAPTER`** define to the `ProjectSettings/Player/Script Compilation` and press Apply. + + + +The migration process may vary from project to project. In many cases, simply replacing `using DG.Tweening;` with `using PrimeTween;` is enough to switch a script from DOTween to PrimeTween. See how easy was to migrate the [MotionDesignFES](https://github.com/KirillKuzyk/MotionDesignFES-PrimeTween/commit/628cb17d027e9648add45e0b2d9b431983a1bde6) project with dozens of complex animations. + +Open a script that uses DOTween, change `using DG.Tweening;` to `using PrimeTween;` and the adapter will handle the majority of cases **automatically**, preserving DOTween's syntax in your project. The most common places that require a **manual change** to the existing code base: +```csharp +// using DG.Tweening; +using PrimeTween; + +// if (tween != null) { +// tween.Kill(complete: true); +// tween = null; +// } +tween.Complete(); // null checking and setting tween to null is not needed + +// tween/sequence.PlayForward/PlayBackwards/Rewind/Restart(); +// In PrimeTween, tweens and sequences are non-reusable, so there is no direct equivalent. +// Instead, start a new animation in the desired direction (see the example below). +// Starting new animations in PrimeTween is extremely fast, so there is no need for caching. +``` + +#### Tween.PlayForward/PlayBackwards/Restart + +PrimeTween offers a different approach to animating things forward and backward that is simpler and has greater performance. In PrimeTween, tweens and sequences are **[non-reusable]([url](https://discussions.unity.com/t/primetween-high-performance-animations-and-sequences/926420/125))**, which means that it's not possible to cache tweens and reuse them later. + +Let's consider the common DOTween usage pattern: creating a tween once, then calling PlayForward() and PlayBackwards() when needed. +
+DOTweenWindow.cs (click to expand) + +```csharp +public class DOTweenWindow : MonoBehaviour { + // Disable auto-kill and store tween reference to reuse the tween later. + // Disabling auto-kill wastes resources: even when the tween is not running, it still receives an update every frame and consumes memory. + Tween tween; + + void Awake() { + tween = transform.DOLocalMove(Vector3.zero, 1) + .ChangeStartValue(new Vector3(0, -500)) + .SetEase(Ease.InOutSine) + .SetAutoKill(false) + // Option 1: link the tween to this GameObject, so the tween is killed when the GameObject is destroyed + .SetLink(gameObject) + // Paused tweens still receive updates every frame and consume resources + .Pause(); + } + + public void SetWindowOpened(bool isOpened) { + if (isOpened) { + tween.PlayForward(); + } else { + tween.PlayBackwards(); + } + } + + void OnDestroy() { + // Option 2: kill the tween before destroying an object. + tween.Kill(); + + // Option 3: enable 'Safe Mode' and don't use SetLink() and don't kill the tween in OnDestroy(). + // BUT: + // - 'Safe Mode' will silence other potential errors or exceptions + // - 'Safe Mode' doesn't work on WebGL and with 'Fast and no exceptions' on iOS + } +} +``` +
+ +PrimeTween offers a much more elegant way of doing the same that comes with much better performance. [Destroying](https://github.com/KyryloKuzyk/PrimeTween/discussions/4) the window while the animation is playing is perfectly fine: +```csharp +public class PrimeTweenWindow : MonoBehaviour { + public void SetWindowOpened(bool isOpened) { + Tween.LocalPosition(transform, isOpened ? Vector3.zero : new Vector3(0, -500), 1, Ease.InOutSine); + } +} +``` + +#### Migration cheatsheet +If you don't want to use the Adapter and wish to migrate your project to PrimeTween's syntax, please refer to this cheatsheet for the API differences of two libraries. + +```csharp +DOTween API on the left --> PrimeTween API on the right + +// All animations are supported, here are only a few of them as an example +transform.DOMove(...) --> Tween.Position(transform, ...) +uiImage.DOFade(...) --> Tween.Alpha(uiImage, ...) +material.DOColor(...) --> Tween.Color(material, ...) +transform.DOShakePosition(...) --> Tween.ShakeLocalPosition(transform, ...) + +tween.SetEase(Ease.InOutSine) --> Tween.Position(..., ease: Ease.InOutSine); +sequence.SetEase(Ease.OutBounce) --> Sequence.Create(..., sequenceEase: Ease.OutBounce) + +tween.SetLoops(2, LoopType.Yoyo) --> Tween.Position(..., cycles: 2, CycleMode.Yoyo) +sequence.SetLoops(2, LoopType.Yoyo) --> Sequence.Create(cycles: 2, CycleMode.Yoyo) + +tween.SetUpdate(true) --> Tween.Position(..., useUnscaledTime: true) +sequence.SetUpdate(true) --> Sequence.Create(..., useUnscaledTime: true) + +tween.SetUpdate(UpdateType.Fixed) --> Tween.Position(..., new TweenSettings(1f, updateType: UpdateType.Fixed)) +sequence.SetUpdate(UpdateType.Fixed) --> Sequence.Create(updateType: UpdateType.Fixed) + --> github.com/KyryloKuzyk/PrimeTween#lateupdatefixedupdate + +tween.Kill(false) --> tween.Stop() +tween.Kill(true) --> tween.Complete() + +DOVirtual.DelayedCall() --> Tween.Delay() +DOTween.To() --> Tween.Custom() +DOVirtual.Vector3() --> Tween.Custom() + +DOTween.Sequence() --> Sequence.Create() +sequence.Join() --> sequence.Group() +sequence.Append() --> sequence.Chain() +sequence.AppendCallback() --> sequence.ChainCallback() +seq.Insert(1.5f, trans.DOMoveX(...)) --> seq.Insert(1.5f, Tween.PositionX(trans, ...)) + --> // or `seq.Group(Tween.PositionX(..., startDelay: 1.5f))` before the first Chain() operation +seq.InsertCallback(1f, callback)) --> seq.InsertCallback(1f, callback)) + +DOTween.Kill(target, false) --> Tween.StopAll(onTarget: target) +DOTween.Kill(target, true) --> Tween.CompleteAll(onTarget: target) + +yield return tween.WaitForCompletion() --> yield return tween.ToYieldInstruction() +yield return sequence.WaitForCompletion() --> yield return sequence.ToYieldInstruction() + +// PrimeTween doesn't use threads, so you can write async methods even on WebGL +await tween.AsyncWaitForCompletion() --> await tween +await sequence.AsyncWaitForCompletion() --> await sequence + +transform.DOMoveX(to, 1).From(from) --> Tween.PositionX(transform, from, to, 1) + +tween.SetDelay(1f).OnStart(callback) --> Tween.Delay(1, callback).Chain(tween) +sequence.OnStart(callback) --> sequence.ChainCallback(callback) // at the beginning of the sequence + +trans.DOMove(pos, speed).SetSpeedBased() --> Tween.PositionAtSpeed(trans, pos, speed) + +textMeshPro.DOText(...) --> discussions.unity.com/t/926420/159 + --> or see TypewriterAnimatorExample.cs in Demo +text.DOCounter() --> discussions.unity.com/t/926420/80 +transform.DOJump() --> discussions.unity.com/t/926420/4 +transform.DOPath() --> discussions.unity.com/t/926420/158 +transform.DOLookAt() --> discussions.unity.com/t/926420/189 +tween.SetId() --> github.com/KyryloKuzyk/PrimeTween/discussions/26#discussioncomment-7700985 +target.DOBlendable___(...) --> Tween.___Additive(target, ...) // experimental + --> github.com/KyryloKuzyk/PrimeTween/discussions/55 +``` + +Support +--- +Join the discussion on [Unity Discussions](https://discussions.unity.com/t/primetween-high-performance-animations-and-sequences/926420). +Please submit bug reports [here](https://github.com/KyryloKuzyk/PrimeTween/issues). +Submit your questions and feature requests [here](https://github.com/KyryloKuzyk/PrimeTween/discussions). +If you want to contact me privately, please drop me an email: kuzykkirill@gmail.com diff --git a/FactoryNumeric/Packages/PrimeTween/Documentation.md.meta b/FactoryNumeric/Packages/PrimeTween/Documentation.md.meta new file mode 100644 index 00000000..7ed24803 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Documentation.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b00cea779ee947faaea4b32a3012dc6c +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/PrimeTween/Documentation.meta b/FactoryNumeric/Packages/PrimeTween/Documentation.meta new file mode 100644 index 00000000..4bd1dcd1 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Documentation.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b55ae79f4b62b45e490f411c8f3933a9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/PrimeTween/Documentation/adapter_define.png b/FactoryNumeric/Packages/PrimeTween/Documentation/adapter_define.png new file mode 100644 index 00000000..bdc3600f Binary files /dev/null and b/FactoryNumeric/Packages/PrimeTween/Documentation/adapter_define.png differ diff --git a/FactoryNumeric/Packages/PrimeTween/Documentation/adapter_define.png.meta b/FactoryNumeric/Packages/PrimeTween/Documentation/adapter_define.png.meta new file mode 100644 index 00000000..06612e97 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Documentation/adapter_define.png.meta @@ -0,0 +1,159 @@ +fileFormatVersion: 2 +guid: df2f3544663d444cb890ac9bf7f52487 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + 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 + vTOnly: 0 + ignoreMasterTextureLimit: 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: 1 + 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: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + 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: Standalone + 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: 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: Android + 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: iPhone + 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: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + 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: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/PrimeTween/Documentation/debug_tweens.jpg b/FactoryNumeric/Packages/PrimeTween/Documentation/debug_tweens.jpg new file mode 100644 index 00000000..5c8e69c9 Binary files /dev/null and b/FactoryNumeric/Packages/PrimeTween/Documentation/debug_tweens.jpg differ diff --git a/FactoryNumeric/Packages/PrimeTween/Documentation/debug_tweens.jpg.meta b/FactoryNumeric/Packages/PrimeTween/Documentation/debug_tweens.jpg.meta new file mode 100644 index 00000000..263d4772 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Documentation/debug_tweens.jpg.meta @@ -0,0 +1,147 @@ +fileFormatVersion: 2 +guid: f25774ab3869144b9a6c7d66028f945d +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + 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 + vTOnly: 0 + ignoreMasterTextureLimit: 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: 1 + 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: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + 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: Standalone + 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: 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: Android + 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: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + 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: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/PrimeTween/Documentation/inspector_integration.jpg b/FactoryNumeric/Packages/PrimeTween/Documentation/inspector_integration.jpg new file mode 100644 index 00000000..67bac182 Binary files /dev/null and b/FactoryNumeric/Packages/PrimeTween/Documentation/inspector_integration.jpg differ diff --git a/FactoryNumeric/Packages/PrimeTween/Documentation/inspector_integration.jpg.meta b/FactoryNumeric/Packages/PrimeTween/Documentation/inspector_integration.jpg.meta new file mode 100644 index 00000000..642eb76b --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Documentation/inspector_integration.jpg.meta @@ -0,0 +1,147 @@ +fileFormatVersion: 2 +guid: fcc015a881d674deba6507c7ea2c03c2 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + 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 + vTOnly: 0 + ignoreMasterTextureLimit: 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: 1 + 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: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + 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: Standalone + 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: 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: Android + 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: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + 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: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/PrimeTween/Editor.meta b/FactoryNumeric/Packages/PrimeTween/Editor.meta new file mode 100644 index 00000000..2f01d640 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Editor.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 4cea55d2599c4964996e85be8723ab51 +timeCreated: 1673348424 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Editor/AssemblyInfo.cs b/FactoryNumeric/Packages/PrimeTween/Editor/AssemblyInfo.cs new file mode 100644 index 00000000..74b96d6b --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Editor/AssemblyInfo.cs @@ -0,0 +1,3 @@ +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("PrimeTween.Tests")] diff --git a/FactoryNumeric/Packages/PrimeTween/Editor/AssemblyInfo.cs.meta b/FactoryNumeric/Packages/PrimeTween/Editor/AssemblyInfo.cs.meta new file mode 100644 index 00000000..b825c589 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Editor/AssemblyInfo.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: a3c27f8cb2a846f589acacc063d08498 +timeCreated: 1683538561 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Editor/CodeGenerator.asset b/FactoryNumeric/Packages/PrimeTween/Editor/CodeGenerator.asset new file mode 100644 index 00000000..a5afa256 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Editor/CodeGenerator.asset @@ -0,0 +1,1088 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f81c141b47ab4aee9ea1454818ce73d3, type: 3} + m_Name: CodeGenerator + m_EditorClassIdentifier: + methodsScript: {fileID: 11500000, guid: 51610f0e9d8e4ccead49e9fcc96d54e3, type: 3} + dotweenMethodsScript: {fileID: 11500000, guid: 3c238e2b584a4987b714406da2cf9c56, type: 3} + tweenComponentScript: {fileID: 11500000, guid: f191f8e3fa31440d9f1217f1f80dba7d, type: 3} + editorUtilsScript: {fileID: 11500000, guid: 7f3bfd9524c14644bfbab698076886f3, type: 3} + methodsData: + - description: Range_Light + methodName: Range + targetType: UnityEngine.Light + propertyType: 1 + propertyName: range + propertyGetter: + propertySetter: + dotweenMethodName: + dependency: 7 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: ShadowStrength_Light + methodName: ShadowStrength + targetType: UnityEngine.Light + propertyType: 1 + propertyName: shadowStrength + propertyGetter: + propertySetter: + dotweenMethodName: DOShadowStrength + dependency: 7 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: Intensity_Light + methodName: Intensity + targetType: UnityEngine.Light + propertyType: 1 + propertyName: intensity + propertyGetter: + propertySetter: + dotweenMethodName: DOIntensity + dependency: 7 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: OrthographicSize_Camera + methodName: OrthographicSize + targetType: UnityEngine.Camera + propertyType: 1 + propertyName: orthographicSize + propertyGetter: + propertySetter: + dotweenMethodName: DOOrthoSize + dependency: 5 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: BackgroundColor_Camera + methodName: BackgroundColor + targetType: UnityEngine.Camera + propertyType: 2 + propertyName: backgroundColor + propertyGetter: + propertySetter: + dotweenMethodName: DOColor + dependency: 5 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: Aspect_Camera + methodName: Aspect + targetType: UnityEngine.Camera + propertyType: 1 + propertyName: aspect + propertyGetter: + propertySetter: + dotweenMethodName: DOAspect + dependency: 5 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: FarClipPlane_Camera + methodName: FarClipPlane + targetType: UnityEngine.Camera + propertyType: 1 + propertyName: farClipPlane + propertyGetter: + propertySetter: + dotweenMethodName: DOFarClipPlane + dependency: 5 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: FieldOfView_Camera + methodName: FieldOfView + targetType: UnityEngine.Camera + propertyType: 1 + propertyName: fieldOfView + propertyGetter: + propertySetter: + dotweenMethodName: DOFieldOfView + dependency: 5 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: NearClipPlane_Camera + methodName: NearClipPlane + targetType: UnityEngine.Camera + propertyType: 1 + propertyName: nearClipPlane + propertyGetter: + propertySetter: + dotweenMethodName: DONearClipPlane + dependency: 5 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: PixelRect_Camera + methodName: PixelRect + targetType: UnityEngine.Camera + propertyType: 7 + propertyName: pixelRect + propertyGetter: + propertySetter: + dotweenMethodName: DOPixelRect + dependency: 5 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: Rect_Camera + methodName: Rect + targetType: UnityEngine.Camera + propertyType: 7 + propertyName: rect + propertyGetter: + propertySetter: + dotweenMethodName: DORect + dependency: 5 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: LocalRotation_Transform + methodName: LocalRotation + targetType: UnityEngine.Transform + propertyType: 4 + propertyName: + propertyGetter: + propertySetter: + dotweenMethodName: + dependency: 0 + placeInGlobalScope: 1 + generateOnlyOverloads: 1 + - description: Scale_Transform + methodName: Scale + targetType: UnityEngine.Transform + propertyType: 1 + propertyName: + propertyGetter: + propertySetter: + dotweenMethodName: + dependency: 0 + placeInGlobalScope: 1 + generateOnlyOverloads: 1 + - description: Rotation_Transform + methodName: Rotation + targetType: UnityEngine.Transform + propertyType: 4 + propertyName: + propertyGetter: + propertySetter: + dotweenMethodName: + dependency: 0 + placeInGlobalScope: 1 + generateOnlyOverloads: 1 + - description: SliderValue_Slider + methodName: SliderValue + targetType: UnityEngine.UI.Slider + propertyType: 1 + propertyName: value + propertyGetter: + propertySetter: + dotweenMethodName: DOValue + dependency: 1 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: NormalizedPosition_ScrollRect + methodName: NormalizedPosition + targetType: UnityEngine.UI.ScrollRect + propertyType: 3 + propertyName: + propertyGetter: GetNormalizedPosition() + propertySetter: SetNormalizedPosition(val) + dotweenMethodName: DONormalizedPos + dependency: 1 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: HorizontalNormalizedPosition_ScrollRect + methodName: HorizontalNormalizedPosition + targetType: UnityEngine.UI.ScrollRect + propertyType: 1 + propertyName: horizontalNormalizedPosition + propertyGetter: + propertySetter: + dotweenMethodName: DOHorizontalNormalizedPos + dependency: 1 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: VerticalNormalizedPosition_ScrollRect + methodName: VerticalNormalizedPosition + targetType: UnityEngine.UI.ScrollRect + propertyType: 1 + propertyName: verticalNormalizedPosition + propertyGetter: + propertySetter: + dotweenMethodName: DOVerticalNormalizedPos + dependency: 1 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: PivotX_RectTransform + methodName: PivotX + targetType: UnityEngine.RectTransform + propertyType: 1 + propertyName: + propertyGetter: pivot[0] + propertySetter: pivot = _target.pivot.WithComponent(0, val) + dotweenMethodName: DOPivotX + dependency: 1 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: PivotY_RectTransform + methodName: PivotY + targetType: UnityEngine.RectTransform + propertyType: 1 + propertyName: + propertyGetter: pivot[1] + propertySetter: pivot = _target.pivot.WithComponent(1, val) + dotweenMethodName: DOPivotY + dependency: 1 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: Pivot_RectTransform + methodName: Pivot + targetType: UnityEngine.RectTransform + propertyType: 3 + propertyName: pivot + propertyGetter: + propertySetter: + dotweenMethodName: DOPivot + dependency: 1 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: AnchorMax_RectTransform + methodName: AnchorMax + targetType: UnityEngine.RectTransform + propertyType: 3 + propertyName: anchorMax + propertyGetter: + propertySetter: + dotweenMethodName: DOAnchorMax + dependency: 1 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: AnchorMin_RectTransform + methodName: AnchorMin + targetType: UnityEngine.RectTransform + propertyType: 3 + propertyName: anchorMin + propertyGetter: + propertySetter: + dotweenMethodName: DOAnchorMin + dependency: 1 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: AnchoredPosition3D_RectTransform + methodName: AnchoredPosition3D + targetType: UnityEngine.RectTransform + propertyType: 4 + propertyName: anchoredPosition3D + propertyGetter: + propertySetter: + dotweenMethodName: DOAnchorPos3D + dependency: 1 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: AnchoredPosition3DX_RectTransform + methodName: AnchoredPosition3DX + targetType: UnityEngine.RectTransform + propertyType: 1 + propertyName: + propertyGetter: anchoredPosition3D[0] + propertySetter: anchoredPosition3D = _target.anchoredPosition3D.WithComponent(0, + val) + dotweenMethodName: DOAnchorPos3DX + dependency: 1 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: AnchoredPosition3DY_RectTransform + methodName: AnchoredPosition3DY + targetType: UnityEngine.RectTransform + propertyType: 1 + propertyName: + propertyGetter: anchoredPosition3D[1] + propertySetter: anchoredPosition3D = _target.anchoredPosition3D.WithComponent(1, + val) + dotweenMethodName: DOAnchorPos3DY + dependency: 1 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: AnchoredPosition3DZ_RectTransform + methodName: AnchoredPosition3DZ + targetType: UnityEngine.RectTransform + propertyType: 1 + propertyName: + propertyGetter: anchoredPosition3D[2] + propertySetter: anchoredPosition3D = _target.anchoredPosition3D.WithComponent(2, + val) + dotweenMethodName: DOAnchorPos3DZ + dependency: 1 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: EffectDistance_Shadow + methodName: EffectDistance + targetType: UnityEngine.UI.Shadow + propertyType: 3 + propertyName: effectDistance + propertyGetter: + propertySetter: + dotweenMethodName: DOScale + dependency: 1 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: Alpha_Shadow + methodName: Alpha + targetType: UnityEngine.UI.Shadow + propertyType: 1 + propertyName: + propertyGetter: effectColor.a + propertySetter: effectColor = _target.effectColor.WithAlpha(val) + dotweenMethodName: DOFade + dependency: 1 + placeInGlobalScope: 1 + generateOnlyOverloads: 0 + - description: Color_Shadow + methodName: Color + targetType: UnityEngine.UI.Shadow + propertyType: 2 + propertyName: effectColor + propertyGetter: + propertySetter: + dotweenMethodName: DOColor + dependency: 1 + placeInGlobalScope: 1 + generateOnlyOverloads: 0 + - description: PreferredSize_LayoutElement + methodName: PreferredSize + targetType: UnityEngine.UI.LayoutElement + propertyType: 3 + propertyName: + propertyGetter: GetPreferredSize() + propertySetter: SetPreferredSize(val) + dotweenMethodName: DOPreferredSize + dependency: 1 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: PreferredWidth_LayoutElement + methodName: PreferredWidth + targetType: UnityEngine.UI.LayoutElement + propertyType: 1 + propertyName: preferredWidth + propertyGetter: + propertySetter: + dotweenMethodName: + dependency: 1 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: PreferredHeight_LayoutElement + methodName: PreferredHeight + targetType: UnityEngine.UI.LayoutElement + propertyType: 1 + propertyName: preferredHeight + propertyGetter: + propertySetter: + dotweenMethodName: + dependency: 1 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: MovePosition_Rigidbody + methodName: MovePosition + targetType: UnityEngine.Rigidbody + propertyType: 4 + propertyName: + propertyGetter: position + propertySetter: MovePosition(val) + dotweenMethodName: DOMove + dependency: 3 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: MoveRotation_Rigidbody + methodName: MoveRotation + targetType: UnityEngine.Rigidbody + propertyType: 6 + propertyName: + propertyGetter: rotation + propertySetter: MoveRotation(val) + dotweenMethodName: DORotate + dependency: 3 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: MovePosition_Rigidbody2D + methodName: MovePosition + targetType: UnityEngine.Rigidbody2D + propertyType: 3 + propertyName: + propertyGetter: position + propertySetter: MovePosition(val) + dotweenMethodName: DOMove + dependency: 4 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: MoveRotation_Rigidbody2D + methodName: MoveRotation + targetType: UnityEngine.Rigidbody2D + propertyType: 1 + propertyName: + propertyGetter: rotation + propertySetter: MoveRotation(val) + dotweenMethodName: DORotate + dependency: 4 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: FlexibleSize_LayoutElement + methodName: FlexibleSize + targetType: UnityEngine.UI.LayoutElement + propertyType: 3 + propertyName: + propertyGetter: GetFlexibleSize() + propertySetter: SetFlexibleSize(val) + dotweenMethodName: DOFlexibleSize + dependency: 1 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: FlexibleWidth_LayoutElement + methodName: FlexibleWidth + targetType: UnityEngine.UI.LayoutElement + propertyType: 1 + propertyName: flexibleWidth + propertyGetter: + propertySetter: + dotweenMethodName: + dependency: 1 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: FlexibleHeight_LayoutElement + methodName: FlexibleHeight + targetType: UnityEngine.UI.LayoutElement + propertyType: 1 + propertyName: flexibleHeight + propertyGetter: + propertySetter: + dotweenMethodName: + dependency: 1 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: MinSize_LayoutElement + methodName: MinSize + targetType: UnityEngine.UI.LayoutElement + propertyType: 3 + propertyName: + propertyGetter: GetMinSize() + propertySetter: SetMinSize(val) + dotweenMethodName: DOMinSize + dependency: 1 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: MinWidth_LayoutElement + methodName: MinWidth + targetType: UnityEngine.UI.LayoutElement + propertyType: 1 + propertyName: minWidth + propertyGetter: + propertySetter: + dotweenMethodName: + dependency: 1 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: MinHeight_LayoutElement + methodName: MinHeight + targetType: UnityEngine.UI.LayoutElement + propertyType: 1 + propertyName: minHeight + propertyGetter: + propertySetter: + dotweenMethodName: + dependency: 1 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: Position_Transform + methodName: Position + targetType: UnityEngine.Transform + propertyType: 4 + propertyName: position + propertyGetter: + propertySetter: + dotweenMethodName: DOMove + dependency: 0 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: PositionX_Transform + methodName: PositionX + targetType: UnityEngine.Transform + propertyType: 1 + propertyName: + propertyGetter: position.x + propertySetter: position = _target.position.WithComponent(0, val) + dotweenMethodName: DOMoveX + dependency: 0 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: PositionY_Transform + methodName: PositionY + targetType: UnityEngine.Transform + propertyType: 1 + propertyName: + propertyGetter: position.y + propertySetter: position = _target.position.WithComponent(1, val) + dotweenMethodName: DOMoveY + dependency: 0 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: PositionZ_Transform + methodName: PositionZ + targetType: UnityEngine.Transform + propertyType: 1 + propertyName: + propertyGetter: position.z + propertySetter: position = _target.position.WithComponent(2, val) + dotweenMethodName: DOMoveZ + dependency: 0 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: LocalPosition_Transform + methodName: LocalPosition + targetType: UnityEngine.Transform + propertyType: 4 + propertyName: localPosition + propertyGetter: + propertySetter: + dotweenMethodName: DOLocalMove + dependency: 0 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: LocalPositionX_Transform + methodName: LocalPositionX + targetType: UnityEngine.Transform + propertyType: 1 + propertyName: + propertyGetter: localPosition.x + propertySetter: localPosition = _target.localPosition.WithComponent(0, val) + dotweenMethodName: DOLocalMoveX + dependency: 0 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: LocalPositionY_Transform + methodName: LocalPositionY + targetType: UnityEngine.Transform + propertyType: 1 + propertyName: + propertyGetter: localPosition.y + propertySetter: localPosition = _target.localPosition.WithComponent(1, val) + dotweenMethodName: DOLocalMoveY + dependency: 0 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: LocalPositionZ_Transform + methodName: LocalPositionZ + targetType: UnityEngine.Transform + propertyType: 1 + propertyName: + propertyGetter: localPosition.z + propertySetter: localPosition = _target.localPosition.WithComponent(2, val) + dotweenMethodName: DOLocalMoveZ + dependency: 0 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: Rotation_Transform + methodName: Rotation + targetType: UnityEngine.Transform + propertyType: 6 + propertyName: rotation + propertyGetter: + propertySetter: + dotweenMethodName: DORotateQuaternion + dependency: 0 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: LocalRotation_Transform + methodName: LocalRotation + targetType: UnityEngine.Transform + propertyType: 6 + propertyName: localRotation + propertyGetter: + propertySetter: + dotweenMethodName: DOLocalRotateQuaternion + dependency: 0 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: Scale_Transform + methodName: Scale + targetType: UnityEngine.Transform + propertyType: 4 + propertyName: localScale + propertyGetter: + propertySetter: + dotweenMethodName: DOScale + dependency: 0 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: ScaleX_Transform + methodName: ScaleX + targetType: UnityEngine.Transform + propertyType: 1 + propertyName: + propertyGetter: localScale.x + propertySetter: localScale = _target.localScale.WithComponent(0, val) + dotweenMethodName: DOScaleX + dependency: 0 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: ScaleY_Transform + methodName: ScaleY + targetType: UnityEngine.Transform + propertyType: 1 + propertyName: + propertyGetter: localScale.y + propertySetter: localScale = _target.localScale.WithComponent(1, val) + dotweenMethodName: DOScaleY + dependency: 0 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: ScaleZ_Transform + methodName: ScaleZ + targetType: UnityEngine.Transform + propertyType: 1 + propertyName: + propertyGetter: localScale.z + propertySetter: localScale = _target.localScale.WithComponent(2, val) + dotweenMethodName: DOScaleZ + dependency: 0 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: Color_Graphic + methodName: Color + targetType: UnityEngine.UI.Graphic + propertyType: 2 + propertyName: color + propertyGetter: + propertySetter: + dotweenMethodName: DOColor + dependency: 1 + placeInGlobalScope: 1 + generateOnlyOverloads: 0 + - description: Color_SpriteRenderer + methodName: Color + targetType: UnityEngine.SpriteRenderer + propertyType: 2 + propertyName: color + propertyGetter: + propertySetter: + dotweenMethodName: DOColor + dependency: 0 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: Color_Material + methodName: Color + targetType: UnityEngine.Material + propertyType: 2 + propertyName: color + propertyGetter: + propertySetter: + dotweenMethodName: DOColor + dependency: 6 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: Color_Light + methodName: Color + targetType: UnityEngine.Light + propertyType: 2 + propertyName: color + propertyGetter: + propertySetter: + dotweenMethodName: DOColor + dependency: 7 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: AnchoredPosition_RectTransform + methodName: AnchoredPosition + targetType: UnityEngine.RectTransform + propertyType: 3 + propertyName: anchoredPosition + propertyGetter: + propertySetter: + dotweenMethodName: DOAnchorPos + dependency: 1 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: AnchoredPositionX_RectTransform + methodName: AnchoredPositionX + targetType: UnityEngine.RectTransform + propertyType: 1 + propertyName: + propertyGetter: anchoredPosition.x + propertySetter: anchoredPosition = _target.anchoredPosition.WithComponent(0, + val) + dotweenMethodName: DOAnchorPosX + dependency: 1 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: AnchoredPositionY_RectTransform + methodName: AnchoredPositionY + targetType: UnityEngine.RectTransform + propertyType: 1 + propertyName: + propertyGetter: anchoredPosition.y + propertySetter: anchoredPosition = _target.anchoredPosition.WithComponent(1, + val) + dotweenMethodName: DOAnchorPosY + dependency: 1 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: SizeDelta_RectTransform + methodName: SizeDelta + targetType: UnityEngine.RectTransform + propertyType: 3 + propertyName: sizeDelta + propertyGetter: + propertySetter: + dotweenMethodName: DOSizeDelta + dependency: 1 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: Alpha_CanvasGroup + methodName: Alpha + targetType: UnityEngine.CanvasGroup + propertyType: 1 + propertyName: alpha + propertyGetter: + propertySetter: + dotweenMethodName: DOFade + dependency: 1 + placeInGlobalScope: 1 + generateOnlyOverloads: 0 + - description: Alpha_Graphic + methodName: Alpha + targetType: UnityEngine.UI.Graphic + propertyType: 1 + propertyName: + propertyGetter: color.a + propertySetter: color = _target.color.WithAlpha(val) + dotweenMethodName: DOFade + dependency: 1 + placeInGlobalScope: 1 + generateOnlyOverloads: 0 + - description: Alpha_SpriteRenderer + methodName: Alpha + targetType: UnityEngine.SpriteRenderer + propertyType: 1 + propertyName: + propertyGetter: color.a + propertySetter: color = _target.color.WithAlpha(val) + dotweenMethodName: DOFade + dependency: 0 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: Alpha_Material + methodName: Alpha + targetType: UnityEngine.Material + propertyType: 1 + propertyName: + propertyGetter: color.a + propertySetter: color = _target.color.WithAlpha(val) + dotweenMethodName: DOFade + dependency: 6 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: MainTextureOffset_Material + methodName: MainTextureOffset + targetType: UnityEngine.Material + propertyType: 3 + propertyName: mainTextureOffset + propertyGetter: + propertySetter: + dotweenMethodName: DOOffset + dependency: 6 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: MainTextureScale_Material + methodName: MainTextureScale + targetType: UnityEngine.Material + propertyType: 3 + propertyName: mainTextureScale + propertyGetter: + propertySetter: + dotweenMethodName: DOTiling + dependency: 6 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: FillAmount_Image + methodName: FillAmount + targetType: UnityEngine.UI.Image + propertyType: 1 + propertyName: fillAmount + propertyGetter: + propertySetter: + dotweenMethodName: DOFillAmount + dependency: 1 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: Volume_AudioSource + methodName: Volume + targetType: UnityEngine.AudioSource + propertyType: 1 + propertyName: volume + propertyGetter: + propertySetter: + dotweenMethodName: DOFade + dependency: 2 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: Pitch_AudioSource + methodName: Pitch + targetType: UnityEngine.AudioSource + propertyType: 1 + propertyName: pitch + propertyGetter: + propertySetter: + dotweenMethodName: DOPitch + dependency: 2 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: PanStereo_AudioSource + methodName: PanStereo + targetType: UnityEngine.AudioSource + propertyType: 1 + propertyName: panStereo + propertyGetter: + propertySetter: + dotweenMethodName: + dependency: 2 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: TweenTimeScale_Tween + methodName: TweenTimeScale + targetType: PrimeTween.Tween + propertyType: 1 + propertyName: + propertyGetter: + propertySetter: + dotweenMethodName: DOTimeScale + dependency: 0 + placeInGlobalScope: 0 + generateOnlyOverloads: 1 + - description: TweenTimeScale_Sequence + methodName: TweenTimeScale + targetType: PrimeTween.Sequence + propertyType: 1 + propertyName: + propertyGetter: + propertySetter: + dotweenMethodName: DOTimeScale + dependency: 0 + placeInGlobalScope: 0 + generateOnlyOverloads: 1 + - description: VisualElementLayout_VisualElement + methodName: VisualElementLayout + targetType: UnityEngine.UIElements.VisualElement + propertyType: 7 + propertyName: + propertyGetter: GetResolvedStyleRect() + propertySetter: SetStyleRect(val) + dotweenMethodName: + dependency: 9 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: Position_ITransform + methodName: Position + targetType: UnityEngine.UIElements.ITransform + propertyType: 4 + propertyName: position + propertyGetter: + propertySetter: + dotweenMethodName: + dependency: 9 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: Rotation_ITransform + methodName: Rotation + targetType: UnityEngine.UIElements.ITransform + propertyType: 6 + propertyName: rotation + propertyGetter: + propertySetter: + dotweenMethodName: + dependency: 9 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: Scale_ITransform + methodName: Scale + targetType: UnityEngine.UIElements.ITransform + propertyType: 4 + propertyName: scale + propertyGetter: + propertySetter: + dotweenMethodName: + dependency: 9 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: VisualElementSize_VisualElement + methodName: VisualElementSize + targetType: UnityEngine.UIElements.VisualElement + propertyType: 3 + propertyName: + propertyGetter: layout.size + propertySetter: style.width = val.x; _target.style.height = val.y + dotweenMethodName: + dependency: 9 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: VisualElementTopLeft_VisualElement + methodName: VisualElementTopLeft + targetType: UnityEngine.UIElements.VisualElement + propertyType: 3 + propertyName: + propertyGetter: GetTopLeft() + propertySetter: SetTopLeft(val) + dotweenMethodName: + dependency: 9 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: VisualElementColor_VisualElement + methodName: VisualElementColor + targetType: UnityEngine.UIElements.VisualElement + propertyType: 2 + propertyName: + propertyGetter: style.color.value + propertySetter: style.color = val + dotweenMethodName: + dependency: 9 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: VisualElementBackgroundColor_VisualElement + methodName: VisualElementBackgroundColor + targetType: UnityEngine.UIElements.VisualElement + propertyType: 2 + propertyName: + propertyGetter: style.backgroundColor.value + propertySetter: style.backgroundColor = val + dotweenMethodName: + dependency: 9 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: OffsetMin_RectTransform + methodName: OffsetMin + targetType: UnityEngine.RectTransform + propertyType: 3 + propertyName: offsetMin + propertyGetter: + propertySetter: + dotweenMethodName: + dependency: 1 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: OffsetMinX_RectTransform + methodName: OffsetMinX + targetType: UnityEngine.RectTransform + propertyType: 1 + propertyName: + propertyGetter: offsetMin[0] + propertySetter: offsetMin = _target.offsetMin.WithComponent(0, val) + dotweenMethodName: + dependency: 1 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: OffsetMinY_RectTransform + methodName: OffsetMinY + targetType: UnityEngine.RectTransform + propertyType: 1 + propertyName: + propertyGetter: offsetMin[1] + propertySetter: offsetMin = _target.offsetMin.WithComponent(1, val) + dotweenMethodName: + dependency: 1 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: OffsetMax_RectTransform + methodName: OffsetMax + targetType: UnityEngine.RectTransform + propertyType: 3 + propertyName: offsetMax + propertyGetter: + propertySetter: + dotweenMethodName: + dependency: 1 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: OffsetMaxX_RectTransform + methodName: OffsetMaxX + targetType: UnityEngine.RectTransform + propertyType: 1 + propertyName: + propertyGetter: offsetMax[0] + propertySetter: offsetMax = _target.offsetMax.WithComponent(0, val) + dotweenMethodName: + dependency: 1 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: OffsetMaxY_RectTransform + methodName: OffsetMaxY + targetType: UnityEngine.RectTransform + propertyType: 1 + propertyName: + propertyGetter: offsetMax[1] + propertySetter: offsetMax = _target.offsetMax.WithComponent(1, val) + dotweenMethodName: + dependency: 1 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + - description: TextMaxVisibleCharacters_TMP_Text + methodName: TextMaxVisibleCharacters + targetType: TMPro.TMP_Text + propertyType: 8 + propertyName: maxVisibleCharacters + propertyGetter: + propertySetter: + dotweenMethodName: DOMaxVisibleCharacters + dependency: 10 + placeInGlobalScope: 0 + generateOnlyOverloads: 1 + - description: FontSize_TMP_Text + methodName: TextFontSize + targetType: TMPro.TMP_Text + propertyType: 1 + propertyName: fontSize + propertyGetter: + propertySetter: + dotweenMethodName: + dependency: 10 + placeInGlobalScope: 0 + generateOnlyOverloads: 0 + additiveMethodsGenerator: + additiveMethods: + - methodName: PositionAdditive + propertyType: 4 + setter: _target.position += delta + - methodName: LocalPositionAdditive + propertyType: 4 + setter: _target.localPosition += delta + - methodName: ScaleAdditive + propertyType: 4 + setter: _target.localScale += delta + - methodName: RotationAdditive + propertyType: 4 + setter: _target.rotation *= UnityEngine.Quaternion.Euler(delta) + - methodName: LocalRotationAdditive + propertyType: 4 + setter: _target.localRotation *= UnityEngine.Quaternion.Euler(delta) + - methodName: RotationAdditive + propertyType: 6 + setter: _target.rotation *= delta + - methodName: LocalRotationAdditive + propertyType: 6 + setter: _target.localRotation *= delta + speedBasedMethodsGenerator: + data: + - methodName: Position + propType: 4 + propName: position + speedParamName: averageSpeed + - methodName: LocalPosition + propType: 4 + propName: localPosition + speedParamName: averageSpeed + - methodName: Rotation + propType: 6 + propName: rotation + speedParamName: averageAngularSpeed + - methodName: LocalRotation + propType: 6 + propName: localRotation + speedParamName: averageAngularSpeed diff --git a/FactoryNumeric/Packages/PrimeTween/Editor/CodeGenerator.asset.meta b/FactoryNumeric/Packages/PrimeTween/Editor/CodeGenerator.asset.meta new file mode 100644 index 00000000..0702eb76 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Editor/CodeGenerator.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b7964af3ed0024db49a5758e8a4de1c6 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/PrimeTween/Editor/CodeGenerator.cs b/FactoryNumeric/Packages/PrimeTween/Editor/CodeGenerator.cs new file mode 100644 index 00000000..e56e695d --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Editor/CodeGenerator.cs @@ -0,0 +1,753 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using JetBrains.Annotations; +using PrimeTween; +using UnityEditor; +using UnityEngine; +using Assert = UnityEngine.Assertions.Assert; + +// todo check all TweenType are covered in TweenTypeToTweenData() +internal class CodeGenerator : ScriptableObject { + [SerializeField] MonoScript methodsScript; + [SerializeField] MonoScript dotweenMethodsScript; + [SerializeField] MonoScript tweenComponentScript; + [SerializeField] MonoScript editorUtilsScript; + [SerializeField] MethodGenerationData[] methodsData; + [SerializeField] AdditiveMethodsGenerator additiveMethodsGenerator; + [SerializeField] SpeedBasedMethodsGenerator speedBasedMethodsGenerator; + + /*void OnEnable() { + #if PRIME_TWEEN_SAFETY_CHECKS + foreach (var data in methodsData) { + data.description = ""; + var methodPrefix = getMethodPrefix(data.dependency); + if (!string.IsNullOrEmpty(methodPrefix)) { + data.description += methodPrefix + "_"; + } + data.description = data.methodName + "_" + getTypeByName(data.targetType).Name; + } + #endif + }*/ + + [Serializable] + class AdditiveMethodsGenerator { + [SerializeField] AdditiveMethodsGeneratorData[] additiveMethods; + + [Serializable] + class AdditiveMethodsGeneratorData { + [SerializeField] internal string methodName; + [SerializeField] internal PropType propertyType; + [SerializeField] internal string setter; + } + + [NotNull] + internal string Generate() { + string result = @" +#if PRIME_TWEEN_EXPERIMENTAL"; + foreach (var data in additiveMethods) { + const string template = @" + public static Tween PositionAdditive([NotNull] UnityEngine.Transform target, Single deltaValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => PositionAdditive(target, deltaValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)); + public static Tween PositionAdditive([NotNull] UnityEngine.Transform target, Single deltaValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => PositionAdditive(target, deltaValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)); + public static Tween PositionAdditive([NotNull] UnityEngine.Transform target, Single deltaValue, TweenSettings settings) + => CustomAdditive(target, deltaValue, settings, (_target, delta) => additiveTweenSetter()); +"; + result += template.Replace("Single", data.propertyType.ToFullTypeName()) + .Replace("PositionAdditive", data.methodName) + .Replace("additiveTweenSetter()", data.setter); + } + result += "#endif"; + return result; + } + } + + [ContextMenu(nameof(generateAllMethods))] + internal void generateAllMethods() { + generateMethods(); + generateDotweenMethods(); + } + + const string generatorBeginLabel = "// CODE GENERATOR BEGIN"; + + [ContextMenu(nameof(generateTweenComponent))] + void generateTweenComponent() { + if (tweenComponentScript == null) { + Debug.LogError("Not generating TweenComponent script because this component is only available in PrimeTween PRO."); + return; + } + + var str = tweenComponentScript.text; + var searchIndex = str.IndexOf(generatorBeginLabel, StringComparison.Ordinal); + Assert.AreNotEqual(-1, searchIndex); + str = str.Substring(0, searchIndex + generatorBeginLabel.Length) + "\n"; + + var tweenTypes = (TweenType[]) Enum.GetValues(typeof(TweenType)); + tweenTypes = tweenTypes.SkipWhile(x => x != TweenType.LightRange).ToArray(); + var generationData = methodsData + .GroupBy(_ => _.dependency) + .SelectMany(x => x) + .SkipWhile(x => x.description != "Range_Light") + .ToArray(); + + Dependency dependency = Dependency.None; + for (var i = 0; i < generationData.Length; i++) { + var data = generationData[i]; + if (dependency != data.dependency) { + if (shouldWrapInDefine(dependency)) { + str += " #endif\n"; + } + dependency = data.dependency; + if (shouldWrapInDefine(dependency)) { + switch (dependency) { + case Dependency.PRIME_TWEEN_EXPERIMENTAL: + case Dependency.UI_ELEMENTS_MODULE_INSTALLED: + case Dependency.TEXT_MESH_PRO_INSTALLED: + str += $" #if {dependency}\n"; + break; + default: + str += $" #if !UNITY_2019_1_OR_NEWER || {dependency}\n"; + break; + } + } + } + var tweenType = tweenTypes[i]; + if (data.dependency == Dependency.UI_ELEMENTS_MODULE_INSTALLED || data.targetType.Contains("PrimeTween.")) { // skip both TweenTimeScale + continue; + } + Assert.IsTrue(tweenType.ToString().Contains(data.methodName), $"{i}, {tweenType}, {data.methodName}"); + // Debug.Log(data.methodName); + + var template = @" case TweenType.Position: + return target is Transform positionTarget ? Tween.Position(positionTarget, settingsVector3) : (Tween?)null;"; + template = template.Replace("TweenType.Position", $"TweenType.{tweenType}"); + template = template.Replace("Transform", getTypeByName(data.targetType).Name); + var varName = tweenType.ToString(); + varName = char.ToLower(varName[0]) + varName.Substring(1) + "Target"; + template = template.Replace("positionTarget", varName); + template = template.Replace("Tween.Position", $"Tween.{getPrefix()}{data.methodName}"); + template = template.Replace("settingsVector3", $"settings{data.propertyType}"); + str += template + "\n"; + + string getPrefix() => data.placeInGlobalScope ? null : getMethodPrefix(data.dependency); + } + if (shouldWrapInDefine(dependency)) { + str += " #endif\n"; + } + str += @" default: + throw new Exception(); + } + } + } + } +} +"; + SaveScript(tweenComponentScript, str); + } + + static void SaveScript(MonoScript script, string text) { + var path = AssetDatabase.GetAssetPath(script); + if (text == File.ReadAllText(path)) { + return; + } + File.WriteAllText(path, text); + EditorUtility.SetDirty(script); + AssetDatabase.Refresh(); + AssetDatabase.SaveAssets(); + } + + void generateDotweenMethods() { + // todo combine adapter files into one file + var str = @"#if PRIME_TWEEN_DOTWEEN_ADAPTER +// This file is generated by CodeGenerator.cs +using JetBrains.Annotations; +using System; + +namespace PrimeTween { + [PublicAPI] + public static partial class DOTweenAdapter {"; + const string dotweenOverload = " public static Tween DOTWEEN_METHOD_NAME([NotNull] this UnityEngine.Camera target, Single endValue, float duration) => Tween.METHOD_NAME(target, endValue, duration);"; + str += generateWithDefines(data => { + if (!data.dotweenMethodName.Any()) { + return string.Empty; + } + Assert.IsTrue(data.dotweenMethodName.Any()); + string result = ""; + result += "\n"; + result += populateTemplate(dotweenOverload.Replace("DOTWEEN_METHOD_NAME", data.dotweenMethodName), data); + return result; + }); + str += @" + } +} +#endif"; + SaveScript(dotweenMethodsScript, str); + } + + [CanBeNull] + static string getMethodPrefix(Dependency dep) { + switch (dep) { + case Dependency.UNITY_UGUI_INSTALLED: + return "UI"; + case Dependency.AUDIO_MODULE_INSTALLED: + return "Audio"; + case Dependency.PHYSICS_MODULE_INSTALLED: + case Dependency.PHYSICS2D_MODULE_INSTALLED: + return nameof(Rigidbody); + case Dependency.None: + case Dependency.PRIME_TWEEN_EXPERIMENTAL: + case Dependency.UI_ELEMENTS_MODULE_INSTALLED: + case Dependency.TEXT_MESH_PRO_INSTALLED: + return null; + } + return dep.ToString(); + } + + static bool shouldWrapInDefine(Dependency d) { + switch (d) { + case Dependency.UNITY_UGUI_INSTALLED: + case Dependency.AUDIO_MODULE_INSTALLED: + case Dependency.PHYSICS_MODULE_INSTALLED: + case Dependency.PHYSICS2D_MODULE_INSTALLED: + case Dependency.PRIME_TWEEN_EXPERIMENTAL: + case Dependency.UI_ELEMENTS_MODULE_INSTALLED: + case Dependency.TEXT_MESH_PRO_INSTALLED: + return true; + } + return false; + } + + const string overloadTemplateTo = @" public static Tween METHOD_NAME([NotNull] UnityEngine.Camera target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => METHOD_NAME(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween METHOD_NAME([NotNull] UnityEngine.Camera target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => METHOD_NAME(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween METHOD_NAME([NotNull] UnityEngine.Camera target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => METHOD_NAME(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween METHOD_NAME([NotNull] UnityEngine.Camera target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => METHOD_NAME(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween METHOD_NAME([NotNull] UnityEngine.Camera target, Single endValue, TweenSettings settings) => METHOD_NAME(target, new TweenSettings(endValue, settings)); + public static Tween METHOD_NAME([NotNull] UnityEngine.Camera target, Single startValue, Single endValue, TweenSettings settings) => METHOD_NAME(target, new TweenSettings(startValue, endValue, settings));"; + const string fullTemplate = @" public static Tween METHOD_NAME([NotNull] UnityEngine.Camera target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.Camera; + var val = _tween.FloatVal; + _target.orthographicSize = val; + }, t => (t.target as UnityEngine.Camera).orthographicSize.ToContainer(), TweenType.CameraOrthographicSize); + }"; + + void generateMethods() { + var text = methodsScript.text; + var searchIndex = text.IndexOf(generatorBeginLabel, StringComparison.Ordinal); + Assert.AreNotEqual(-1, searchIndex); + text = text.Substring(0, searchIndex + generatorBeginLabel.Length) + "\n"; + + var methodDataToEnumName = new Dictionary(); + { // generate enums + foreach (var group in methodsData.GroupBy(_ => _.dependency)) { + foreach (var data in group) { + text += " "; + var enumName = GetTweenTypeEnumName(data); + methodDataToEnumName.Add(data, enumName); + text += enumName; + text += ",\n"; + } + } + text += " }\n\n"; + } + { // generate TweenTypeToTweenData() + // todo combine Utils class with TweenGenerated or Extensions file + string utilsText = @"using System; +using PrimeTween; + +internal static class Utils { + internal static (PropType, Type) TweenTypeToTweenData(TweenType tweenType) { + switch (tweenType) { +"; + foreach (var group in methodsData.GroupBy(x => x.dependency)) { + var dependency = group.Key; + if (shouldWrapInDefine(dependency)) { + switch (dependency) { + case Dependency.PRIME_TWEEN_EXPERIMENTAL: + case Dependency.UI_ELEMENTS_MODULE_INSTALLED: + case Dependency.TEXT_MESH_PRO_INSTALLED: + utilsText += $" #if {dependency}\n"; + break; + default: + utilsText += $" #if !UNITY_2019_1_OR_NEWER || {dependency}\n"; + break; + } + } + foreach (var data in group) { + utilsText += $" case TweenType.{methodDataToEnumName[data]}:\n"; + utilsText += $" return (PropType.{data.propertyType}, typeof({getTypeByName(data.targetType).FullName}));\n"; + } + if (shouldWrapInDefine(dependency)) { + utilsText += " #endif\n"; + } + } + var tweenData = new List<(TweenType, PropType, Type)> { + (TweenType.None, PropType.None, null), + #if PRIME_TWEEN_PRO + (TweenType.TweenComponent, PropType.None, typeof(TweenComponent)), + #endif + (TweenType.Delay, PropType.Float, null), + (TweenType.Callback, PropType.Float, null), + (TweenType.ShakeLocalPosition, PropType.Vector3, typeof(Transform)), + (TweenType.ShakeLocalRotation, PropType.Quaternion, typeof(Transform)), + (TweenType.ShakeScale, PropType.Vector3, typeof(Transform)), + (TweenType.ShakeCustom, PropType.Vector3, typeof(Transform)), + (TweenType.ShakeCamera, PropType.Float, typeof(Camera)), + (TweenType.CustomFloat, PropType.Float, null), + (TweenType.CustomColor, PropType.Color, null), + (TweenType.CustomVector2, PropType.Vector2, null), + (TweenType.CustomVector3, PropType.Vector3, null), + (TweenType.CustomVector4, PropType.Vector4, null), + (TweenType.CustomQuaternion, PropType.Quaternion, null), + (TweenType.CustomRect, PropType.Rect, null), + (TweenType.CustomDouble, PropType.Double, null), + (TweenType.MaterialColorProperty, PropType.Color, typeof(Material)), + (TweenType.MaterialProperty, PropType.Float, typeof(Material)), + (TweenType.MaterialAlphaProperty, PropType.Float, typeof(Material)), + (TweenType.MaterialTextureOffset, PropType.Vector2, typeof(Material)), + (TweenType.MaterialTextureScale, PropType.Vector2, typeof(Material)), + (TweenType.MaterialPropertyVector4, PropType.Vector4, typeof(Material)), + (TweenType.EulerAngles, PropType.Vector3, typeof(Transform)), + (TweenType.LocalEulerAngles, PropType.Vector3, typeof(Transform)), + (TweenType.GlobalTimeScale, PropType.Float, null), + (TweenType.MainSequence, PropType.Float, null), + (TweenType.NestedSequence, PropType.Float, null) + }; + foreach (var tuple in tweenData) { + utilsText += $" case TweenType.{tuple.Item1}:\n"; + string typeStr = tuple.Item3 == null ? "null" : $"typeof({tuple.Item3})"; + utilsText += $" return (PropType.{tuple.Item2}, {typeStr});\n"; + } + utilsText += @" default: + throw new Exception(); + } + } +} +"; + SaveScript(editorUtilsScript, utilsText); + } + + text += " public partial struct Tween {"; + text += generateWithDefines(generate); + text = addCustomAnimationMethods(text); + text += additiveMethodsGenerator.Generate(); + text += speedBasedMethodsGenerator.Generate(); + text += @" + } +}"; + SaveScript(methodsScript, text); + } + + static string GetTweenTypeEnumName(MethodGenerationData data) { + string result = ""; + var dependency = data.dependency; + if (dependency != Dependency.None) { + result += getMethodPrefix(dependency); + } + if (dependency == Dependency.UI_ELEMENTS_MODULE_INSTALLED && !data.methodName.Contains("VisualElement")) { + result += "VisualElement"; + } + result += data.methodName; + if ((data.methodName == "Alpha" || data.methodName == "Color") && data.dependency == Dependency.UNITY_UGUI_INSTALLED) { + result += getTypeByName(data.targetType).Name; + } else if (data.methodName == "Scale" && data.propertyType == PropType.Float) { + result += "Uniform"; + } else if ((data.methodName == "Rotation" || data.methodName == "LocalRotation") && data.propertyType == PropType.Quaternion) { + result += "Quaternion"; + } else if (data.targetType == "PrimeTween.Sequence" ) { + result += "Sequence"; + } else if (data.targetType == "UnityEngine.Rigidbody2D") { + result += "2D"; + } + return result; + } + + [NotNull] + string generateWithDefines([NotNull] Func generator) { + string result = ""; + foreach (var group in methodsData.GroupBy(_ => _.dependency)) { + result += generateWithDefines(generator, group); + } + return result; + } + + [NotNull] + static string generateWithDefines([NotNull] Func generator, [NotNull] IGrouping group) { + var result = ""; + var dependency = group.Key; + if (shouldWrapInDefine(dependency)) { + switch (dependency) { + case Dependency.PRIME_TWEEN_EXPERIMENTAL: + case Dependency.UI_ELEMENTS_MODULE_INSTALLED: + case Dependency.TEXT_MESH_PRO_INSTALLED: + result += $"\n #if {dependency}"; + break; + default: + result += $"\n #if !UNITY_2019_1_OR_NEWER || {dependency}"; + break; + } + } + foreach (var method in group) { + var generated = generator(method); + if (!string.IsNullOrEmpty(generated)) { + result += generated; + result += "\n"; + } + } + if (shouldWrapInDefine(dependency)) { + result += "\n #endif"; + } + return result; + } + + [NotNull] + static Type getTypeByName(string targetType) { + var types = AppDomain.CurrentDomain + .GetAssemblies() + .Select(_ => _.GetType(targetType)) + .Where(_ => _ != null) + .Where(_ => _.FullName == targetType) + .Distinct() + .ToArray(); + switch (types.Length) { + case 0: + throw new Exception($"target type ({targetType}) not found in any of the assemblies.\n" + + "Please specify the full name of the type. For example, instead of 'Transform', use 'UnityEngine.Transform'.\n" + + "Or install the target package in Package Manager.\n"); + case 1: + break; + default: + throw new Exception($"More than one type found that match {targetType}. Found:\n" + + string.Join("\n", types.Select(_ => $"{_.AssemblyQualifiedName}\n{_.Assembly.GetName().FullName}"))); + } + var type = types.Single(); + Assert.IsNotNull(type, $"targetType ({targetType}) wasn't found in any assembly."); + return type; + } + + [NotNull] + static string generate([NotNull] MethodGenerationData data) { + var methodName = data.methodName; + Assert.IsTrue(System.CodeDom.Compiler.CodeGenerator.IsValidLanguageIndependentIdentifier(methodName), $"Method name is invalid: {methodName}."); + var propertyName = data.propertyName; + + var overload = populateTemplate(overloadTemplateTo, data); + var full = populateTemplate(fullTemplate, data); + const string templatePropName = "orthographicSize"; + string replaced = ""; + if (data.generateOnlyOverloads) { + replaced += "\n"; + replaced += overload; + } else if (propertyName.Any()) { + checkFieldOrProp(); + Assert.IsFalse(data.propertyGetter.Any()); + Assert.IsFalse(data.propertySetter.Any()); + replaced += "\n"; + replaced += overload; + replaced += "\n"; + replaced += full; + replaced = replaced.Replace(templatePropName, propertyName); + + void checkFieldOrProp() { + var type = getTypeByName(data.targetType); + Assert.IsNotNull(type); + const BindingFlags flags = BindingFlags.Instance | BindingFlags.Public; + var prop = type.GetProperty(propertyName, flags); + Type expectedPropType; + if (data.propertyType == PropType.Float) { + expectedPropType = typeof(float); + } else if (data.propertyType == PropType.Int) { + expectedPropType = typeof(int); + } else { + var typeName = $"{data.propertyType.ToFullTypeName()}, UnityEngine.CoreModule"; + expectedPropType = Type.GetType(typeName); + Assert.IsNotNull(expectedPropType, typeName); + } + if (prop != null) { + Assert.AreEqual(expectedPropType, prop.PropertyType); + return; + } + + var field = type.GetField(propertyName, flags); + if (field != null) { + Assert.AreEqual(expectedPropType, field.FieldType, "Field type is incorrect."); + return; + } + + throw new Exception($"Field or property with name ({propertyName}) not found for type {type.FullName}. Generation data name: {data.description}."); + } + } else { + Assert.IsTrue(data.propertySetter.Any()); + if (data.propertyGetter.Any()) { + replaced += "\n"; + replaced += replaceGetter(overload); + } + + replaced += "\n"; + full = replaceSetter(full); + replaced += replaceGetter(full); + + // ReSharper disable once AnnotateNotNullTypeMember + string replaceGetter(string str) { + while (true) { + var j = str.IndexOf(templatePropName, StringComparison.Ordinal); + if (j == -1) { + break; + } + Assert.AreNotEqual(-1, j); + str = str.Remove(j, templatePropName.Length); + str = str.Insert(j, data.propertyGetter); + } + return str; + } + + // ReSharper disable once AnnotateNotNullTypeMember + string replaceSetter(string str) { + while (true) { + var k = str.IndexOf("orthographicSize =", StringComparison.Ordinal); + if (k == -1) { + break; + } + Assert.AreNotEqual(-1, k); + var endIndex = str.IndexOf(";", k, StringComparison.Ordinal); + Assert.AreNotEqual(-1, endIndex); + str = str.Remove(k, endIndex - k); + str = str.Insert(k, data.propertySetter); + } + return str; + } + } + return replaced; + } + + [NotNull] + static string addCustomAnimationMethods(string text) { + const string template = @" public static Tween Custom_TEMPLATE(Single startValue, Single endValue, float duration, [NotNull] Action onValueChange, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Custom_TEMPLATE(new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + public static Tween Custom_TEMPLATE(Single startValue, Single endValue, float duration, [NotNull] Action onValueChange, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Custom_TEMPLATE(new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + public static Tween Custom_TEMPLATE(Single startValue, Single endValue, TweenSettings settings, [NotNull] Action onValueChange) => Custom_TEMPLATE(new TweenSettings(startValue, endValue, settings), onValueChange); + public static Tween Custom_TEMPLATE(TweenSettings settings, [NotNull] Action onValueChange) { + Assert.IsNotNull(onValueChange); + if (settings.startFromCurrent) { + UnityEngine.Debug.LogWarning(Constants.customTweensDontSupportStartFromCurrentWarning); + } + var tween = PrimeTweenManager.fetchTween(); + tween.startValue.CopyFrom(ref settings.startValue); + tween.endValue.CopyFrom(ref settings.endValue); + tween.customOnValueChange = onValueChange; + tween.Setup(PrimeTweenManager.dummyTarget, ref settings.settings, _tween => { + var _onValueChange = _tween.customOnValueChange as Action; + var val = _tween.FloatVal; + try { + _onValueChange(val); + } catch (Exception e) { + UnityEngine.Debug.LogException(e); + Assert.LogWarning($""Tween was stopped because of exception in {nameof(onValueChange)} callback, tween: {_tween.GetDescription()}\n"", _tween.id, _tween.target as UnityEngine.Object); + _tween.EmergencyStop(); + } + }, null, false, TweenType.CustomFloat); + return PrimeTweenManager.Animate(tween); + } + public static Tween Custom_TEMPLATE([NotNull] T target, Single startValue, Single endValue, float duration, [NotNull] Action onValueChange, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) where T : class + => Custom_internal(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + public static Tween Custom_TEMPLATE([NotNull] T target, Single startValue, Single endValue, float duration, [NotNull] Action onValueChange, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) where T : class + => Custom_internal(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + public static Tween Custom_TEMPLATE([NotNull] T target, Single startValue, Single endValue, TweenSettings settings, [NotNull] Action onValueChange) where T : class + => Custom_internal(target, new TweenSettings(startValue, endValue, settings), onValueChange); + public static Tween Custom_TEMPLATE([NotNull] T target, TweenSettings settings, [NotNull] Action onValueChange) where T : class + => Custom_internal(target, settings, onValueChange); + #if PRIME_TWEEN_EXPERIMENTAL + public static Tween CustomAdditive([NotNull] T target, Single deltaValue, TweenSettings settings, [NotNull] Action onDeltaChange) where T : class + => Custom_internal(target, new TweenSettings(default, deltaValue, settings), onDeltaChange, true); + #endif + static Tween Custom_internal([NotNull] T target, TweenSettings settings, [NotNull] Action onValueChange, bool isAdditive = false) where T : class { + Assert.IsNotNull(onValueChange); + if (settings.startFromCurrent) { + UnityEngine.Debug.LogWarning(Constants.customTweensDontSupportStartFromCurrentWarning); + } + var tween = PrimeTweenManager.fetchTween(); + tween.startValue.CopyFrom(ref settings.startValue); + tween.endValue.CopyFrom(ref settings.endValue); + tween.customOnValueChange = onValueChange; + tween.isAdditive = isAdditive; + tween.Setup(target, ref settings.settings, _tween => { + var _onValueChange = _tween.customOnValueChange as Action; + var _target = _tween.target as T; + Single val; + if (_tween.isAdditive) { + var newVal = _tween.FloatVal; + val = newVal.calcDelta(_tween.prevVal); + _tween.prevVal.FloatVal = newVal; + } else { + val = _tween.FloatVal; + } + try { + _onValueChange(_target, val); + } catch (Exception e) { + UnityEngine.Debug.LogException(e, _target as UnityEngine.Object); + Assert.LogWarning($""Tween was stopped because of exception in {nameof(onValueChange)} callback, tween: {_tween.GetDescription()}\n"", _tween.id, _tween.target as UnityEngine.Object); + _tween.EmergencyStop(); + } + }, null, false, TweenType.CustomFloat); + return PrimeTweenManager.Animate(tween); + } + static Tween animate(object target, ref TweenSettings settings, [NotNull] Action setter, Func getter, TweenType _tweenType) { + var tween = PrimeTweenManager.fetchTween(); + tween.startValue.CopyFrom(ref settings.startValue); + tween.endValue.CopyFrom(ref settings.endValue); + tween.Setup(target, ref settings.settings, setter, getter, settings.startFromCurrent, _tweenType); + return PrimeTweenManager.Animate(tween); + } + static Tween animateWithIntParam([NotNull] object target, int intParam, ref TweenSettings settings, [NotNull] Action setter, [NotNull] Func getter, TweenType _tweenType) { + var tween = PrimeTweenManager.fetchTween(); + tween.intParam = intParam; + tween.startValue.CopyFrom(ref settings.startValue); + tween.endValue.CopyFrom(ref settings.endValue); + tween.Setup(target, ref settings.settings, setter, getter, settings.startFromCurrent, _tweenType); + return PrimeTweenManager.Animate(tween); + }"; + + var types = new[] { typeof(float), typeof(Color), typeof(Vector2), typeof(Vector3), typeof(Vector4), typeof(Quaternion), typeof(Rect) }; + foreach (var type in types) { + text += "\n\n"; + var isFloat = type == typeof(float); + var replaced = template; + replaced = replaced.Replace("Single", isFloat ? "float" : type.FullName); + if (!isFloat) { + replaced = replaced.Replace("TweenSettings", $"TweenSettings<{type.FullName}>"); + replaced = replaced.Replace(".FloatVal", $".{type.Name}Val"); + replaced = replaced.Replace("Single val;", $"{type.Name} val;"); + replaced = replaced.Replace("PropType.Float", $"PropType.{type.Name}"); + replaced = replaced.Replace("TweenType.CustomFloat", $"TweenType.Custom{type.Name}"); + } + replaced = replaced.Replace("Custom_TEMPLATE", "Custom"); + text += replaced; + } + return text; + } + + [NotNull] + static string populateTemplate([NotNull] string str, [NotNull] MethodGenerationData data) { + var methodName = data.methodName; + var prefix = getMethodPrefix(data.dependency); + if (prefix != null && !data.placeInGlobalScope) { + methodName = prefix + methodName; + } + var targetType = data.targetType; + if (string.IsNullOrEmpty(targetType)) { + str = str.Replace("[NotNull] UnityEngine.Camera target, ", "") + .Replace("METHOD_NAME(target, ", "METHOD_NAME("); + } else { + str = str.Replace("UnityEngine.Camera", targetType); + } + str = str.Replace("METHOD_NAME", methodName); + str = str.Replace("TweenType.CameraOrthographicSize", $"TweenType.{GetTweenTypeEnumName(data)}"); + if (data.propertyType != PropType.Float) { + str = str.Replace("Single", data.propertyType.ToFullTypeName()); + str = str.Replace("_tween.FloatVal", $"_tween.{data.propertyType.ToString()}Val"); + str = str.Replace("TweenSettings", $"TweenSettings<{data.propertyType.ToFullTypeName()}>"); + } + return str; + } + + [Serializable] + internal class SpeedBasedMethodsGenerator { + [SerializeField] Data[] data; + + [Serializable] + class Data { + [SerializeField] internal string methodName; + [SerializeField] internal PropType propType; + [SerializeField] internal string propName; + [SerializeField] internal string speedParamName; + } + + [NotNull] + internal string Generate() { + string result = ""; + foreach (var d in data) { + const string template = @" + public static Tween PositionAtSpeed([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 endValue, float averageSpeed, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => PositionAtSpeed(target, new TweenSettings(endValue, new TweenSettings(averageSpeed, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween PositionAtSpeed([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 endValue, float averageSpeed, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => PositionAtSpeed(target, new TweenSettings(endValue, new TweenSettings(averageSpeed, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween PositionAtSpeed([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, float averageSpeed, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => PositionAtSpeed(target, new TweenSettings(startValue, endValue, new TweenSettings(averageSpeed, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween PositionAtSpeed([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, float averageSpeed, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => PositionAtSpeed(target, new TweenSettings(startValue, endValue, new TweenSettings(averageSpeed, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + static Tween PositionAtSpeed([NotNull] UnityEngine.Transform target, TweenSettings settings) { + var speed = settings.settings.duration; + if (speed <= 0) { + UnityEngine.Debug.LogError($""Invalid speed provided to the Tween.{nameof(PositionAtSpeed)}() method: {speed}.""); + return default; + } + if (settings.startFromCurrent) { + settings.startFromCurrent = false; + settings.startValue = target.position; + } + settings.settings.duration = Extensions.CalcDistance(settings.startValue, settings.endValue) / speed; + return Tween.Position(target, settings); + } +"; + result += template.Replace("PositionAtSpeed", $"{d.methodName}AtSpeed") + .Replace("UnityEngine.Vector3", d.propType.ToFullTypeName()) + .Replace("Tween.Position", $"{d.methodName}") + .Replace("target.position", $"target.{d.propName}") + .Replace("averageSpeed", $"{d.speedParamName}") + ; + } + return result; + } + } +} + +[Serializable] +class MethodGenerationData { + public string description; + public string methodName; + public string targetType; + public PropType propertyType; + + public string propertyName; + + public string propertyGetter; + public string propertySetter; + public string dotweenMethodName; + public Dependency dependency; + public bool placeInGlobalScope; + public bool generateOnlyOverloads; +} + +[PublicAPI] +enum Dependency { + None, + UNITY_UGUI_INSTALLED, + AUDIO_MODULE_INSTALLED, + PHYSICS_MODULE_INSTALLED, + PHYSICS2D_MODULE_INSTALLED, + Camera, + Material, + Light, + PRIME_TWEEN_EXPERIMENTAL, + UI_ELEMENTS_MODULE_INSTALLED, + TEXT_MESH_PRO_INSTALLED +} + +static class Ext { + [NotNull] + internal static string ToFullTypeName(this PropType type) { + Assert.AreNotEqual(PropType.Float, type); + if (type == PropType.Int) { + return "int"; + } + return $"UnityEngine.{type}"; + } +} diff --git a/FactoryNumeric/Packages/PrimeTween/Editor/CodeGenerator.cs.meta b/FactoryNumeric/Packages/PrimeTween/Editor/CodeGenerator.cs.meta new file mode 100644 index 00000000..38d5027b --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Editor/CodeGenerator.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: f81c141b47ab4aee9ea1454818ce73d3 +timeCreated: 1673348438 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Editor/CodeTemplates.cs b/FactoryNumeric/Packages/PrimeTween/Editor/CodeTemplates.cs new file mode 100644 index 00000000..d9b030a0 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Editor/CodeTemplates.cs @@ -0,0 +1,152 @@ +/* +// ReSharper disable PossibleNullReferenceException +// ReSharper disable UnusedMember.Global +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedMember.Local +using System; +using JetBrains.Annotations; + +namespace PrimeTween { + internal static class CodeTemplates { + public static Tween PositionAtSpeed([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 endValue, float averageSpeed, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => PositionAtSpeed(target, new TweenSettings(endValue, new TweenSettings(averageSpeed, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween PositionAtSpeed([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 endValue, float averageSpeed, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => PositionAtSpeed(target, new TweenSettings(endValue, new TweenSettings(averageSpeed, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween PositionAtSpeed([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, float averageSpeed, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => PositionAtSpeed(target, new TweenSettings(startValue, endValue, new TweenSettings(averageSpeed, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween PositionAtSpeed([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, float averageSpeed, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => PositionAtSpeed(target, new TweenSettings(startValue, endValue, new TweenSettings(averageSpeed, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + static Tween PositionAtSpeed([NotNull] UnityEngine.Transform target, TweenSettings settings) { + var speed = settings.settings.duration; + if (speed <= 0) { + UnityEngine.Debug.LogError($"Invalid speed provided to the Tween.{nameof(PositionAtSpeed)}() method: {speed}."); + return default; + } + if (settings.startFromCurrent) { + settings.startFromCurrent = false; + settings.startValue = target.position; + } + settings.settings.duration = Extensions.CalcDistance(settings.startValue, settings.endValue) / speed; + return Tween.Position(target, settings); + } + + public static Tween METHOD_NAME([NotNull] UnityEngine.Camera target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => METHOD_NAME(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween METHOD_NAME([NotNull] UnityEngine.Camera target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => METHOD_NAME(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween METHOD_NAME([NotNull] UnityEngine.Camera target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => METHOD_NAME(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween METHOD_NAME([NotNull] UnityEngine.Camera target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => METHOD_NAME(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween METHOD_NAME([NotNull] UnityEngine.Camera target, Single endValue, TweenSettings settings) => METHOD_NAME(target, new TweenSettings(endValue, settings)); + public static Tween METHOD_NAME([NotNull] UnityEngine.Camera target, Single startValue, Single endValue, TweenSettings settings) => METHOD_NAME(target, new TweenSettings(startValue, endValue, settings)); + + public static Tween METHOD_NAME([NotNull] UnityEngine.Camera target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.Camera; + var val = _tween.FloatVal; + _target.orthographicSize = val; + }, t => (t.target as UnityEngine.Camera).orthographicSize.ToContainer(), TweenType.CameraOrthographicSize); + } + + public static Tween Custom_TEMPLATE(Single startValue, Single endValue, float duration, [NotNull] Action onValueChange, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Custom_TEMPLATE(new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + public static Tween Custom_TEMPLATE(Single startValue, Single endValue, float duration, [NotNull] Action onValueChange, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Custom_TEMPLATE(new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + public static Tween Custom_TEMPLATE(Single startValue, Single endValue, TweenSettings settings, [NotNull] Action onValueChange) => Custom_TEMPLATE(new TweenSettings(startValue, endValue, settings), onValueChange); + public static Tween Custom_TEMPLATE(TweenSettings settings, [NotNull] Action onValueChange) { + Assert.IsNotNull(onValueChange); + if (settings.startFromCurrent) { + UnityEngine.Debug.LogWarning(Constants.customTweensDontSupportStartFromCurrentWarning); + } + var tween = PrimeTweenManager.fetchTween(); + tween.startValue.CopyFrom(ref settings.startValue); + tween.endValue.CopyFrom(ref settings.endValue); + tween.propType = PropType.Float; + tween.customOnValueChange = onValueChange; + tween.Setup(PrimeTweenManager.dummyTarget, ref settings.settings, _tween => { + var _onValueChange = _tween.customOnValueChange as Action; + var val = _tween.FloatVal; + try { + _onValueChange(val); + } catch (Exception e) { + UnityEngine.Debug.LogException(e); + Assert.LogWarning($"Tween was stopped because of exception in {nameof(onValueChange)} callback, tween: {_tween.GetDescription()}\n", _tween.id, _tween.target as UnityEngine.Object); + _tween.EmergencyStop(); + } + }, null, false, TweenType.CustomFloat); + return PrimeTweenManager.Animate(tween); + } + public static Tween Custom_TEMPLATE([NotNull] T target, Single startValue, Single endValue, float duration, [NotNull] Action onValueChange, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) where T : class + => Custom_internal(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + public static Tween Custom_TEMPLATE([NotNull] T target, Single startValue, Single endValue, float duration, [NotNull] Action onValueChange, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) where T : class + => Custom_internal(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + public static Tween Custom_TEMPLATE([NotNull] T target, Single startValue, Single endValue, TweenSettings settings, [NotNull] Action onValueChange) where T : class + => Custom_internal(target, new TweenSettings(startValue, endValue, settings), onValueChange); + public static Tween Custom_TEMPLATE([NotNull] T target, TweenSettings settings, [NotNull] Action onValueChange) where T : class + => Custom_internal(target, settings, onValueChange); + #if PRIME_TWEEN_EXPERIMENTAL + public static Tween CustomAdditive([NotNull] T target, Single deltaValue, TweenSettings settings, [NotNull] Action onDeltaChange) where T : class + => Custom_internal(target, new TweenSettings(default, deltaValue, settings), onDeltaChange, true); + #endif + static Tween Custom_internal([NotNull] T target, TweenSettings settings, [NotNull] Action onValueChange, bool isAdditive = false) where T : class { + Assert.IsNotNull(onValueChange); + if (settings.startFromCurrent) { + UnityEngine.Debug.LogWarning(Constants.customTweensDontSupportStartFromCurrentWarning); + } + var tween = PrimeTweenManager.fetchTween(); + tween.startValue.CopyFrom(ref settings.startValue); + tween.endValue.CopyFrom(ref settings.endValue); + tween.propType = PropType.Float; + tween.customOnValueChange = onValueChange; + tween.isAdditive = isAdditive; + tween.Setup(target, ref settings.settings, _tween => { + var _onValueChange = _tween.customOnValueChange as Action; + var _target = _tween.target as T; + Single val; + if (_tween.isAdditive) { + var newVal = _tween.FloatVal; + val = newVal.calcDelta(_tween.prevVal); + _tween.prevVal.FloatVal = newVal; + } else { + val = _tween.FloatVal; + } + try { + _onValueChange(_target, val); + } catch (Exception e) { + UnityEngine.Debug.LogException(e, _target as UnityEngine.Object); + Assert.LogWarning($"Tween was stopped because of exception in {nameof(onValueChange)} callback, tween: {_tween.GetDescription()}\n", _tween.id, _tween.target as UnityEngine.Object); + _tween.EmergencyStop(); + } + }, null, false, TweenType.CustomFloat); + return PrimeTweenManager.Animate(tween); + } + static Tween animate(object target, ref TweenSettings settings, [NotNull] Action setter, Func getter, TweenType _tweenType) { + var tween = PrimeTweenManager.fetchTween(); + tween.startValue.CopyFrom(ref settings.startValue); + tween.endValue.CopyFrom(ref settings.endValue); + tween.propType = PropType.Float; + tween.Setup(target, ref settings.settings, setter, getter, settings.startFromCurrent, _tweenType); + return PrimeTweenManager.Animate(tween); + } + static Tween animateWithIntParam([NotNull] object target, int intParam, ref TweenSettings settings, [NotNull] Action setter, [NotNull] Func getter, TweenType _tweenType) { + var tween = PrimeTweenManager.fetchTween(); + tween.intParam = intParam; + tween.startValue.CopyFrom(ref settings.startValue); + tween.endValue.CopyFrom(ref settings.endValue); + tween.propType = PropType.Float; + tween.Setup(target, ref settings.settings, setter, getter, settings.startFromCurrent, _tweenType); + return PrimeTweenManager.Animate(tween); + } + + public static Tween PositionAdditive([NotNull] UnityEngine.Transform target, Single deltaValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => PositionAdditive(target, deltaValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)); + public static Tween PositionAdditive([NotNull] UnityEngine.Transform target, Single deltaValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => PositionAdditive(target, deltaValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)); + public static Tween PositionAdditive([NotNull] UnityEngine.Transform target, Single deltaValue, TweenSettings settings) + => CustomAdditive(target, deltaValue, settings, (_, _) => additiveTweenSetter()); + + static void additiveTweenSetter() {} + } +} +*/ diff --git a/FactoryNumeric/Packages/PrimeTween/Editor/CodeTemplates.cs.meta b/FactoryNumeric/Packages/PrimeTween/Editor/CodeTemplates.cs.meta new file mode 100644 index 00000000..f01230aa --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Editor/CodeTemplates.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 566b3920ae914b24909cd26d64c86e77 +timeCreated: 1677166276 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Editor/PrimeTween.Editor.asmdef b/FactoryNumeric/Packages/PrimeTween/Editor/PrimeTween.Editor.asmdef new file mode 100644 index 00000000..bf0ea146 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Editor/PrimeTween.Editor.asmdef @@ -0,0 +1,18 @@ +{ + "name": "PrimeTween.Editor", + "rootNamespace": "", + "references": [ + "PrimeTween.Runtime" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Editor/PrimeTween.Editor.asmdef.meta b/FactoryNumeric/Packages/PrimeTween/Editor/PrimeTween.Editor.asmdef.meta new file mode 100644 index 00000000..86440c2e --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Editor/PrimeTween.Editor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9b75a211bc674cd2906483cd8aa2159d +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/PrimeTween/Editor/PrimeTweenManagerInspector.cs b/FactoryNumeric/Packages/PrimeTween/Editor/PrimeTweenManagerInspector.cs new file mode 100644 index 00000000..1364110e --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Editor/PrimeTweenManagerInspector.cs @@ -0,0 +1,89 @@ +using System.Collections.Generic; +using JetBrains.Annotations; +using PrimeTween; +using UnityEditor; +using UnityEngine; + +[CustomEditor(typeof(PrimeTweenManager))] +internal class PrimeTweenManagerInspector : Editor { + SerializedProperty tweensProp; + SerializedProperty lateUpdateTweensProp; + SerializedProperty fixedUpdateTweensProp; + GUIContent aliveTweenGuiContent; + GUIContent lateUpdateTweenGuiContent; + GUIContent fixedUpdateTweenGuiContent; + StringCache tweensCountCache; + StringCache maxSimultaneousTweensCountCache; + StringCache currentPoolCapacityCache; + + void OnEnable() { + tweensProp = serializedObject.FindProperty(nameof(PrimeTweenManager.tweens)); + lateUpdateTweensProp = serializedObject.FindProperty(nameof(PrimeTweenManager.lateUpdateTweens)); + fixedUpdateTweensProp = serializedObject.FindProperty(nameof(PrimeTweenManager.fixedUpdateTweens)); + Assert.IsNotNull(tweensProp); + Assert.IsNotNull(lateUpdateTweensProp); + Assert.IsNotNull(fixedUpdateTweensProp); + aliveTweenGuiContent = new GUIContent("Tweens"); + lateUpdateTweenGuiContent = new GUIContent("Late update tweens"); + fixedUpdateTweenGuiContent = new GUIContent("Fixed update tweens"); + } + + public override void OnInspectorGUI() { + using (new EditorGUI.DisabledScope(true)) { + EditorGUILayout.ObjectField("Script", MonoScript.FromMonoBehaviour((MonoBehaviour)target), typeof(MonoBehaviour), false); + } + + var manager = target as PrimeTweenManager; + Assert.IsNotNull(manager); + + GUILayout.BeginHorizontal(); + GUILayout.Label("Alive tweens", EditorStyles.label); + GUILayout.Label(tweensCountCache.GetCachedString(manager.tweensCount), EditorStyles.boldLabel); + GUILayout.FlexibleSpace(); + GUILayout.EndHorizontal(); + + GUILayout.BeginHorizontal(); + GUILayout.Label( Constants.maxAliveTweens, EditorStyles.label); + GUILayout.Label(maxSimultaneousTweensCountCache.GetCachedString(manager.maxSimultaneousTweensCount), EditorStyles.boldLabel); + GUILayout.FlexibleSpace(); + GUILayout.EndHorizontal(); + + GUILayout.BeginHorizontal(); + GUILayout.Label("Tweens capacity", EditorStyles.label); + GUILayout.Label(currentPoolCapacityCache.GetCachedString(manager.currentPoolCapacity), EditorStyles.boldLabel); + GUILayout.FlexibleSpace(); + GUILayout.EndHorizontal(); + EditorGUILayout.HelpBox("Use " + Constants.setTweensCapacityMethod + " to set tweens capacity.\n" + + "To prevent memory allocations during runtime, choose the value that is greater than the maximum number of simultaneous tweens in your game.", MessageType.None); + + drawList(tweensProp, manager.tweens, aliveTweenGuiContent); + drawList(lateUpdateTweensProp, manager.lateUpdateTweens, lateUpdateTweenGuiContent); + drawList(fixedUpdateTweensProp, manager.fixedUpdateTweens, fixedUpdateTweenGuiContent); + void drawList(SerializedProperty tweensProp, List list, GUIContent guiContent) { + if (tweensProp.isExpanded) { + foreach (var tween in list) { + if (tween != null && string.IsNullOrEmpty(tween.debugDescription)) { + tween.debugDescription = tween.GetDescription(); + } + } + } + using (new EditorGUI.DisabledScope(true)) { + EditorGUILayout.PropertyField(tweensProp, guiContent); + } + } + } + + struct StringCache { + int currentValue; + string str; + + [NotNull] + internal string GetCachedString(int value) { + if (currentValue != value || str == null) { + currentValue = value; + str = value.ToString(); + } + return str; + } + } +} \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Editor/PrimeTweenManagerInspector.cs.meta b/FactoryNumeric/Packages/PrimeTween/Editor/PrimeTweenManagerInspector.cs.meta new file mode 100644 index 00000000..fb4ed9fe --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Editor/PrimeTweenManagerInspector.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 98b4466711c04e95b1d84f31e10116ba +timeCreated: 1683813842 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Editor/Tests.meta b/FactoryNumeric/Packages/PrimeTween/Editor/Tests.meta new file mode 100644 index 00000000..2afe6527 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Editor/Tests.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d057e4b13cb03419fbb4f13ffaaa50fd +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/PrimeTween/Editor/Tests/EditModeTests.cs b/FactoryNumeric/Packages/PrimeTween/Editor/Tests/EditModeTests.cs new file mode 100644 index 00000000..e759c9a1 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Editor/Tests/EditModeTests.cs @@ -0,0 +1,61 @@ +#if TEST_FRAMEWORK_INSTALLED +using NUnit.Framework; +using PrimeTween; +using UnityEngine; +using UnityEngine.TestTools; +using Assert = NUnit.Framework.Assert; +using AssertionException = UnityEngine.Assertions.AssertionException; + +public class EditModeTests { + [Test] + public void TestEditMode() { + expectError(); + Tween.Custom(0, 1, 1, delegate {}); + var go = new GameObject(); + { + expectError(); + Tween.Alpha(go.AddComponent(), 0, 1); + expectError(); + Tween.Delay(1); + expectError(); + Tween.Delay(0); + expectError(); + Tween.CompleteAll(); + expectError(); + Tween.StopAll(); + expectError(); + Tween.SetPausedAll(true); + expectError(); + Tween.ShakeLocalPosition(go.transform, Vector3.one, 1); + expectError(); + Tween.ShakeCustom(go, Vector3.zero, new ShakeSettings(Vector3.one, 1), delegate {}); + expectError(); + Sequence.Create(); + expectError(); + Tween.GlobalTimeScale(0.5f, 0.1f); + expectError(); + Tween.GetTweensCount(this); + expectError(); + Tween.GetTweensCount(); + expectError(); + Sequence.Create(new Tween()); + + TweenSettings.ValidateCustomCurveKeyframes(AnimationCurve.Linear(0, 0, 1, 1)); + PrimeTweenConfig.SetTweensCapacity(10); + Assert.Throws(() => PrimeTweenConfig.defaultEase = Ease.InCirc); + } + Object.DestroyImmediate(go); + void expectError() { + LogAssert.Expect(LogType.Warning, Constants.editModeWarning); + } + LogAssert.NoUnexpectedReceived(); + } + + #if PRIME_TWEEN_SAFETY_CHECKS + [Test] + public void DebugStackTraces() { + StackTraces.logDebugInfo(); + } + #endif +} +#endif diff --git a/FactoryNumeric/Packages/PrimeTween/Editor/Tests/EditModeTests.cs.meta b/FactoryNumeric/Packages/PrimeTween/Editor/Tests/EditModeTests.cs.meta new file mode 100644 index 00000000..5390eb96 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Editor/Tests/EditModeTests.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b0ff2556c5a9049f9b88ec6cda057c06 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/PrimeTween/Editor/Tests/PrimeTween.Tests.Editor.asmdef b/FactoryNumeric/Packages/PrimeTween/Editor/Tests/PrimeTween.Tests.Editor.asmdef new file mode 100644 index 00000000..3ddda132 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Editor/Tests/PrimeTween.Tests.Editor.asmdef @@ -0,0 +1,29 @@ +{ + "name": "PrimeTween.Tests.Editor", + "rootNamespace": "", + "references": [ + "UnityEngine.TestRunner", + "UnityEditor.TestRunner", + "PrimeTween.Runtime" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": true, + "precompiledReferences": [ + "nunit.framework.dll" + ], + "autoReferenced": false, + "defineConstraints": [ + "UNITY_INCLUDE_TESTS" + ], + "versionDefines": [ + { + "name": "com.unity.test-framework", + "expression": "1.3.9", + "define": "TEST_FRAMEWORK_INSTALLED" + }], + "noEngineReferences": false +} \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Editor/Tests/PrimeTween.Tests.Editor.asmdef.meta b/FactoryNumeric/Packages/PrimeTween/Editor/Tests/PrimeTween.Tests.Editor.asmdef.meta new file mode 100644 index 00000000..199d2718 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Editor/Tests/PrimeTween.Tests.Editor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 96901b66f89944bf6aa2338f07026648 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/PrimeTween/Editor/TweenSettingsPropDrawer.cs b/FactoryNumeric/Packages/PrimeTween/Editor/TweenSettingsPropDrawer.cs new file mode 100644 index 00000000..081b9562 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Editor/TweenSettingsPropDrawer.cs @@ -0,0 +1,170 @@ +using JetBrains.Annotations; +using PrimeTween; +using UnityEditor; +using UnityEngine; +using static UnityEditor.EditorGUI; +using static UnityEditor.EditorGUIUtility; + +/// todo clear the custom ease curve when ease != Ease.Custom +[CustomPropertyDrawer(typeof(TweenSettings))] +internal class TweenSettingsPropDrawer : PropertyDrawer { + public override float GetPropertyHeight([NotNull] SerializedProperty property, GUIContent label) { + if (!property.isExpanded) { + return singleLineHeight; + } + return getPropHeight(property); + } + + internal static float getPropHeight([NotNull] SerializedProperty property) { + var count = 1; + count++; // duration + count++; // ease + var easeIndex = property.FindPropertyRelative(nameof(TweenSettings.ease)).intValue; + if (easeIndex == (int)Ease.Custom) { + count++; // customEase + } + count++; // cycles + var cycles = property.FindPropertyRelative(nameof(TweenSettings.cycles)).intValue; + if (cycles != 0 && cycles != 1) { + count++; // cycleMode + } + count++; // startDelay + count++; // endDelay + count++; // useUnscaledTime + count++; // useFixedUpdate + var result = singleLineHeight * count + standardVerticalSpacing * (count - 1); + result += standardVerticalSpacing * 2; // extra spacing + return result; + } + + public override void OnGUI(Rect position, [NotNull] SerializedProperty property, GUIContent label) { + var rect = new Rect(position) { height = singleLineHeight }; + PropertyField(rect, property, label); + if (!property.isExpanded) { + return; + } + moveToNextLine(ref rect); + indentLevel++; + { // duration + property.NextVisible(true); + DrawDuration(rect, property); + moveToNextLine(ref rect); + } + drawEaseTillEnd(property, ref rect); + indentLevel--; + } + + internal static void DrawDuration(Rect rect, [NotNull] SerializedProperty property) { + if (GUI.enabled) { + ClampProperty(property, 1f); + } + PropertyField(rect, property); + } + + internal static void ClampProperty(SerializedProperty prop, float defaultValue, float min = 0.01f, float max = float.MaxValue) { + prop.floatValue = prop.floatValue == 0f ? defaultValue : Mathf.Clamp(prop.floatValue, min, max); + } + + internal static void drawEaseTillEnd([NotNull] SerializedProperty property, ref Rect rect) { + DrawEaseAndCycles(property, ref rect); + drawStartDelayTillEnd(ref rect, property); + } + + internal static void DrawEaseAndCycles(SerializedProperty property, ref Rect rect, bool addSpace = true, bool draw = true, bool allowInfiniteCycles = true) { + { // ease + property.NextVisible(true); + if (draw) PropertyField(rect, property); + moveToNextLine(ref rect); + // customEase + bool isCustom = property.intValue == (int) Ease.Custom; + property.NextVisible(true); + if (isCustom) { + if (draw) PropertyField(rect, property); + moveToNextLine(ref rect); + } + } + if (addSpace) { + rect.y += standardVerticalSpacing * 2; + } + { // cycles + var cycles = drawCycles(rect, property, draw, allowInfiniteCycles); + moveToNextLine(ref rect); + { + // cycleMode + property.NextVisible(true); + if (cycles != 0 && cycles != 1) { + if (draw) PropertyField(rect, property); + moveToNextLine(ref rect); + } + } + } + } + + internal static void drawStartDelayTillEnd(ref Rect rect, [NotNull] SerializedProperty property) { + { // startDelay, endDelay + for (int _ = 0; _ < 2; _++) { + property.NextVisible(true); + if (property.floatValue < 0f) { + property.floatValue = 0f; + } + PropertyField(rect, property); + moveToNextLine(ref rect); + } + } + { // useUnscaledTime + property.NextVisible(true); + PropertyField(rect, property); + moveToNextLine(ref rect); + } + { // useFixedUpdate + property.Next(false); + bool useFixedUpdateObsolete = property.boolValue; + var useFixedUpdateProp = property.Copy(); + + property.NextVisible(false); + var current = (_UpdateType)property.enumValueIndex; + if (useFixedUpdateObsolete && current != _UpdateType.FixedUpdate) { + property.serializedObject.Update(); + property.enumValueIndex = (int)_UpdateType.FixedUpdate; + property.serializedObject.ApplyModifiedProperties(); + } else { + using (var propScope = new PropertyScope(rect, new GUIContent(property.displayName, property.tooltip), property)) { + using (var changeCheck = new ChangeCheckScope()) { + var newUpdateType = (_UpdateType)EnumPopup(rect, propScope.content, current); + if (changeCheck.changed) { + property.enumValueIndex = (int)newUpdateType; + useFixedUpdateProp.boolValue = newUpdateType == _UpdateType.FixedUpdate; + } + moveToNextLine(ref rect); + } + } + } + } + } + + internal static int drawCycles(Rect rect, [NotNull] SerializedProperty property, bool draw = true, bool allowInfiniteCycles = true) { + property.NextVisible(false); + int val = property.intValue; + if (val == 0) { + val = 1; + } else if (val < 0) { + val = allowInfiniteCycles ? -1 : 1; + } + property.intValue = val; + if (draw) PropertyField(rect, property); + return val; + } + + static void moveToNextLine(ref Rect rect) { + rect.y += singleLineHeight + standardVerticalSpacing; + } +} + +[CustomPropertyDrawer(typeof(UpdateType))] +class UpdateTypePropDrawer : PropertyDrawer { + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) => singleLineHeight; + public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label) { + prop.Next(true); + PropertyField(pos, prop, label); + } +} diff --git a/FactoryNumeric/Packages/PrimeTween/Editor/TweenSettingsPropDrawer.cs.meta b/FactoryNumeric/Packages/PrimeTween/Editor/TweenSettingsPropDrawer.cs.meta new file mode 100644 index 00000000..26faeedb --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Editor/TweenSettingsPropDrawer.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 142499da0ff44fac99f2ac376bbce331 +timeCreated: 1677570253 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Editor/TweenSettingsTypesPropDrawer.cs b/FactoryNumeric/Packages/PrimeTween/Editor/TweenSettingsTypesPropDrawer.cs new file mode 100644 index 00000000..bf90a8ad --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Editor/TweenSettingsTypesPropDrawer.cs @@ -0,0 +1,85 @@ +#pragma warning disable CS0162 +using JetBrains.Annotations; +using PrimeTween; +using UnityEditor; +using UnityEngine; +using static UnityEditor.EditorGUI; +using static UnityEditor.EditorGUIUtility; + +[CustomPropertyDrawer(typeof(TweenSettings)), + CustomPropertyDrawer(typeof(TweenSettings)), + CustomPropertyDrawer(typeof(TweenSettings)), + CustomPropertyDrawer(typeof(TweenSettings)), + CustomPropertyDrawer(typeof(TweenSettings)), + CustomPropertyDrawer(typeof(TweenSettings)), + CustomPropertyDrawer(typeof(TweenSettings)), + CustomPropertyDrawer(typeof(TweenSettings)) +] +internal class TweenSettingsTypesPropDrawer : PropertyDrawer { + const bool drawStartFromCurrent = false; + + public override float GetPropertyHeight([NotNull] SerializedProperty property, GUIContent label) { + if (!property.isExpanded) { + return singleLineHeight; + } + var count = 0; + float height = 0f; + property.NextVisible(true); // startFromCurrent + incrementHeight(); // startValue + incrementHeight(); // endValue + property.NextVisible(false); + var result = height + 0 * (count - 1) + TweenSettingsPropDrawer.getPropHeight(property); + result += standardVerticalSpacing * 2; // extra space + return result; + + void incrementHeight() { + property.NextVisible(false); + count++; // startFromCurrent + height += EditorGUI.GetPropertyHeight(property, true); + } + } + + public override void OnGUI(Rect position, [NotNull] SerializedProperty property, GUIContent label) { + var rect = new Rect(position) { height = singleLineHeight }; + PropertyField(rect, property, label); + if (!property.isExpanded) { + return; + } + rect.y += singleLineHeight + standardVerticalSpacing; + indentLevel++; + + // startFromCurrent + property.NextVisible(true); + + // startValue + { + var startFromCurrent = property.boolValue; + property.NextVisible(false); + if (!startFromCurrent || !drawStartFromCurrent) { + PropertyField(rect, property, true); + moveToNextLine(true); + } + } + + // endValue + property.NextVisible(false); + PropertyField(rect, property, true); + moveToNextLine(true); + + // duration + { + property.NextVisible(false); // settings + property.NextVisible(true); // duration + TweenSettingsPropDrawer.DrawDuration(rect, property); + moveToNextLine(false); + } + + TweenSettingsPropDrawer.drawEaseTillEnd(property, ref rect); + + indentLevel--; + + void moveToNextLine(bool includeChildren) { + rect.y += EditorGUI.GetPropertyHeight(property, includeChildren) + standardVerticalSpacing; + } + } +} diff --git a/FactoryNumeric/Packages/PrimeTween/Editor/TweenSettingsTypesPropDrawer.cs.meta b/FactoryNumeric/Packages/PrimeTween/Editor/TweenSettingsTypesPropDrawer.cs.meta new file mode 100644 index 00000000..21bad296 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Editor/TweenSettingsTypesPropDrawer.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 9e0988c54c7744db9aa91eae79ed7e5e +timeCreated: 1677747774 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Editor/TweenShakeSettingsPropDrawer.cs b/FactoryNumeric/Packages/PrimeTween/Editor/TweenShakeSettingsPropDrawer.cs new file mode 100644 index 00000000..e868d843 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Editor/TweenShakeSettingsPropDrawer.cs @@ -0,0 +1,117 @@ +using JetBrains.Annotations; +using PrimeTween; +using UnityEditor; +using UnityEngine; +using static UnityEditor.EditorGUI; +using static UnityEditor.EditorGUIUtility; + +[CustomPropertyDrawer(typeof(ShakeSettings))] +internal class TweenShakeSettingsPropDrawer : PropertyDrawer { // todo rename to ShakeSettingsPropDrawer + public override float GetPropertyHeight([NotNull] SerializedProperty property, GUIContent label) { + if (!property.isExpanded) { + return singleLineHeight; + } + property.NextVisible(true); + float result = EditorGUI.GetPropertyHeight(property, true); // strength + var count = 1; + count++; // frequency + count++; // duration + count++; // enableFalloff + property.NextVisible(false); + property.NextVisible(false); + property.NextVisible(false); // enableFalloff + if (property.boolValue) { + count++; // falloffEase + property.NextVisible(false); + if (property.intValue == -1) { + count++; // strengthOverTime + } + } + count++; // asymmetry + count++; // easeBetweenShakes + count++; // cycles + count++; // startDelay + count++; // endDelay + count++; // useUnscaledTime + count++; // useFixedUpdate + result += singleLineHeight * count + standardVerticalSpacing * (count - 1); + result += standardVerticalSpacing * 2; // extra space + return result; + } + + public override void OnGUI(Rect position, [NotNull] SerializedProperty property, GUIContent label) { + var rect = new Rect(position) { height = singleLineHeight }; + PropertyField(rect, property, label); + if (!property.isExpanded) { + return; + } + moveToNextLine(); + indentLevel++; + property.NextVisible(true); + { // strength + PropertyField(rect, property); + rect.y += EditorGUI.GetPropertyHeight(property, true); + } + { // duration + property.NextVisible(false); + TweenSettingsPropDrawer.DrawDuration(rect, property); + moveToNextLine(); + } + { // frequency + property.NextVisible(false); + var floatValue = property.floatValue; + if (floatValue == 0f) { + property.floatValue = ShakeSettings.defaultFrequency; + } else if (floatValue < 0.1f) { + property.floatValue = 0.1f; + } + propertyField(); + } + { // enableFalloff + property.NextVisible(false); + propertyField(); + var enableFalloff = property.boolValue; + property.NextVisible(false); + if (enableFalloff) { + // falloffEase + propertyField(); + // strengthOverTime + var customFalloffEase = property.intValue == (int)Ease.Custom; + property.NextVisible(false); + if (customFalloffEase) { + propertyField(); + } + } else { + // skipped strengthOverTime + property.NextVisible(false); + } + } + // extra space + rect.y += standardVerticalSpacing * 2; + { // asymmetry + property.NextVisible(false); + propertyField(); + } + { // easeBetweenShakes + property.NextVisible(false); + if (property.intValue == (int)Ease.Custom) { + Debug.LogWarning($"Ease.Custom is not supported for {nameof(ShakeSettings.easeBetweenShakes)}."); + property.intValue = (int)Ease.Default; + } + propertyField(); + } + TweenSettingsPropDrawer.drawCycles(rect, property); + moveToNextLine(); + TweenSettingsPropDrawer.drawStartDelayTillEnd(ref rect, property); + indentLevel--; + + void propertyField() { + PropertyField(rect, property); + moveToNextLine(); + } + + void moveToNextLine() { + rect.y += singleLineHeight + standardVerticalSpacing; + } + } +} diff --git a/FactoryNumeric/Packages/PrimeTween/Editor/TweenShakeSettingsPropDrawer.cs.meta b/FactoryNumeric/Packages/PrimeTween/Editor/TweenShakeSettingsPropDrawer.cs.meta new file mode 100644 index 00000000..ee61c161 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Editor/TweenShakeSettingsPropDrawer.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: ccef20e0855347cdae977a49716d656f +timeCreated: 1677573071 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Editor/ValueContainerStartEndPropDrawer.cs b/FactoryNumeric/Packages/PrimeTween/Editor/ValueContainerStartEndPropDrawer.cs new file mode 100644 index 00000000..7af0d563 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Editor/ValueContainerStartEndPropDrawer.cs @@ -0,0 +1,143 @@ +using System; +using PrimeTween; +using UnityEditor; +using UnityEngine; + +[CustomPropertyDrawer(typeof(ValueContainerStartEnd))] +public class ValueContainerStartEndPropDrawer : PropertyDrawer { + public override float GetPropertyHeight(SerializedProperty prop, GUIContent label) { + prop.Next(true); + var tweenType = (TweenType)prop.enumValueIndex; + prop.Next(false); + return GetHeight(prop, label, tweenType); + } + + internal static float GetHeight(SerializedProperty prop, GUIContent label, TweenType tweenType) { + var propType = Utils.TweenTypeToTweenData(tweenType).Item1; + Assert.AreNotEqual(PropType.None, propType); + bool startFromCurrent = prop.boolValue; + bool hasStartValue = !startFromCurrent; + if (hasStartValue) { + return GetSingleItemHeight(propType, label) * 2f + EditorGUIUtility.standardVerticalSpacing; + } + return EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing + GetSingleItemHeight(propType, label); + } + + static float GetSingleItemHeight(PropType propType, GUIContent label) { + return EditorGUI.GetPropertyHeight(ToSerializedPropType(), label); + SerializedPropertyType ToSerializedPropType() { + switch (propType) { + case PropType.Float: + return SerializedPropertyType.Float; + case PropType.Color: + return SerializedPropertyType.Color; + case PropType.Vector2: + return SerializedPropertyType.Vector2; + case PropType.Vector3: + return SerializedPropertyType.Vector3; + case PropType.Vector4: + case PropType.Quaternion: + return SerializedPropertyType.Vector4; + case PropType.Rect: + return SerializedPropertyType.Rect; + case PropType.Int: + return SerializedPropertyType.Integer; + case PropType.Double: // todo support double + case PropType.None: + default: + throw new Exception(); + } + } + } + + public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label) { + prop.Next(true); + var tweenType = (TweenType)prop.enumValueIndex; + prop.Next(false); + Draw(ref pos, prop, tweenType); + } + + internal static void Draw(ref Rect pos, SerializedProperty prop, TweenType tweenType) { + var propType = Utils.TweenTypeToTweenData(tweenType).Item1; + Assert.AreNotEqual(PropType.None, propType); + const float toggleWidth = 18f; + EditorGUIUtility.labelWidth -= toggleWidth; + var togglePos = new Rect(pos.x + 2, pos.y, toggleWidth - 2, EditorGUIUtility.singleLineHeight); + var guiContent = EditorGUI.BeginProperty(togglePos, new GUIContent(), prop); // todo is it possible to display tooltip? tooltip is only displayed over the label, but I need to display it over the ToggleLeft + EditorGUI.BeginChangeCheck(); + bool newStartFromCurrent = !EditorGUI.ToggleLeft(togglePos, guiContent, !prop.boolValue); + if (EditorGUI.EndChangeCheck()) { + prop.boolValue = newStartFromCurrent; + } + EditorGUI.EndProperty(); + + pos.x += toggleWidth; + pos.width -= toggleWidth; + + prop.Next(false); + if (newStartFromCurrent) { + pos.height = EditorGUIUtility.singleLineHeight; + EditorGUI.LabelField(pos, new GUIContent(prop.displayName, prop.tooltip)); + prop.Next(false); + } else { + DrawValueContainer(ref pos, prop, propType); + } + + pos.y += pos.height + EditorGUIUtility.standardVerticalSpacing; + DrawValueContainer(ref pos, prop, propType); + pos.y += pos.height + EditorGUIUtility.standardVerticalSpacing; + + pos.x -= toggleWidth; + pos.width += toggleWidth; + } + + static void DrawValueContainer(ref Rect pos, SerializedProperty prop, PropType propType) { + var root = prop.Copy(); + prop.Next(true); + ValueContainer valueContainer = default; + for (int i = 0; i < 4; i++) { + valueContainer[i] = prop.floatValue; + prop.Next(false); + } + var guiContent = new GUIContent(root.displayName, root.tooltip); + pos.height = GetSingleItemHeight(propType, guiContent); + guiContent = EditorGUI.BeginProperty(pos, guiContent, root); + EditorGUI.BeginChangeCheck(); + ValueContainer newVal = DrawField(pos); + ValueContainer DrawField(Rect position) { + switch (propType) { + case PropType.Float: + return EditorGUI.FloatField(position, guiContent, valueContainer.FloatVal).ToContainer(); + case PropType.Color: + return EditorGUI.ColorField(position, guiContent, valueContainer.ColorVal).ToContainer(); + case PropType.Vector2: + return EditorGUI.Vector2Field(position, guiContent, valueContainer.Vector2Val).ToContainer(); + case PropType.Vector3: + return EditorGUI.Vector3Field(position, guiContent, valueContainer.Vector3Val).ToContainer(); + case PropType.Vector4: + case PropType.Quaternion: // todo don't draw quaternion + return EditorGUI.Vector4Field(position, guiContent, valueContainer.Vector4Val).ToContainer(); + case PropType.Rect: + return EditorGUI.RectField(position, guiContent, valueContainer.RectVal).ToContainer(); + case PropType.Int: + var newIntVal = EditorGUI.IntField(position, guiContent, Mathf.RoundToInt(valueContainer.FloatVal)); + return ((float)newIntVal).ToContainer(); + case PropType.Double: // todo support double with EditorGUI.DoubleField()? + case PropType.None: + default: + throw new Exception(); + } + } + if (EditorGUI.EndChangeCheck()) { + root.Next(true); + for (int i = 0; i < 4; i++) { + // ReSharper disable once CompareOfFloatsByEqualityOperator + if (root.floatValue != newVal[i]) { + root.floatValue = newVal[i]; + } + root.Next(false); + } + } + EditorGUI.EndProperty(); + } +} diff --git a/FactoryNumeric/Packages/PrimeTween/Editor/ValueContainerStartEndPropDrawer.cs.meta b/FactoryNumeric/Packages/PrimeTween/Editor/ValueContainerStartEndPropDrawer.cs.meta new file mode 100644 index 00000000..4ab8b2b7 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Editor/ValueContainerStartEndPropDrawer.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 6c08ff7f819145b987090598c6a13397 +timeCreated: 1710625562 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime.meta b/FactoryNumeric/Packages/PrimeTween/Runtime.meta new file mode 100644 index 00000000..aa9f7539 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4bf778a7b3cdd4ed3828edfd010cb8b5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Easing.cs b/FactoryNumeric/Packages/PrimeTween/Runtime/Easing.cs new file mode 100644 index 00000000..f63655c5 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Easing.cs @@ -0,0 +1,188 @@ +using JetBrains.Annotations; +using UnityEngine; + +namespace PrimeTween { + /// + /// A wrapper struct that encapsulates three available easing methods: standard Ease, AnimationCurve, or Parametric Easing.
+ /// Use static methods to create an Easing struct, for example: Easing.Standard(Ease.OutBounce), Easing.Curve(animationCurve), + /// Easing.Elastic(strength, period), etc. + ///
+ [PublicAPI] + public readonly struct Easing { + internal readonly Ease ease; + internal readonly AnimationCurve curve; + internal readonly ParametricEase parametricEase; + internal readonly float parametricEaseStrength; + internal readonly float parametricEasePeriod; + + Easing(ParametricEase type, float strength, float period = float.NaN) { + ease = Ease.Custom; + curve = null; + parametricEase = type; + parametricEaseStrength = strength; + parametricEasePeriod = period; + } + + Easing(Ease ease, [CanBeNull] AnimationCurve curve) { + if (ease == Ease.Custom) { + if (curve == null || !TweenSettings.ValidateCustomCurveKeyframes(curve)) { + Debug.LogError("Ease is Ease.Custom, but AnimationCurve is not configured correctly. Using Ease.Default instead."); + ease = Ease.Default; + } + } + this.ease = ease; + this.curve = curve; + parametricEase = ParametricEase.None; + parametricEaseStrength = float.NaN; + parametricEasePeriod = float.NaN; + } + + public static implicit operator Easing(Ease ease) => Standard(ease); + + /// Standard Robert Penner's easing method. Or simply use Ease enum instead. + public static Easing Standard(Ease ease) { + Assert.AreNotEqual(Ease.Custom, ease); + if (ease == Ease.Default) { + ease = PrimeTweenConfig.defaultEase; + } + return new Easing(ease, null); + } + + public static implicit operator Easing([NotNull] AnimationCurve curve) => Curve(curve); + + /// AnimationCurve to use as an easing function. Or simply use AnimationCurve instead. + public static Easing Curve([NotNull] AnimationCurve curve) => new Easing(Ease.Custom, curve); + + /// Customizes the bounce of Ease.OutBounce. + public static Easing Bounce(float strength) => new Easing(ParametricEase.Bounce, strength); + + /// Customizes the exact of the first bounce in meters/angles. + public static Easing BounceExact(float amplitude) => new Easing(ParametricEase.BounceExact, amplitude); + + /// Customizes the overshoot of Ease.OutBack. + public static Easing Overshoot(float strength) => new Easing(ParametricEase.Overshoot, strength * StandardEasing.backEaseConst); + + /// Customizes the and oscillation of Ease.OutElastic. + public static Easing Elastic(float strength, float period = StandardEasing.defaultElasticEasePeriod) { + if (strength < 1) { + strength = Mathf.Lerp(0.2f, 1f, strength); // remap strength to limit decayFactor + } + return new Easing(ParametricEase.Elastic, strength, Mathf.Max(0.1f, period)); + } + + internal static float Evaluate(float t, ParametricEase parametricEase, float strength, float period, float duration) { + switch (parametricEase) { + case ParametricEase.Overshoot: + t -= 1.0f; + return t * t * ((strength + 1) * t + strength) + 1.0f; + case ParametricEase.Elastic: + const float twoPi = 2 * Mathf.PI; + float decayFactor; + if (strength >= 1) { + decayFactor = 1f; + } else { + decayFactor = 1 / strength; + strength = 1; + } + float decay = Mathf.Pow(2, -10f * t * decayFactor); + if (duration == 0) { + return 1; + } + period /= duration; + float phase = period / twoPi * Mathf.Asin(1f / strength); + return t > 0.9999f ? 1 : strength * decay * Mathf.Sin((t - phase) * twoPi / period) + 1f; + case ParametricEase.Bounce: + return Bounce(t, strength); + case ParametricEase.BounceExact: + case ParametricEase.None: + default: + throw new System.Exception(); + } + } + + internal static float Evaluate(float t, [NotNull] ReusableTween tween) { + var settings = tween.settings; + var parametricEase = settings.parametricEase; + var strength = settings.parametricEaseStrength; + if (parametricEase == ParametricEase.BounceExact) { + var fullAmplitude = tween.propType == PropType.Quaternion ? + Quaternion.Angle(tween.startValue.QuaternionVal, tween.endValue.QuaternionVal) : + tween.diff.Vector4Val.magnitude; + // todo account for double + /*double calcFullAmplitude() { + switch (tween.propType) { + case PropType.Quaternion: + return Quaternion.Angle(tween.startValue.QuaternionVal, tween.endValue.QuaternionVal); + case PropType.Double: + return tween.startValue.DoubleVal - tween.endValue.DoubleVal; + default: + return tween.diff.Vector4Val.magnitude; + } + }*/ + float strengthFactor = fullAmplitude < 0.0001f ? 1f : 1f / (fullAmplitude * (1f - firstBounceAmpl)); + return Bounce(t, strength * strengthFactor); + } + return Evaluate(t, parametricEase, strength, settings.parametricEasePeriod, settings.duration); + } + + const float firstBounceAmpl = 0.75f; + static float Bounce(float t, float strength) { + const float n1 = 7.5625f; + const float d1 = 2.75f; + if (t < 1 / d1) { + return n1 * t * t; + } + return 1 - (1 - bounce()) * strength; + float bounce() { + if (t < 2 / d1) { + return n1 * (t -= 1.5f / d1) * t + firstBounceAmpl; + } + if (t < 2.5 / d1) { + return n1 * (t -= 2.25f / d1) * t + 0.9375f; + } + return n1 * (t -= 2.625f / d1) * t + 0.984375f; + } + } + + #if PRIME_TWEEN_DOTWEEN_ADAPTER + /// Can't be public API because ParametricEase.BounceExact can only be evaluated with these params: propType, startValue, endValue + /// + internal float Evaluate(float interpolationFactor) { + if (ease == Ease.Custom) { + if (parametricEase != ParametricEase.None) { + Assert.AreNotEqual(ParametricEase.BounceExact, parametricEase); + return Evaluate(interpolationFactor, parametricEase, parametricEaseStrength, parametricEasePeriod, 1f); + } + Assert.IsNull(curve); + return curve.Evaluate(interpolationFactor); + } + return Evaluate(interpolationFactor, ease); + } + #endif + + public static float Evaluate(float interpolationFactor, Ease ease) { + switch (ease) { + case Ease.Custom: + Debug.LogError("Ease.Custom is an invalid type for Easing.Evaluate(). Please choose another Ease type instead."); + return interpolationFactor; + case Ease.Default: + #if UNITY_EDITOR + if (Constants.warnNoInstance) { + return interpolationFactor; + } + #endif + return StandardEasing.Evaluate(interpolationFactor, PrimeTweenManager.Instance.defaultEase); + default: + return StandardEasing.Evaluate(interpolationFactor, ease); + } + } + } + + internal enum ParametricEase { + None = 0, + Overshoot = 5, + Bounce = 7, + Elastic = 11, + BounceExact + } +} diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Easing.cs.meta b/FactoryNumeric/Packages/PrimeTween/Runtime/Easing.cs.meta new file mode 100644 index 00000000..f5453fea --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Easing.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 5d7874887c74422a835daf3c70912dcf +timeCreated: 1695050976 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal.meta b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal.meta new file mode 100644 index 00000000..b5665c6a --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 7e94f642418940748d478b3f5e1a2cf7 +timeCreated: 1677165257 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/AssemblyInfo.cs b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/AssemblyInfo.cs new file mode 100644 index 00000000..f39f3514 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/AssemblyInfo.cs @@ -0,0 +1,6 @@ +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("PrimeTween.Editor")] +[assembly: InternalsVisibleTo("PrimeTween.Tests")] +[assembly: InternalsVisibleTo("PrimeTween.Tests.Editor")] +[assembly: InternalsVisibleTo("PrimeTween.Debug")] diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/AssemblyInfo.cs.meta b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/AssemblyInfo.cs.meta new file mode 100644 index 00000000..dc446672 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/AssemblyInfo.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 61f306d3fcd147d6819d3c8d1ec82489 +timeCreated: 1674163732 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/Assert.cs b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/Assert.cs new file mode 100644 index 00000000..c551e025 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/Assert.cs @@ -0,0 +1,58 @@ +using JetBrains.Annotations; +using UnityEngine; + +namespace PrimeTween { + internal static class Assert { + internal static void LogError(string msg, long id, [CanBeNull] Object context = null) { + Debug.LogError(TryAddStackTrace(msg, id), context); + } + + internal static void LogWarning(string msg, long id, [CanBeNull] Object context = null) { + Debug.LogWarning(TryAddStackTrace(msg, id), context); + } + + [CanBeNull, PublicAPI] + static string TryAddStackTrace([CanBeNull] string msg, long tweenId) { + #if UNITY_ASSERTIONS + #if PRIME_TWEEN_SAFETY_CHECKS + if (tweenId == 0) { + msg += "\nTween is not created (id == 0).\n"; + } else { + msg += $"\nTween (id {tweenId}) creation stack trace:\n{StackTraces.Get(tweenId)}"; + } + #else + msg += "\nAdd 'PRIME_TWEEN_SAFETY_CHECKS' to 'Project Settings/Player/Scripting Define Symbols' to see which tween produced this error (works only in Development Builds).\n"; + #endif + #endif + return msg; + } + + #if UNITY_ASSERTIONS && !PRIME_TWEEN_DISABLE_ASSERTIONS + [ContractAnnotation("condition:false => halt")] + internal static void IsTrue(bool condition, long? tweenId = null, string msg = null) => UnityEngine.Assertions.Assert.IsTrue(condition, AddStackTrace(!condition, msg, tweenId)); + internal static void AreEqual(T expected, T actual, string msg = null) => UnityEngine.Assertions.Assert.AreEqual(expected, actual, msg); + internal static void AreNotEqual(T expected, T actual, string msg = null) => UnityEngine.Assertions.Assert.AreNotEqual(expected, actual, msg); + internal static void IsFalse(bool condition, string msg = null) => UnityEngine.Assertions.Assert.IsFalse(condition, msg); + [ContractAnnotation("value:null => halt")] + internal static void IsNotNull(T value, string msg = null) where T : class => UnityEngine.Assertions.Assert.IsNotNull(value, msg); + internal static void IsNull(T value, string msg = null) where T : class => UnityEngine.Assertions.Assert.IsNull(value, msg); + [CanBeNull] + static string AddStackTrace(bool add, [CanBeNull] string msg, long? tweenId) { + if (add && tweenId.HasValue) { + return TryAddStackTrace(msg, tweenId.Value); + } + return msg; + } + #else + const string DUMMY = "_"; + // ReSharper disable UnusedParameter.Global + [System.Diagnostics.Conditional(DUMMY)] internal static void IsTrue(bool condition, long? tweenId = null, string msg = null) {} + [System.Diagnostics.Conditional(DUMMY)] internal static void AreEqual(T expected, T actual, string msg = null) {} + [System.Diagnostics.Conditional(DUMMY)] internal static void AreNotEqual(T expected, T actual, string msg = null) {} + [System.Diagnostics.Conditional(DUMMY)] internal static void IsFalse(bool condition, string msg = null) {} + [ContractAnnotation("value:null => halt")] + [System.Diagnostics.Conditional(DUMMY)] internal static void IsNotNull(T value, string msg = null) where T : class {} + [System.Diagnostics.Conditional(DUMMY)] internal static void IsNull(T value, string msg = null) where T : class {} + #endif + } +} diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/Assert.cs.meta b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/Assert.cs.meta new file mode 100644 index 00000000..cb671b48 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/Assert.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: c593ca227a744d37b174fc677404e1a9 +timeCreated: 1686059830 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/AsyncAwaitSupport.cs b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/AsyncAwaitSupport.cs new file mode 100644 index 00000000..45de3bc7 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/AsyncAwaitSupport.cs @@ -0,0 +1,67 @@ +using System; +using System.ComponentModel; +using System.Runtime.CompilerServices; +using JetBrains.Annotations; +using UnityEngine; +#pragma warning disable CS0618 + +namespace PrimeTween { + public partial struct Tween { + /// This method is needed for async/await support. Don't use it directly. + [EditorBrowsable(EditorBrowsableState.Never)] + public TweenAwaiter GetAwaiter() { + return new TweenAwaiter(this); + } + + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("This struct is needed for async/await support, you should not use it directly.")] + public readonly struct TweenAwaiter : INotifyCompletion { + readonly Tween tween; + + internal TweenAwaiter(Tween tween) { + if (tween.isAlive && !tween.tryManipulate()) { + this.tween = default; + } else { + this.tween = tween; + } + } + + public bool IsCompleted => !tween.isAlive; + + public void OnCompleted([NotNull] Action continuation) { + // try-catch is needed here because any exception that is thrown inside the OnCompleted will be silenced + // probably because this try in UnitySynchronizationContext.cs has no exception handling: + // https://github.com/Unity-Technologies/UnityCsReference/blob/dd0d959800a675836a77dbe188c7dd55abc7c512/Runtime/Export/Scripting/UnitySynchronizationContext.cs#L157 + try { + Assert.IsTrue(tween.isAlive); + var infiniteSettings = new TweenSettings(0, 0, float.MaxValue, Ease.Linear, -1); + var wait = animate(tween.tween, ref infiniteSettings, t => { + if (t._isAlive) { + var target = t.target as ReusableTween; + if (t.longParam != target.id || !target._isAlive) { + t.ForceComplete(); + } + } + }, null, TweenType.Callback); + Assert.IsTrue(wait.isAlive); + wait.tween.longParam = tween.id; + wait.tween.OnComplete(continuation, true); + } catch (Exception e) { + Debug.LogException(e); + throw; + } + } + + public void GetResult() { + } + } + } + + public partial struct Sequence { + /// This method is needed for async/await support. Don't use it directly. + [EditorBrowsable(EditorBrowsableState.Never)] + public Tween.TweenAwaiter GetAwaiter() { + return new Tween.TweenAwaiter(root); + } + } +} diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/AsyncAwaitSupport.cs.meta b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/AsyncAwaitSupport.cs.meta new file mode 100644 index 00000000..c9a778c9 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/AsyncAwaitSupport.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 3aad1100da5540a191e769695ce94322 +timeCreated: 1678262334 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/Constants.cs b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/Constants.cs new file mode 100644 index 00000000..6385720a --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/Constants.cs @@ -0,0 +1,69 @@ +using JetBrains.Annotations; +using UnityEngine; +using T = PrimeTween.TweenSettings; + +namespace PrimeTween { + internal static class Constants { + internal const string onCompleteCallbackIgnored = "Tween's " + nameof(Tween.OnComplete) + " callback was ignored."; + internal const string durationInvalidError = "Tween's duration is invalid."; + + internal const string cantManipulateNested = "It's not allowed to manipulate 'nested' tweens and sequences, please use the parent Sequence instead.\n" + + "When a tween or sequence is added to another sequence, they become 'nested', and manipulating them directly is no longer allowed.\n" + + "Use Stop()/Complete()/isPaused/timeScale/elapsedTime/etc. of their parent Sequence instead.\n"; + [NotNull] + internal static string buildWarningCanBeDisabledMessage(string settingName) { + return $"To disable this warning, set '{nameof(PrimeTweenConfig)}.{settingName} = false;'."; + } + + internal const string isDeadMessage = "Tween/Sequence is not alive. Please check the 'isAlive' property before calling this API.\n"; + internal const string unscaledTimeTooltip = "The tween will use real time, ignoring Time.timeScale."; + internal const string easeTooltip = "The easing curve of an animation.\n\n" + + "Default is Ease." + nameof(Ease.OutQuad) + ". The Default ease can be modified via '" + nameof(PrimeTweenConfig) + "." + nameof(PrimeTweenConfig.defaultEase) + "' setting.\n\n" + + "Set to " + nameof(Ease) + "." + nameof(Ease.Custom) + " to control the easing with custom " + nameof(AnimationCurve) + "."; + internal const string cyclesTooltip = "Setting cycles to -1 will repeat the tween indefinitely."; + internal const string cycleModeTooltip = "See the documentation of each cycle mode by hoovering the dropdown."; + internal const string defaultCtorError = "Tween or Sequence is not created properly.\n" + + "- Use Sequence." + nameof(Sequence.Create) + "() to start a Sequence.\n" + + "- Use static 'Tween.' methods to start a Tween.\n"; + internal const string startDelayTooltip = "Delays the start of a tween."; + internal const string endDelayTooltip = "Delays the completion of a tween.\n\n" + + "For example, can be used to add the delay between cycles.\n\n" + + "Or can be used to postpone the execution of the onComplete callback."; + internal const string updateTypeTooltip = "Controls Unity's event function, which updates the animation.\n\n" + + "Default is MonoBehaviour.Update()."; + internal const string infiniteTweenInSequenceError = "It's not allowed to have infinite tweens (cycles == -1) in a sequence. If you want the sequence to repeat forever, " + nameof(Sequence.SetRemainingCycles) + "(-1) on the parent sequence instead."; // todo allow this as the last animation in the Sequence? it would still not be possible to Chain anything after the infinite animation, but will unlock use cases like adding startDelay to the Sequence. I can't do by adding startDelay support to Sequence because startDelay works differently for tweens: it's applied every tween loop + internal const string customTweensDontSupportStartFromCurrentWarning = + "Custom tweens don't support the '" + nameof(T.startFromCurrent) + "' because they don't know the current value of animated property.\n" + + "This means that the animated value will be changed abruptly if a new tween is started mid-way.\n" + + "Please pass the current value to the '" + nameof(T) + "." + nameof(T.WithDirection) + "(bool toEndValue, T currentValue)' method or use the constructor that accepts the '" + nameof(T.startValue) + "'.\n"; + internal const string startFromCurrentTooltip = "If true, the current value of an animated property will be used instead of the 'startValue'.\n\n" + + "This field typically should not be manipulated directly. Instead, it's set by TweenSettings(T endValue, TweenSettings settings) constructor or by " + nameof(T.WithDirection) + "() method."; + internal const string startValueTooltip = "Start value of a tween.\n\n" + + "For example, if you're animating a window, the 'startValue' can represent the closed (off-screen) position of the window."; + internal const string endValueTooltip = "End value of a tween.\n\n" + + "For example, if you're animating a window, the 'endValue' can represent the opened position of the window."; + internal const string setTweensCapacityMethod = "'" + nameof(PrimeTweenConfig) + "." + nameof(PrimeTweenConfig.SetTweensCapacity) + "(int capacity)'"; + internal const string maxAliveTweens = "Max alive tweens"; + internal const string animationAlreadyStarted = "Animation has already been started, it's not allowed to manipulate it anymore."; + internal const string recursiveCallError = "Please don't call this API recursively from Tween.Custom() or tween.OnUpdate()."; + internal const string nestSequenceTwiceError = "Sequence can be nested in other sequence only once."; + internal const string nestTweenTwiceError = "A tween can be added to a sequence only once and can only belong to one sequence."; + internal const string addDeadTweenToSequenceError = "It's not allowed to add 'dead' tweens to a sequence."; + + #if UNITY_EDITOR + internal const string editModeWarning = "Please don't call PrimeTween's API in Edit mode (while the scene is not playing)."; + + internal static bool warnNoInstance { + get { + if (noInstance) { + Debug.LogWarning(editModeWarning); + return true; + } + return false; + } + } + + internal static bool noInstance => ReferenceEquals(null, PrimeTweenManager.Instance); + #endif + } +} diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/Constants.cs.meta b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/Constants.cs.meta new file mode 100644 index 00000000..e897b480 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/Constants.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 60bd878528e14f21ae03c089de19f253 +timeCreated: 1677010307 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/CoroutinesSupport.cs b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/CoroutinesSupport.cs new file mode 100644 index 00000000..042d0929 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/CoroutinesSupport.cs @@ -0,0 +1,105 @@ +using System; +using System.Collections; +using System.Linq; +using JetBrains.Annotations; + +namespace PrimeTween { + public partial struct Tween : IEnumerator { + /// Use this method to wait for a Tween in coroutines. + /// + /// IEnumerator Coroutine() { + /// yield return Tween.Delay(1).ToYieldInstruction(); + /// } + /// + [NotNull] + public IEnumerator ToYieldInstruction() { + if (!isAlive || !tryManipulate()) { + // ReSharper disable once NotDisposedResourceIsReturned + return Enumerable.Empty().GetEnumerator(); + } + var result = tween.coroutineEnumerator; + result.SetTween(this); + return result; + } + + bool IEnumerator.MoveNext() { + PrimeTweenManager.Instance.warnStructBoxingInCoroutineOnce(id); + return isAlive; + } + + object IEnumerator.Current { + get { + Assert.IsTrue(isAlive); + return null; + } + } + + void IEnumerator.Reset() => throw new NotSupportedException(); + } + + public partial struct Sequence : IEnumerator { + /// Use this method to wait for a Sequence in coroutines. + /// + /// IEnumerator Coroutine() { + /// var sequence = Sequence.Create(Tween.Delay(1)).ChainCallback(() => Debug.Log("Done!")); + /// yield return sequence.ToYieldInstruction(); + /// } + /// + [NotNull] + public IEnumerator ToYieldInstruction() => root.ToYieldInstruction(); + + bool IEnumerator.MoveNext() { + PrimeTweenManager.Instance.warnStructBoxingInCoroutineOnce(id); + return isAlive; + } + + object IEnumerator.Current { + get { + Assert.IsTrue(isAlive); + return null; + } + } + + void IEnumerator.Reset() => throw new NotSupportedException(); + } + + internal class TweenCoroutineEnumerator : IEnumerator { + internal Tween tween; + bool isRunning; + + internal void SetTween(Tween _tween) { + Assert.IsFalse(isRunning); // todo turn to error? + Assert.IsTrue(!tween.IsCreated || tween.id == _tween.id); + Assert.IsTrue(_tween.isAlive); + tween = _tween; + isRunning = true; + } + + bool IEnumerator.MoveNext() { + var result = tween.isAlive; + if (!result) { + resetEnumerator(); + } + return result; + } + + internal bool resetEnumerator() { + if (tween.IsCreated) { + tween = default; + isRunning = false; + return true; + } + return false; + } + + object IEnumerator.Current { + get { + Assert.IsTrue(tween.isAlive); // todo throws if debugger is attached + Assert.IsTrue(isRunning); + return null; + } + } + + void IEnumerator.Reset() => throw new NotSupportedException(); + } +} \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/CoroutinesSupport.cs.meta b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/CoroutinesSupport.cs.meta new file mode 100644 index 00000000..8bcee2eb --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/CoroutinesSupport.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 6b4374d6f2544e95a115ca74b92bec0c +timeCreated: 1678282601 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/DOTweenAdapter.meta b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/DOTweenAdapter.meta new file mode 100644 index 00000000..f8110487 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/DOTweenAdapter.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 7e46be11dbfe47849bc893876e4b3011 +timeCreated: 1675753203 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/DOTweenAdapter/DOTweenAdapter.cs b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/DOTweenAdapter/DOTweenAdapter.cs new file mode 100644 index 00000000..ee174a88 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/DOTweenAdapter/DOTweenAdapter.cs @@ -0,0 +1,476 @@ +// ReSharper disable UnusedMember.Global +// ReSharper disable UnusedMethodReturnValue.Global +#if PRIME_TWEEN_DOTWEEN_ADAPTER +using System; +using System.Collections; +using JetBrains.Annotations; +using UnityEngine; + +namespace PrimeTween { + public static partial class DOTweenAdapter { + static int remapFrequency(float frequency) { + return (int) (frequency * 1.35f); + } + + public static Tween DOShakePosition([NotNull] this Component target, float duration, float strength, int vibrato = 10, float randomness = 90, bool snapping = false, bool fadeOut = true) + => DOShakePosition(target, duration, Vector3.one * strength, vibrato, randomness, snapping, fadeOut); + public static Tween DOShakePosition([NotNull] this Component target, float duration, Vector3 strength, int vibrato = 10, float randomness = 90, bool snapping = false, bool fadeOut = true) { + if (Math.Abs(randomness - 90f) > 0.001f) { + Debug.LogWarning("PrimeTween doesn't support " + nameof(randomness)); + } + if (snapping) { + Debug.LogWarning("PrimeTween doesn't support " + nameof(snapping)); + } + var settings = new ShakeSettings(strength, duration, vibrato); + if (fadeOut) { + settings.enableFalloff = true; + settings.frequency = remapFrequency(settings.frequency); + } + return Tween.ShakeLocalPosition(target.transform, settings); + } + public static Tween DOPunchPosition([NotNull] this Component target, Vector3 punch, float duration, int vibrato = 10, float elasticity = 1, bool snapping = false) { + if (snapping) { + Debug.LogWarning("PrimeTween doesn't support " + nameof(snapping)); + } + var shakeSettings = new ShakeSettings(punch, duration, remapFrequency(vibrato), asymmetryFactor: 1 - elasticity); + return Tween.PunchLocalPosition(target.transform, shakeSettings); + } + + public static Tween DOShakeRotation([NotNull] this Component target, float duration, float strength, int vibrato = 10, float randomness = 90, bool fadeOut = true) + => DOShakeRotation(target, duration, Vector3.one * strength, vibrato, randomness, fadeOut); + public static Tween DOShakeRotation([NotNull] this Component target, float duration, Vector3 strength, int vibrato = 10, float randomness = 90, bool fadeOut = true) { + if (Math.Abs(randomness - 90f) > 0.001f) { + Debug.LogWarning("PrimeTween doesn't support " + nameof(randomness)); + } + var settings = new ShakeSettings(strength, duration, vibrato); + if (fadeOut) { + settings.enableFalloff = true; + settings.frequency = remapFrequency(settings.frequency); + } + return Tween.ShakeLocalRotation(target.transform, settings); + } + public static Tween DOPunchRotation([NotNull] this Component target, Vector3 punch, float duration, int vibrato = 10, float elasticity = 1) { + var shakeSettings = new ShakeSettings(punch, duration, remapFrequency(vibrato), asymmetryFactor: 1 - elasticity); + return Tween.PunchLocalRotation(target.transform, shakeSettings); + } + + public static Tween DOShakeScale([NotNull] this Component target, float duration, float strength, int vibrato = 10, float randomness = 90, bool fadeOut = true) + => DOShakeScale(target, duration, Vector3.one * strength, vibrato, randomness, fadeOut); + public static Tween DOShakeScale([NotNull] this Component target, float duration, Vector3 strength, int vibrato = 10, float randomness = 90, bool fadeOut = true) { + if (Math.Abs(randomness - 90f) > 0.001f) { + Debug.LogWarning("PrimeTween doesn't support " + nameof(randomness)); + } + var settings = new ShakeSettings(strength, duration, vibrato); + if (fadeOut) { + settings.enableFalloff = true; + settings.frequency = remapFrequency(settings.frequency); + } + return Tween.ShakeScale(target.transform, settings); + } + public static Tween DOPunchScale([NotNull] this Component target, Vector3 punch, float duration, int vibrato = 10, float elasticity = 1) { + var shakeSettings = new ShakeSettings(punch, duration, remapFrequency(vibrato), asymmetryFactor: 1 - elasticity); + return Tween.PunchScale(target.transform, shakeSettings); + } + + public static Tween DORotate([NotNull] this Transform target, Vector3 endValue, float duration) { + return Tween.Rotation(target, Quaternion.Euler(endValue), duration); + } + + public static Tween DOLocalRotate([NotNull] this Transform target, Vector3 endValue, float duration) { + return Tween.LocalRotation(target, Quaternion.Euler(endValue), duration); + } + + public static Tween DOScale([NotNull] this Transform target, Single endValue, float duration) { + return Tween.Scale(target, endValue, duration); + } + + public static int DOKill([NotNull] this Component target, bool complete = false) => doKill_internal(target, complete); + public static int DOKill([NotNull] this Material target, bool complete = false) => doKill_internal(target, complete); + + internal static int doKill_internal([CanBeNull] object target, bool complete = false) { + bool prevLogCantManipulateError = PrimeTweenManager.logCantManipulateError; + PrimeTweenManager.logCantManipulateError = false; + var result = complete ? Tween.CompleteAll(target) : Tween.StopAll(target); + PrimeTweenManager.logCantManipulateError = prevLogCantManipulateError; + return result; + } + + internal static Easing GetEasing(Ease ease, float? maybeStrength, float? maybePeriod) { + var strength = maybeStrength ?? 1; + switch (ease) { + case Ease.OutBack: + if (maybePeriod.HasValue) { + Debug.LogWarning("Ease.OutBack doesn't support custom period."); + } + return Easing.Overshoot(strength / StandardEasing.backEaseConst); + case Ease.OutBounce: + return Easing.Bounce(strength); + case Ease.OutElastic: + return Easing.Elastic(strength, maybePeriod ?? StandardEasing.defaultElasticEasePeriod); + } + return Easing.Standard(ease); + } + + // public static Tween DOTWEEN_METHOD_NAME([NotNull] this UnityEngine.Camera target, Single endValue, float duration) => Tween.METHOD_NAME(target, endValue, duration); + } + + public static class DOTween { + public static Ease defaultEaseType { + get => PrimeTweenConfig.defaultEase; + set => PrimeTweenConfig.defaultEase = value; + } + + public static Sequence Sequence() => PrimeTween.Sequence.Create(); + + public static void Kill([NotNull] object target, bool complete = false) => DOTweenAdapter.doKill_internal(target, complete); + + public static void KillAll(bool complete = false) => DOTweenAdapter.doKill_internal(null, complete); + + public static Tween To([NotNull] Func getter, [NotNull] Action setter, float endValue, float duration) => Tween.Custom(getter(), endValue, duration, val => setter(val)); + public static Tween To([NotNull] Func getter, [NotNull] Action setter, Vector2 endValue, float duration) => Tween.Custom(getter(), endValue, duration, val => setter(val)); + public static Tween To([NotNull] Func getter, [NotNull] Action setter, Vector3 endValue, float duration) => Tween.Custom(getter(), endValue, duration, val => setter(val)); + public static Tween To([NotNull] Func getter, [NotNull] Action setter, Vector4 endValue, float duration) => Tween.Custom(getter(), endValue, duration, val => setter(val)); + public static Tween To([NotNull] Func getter, [NotNull] Action setter, Quaternion endValue, float duration) => Tween.Custom(getter(), endValue, duration, val => setter(val)); + public static Tween To([NotNull] Func getter, [NotNull] Action setter, Color endValue, float duration) => Tween.Custom(getter(), endValue, duration, val => setter(val)); + public static Tween To([NotNull] Func getter, [NotNull] Action setter, Rect endValue, float duration) => Tween.Custom(getter(), endValue, duration, val => setter(val)); + } + + public static class DOVirtual { + public static Tween DelayedCall(float delay, Action callback, bool ignoreTimeScale = true) + => Tween.Delay(delay, callback, ignoreTimeScale); + + public static Tween Float(float startValue, float endValue, float duration, Action onValueChange) => Tween.Custom(startValue, endValue, duration, onValueChange); + public static Tween Vector3(Vector3 startValue, Vector3 endValue, float duration, Action onValueChange) => Tween.Custom(startValue, endValue, duration, onValueChange); + public static Tween Color(Color startValue, Color endValue, float duration, Action onValueChange) => Tween.Custom(startValue, endValue, duration, onValueChange); + + public static float EasedValue(float from, float to, float lifetimePercentage, Ease easeType, float? amplitude = null, float? period = null) + => Mathf.LerpUnclamped(from, to, DOTweenAdapter.GetEasing(easeType, amplitude, period).Evaluate(lifetimePercentage)); + public static float EasedValue(float from, float to, float lifetimePercentage, [NotNull] AnimationCurve easeCurve) + => Mathf.LerpUnclamped(from, to, Easing.Curve(easeCurve).Evaluate(lifetimePercentage)); + public static Vector3 EasedValue(Vector3 from, Vector3 to, float lifetimePercentage, Ease easeType, float? amplitude = null, float? period = null) + => UnityEngine.Vector3.LerpUnclamped(from, to, DOTweenAdapter.GetEasing(easeType, amplitude, period).Evaluate(lifetimePercentage)); + public static Vector3 EasedValue(Vector3 from, Vector3 to, float lifetimePercentage, [NotNull] AnimationCurve easeCurve) + => UnityEngine.Vector3.LerpUnclamped(from, to, Easing.Curve(easeCurve).Evaluate(lifetimePercentage)); + } + + public partial struct Sequence { + public Sequence AppendCallback([NotNull] Action callback) { + return ChainCallback(callback); + } + + public Sequence SetLoops(int loops, LoopType? loopType = null) { + root.SetLoops(loops, loopType); + return this; + } + + public Sequence Join(Sequence other) => Group(other); + + public Sequence Join(Tween other) { + var tween = other.tween; + var startDelay = tween.settings.startDelay; + if (startDelay > 0) { + // For some weird reason, DG.Tweening.Sequence.DoInsert shifts the lastTweenInsertTime by a tween's delay. + tween.settings.startDelay = 0; + tween.recalculateTotalDuration(); + Group(Tween.Delay(startDelay)); + ChainLast(other); + return this; + } + return Group(other); + } + + /// Schedules after the last added tween. + /// Internal because this API is hard to understand, but needed for adapter. + internal Sequence ChainLast(Tween other) { + if (tryManipulate()) { + Insert(getLastInSelfOrRoot().durationWithWaitDelay, other); + } + return this; + } + + public Sequence Append(Sequence other) => Chain(other); + + public Sequence Append(Tween other) { + var tween = other.tween; + var startDelay = tween.settings.startDelay; + if (startDelay > 0) { + // For some weird reason, DG.Tweening.Sequence.DoInsert shifts the lastTweenInsertTime by a tween's delay. + tween.settings.startDelay = 0; + tween.recalculateTotalDuration(); + Chain(Tween.Delay(startDelay)); + } + return Chain(other); + } + + public Sequence AppendInterval(float delay) { + return Chain(Tween.Delay(delay)); + } + + public void Kill(bool complete = false) { + if (complete) { + Complete(); + } else { + Stop(); + } + } + + public void Complete(bool withCallbacks) { + if (withCallbacks) { + Debug.LogWarning("PrimeTween doesn't support " + nameof(Sequence) + "." + nameof(Complete) + "() " + nameof(withCallbacks) + " == true"); + } + Complete(); + } + + public Sequence SetEase(Ease ease, float? amplitude = null, float? period = null) { + root.SetEase(ease, amplitude, period); + return this; + } + + public Sequence SetEase([NotNull] AnimationCurve animCurve) { + root.SetEase(animCurve); + return this; + } + + public Sequence SetDelay(float delay) { + return PrependInterval(delay); + } + + public Sequence OnStepComplete([NotNull] Action action) { + Debug.LogWarning("Please use sequence.ChainCallback() as the last operation instead of sequence.OnStepComplete()"); + return ChainCallback(action); + } + + public Sequence PrependInterval(float interval) { + if (!ValidateCanManipulateSequence()) { + return this; + } + foreach (var t in getSelfChildren()) { + t.tween.waitDelay += interval; + } + duration += interval; + return this; + } + + public Sequence SetUpdate(bool isIndependentUpdate) { + Assert.IsTrue(isAlive); + Assert.IsTrue(root.tween.isMainSequenceRoot()); + root.tween.settings.useUnscaledTime = isIndependentUpdate; + return this; + } + + public Sequence AsyncWaitForCompletion() => this; + + public IEnumerator WaitForCompletion() => ToYieldInstruction(); + + /// It's safe to destroy objects with running animations in PrimeTween, so this adapter method does nothing. More info: https://github.com/KyryloKuzyk/PrimeTween/discussions/4 + [PublicAPI] + public Sequence SetLink(GameObject gameObject) => this; + + public Sequence Pause() { + isPaused = true; + return this; + } + + public Sequence Play() { + isPaused = false; + return this; + } + } + + public partial struct Tween { + public Tween SetEase(Ease ease, float? amplitude = null, float? period = null) { + Assert.IsTrue(isAlive); + var parametricEasing = DOTweenAdapter.GetEasing(ease, amplitude, period); + tween.settings.SetEasing(parametricEasing); + return this; + } + + public Tween SetDelay(float delay) { + Assert.IsTrue(isAlive); + Assert.IsFalse(tween.IsInSequence()); + tween.settings.startDelay = delay; + tween.recalculateTotalDuration(); + return this; + } + + public Tween SetRelative(bool isRelative = true) { + Assert.IsTrue(isAlive); + if (!isRelative) { + return this; + } + var getter = tween.getter; + if (getter == null) { + return this; + } + tween.endValue = CalculateRelative(tween, getter(tween), tween.endValue); + /*var getter = tween.getter; + // todo this doesn't account for double val + if (tween.propType == PropType.Quaternion) { + if (getter != null) { + tween.endValue.QuaternionVal *= getter(tween).QuaternionVal; + } else { + tween.endValue.QuaternionVal *= tween.startValue.QuaternionVal; + } + } else { + if (getter != null) { + tween.endValue.Vector4Val += getter(tween).Vector4Val; + } else { + tween.endValue.Vector4Val += tween.startValue.Vector4Val; + } + }*/ + return this; + } + + public Tween SetLoops(int loops, LoopType? loopType = null) { + SetRemainingCycles(loops); + if (isAlive && loopType.HasValue) { + tween.settings.cycleMode = toCycleMode(loopType.Value); + } + return this; + } + + static CycleMode toCycleMode(LoopType t) { + switch (t) { + case LoopType.Restart: + return CycleMode.Restart; + case LoopType.Yoyo: + // yoyo in dotween behaves like rewind. But yoyo in other tween libraries (like tween.js) preserves the normal ease + return CycleMode.Rewind; + case LoopType.Incremental: + return CycleMode.Incremental; + default: + throw new Exception(); + } + } + + public void Kill(bool complete = false) { + if (complete) { + Complete(); + } else { + Stop(); + } + } + + public bool IsActive() => isAlive; + public bool active => isAlive; + public bool IsPlaying() => isAlive && !isPaused; + + public Tween Pause() { + isPaused = true; + return this; + } + + public Tween Play() { + isPaused = false; + return this; + } + + public float Elapsed(bool includeLoops = true) => includeLoops ? elapsedTimeTotal : elapsedTime; + public float Duration(bool includeLoops = true) => includeLoops ? durationTotal : duration; + public int Loops() => cyclesTotal; + public int CompletedLoops() => cyclesDone; + public float ElapsedDelay() => isAlive ? Mathf.Clamp(elapsedTime, 0f, tween.settings.startDelay) : 0; + public float ElapsedPercentage(bool includeLoops = true) => includeLoops ? progressTotal : progress; + public void TogglePause() => isPaused = !isPaused; + + public Tween SetEase([NotNull] AnimationCurve animCurve) { + Assert.IsTrue(isAlive); + Assert.IsNotNull(animCurve); + tween.settings.SetEasing(Easing.Curve(animCurve)); + return this; + } + + public Tween SetTarget([NotNull] object target) { + Assert.IsNotNull(target); + Assert.IsTrue(isAlive); + tween.target = target; + tween.setUnityTarget(target); + return this; + } + + public IEnumerator WaitForCompletion() => ToYieldInstruction(); + + public Tween AsyncWaitForCompletion() => this; + + public Tween SetUpdate(bool isIndependentUpdate) { + Assert.IsTrue(isAlive); + tween.settings.useUnscaledTime = isIndependentUpdate; + return this; + } + + public Tween From() => setFrom(true, false); + public Tween From(bool isRelative) => setFrom(true, isRelative); + public Tween From(bool setImmediately, bool isRelative) => setFrom(setImmediately, isRelative); + + public Tween From(float fromValue, bool setImmediately = true, bool isRelative = false) => setFrom(setImmediately, isRelative, fromValue.ToContainer(), PropType.Float); + public Tween From(Color fromValue, bool setImmediately = true, bool isRelative = false) => setFrom(setImmediately, isRelative, fromValue.ToContainer(), PropType.Color); + public Tween From(Vector2 fromValue, bool setImmediately = true, bool isRelative = false) => setFrom(setImmediately, isRelative, fromValue.ToContainer(), PropType.Vector2); + public Tween From(Vector3 fromValue, bool setImmediately = true, bool isRelative = false) => setFrom(setImmediately, isRelative, fromValue.ToContainer(), PropType.Vector3); + public Tween From(Vector4 fromValue, bool setImmediately = true, bool isRelative = false) => setFrom(setImmediately, isRelative, fromValue.ToContainer(), PropType.Vector4); + public Tween From(Quaternion fromValue, bool setImmediately = true, bool isRelative = false) => setFrom(setImmediately, isRelative, fromValue.ToContainer(), PropType.Quaternion); + public Tween From(Rect fromValue, bool setImmediately = true, bool isRelative = false) => setFrom(setImmediately, isRelative, fromValue.ToContainer(), PropType.Rect); + + static ValueContainer CalculateRelative(ReusableTween tween, ValueContainer current, ValueContainer diff) { + switch (tween.propType) { + case PropType.Quaternion: + return (current.QuaternionVal * diff.QuaternionVal).ToContainer(); + case PropType.Double: + return (current.DoubleVal + diff.DoubleVal).ToContainer(); + default: + return (current.Vector4Val + diff.Vector4Val).ToContainer(); + } + } + + Tween setFrom(bool setImmediately, bool isRelative, ValueContainer? fromValue = null, PropType propType = PropType.None) { + if (!tryManipulate()) { + return this; + } + if (elapsedTimeTotal != 0f) { + Debug.LogError(Constants.animationAlreadyStarted); + return this; + } + if (tween.isUnityTargetDestroyed()) { + Debug.LogError("Tween's target has been destroyed."); + return this; + } + var getter = tween.getter; + if (getter == null) { + Debug.LogError("Custom tweens don't support 'From()'."); + return this; + } + var current = getter(tween); + if (isRelative) { + tween.endValue = CalculateRelative(tween, current, tween.endValue); + } + if (fromValue.HasValue) { + if (tween.propType != propType) { + Debug.LogError($"Animated value is {tween.propType}, but '{nameof(From)}()' was called with {propType}. Please provide a correct type."); + return this; + } + tween.startFromCurrent = false; + tween.startValue = isRelative ? CalculateRelative(tween, current, fromValue.Value) : fromValue.Value; + } else { + tween.startFromCurrent = false; + tween.startValue = tween.endValue; + tween.endValue = current; + } + tween.cacheDiff(); + if (setImmediately) { + tween.ReportOnValueChange(0f); + } + return this; + } + + [PublicAPI] + public Tween SetLink(GameObject gameObject) { + return this; + } + } + + public enum LoopType { + Restart, + Yoyo, + Incremental + } +} +#endif diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/DOTweenAdapter/DOTweenAdapter.cs.meta b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/DOTweenAdapter/DOTweenAdapter.cs.meta new file mode 100644 index 00000000..331ff4df --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/DOTweenAdapter/DOTweenAdapter.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: f2642faa77224669a504c829da9b8d90 +timeCreated: 1675686833 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/DOTweenAdapter/DOTweenAdapterGenerated.cs b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/DOTweenAdapter/DOTweenAdapterGenerated.cs new file mode 100644 index 00000000..285cbd7d --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/DOTweenAdapter/DOTweenAdapterGenerated.cs @@ -0,0 +1,157 @@ +#if PRIME_TWEEN_DOTWEEN_ADAPTER +// This file is generated by CodeGenerator.cs +using JetBrains.Annotations; +using System; + +namespace PrimeTween { + [PublicAPI] + public static partial class DOTweenAdapter { + public static Tween DOShadowStrength([NotNull] this UnityEngine.Light target, Single endValue, float duration) => Tween.LightShadowStrength(target, endValue, duration); + + public static Tween DOIntensity([NotNull] this UnityEngine.Light target, Single endValue, float duration) => Tween.LightIntensity(target, endValue, duration); + + public static Tween DOColor([NotNull] this UnityEngine.Light target, UnityEngine.Color endValue, float duration) => Tween.LightColor(target, endValue, duration); + + public static Tween DOOrthoSize([NotNull] this UnityEngine.Camera target, Single endValue, float duration) => Tween.CameraOrthographicSize(target, endValue, duration); + + public static Tween DOColor([NotNull] this UnityEngine.Camera target, UnityEngine.Color endValue, float duration) => Tween.CameraBackgroundColor(target, endValue, duration); + + public static Tween DOAspect([NotNull] this UnityEngine.Camera target, Single endValue, float duration) => Tween.CameraAspect(target, endValue, duration); + + public static Tween DOFarClipPlane([NotNull] this UnityEngine.Camera target, Single endValue, float duration) => Tween.CameraFarClipPlane(target, endValue, duration); + + public static Tween DOFieldOfView([NotNull] this UnityEngine.Camera target, Single endValue, float duration) => Tween.CameraFieldOfView(target, endValue, duration); + + public static Tween DONearClipPlane([NotNull] this UnityEngine.Camera target, Single endValue, float duration) => Tween.CameraNearClipPlane(target, endValue, duration); + + public static Tween DOPixelRect([NotNull] this UnityEngine.Camera target, UnityEngine.Rect endValue, float duration) => Tween.CameraPixelRect(target, endValue, duration); + + public static Tween DORect([NotNull] this UnityEngine.Camera target, UnityEngine.Rect endValue, float duration) => Tween.CameraRect(target, endValue, duration); + + public static Tween DOMove([NotNull] this UnityEngine.Transform target, UnityEngine.Vector3 endValue, float duration) => Tween.Position(target, endValue, duration); + + public static Tween DOMoveX([NotNull] this UnityEngine.Transform target, Single endValue, float duration) => Tween.PositionX(target, endValue, duration); + + public static Tween DOMoveY([NotNull] this UnityEngine.Transform target, Single endValue, float duration) => Tween.PositionY(target, endValue, duration); + + public static Tween DOMoveZ([NotNull] this UnityEngine.Transform target, Single endValue, float duration) => Tween.PositionZ(target, endValue, duration); + + public static Tween DOLocalMove([NotNull] this UnityEngine.Transform target, UnityEngine.Vector3 endValue, float duration) => Tween.LocalPosition(target, endValue, duration); + + public static Tween DOLocalMoveX([NotNull] this UnityEngine.Transform target, Single endValue, float duration) => Tween.LocalPositionX(target, endValue, duration); + + public static Tween DOLocalMoveY([NotNull] this UnityEngine.Transform target, Single endValue, float duration) => Tween.LocalPositionY(target, endValue, duration); + + public static Tween DOLocalMoveZ([NotNull] this UnityEngine.Transform target, Single endValue, float duration) => Tween.LocalPositionZ(target, endValue, duration); + + public static Tween DORotateQuaternion([NotNull] this UnityEngine.Transform target, UnityEngine.Quaternion endValue, float duration) => Tween.Rotation(target, endValue, duration); + + public static Tween DOLocalRotateQuaternion([NotNull] this UnityEngine.Transform target, UnityEngine.Quaternion endValue, float duration) => Tween.LocalRotation(target, endValue, duration); + + public static Tween DOScale([NotNull] this UnityEngine.Transform target, UnityEngine.Vector3 endValue, float duration) => Tween.Scale(target, endValue, duration); + + public static Tween DOScaleX([NotNull] this UnityEngine.Transform target, Single endValue, float duration) => Tween.ScaleX(target, endValue, duration); + + public static Tween DOScaleY([NotNull] this UnityEngine.Transform target, Single endValue, float duration) => Tween.ScaleY(target, endValue, duration); + + public static Tween DOScaleZ([NotNull] this UnityEngine.Transform target, Single endValue, float duration) => Tween.ScaleZ(target, endValue, duration); + + public static Tween DOColor([NotNull] this UnityEngine.SpriteRenderer target, UnityEngine.Color endValue, float duration) => Tween.Color(target, endValue, duration); + + public static Tween DOFade([NotNull] this UnityEngine.SpriteRenderer target, Single endValue, float duration) => Tween.Alpha(target, endValue, duration); + + public static Tween DOTimeScale([NotNull] this PrimeTween.Tween target, Single endValue, float duration) => Tween.TweenTimeScale(target, endValue, duration); + + public static Tween DOTimeScale([NotNull] this PrimeTween.Sequence target, Single endValue, float duration) => Tween.TweenTimeScale(target, endValue, duration); + + #if !UNITY_2019_1_OR_NEWER || UNITY_UGUI_INSTALLED + public static Tween DOValue([NotNull] this UnityEngine.UI.Slider target, Single endValue, float duration) => Tween.UISliderValue(target, endValue, duration); + + public static Tween DONormalizedPos([NotNull] this UnityEngine.UI.ScrollRect target, UnityEngine.Vector2 endValue, float duration) => Tween.UINormalizedPosition(target, endValue, duration); + + public static Tween DOHorizontalNormalizedPos([NotNull] this UnityEngine.UI.ScrollRect target, Single endValue, float duration) => Tween.UIHorizontalNormalizedPosition(target, endValue, duration); + + public static Tween DOVerticalNormalizedPos([NotNull] this UnityEngine.UI.ScrollRect target, Single endValue, float duration) => Tween.UIVerticalNormalizedPosition(target, endValue, duration); + + public static Tween DOPivotX([NotNull] this UnityEngine.RectTransform target, Single endValue, float duration) => Tween.UIPivotX(target, endValue, duration); + + public static Tween DOPivotY([NotNull] this UnityEngine.RectTransform target, Single endValue, float duration) => Tween.UIPivotY(target, endValue, duration); + + public static Tween DOPivot([NotNull] this UnityEngine.RectTransform target, UnityEngine.Vector2 endValue, float duration) => Tween.UIPivot(target, endValue, duration); + + public static Tween DOAnchorMax([NotNull] this UnityEngine.RectTransform target, UnityEngine.Vector2 endValue, float duration) => Tween.UIAnchorMax(target, endValue, duration); + + public static Tween DOAnchorMin([NotNull] this UnityEngine.RectTransform target, UnityEngine.Vector2 endValue, float duration) => Tween.UIAnchorMin(target, endValue, duration); + + public static Tween DOAnchorPos3D([NotNull] this UnityEngine.RectTransform target, UnityEngine.Vector3 endValue, float duration) => Tween.UIAnchoredPosition3D(target, endValue, duration); + + public static Tween DOAnchorPos3DX([NotNull] this UnityEngine.RectTransform target, Single endValue, float duration) => Tween.UIAnchoredPosition3DX(target, endValue, duration); + + public static Tween DOAnchorPos3DY([NotNull] this UnityEngine.RectTransform target, Single endValue, float duration) => Tween.UIAnchoredPosition3DY(target, endValue, duration); + + public static Tween DOAnchorPos3DZ([NotNull] this UnityEngine.RectTransform target, Single endValue, float duration) => Tween.UIAnchoredPosition3DZ(target, endValue, duration); + + public static Tween DOScale([NotNull] this UnityEngine.UI.Shadow target, UnityEngine.Vector2 endValue, float duration) => Tween.UIEffectDistance(target, endValue, duration); + + public static Tween DOFade([NotNull] this UnityEngine.UI.Shadow target, Single endValue, float duration) => Tween.Alpha(target, endValue, duration); + + public static Tween DOColor([NotNull] this UnityEngine.UI.Shadow target, UnityEngine.Color endValue, float duration) => Tween.Color(target, endValue, duration); + + public static Tween DOPreferredSize([NotNull] this UnityEngine.UI.LayoutElement target, UnityEngine.Vector2 endValue, float duration) => Tween.UIPreferredSize(target, endValue, duration); + + public static Tween DOFlexibleSize([NotNull] this UnityEngine.UI.LayoutElement target, UnityEngine.Vector2 endValue, float duration) => Tween.UIFlexibleSize(target, endValue, duration); + + public static Tween DOMinSize([NotNull] this UnityEngine.UI.LayoutElement target, UnityEngine.Vector2 endValue, float duration) => Tween.UIMinSize(target, endValue, duration); + + public static Tween DOColor([NotNull] this UnityEngine.UI.Graphic target, UnityEngine.Color endValue, float duration) => Tween.Color(target, endValue, duration); + + public static Tween DOAnchorPos([NotNull] this UnityEngine.RectTransform target, UnityEngine.Vector2 endValue, float duration) => Tween.UIAnchoredPosition(target, endValue, duration); + + public static Tween DOAnchorPosX([NotNull] this UnityEngine.RectTransform target, Single endValue, float duration) => Tween.UIAnchoredPositionX(target, endValue, duration); + + public static Tween DOAnchorPosY([NotNull] this UnityEngine.RectTransform target, Single endValue, float duration) => Tween.UIAnchoredPositionY(target, endValue, duration); + + public static Tween DOSizeDelta([NotNull] this UnityEngine.RectTransform target, UnityEngine.Vector2 endValue, float duration) => Tween.UISizeDelta(target, endValue, duration); + + public static Tween DOFade([NotNull] this UnityEngine.CanvasGroup target, Single endValue, float duration) => Tween.Alpha(target, endValue, duration); + + public static Tween DOFade([NotNull] this UnityEngine.UI.Graphic target, Single endValue, float duration) => Tween.Alpha(target, endValue, duration); + + public static Tween DOFillAmount([NotNull] this UnityEngine.UI.Image target, Single endValue, float duration) => Tween.UIFillAmount(target, endValue, duration); + + #endif + #if !UNITY_2019_1_OR_NEWER || PHYSICS_MODULE_INSTALLED + public static Tween DOMove([NotNull] this UnityEngine.Rigidbody target, UnityEngine.Vector3 endValue, float duration) => Tween.RigidbodyMovePosition(target, endValue, duration); + + public static Tween DORotate([NotNull] this UnityEngine.Rigidbody target, UnityEngine.Quaternion endValue, float duration) => Tween.RigidbodyMoveRotation(target, endValue, duration); + + #endif + #if !UNITY_2019_1_OR_NEWER || PHYSICS2D_MODULE_INSTALLED + public static Tween DOMove([NotNull] this UnityEngine.Rigidbody2D target, UnityEngine.Vector2 endValue, float duration) => Tween.RigidbodyMovePosition(target, endValue, duration); + + public static Tween DORotate([NotNull] this UnityEngine.Rigidbody2D target, Single endValue, float duration) => Tween.RigidbodyMoveRotation(target, endValue, duration); + + #endif + public static Tween DOColor([NotNull] this UnityEngine.Material target, UnityEngine.Color endValue, float duration) => Tween.MaterialColor(target, endValue, duration); + + public static Tween DOFade([NotNull] this UnityEngine.Material target, Single endValue, float duration) => Tween.MaterialAlpha(target, endValue, duration); + + public static Tween DOOffset([NotNull] this UnityEngine.Material target, UnityEngine.Vector2 endValue, float duration) => Tween.MaterialMainTextureOffset(target, endValue, duration); + + public static Tween DOTiling([NotNull] this UnityEngine.Material target, UnityEngine.Vector2 endValue, float duration) => Tween.MaterialMainTextureScale(target, endValue, duration); + + #if !UNITY_2019_1_OR_NEWER || AUDIO_MODULE_INSTALLED + public static Tween DOFade([NotNull] this UnityEngine.AudioSource target, Single endValue, float duration) => Tween.AudioVolume(target, endValue, duration); + + public static Tween DOPitch([NotNull] this UnityEngine.AudioSource target, Single endValue, float duration) => Tween.AudioPitch(target, endValue, duration); + + #endif + #if UI_ELEMENTS_MODULE_INSTALLED + #endif + #if TEXT_MESH_PRO_INSTALLED + public static Tween DOMaxVisibleCharacters([NotNull] this TMPro.TMP_Text target, int endValue, float duration) => Tween.TextMaxVisibleCharacters(target, endValue, duration); + + #endif + } +} +#endif \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/DOTweenAdapter/DOTweenAdapterGenerated.cs.meta b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/DOTweenAdapter/DOTweenAdapterGenerated.cs.meta new file mode 100644 index 00000000..d1ca182e --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/DOTweenAdapter/DOTweenAdapterGenerated.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 3c238e2b584a4987b714406da2cf9c56 +timeCreated: 1675754085 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/Extensions.cs b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/Extensions.cs new file mode 100644 index 00000000..dbf18d0f --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/Extensions.cs @@ -0,0 +1,100 @@ +// ReSharper disable AnnotateNotNullParameter +using UnityEngine; + +namespace PrimeTween { + internal static class Extensions { + internal static float CalcDistance(Vector3 v1, Vector3 v2) => Vector3.Distance(v1, v2); + internal static float CalcDistance(Quaternion q1, Quaternion q2) => Quaternion.Angle(q1, q2); + + internal static float calcDelta(this float val, ValueContainer prevVal) => val - prevVal.FloatVal; + internal static double calcDelta(this double val, ValueContainer prevVal) => val - prevVal.DoubleVal; + internal static Color calcDelta(this Color val, ValueContainer prevVal) => val - prevVal.ColorVal; + internal static Vector2 calcDelta(this Vector2 val, ValueContainer prevVal) => val - prevVal.Vector2Val; + internal static Vector3 calcDelta(this Vector3 val, ValueContainer prevVal) => val - prevVal.Vector3Val; + internal static Vector4 calcDelta(this Vector4 val, ValueContainer prevVal) => val - prevVal.Vector4Val; + internal static Quaternion calcDelta(this Quaternion val, ValueContainer prevVal) => Quaternion.Inverse(prevVal.QuaternionVal) * val; + internal static Rect calcDelta(this Rect val, ValueContainer prevVal) => new Rect( + val.x - prevVal.x, + val.y - prevVal.y, + val.width - prevVal.z, + val.height - prevVal.w); + + internal static Color WithAlpha(this Color c, float alpha) { + c.a = alpha; + return c; + } + + internal static ValueContainer ToContainer(this float f) => new ValueContainer { FloatVal = f }; + internal static ValueContainer ToContainer(this Vector2 v) => new ValueContainer { Vector2Val = v }; + internal static ValueContainer ToContainer(this Vector3 v) => new ValueContainer { Vector3Val = v }; + internal static ValueContainer ToContainer(this Vector4 v) => new ValueContainer { Vector4Val = v }; + internal static ValueContainer ToContainer(this Color c) => new ValueContainer { ColorVal = c }; + internal static ValueContainer ToContainer(this Quaternion q) => new ValueContainer { QuaternionVal = q }; + internal static ValueContainer ToContainer(this Rect r) => new ValueContainer { RectVal = r }; + internal static ValueContainer ToContainer(this double d) => new ValueContainer { DoubleVal = d }; + + internal static Vector2 WithComponent(this Vector2 v, int index, float val) { + v[index] = val; + return v; + } + + internal static Vector3 WithComponent(this Vector3 v, int index, float val) { + v[index] = val; + return v; + } + + #if !UNITY_2019_1_OR_NEWER || UNITY_UGUI_INSTALLED + internal static Vector2 GetFlexibleSize(this UnityEngine.UI.LayoutElement target) => new Vector2(target.flexibleWidth, target.flexibleHeight); + internal static void SetFlexibleSize(this UnityEngine.UI.LayoutElement target, Vector2 vector2) { + target.flexibleWidth = vector2.x; + target.flexibleHeight = vector2.y; + } + + internal static Vector2 GetMinSize(this UnityEngine.UI.LayoutElement target) => new Vector2(target.minWidth, target.minHeight); + internal static void SetMinSize(this UnityEngine.UI.LayoutElement target, Vector2 vector2) { + target.minWidth = vector2.x; + target.minHeight = vector2.y; + } + + internal static Vector2 GetPreferredSize(this UnityEngine.UI.LayoutElement target) => new Vector2(target.preferredWidth, target.preferredHeight); + internal static void SetPreferredSize(this UnityEngine.UI.LayoutElement target, Vector2 vector2) { + target.preferredWidth = vector2.x; + target.preferredHeight = vector2.y; + } + + internal static Vector2 GetNormalizedPosition(this UnityEngine.UI.ScrollRect target) => new Vector2(target.horizontalNormalizedPosition, target.verticalNormalizedPosition); + internal static void SetNormalizedPosition(this UnityEngine.UI.ScrollRect target, Vector2 vector2) { + target.horizontalNormalizedPosition = vector2.x; + target.verticalNormalizedPosition = vector2.y; + } + #endif + + #if UI_ELEMENTS_MODULE_INSTALLED + internal static Vector2 GetTopLeft(this UnityEngine.UIElements.VisualElement e) { + var resolvedStyle = e.resolvedStyle; + return new Vector2(resolvedStyle.left, resolvedStyle.top); + } + internal static void SetTopLeft(this UnityEngine.UIElements.VisualElement e, Vector2 c) { + var style = e.style; + style.left = c.x; + style.top = c.y; + } + internal static Rect GetResolvedStyleRect(this UnityEngine.UIElements.VisualElement e) { + var resolvedStyle = e.resolvedStyle; + return new Rect( + resolvedStyle.left, + resolvedStyle.top, + resolvedStyle.width, + resolvedStyle.height + ); + } + internal static void SetStyleRect(this UnityEngine.UIElements.VisualElement e, Rect c) { + var style = e.style; + style.left = c.x; + style.top = c.y; + style.width = c.width; + style.height = c.height; + } + #endif + } +} diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/Extensions.cs.meta b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/Extensions.cs.meta new file mode 100644 index 00000000..1653550f --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/Extensions.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: af006e099ef04f6aa7cecc43e8cb6097 +timeCreated: 1677165403 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/ITween.cs b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/ITween.cs new file mode 100644 index 00000000..fee2da58 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/ITween.cs @@ -0,0 +1,32 @@ +/*// ReSharper disable UnusedMemberInSuper.Global +using System; +using JetBrains.Annotations; + +namespace PrimeTween { + // ReSharper disable once TypeParameterCanBeVariant + internal interface ITween { + bool isAlive { get; } + void Stop(); + void Complete(); + TResult OnComplete([NotNull] Action onComplete, bool warnIfTargetDestroyed = true); + TResult OnComplete([NotNull] T target, [NotNull] Action onComplete, bool warnIfTargetDestroyed = true) where T : class; + Sequence Group(Tween tween); + Sequence Chain(Tween tween); + Sequence Group(Sequence sequence); + Sequence Chain(Sequence sequence); + void SetRemainingCycles(int cycles); + void SetRemainingCycles(bool stopAtEndValue); + + int cyclesDone { get; } + int cyclesTotal { get; } + bool isPaused { get; set; } + float timeScale { get; set; } + float duration { get; } + float durationTotal { get; } + float elapsedTime { get; set; } + float elapsedTimeTotal { get; set; } + float progress { get; set; } + float progressTotal { get; set; } + // TResult OnUpdate(T target, Action onUpdate) where T : class; // Sequence doesn't support OnUpdate because its root updates before all children tweens, but it's reasonable that OnUpdate() should be called AFTER all sequence children are updated + } +}*/ \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/ITween.cs.meta b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/ITween.cs.meta new file mode 100644 index 00000000..3b1f60a0 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/ITween.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 3cd334e55fa448c3a55e6c14ebaf6638 +timeCreated: 1701681398 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/Obsolete.cs b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/Obsolete.cs new file mode 100644 index 00000000..ec718473 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/Obsolete.cs @@ -0,0 +1,236 @@ +// ReSharper disable UnusedMember.Global +// ReSharper disable PossibleNullReferenceException +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedParameter.Global +using System; +using System.ComponentModel; +using JetBrains.Annotations; +using UnityEngine; + +namespace PrimeTween { + public partial class PrimeTweenConfig { + // ReSharper disable once ValueParameterNotUsed + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("this setting is replaced with the 'warnIfTargetDestroyed' parameter that you can pass to the tween.OnComplete(), Tween.Delay() and Sequence.ChainDelay() methods.")] + public static bool warnDestroyedTweenHasOnComplete { set {} } + } + + static class Messages { + /// Obsolete on 2023-08-29 + internal const string obsoleteIsAliveMessage = "please use 'isAlive' (lower case 'i') instead."; + /// Obsolete on 2023-08-29 + internal const string obsoleteIsPausedMessage = "please use 'isPaused' (lower case 'i') instead."; + internal const string obsoleteTweenSetCycles = "SetCycles() was renamed to SetRemainingCycles()."; + } + + public partial struct Tween { + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(Messages.obsoleteTweenSetCycles)] + public void SetCycles(bool stopAtEndValue) => SetRemainingCycles(stopAtEndValue); + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(Messages.obsoleteTweenSetCycles)] + public void SetCycles(int cycles) => SetRemainingCycles(cycles); + + /// Obsolete on 2023-11-24 + const string minMaxExpected = "numMinExpected/numMaxExpected parameters are no longer supported."; + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(minMaxExpected)] + public static int StopAll([CanBeNull] object onTarget, int? numMinExpected, int? numMaxExpected = null) => StopAll(onTarget); + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(minMaxExpected)] + public static int CompleteAll([CanBeNull] object onTarget, int? numMinExpected, int? numMaxExpected = null) => CompleteAll(onTarget); + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(minMaxExpected)] + public static int SetPausedAll(bool isPaused, [CanBeNull] object onTarget, int? numMinExpected, int? numMaxExpected = null) => SetPausedAll(isPaused, onTarget); + + + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(Messages.obsoleteIsAliveMessage)] + public bool IsAlive => isAlive; + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(Messages.obsoleteIsPausedMessage)] + public bool IsPaused => isPaused; + + /// Obsolete on 2023-08-30 + const string localScaleRenamed = "please use 'Scale' instead of 'LocalScale'."; + + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(localScaleRenamed)] + public static Tween LocalScale([NotNull] Transform target, Vector3 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalScale(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(localScaleRenamed)] + public static Tween LocalScale([NotNull] Transform target, Vector3 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalScale(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(localScaleRenamed)] + public static Tween LocalScale([NotNull] Transform target, Vector3 startValue, Vector3 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalScale(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(localScaleRenamed)] + public static Tween LocalScale([NotNull] Transform target, Vector3 startValue, Vector3 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalScale(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(localScaleRenamed)] + public static Tween LocalScale([NotNull] Transform target, Vector3 endValue, TweenSettings settings) => LocalScale(target, new TweenSettings(endValue, settings)); + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(localScaleRenamed)] + public static Tween LocalScale([NotNull] Transform target, Vector3 startValue, Vector3 endValue, TweenSettings settings) => LocalScale(target, new TweenSettings(startValue, endValue, settings)); + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(localScaleRenamed)] + public static Tween LocalScale([NotNull] Transform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as Transform; + var val = _tween.Vector3Val; + _target.localScale = val; + }, t => (t.target as Transform).localScale.ToContainer(), TweenType.Scale); + } + + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(localScaleRenamed)] + public static Tween LocalScaleX([NotNull] Transform target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalScaleX(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(localScaleRenamed)] + public static Tween LocalScaleX([NotNull] Transform target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalScaleX(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(localScaleRenamed)] + public static Tween LocalScaleX([NotNull] Transform target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalScaleX(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(localScaleRenamed)] + public static Tween LocalScaleX([NotNull] Transform target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalScaleX(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(localScaleRenamed)] + public static Tween LocalScaleX([NotNull] Transform target, Single endValue, TweenSettings settings) => LocalScaleX(target, new TweenSettings(endValue, settings)); + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(localScaleRenamed)] + public static Tween LocalScaleX([NotNull] Transform target, Single startValue, Single endValue, TweenSettings settings) => LocalScaleX(target, new TweenSettings(startValue, endValue, settings)); + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(localScaleRenamed)] + public static Tween LocalScaleX([NotNull] Transform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as Transform; + var val = _tween.FloatVal; + _target.localScale = _target.localScale.WithComponent(0, val); + }, t => (t.target as Transform).localScale.x.ToContainer(), TweenType.ScaleX); + } + + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(localScaleRenamed)] + public static Tween LocalScaleY([NotNull] Transform target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalScaleY(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(localScaleRenamed)] + public static Tween LocalScaleY([NotNull] Transform target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalScaleY(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(localScaleRenamed)] + public static Tween LocalScaleY([NotNull] Transform target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalScaleY(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(localScaleRenamed)] + public static Tween LocalScaleY([NotNull] Transform target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalScaleY(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(localScaleRenamed)] + public static Tween LocalScaleY([NotNull] Transform target, Single endValue, TweenSettings settings) => LocalScaleY(target, new TweenSettings(endValue, settings)); + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(localScaleRenamed)] + public static Tween LocalScaleY([NotNull] Transform target, Single startValue, Single endValue, TweenSettings settings) => LocalScaleY(target, new TweenSettings(startValue, endValue, settings)); + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(localScaleRenamed)] + public static Tween LocalScaleY([NotNull] Transform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as Transform; + var val = _tween.FloatVal; + _target.localScale = _target.localScale.WithComponent(1, val); + }, t => (t.target as Transform).localScale.y.ToContainer(), TweenType.ScaleY); + } + + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(localScaleRenamed)] + public static Tween LocalScaleZ([NotNull] Transform target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalScaleZ(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(localScaleRenamed)] + public static Tween LocalScaleZ([NotNull] Transform target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalScaleZ(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(localScaleRenamed)] + public static Tween LocalScaleZ([NotNull] Transform target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalScaleZ(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(localScaleRenamed)] + public static Tween LocalScaleZ([NotNull] Transform target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalScaleZ(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(localScaleRenamed)] + public static Tween LocalScaleZ([NotNull] Transform target, Single endValue, TweenSettings settings) => LocalScaleZ(target, new TweenSettings(endValue, settings)); + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(localScaleRenamed)] + public static Tween LocalScaleZ([NotNull] Transform target, Single startValue, Single endValue, TweenSettings settings) => LocalScaleZ(target, new TweenSettings(startValue, endValue, settings)); + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(localScaleRenamed)] + public static Tween LocalScaleZ([NotNull] Transform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as Transform; + var val = _tween.FloatVal; + _target.localScale = _target.localScale.WithComponent(2, val); + }, t => (t.target as Transform).localScale.z.ToContainer(), TweenType.ScaleZ); + } + + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(localScaleRenamed)] + public static Tween LocalScale([NotNull] Transform target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalScale(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(localScaleRenamed)] + public static Tween LocalScale([NotNull] Transform target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalScale(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(localScaleRenamed)] + public static Tween LocalScale([NotNull] Transform target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalScale(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(localScaleRenamed)] + public static Tween LocalScale([NotNull] Transform target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalScale(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(localScaleRenamed)] + public static Tween LocalScale([NotNull] Transform target, Single endValue, TweenSettings settings) => LocalScale(target, new TweenSettings(endValue, settings)); + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(localScaleRenamed)] + public static Tween LocalScale([NotNull] Transform target, Single startValue, Single endValue, TweenSettings settings) => LocalScale(target, new TweenSettings(startValue, endValue, settings)); + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(localScaleRenamed)] + public static Tween LocalScale([NotNull] Transform target, TweenSettings uniformScaleSettings) => Scale(target, uniformScaleSettings); + + + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(localScaleRenamed)] + public static Tween ShakeLocalScale([NotNull] Transform target, Vector3 strength, float duration, float frequency = ShakeSettings.defaultFrequency, bool enableFalloff = true, Ease easeBetweenShakes = Ease.Default, float asymmetryFactor = 0f, int cycles = 1, + float startDelay = 0, float endDelay = 0, bool useUnscaledTime = PrimeTweenConfig.defaultUseUnscaledTimeForShakes) + => ShakeScale(target, new ShakeSettings(strength, duration, frequency, enableFalloff, easeBetweenShakes, asymmetryFactor, cycles, startDelay, endDelay, useUnscaledTime)); + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(localScaleRenamed)] + public static Tween ShakeLocalScale([NotNull] Transform target, ShakeSettings settings) => ShakeScale(target, settings); + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(localScaleRenamed)] + public static Tween PunchLocalScale([NotNull] Transform target, Vector3 strength, float duration, float frequency = ShakeSettings.defaultFrequency, bool enableFalloff = true, Ease easeBetweenShakes = Ease.Default, float asymmetryFactor = 0f, int cycles = 1, + float startDelay = 0, float endDelay = 0, bool useUnscaledTime = PrimeTweenConfig.defaultUseUnscaledTimeForShakes) + => PunchScale(target, new ShakeSettings(strength, duration, frequency, enableFalloff, easeBetweenShakes, asymmetryFactor, cycles, startDelay, endDelay, useUnscaledTime)); + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(localScaleRenamed)] + public static Tween PunchLocalScale([NotNull] Transform target, ShakeSettings settings) => ShakeScale(target, settings.WithPunch()); + } + + public partial struct Sequence { + /// Obsolete on 2023-11-28 + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("please use Sequence.Create(cycles: numCycles) instead. Or use SetRemainingCycles() to modify the number of remaining cycles when the Sequence is already running.")] + public Sequence SetCycles(int cycles) { + SetRemainingCycles(cycles); + return this; + } + + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(Messages.obsoleteIsAliveMessage)] + public bool IsAlive => isAlive; + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(Messages.obsoleteIsPausedMessage)] + public bool IsPaused => isPaused; + + const string chainAndInsertCallbackMessage = "The behavior of ChainCallback() and InsertCallback() methods was fixed in version 1.2.0. " + + "Use their obsolete counterparts only if you need to preserve the old incorrect behaviour in the existing project.\n" + + "More info: https://github.com/KyryloKuzyk/PrimeTween/discussions/112\n\n"; + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(chainAndInsertCallbackMessage)] + public Sequence ChainCallbackObsolete([NotNull] Action callback, bool warnIfTargetDestroyed = true) { + if (tryManipulate()) { + InsertCallbackObsolete(duration, callback, warnIfTargetDestroyed); + } + return this; + } + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(chainAndInsertCallbackMessage)] + public Sequence InsertCallbackObsolete(float atTime, Action callback, bool warnIfTargetDestroyed = true) { + if (!tryManipulate()) { + return this; + } + var delay = PrimeTweenManager.delayWithoutDurationCheck(PrimeTweenManager.dummyTarget, atTime, false); + Assert.IsTrue(delay.HasValue); + delay.Value.tween.OnComplete(callback, warnIfTargetDestroyed); + return Insert(0f, delay.Value); + } + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(chainAndInsertCallbackMessage)] + public Sequence ChainCallbackObsolete([NotNull] T target, [NotNull] Action callback, bool warnIfTargetDestroyed = true) where T: class { + if (tryManipulate()) { + InsertCallbackObsolete(duration, target, callback, warnIfTargetDestroyed); + } + return this; + } + [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete(chainAndInsertCallbackMessage)] + public Sequence InsertCallbackObsolete(float atTime, [NotNull] T target, Action callback, bool warnIfTargetDestroyed = true) where T: class { + if (!tryManipulate()) { + return this; + } + var delay = PrimeTweenManager.delayWithoutDurationCheck(target, atTime, false); + if (!delay.HasValue) { + return this; + } + delay.Value.tween.OnComplete(target, callback, warnIfTargetDestroyed); + return Insert(0f, delay.Value); + } + } +} diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/Obsolete.cs.meta b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/Obsolete.cs.meta new file mode 100644 index 00000000..721bb9d6 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/Obsolete.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: e6abe1297f08438d974455dc4b2f5396 +timeCreated: 1693407269 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/PrimeTweenManager.cs b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/PrimeTweenManager.cs new file mode 100644 index 00000000..dd65c08b --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/PrimeTweenManager.cs @@ -0,0 +1,531 @@ +// ReSharper disable Unity.RedundantHideInInspectorAttribute +#if PRIME_TWEEN_SAFETY_CHECKS && UNITY_ASSERTIONS +#define SAFETY_CHECKS +#endif +using System; +using System.Collections.Generic; +using System.Diagnostics; +using JetBrains.Annotations; +using UnityEngine; +using Debug = UnityEngine.Debug; +#if UNITY_EDITOR +using UnityEditor; +#endif + +namespace PrimeTween { + [AddComponentMenu("")] + internal class PrimeTweenManager : MonoBehaviour { + internal static PrimeTweenManager Instance; + #if UNITY_EDITOR + static bool isHotReload = true; + #endif + internal static int customInitialCapacity = -1; + + /// Item can be null if the list is accessed from the via onValueChange() or onComplete() + /// Changing list to array gives about 8% performance improvement and is possible to do in the future + /// The current implementation is simpler and PrimeTweenManagerInspector can draw tweens with no additional code + #if UNITY_2021_3_OR_NEWER + [ItemCanBeNull] + #endif + [SerializeField] internal List tweens; + [SerializeField] internal List lateUpdateTweens; + [SerializeField] internal List fixedUpdateTweens; + [NonSerialized] internal List pool; + /// startValue can't be replaced with 'Tween lastTween' + /// because the lastTween may already be dead, but the tween before it is still alive (count >= 1) + /// and we can't retrieve the startValue from the dead lastTween + internal Dictionary<(Transform, TweenType), (ValueContainer startValue, int count)> shakes; + internal int currentPoolCapacity { get; private set; } + internal int maxSimultaneousTweensCount { get; private set; } + + [HideInInspector] + internal long lastId = 1; + internal Ease defaultEase = Ease.OutQuad; + internal _UpdateType defaultUpdateType = _UpdateType.Update; + internal const Ease defaultShakeEase = Ease.OutQuad; + internal bool warnTweenOnDisabledTarget = true; + internal bool warnZeroDuration = true; + internal bool warnStructBoxingAllocationInCoroutine = true; + internal bool warnBenchmarkWithAsserts = true; + internal bool validateCustomCurves = true; + internal bool warnEndValueEqualsCurrent = true; + int processedCount; + int lateUpdateTweensProcessedCount; + int fixedUpdateTweensProcessedCount; + int maxLateUpdateCount; + internal int updateDepth; + internal static readonly object dummyTarget = new object(); + + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] + static void beforeSceneLoad() { + #if UNITY_EDITOR + isHotReload = false; + #endif + Assert.IsNull(Instance); + var go = new GameObject(nameof(PrimeTweenManager)); + DontDestroyOnLoad(go); + var instance = go.AddComponent(); + const int defaultInitialCapacity = 200; + instance.init(customInitialCapacity != -1 ? customInitialCapacity : defaultInitialCapacity); + Instance = instance; + } + + void init(int capacity) { + tweens = new List(capacity); + lateUpdateTweens = new List(capacity); + fixedUpdateTweens = new List(capacity); + pool = new List(capacity); + for (int i = 0; i < capacity; i++) { + pool.Add(new ReusableTween()); + } + shakes = new Dictionary<(Transform, TweenType), (ValueContainer, int)>(capacity); + currentPoolCapacity = capacity; + } + + const string manualInstanceCreationIsNotAllowedMessage = "Please don't create the " + nameof(PrimeTweenManager) + " instance manually."; + void Awake() => Assert.IsNull(Instance, manualInstanceCreationIsNotAllowedMessage); + + #if UNITY_EDITOR + [InitializeOnLoadMethod] + static void iniOnLoad() { + EditorApplication.playModeStateChanged += state => { + if (state == PlayModeStateChange.EnteredEditMode) { + Instance = null; + customInitialCapacity = -1; + } + }; + if (!isHotReload) { + return; + } + if (!Application.isPlaying) { + return; + } + Assert.IsNull(Instance); + var foundInScene = + #if UNITY_2023_1_OR_NEWER + FindAnyObjectByType + #else + FindObjectOfType + #endif + (); + Assert.IsNotNull(foundInScene); + #if PRIME_TWEEN_INSPECTOR_DEBUGGING + Debug.LogError("PRIME_TWEEN_INSPECTOR_DEBUGGING doesn't work with 'Recompile And Continue Playing' because Tween.id is serializable but Tween.tween is not."); + return; + #endif + var count = foundInScene.tweensCount; + if (count > 0) { + Debug.Log($"All tweens ({count}) were stopped because of 'Recompile And Continue Playing'."); + } + foundInScene.init(foundInScene.currentPoolCapacity); + Instance = foundInScene; + } + + void Reset() { + Assert.IsFalse(Application.isPlaying); + Debug.LogError(manualInstanceCreationIsNotAllowedMessage); + DestroyImmediate(this); + } + #endif + + void Start() { + #if SAFETY_CHECKS + // Selection.activeGameObject = gameObject; + #endif + Assert.AreEqual(Instance, this, manualInstanceCreationIsNotAllowedMessage); + } + + internal void FixedUpdate() => UpdateTweens(_UpdateType.FixedUpdate); + + /// + /// The most common tween lifecycle: + /// 1. User's script creates a tween in Update() in frame N. + /// 2. PrimeTweenManager.LateUpdate() applies the 'startValue' to the tween in the SAME FRAME N. This guarantees that the animation is rendered at the 'startValue' in the same frame the tween is created. + /// 3. PrimeTweenManager.Update() executes the first animation step on frame N+1. PrimeTweenManager's execution order is -2000, this means that + /// all tweens created in previous frames will already be updated before user's script Update() (if user's script execution order is greater than -2000). + /// 4. PrimeTweenManager.Update() completes the tween on frame N+(duration*targetFrameRate) given that targetFrameRate is stable. + /// + internal void Update() => UpdateTweens(_UpdateType.Update); + + void update(List tweens, float deltaTime, float unscaledDeltaTime, out int processedCount, int? maxCount = null) { + if (updateDepth != 0) { + throw new Exception("updateDepth != 0"); + } + updateDepth++; + // onComplete and onValueChange can create new tweens. Cache count to process only those tweens that were present when the update started + int oldCount = maxCount < tweens.Count ? maxCount.Value : tweens.Count; + var numRemoved = 0; + // Process tweens in the order of creation. + // This allows to create tween duplicates because the latest tween on the same value will overwrite the previous ones. + for (int i = 0; i < oldCount; i++) { + var tween = tweens[i]; + var newIndex = i - numRemoved; + #if SAFETY_CHECKS + Assert.IsNotNull(tween); + if (numRemoved > 0) { + Assert.IsNull(tweens[newIndex]); + } + #endif + // ReSharper disable once PossibleNullReferenceException + // delay release for one frame if coroutineEnumerator.resetEnumerator() + if (tween.updateAndCheckIfRunning(tween.settings.useUnscaledTime ? unscaledDeltaTime : deltaTime) || tween.coroutineEnumerator.resetEnumerator()) { + if (i != newIndex) { + tweens[i] = null; + tweens[newIndex] = tween; + } + continue; + } + releaseTweenToPool(tween); + tweens[i] = null; // set to null after releaseTweenToPool() so in case of an exception, the tween will stay inspectable via Inspector + numRemoved++; + } + processedCount = oldCount - numRemoved; + #if SAFETY_CHECKS + for (int i = oldCount - numRemoved; i < oldCount; i++) { // Check removed tweens are shifted to the left and are null + Assert.IsNull(tweens[i]); + } + for (int i = oldCount; i < tweens.Count; i++) { // Check all newly created tweens are not null + Assert.IsNotNull(tweens[i]); + } + #endif + updateDepth--; + if (numRemoved != 0) { + var newCount = tweens.Count; + for (int i = oldCount; i < newCount; i++) { + var tween = tweens[i]; + var newIndex = i - numRemoved; + #if SAFETY_CHECKS + Assert.IsNotNull(tween); + #endif + tweens[newIndex] = tween; + } + tweens.RemoveRange(newCount - numRemoved, numRemoved); + Assert.AreEqual(tweens.Count, newCount - numRemoved); + #if SAFETY_CHECKS + foreach (var t in tweens) { + Assert.IsNotNull(t); + } + // Check no duplicates + hashSet.Clear(); + hashSet.UnionWith(tweens); + Assert.AreEqual(hashSet.Count, tweens.Count); + #endif + } + } + + #if SAFETY_CHECKS + readonly HashSet hashSet = new HashSet(); + #endif + + internal void LateUpdate() { + UpdateTweens(_UpdateType.LateUpdate); + ApplyStartValues(_UpdateType.Update); + ApplyStartValues(_UpdateType.LateUpdate); + } + + internal void ApplyStartValues(_UpdateType updateType) { + switch (updateType) { + case _UpdateType.Default: + Debug.LogError("Please provide non-default update type."); + break; + case _UpdateType.Update: + ApplyStartValuesInternal(tweens, processedCount); + break; + case _UpdateType.LateUpdate: + ApplyStartValuesInternal(lateUpdateTweens, lateUpdateTweensProcessedCount); + break; + case _UpdateType.FixedUpdate: + ApplyStartValuesInternal(fixedUpdateTweens, fixedUpdateTweensProcessedCount); + break; + default: throw new Exception($"Invalid update type: {updateType}"); + } + + void ApplyStartValuesInternal(List list, int processedCount) { + updateDepth++; + int cachedCount = list.Count; + for (int i = processedCount; i < cachedCount; i++) { + var tween = list[i]; + // ReSharper disable once PossibleNullReferenceException + if (tween._isAlive && !tween.startFromCurrent && tween.settings.startDelay == 0 && !tween.isUnityTargetDestroyed() && !tween.isAdditive + && tween.canManipulate() + && tween.elapsedTimeTotal == 0f) { + tween.SetElapsedTimeTotal(0f); + } + } + updateDepth--; + } + } + + internal void UpdateTweens(_UpdateType updateType, float? deltaTime = null, float? unscaledDeltaTime = null) { + switch (updateType) { + case _UpdateType.Default: + Debug.LogError("Please provide non-default update type."); + break; + case _UpdateType.Update: + update(tweens, deltaTime ?? Time.deltaTime, unscaledDeltaTime ?? Time.unscaledDeltaTime, out processedCount); + break; + case _UpdateType.LateUpdate: + update(lateUpdateTweens, deltaTime ?? Time.deltaTime, unscaledDeltaTime ?? Time.unscaledDeltaTime, out lateUpdateTweensProcessedCount, maxLateUpdateCount); + maxLateUpdateCount = lateUpdateTweens.Count; + break; + case _UpdateType.FixedUpdate: + update(fixedUpdateTweens, deltaTime ?? Time.fixedDeltaTime, unscaledDeltaTime ?? Time.fixedUnscaledDeltaTime, out fixedUpdateTweensProcessedCount); + break; + default: throw new Exception($"Invalid update type: {updateType}"); + } + } + + void releaseTweenToPool([NotNull] ReusableTween tween) { + #if SAFETY_CHECKS + checkNotInSequence(tweens); + checkNotInSequence(lateUpdateTweens); + checkNotInSequence(fixedUpdateTweens); + void checkNotInSequence(List list) { + foreach (var t in list) { + if (t != null) { + Assert.AreNotEqual(tween.id, t.next.id); + Assert.AreNotEqual(tween.id, t.nextSibling.id); + Assert.AreNotEqual(tween.id, t.prev.id); + } + } + } + #endif + tween.Reset(); + pool.Add(tween); + } + + /// Returns null if target is a destroyed UnityEngine.Object + internal static Tween? delayWithoutDurationCheck([CanBeNull] object target, float duration, bool useUnscaledTime) { + #if UNITY_EDITOR + if (Constants.warnNoInstance) { + return null; + } + #endif + var tween = fetchTween(); + var settings = new TweenSettings { + duration = duration, + ease = Ease.Linear, + useUnscaledTime = useUnscaledTime + }; + tween.Setup(target, ref settings, _ => {}, null, false, TweenType.Delay); + var result = addTween(tween); + // ReSharper disable once RedundantCast + return result.IsCreated ? result : (Tween?)null; + } + + [NotNull] + internal static ReusableTween fetchTween() { + #if UNITY_EDITOR + if (Constants.warnNoInstance) { + return new ReusableTween(); + } + #endif + return Instance.fetchTween_internal(); + } + + [NotNull] + ReusableTween fetchTween_internal() { + ReusableTween result; + if (pool.Count == 0) { + result = new ReusableTween(); + if (tweensCount + 1 > currentPoolCapacity) { + var newCapacity = currentPoolCapacity == 0 ? 4 : currentPoolCapacity * 2; + Debug.LogWarning($"Tweens capacity has been increased from {currentPoolCapacity} to {newCapacity}. Please increase the capacity manually to prevent memory allocations at runtime by calling {Constants.setTweensCapacityMethod}.\n" + + $"To know the highest number of simultaneously running tweens, please observe the '{nameof(PrimeTweenManager)}/{Constants.maxAliveTweens}' in Inspector.\n"); + currentPoolCapacity = newCapacity; + } + } else { + var lastIndex = pool.Count - 1; + result = pool[lastIndex]; + pool.RemoveAt(lastIndex); + } + Assert.AreEqual(-1, result.id); + result.id = lastId; + return result; + } + + internal static Tween Animate([NotNull] ReusableTween tween) { + checkDuration(tween.target, tween.settings.duration); + return addTween(tween); + } + + internal static void checkDuration([CanBeNull] T target, float duration) where T : class { + #if UNITY_EDITOR + if (Constants.noInstance) { + return; + } + #endif + if (Instance.warnZeroDuration && duration <= 0) { + Debug.LogWarning($"Tween duration ({duration}) <= 0. {Constants.buildWarningCanBeDisabledMessage(nameof(warnZeroDuration))}", target as UnityEngine.Object); + } + } + + internal static Tween addTween([NotNull] ReusableTween tween) { + #if UNITY_EDITOR + if (Constants.noInstance) { + return default; + } + #endif + return Instance.addTween_internal(tween); + } + + Tween addTween_internal([NotNull] ReusableTween tween) { + Assert.IsNotNull(tween); + Assert.IsTrue(tween.id > 0); + if (tween.target == null || tween.isUnityTargetDestroyed()) { + Debug.LogError($"Tween's target is null: {tween.GetDescription()}. This error can mean that:\n" + + "- The target reference is null.\n" + + "- UnityEngine.Object target reference is not populated in the Inspector.\n" + + "- UnityEngine.Object target has been destroyed.\n" + + "Please ensure you're using a valid target.\n"); + tween.kill(); + releaseTweenToPool(tween); + return default; + } + if (warnTweenOnDisabledTarget) { + if (tween.target is Component comp && !comp.gameObject.activeInHierarchy) { + Debug.LogWarning($"Tween is started on GameObject that is not active in hierarchy: {comp.name}. {Constants.buildWarningCanBeDisabledMessage(nameof(warnTweenOnDisabledTarget))}", comp); + } + } + if (tween.settings._updateType == _UpdateType.Default) { + tween.settings._updateType = defaultUpdateType; + } + switch (tween.settings._updateType) { + case _UpdateType.Update: + tweens.Add(tween); + break; + case _UpdateType.LateUpdate: + lateUpdateTweens.Add(tween); + break; + case _UpdateType.FixedUpdate: + fixedUpdateTweens.Add(tween); + break; + default: + Debug.LogError($"Invalid update type: {tween.settings._updateType}"); + return default; + } + #if SAFETY_CHECKS + // Debug.Log($"[{Time.frameCount}] created: {tween.GetDescription()}", tween.unityTarget); + StackTraces.Record(tween.id); + #endif + lastId++; // increment only when tween added successfully + #if UNITY_ASSERTIONS && !PRIME_TWEEN_DISABLE_ASSERTIONS + maxSimultaneousTweensCount = Math.Max(maxSimultaneousTweensCount, tweensCount); + if (warnBenchmarkWithAsserts && maxSimultaneousTweensCount > 50000) { + warnBenchmarkWithAsserts = false; + var msg = "PrimeTween detected more than 50000 concurrent tweens. If you're running benchmarks, please add the PRIME_TWEEN_DISABLE_ASSERTIONS to the 'ProjectSettings/Player/Script Compilation' to disable assertions. This will ensure PrimeTween runs with the release performance.\n" + + "Also disable optional convenience features: PrimeTweenConfig.warnZeroDuration and PrimeTweenConfig.warnTweenOnDisabledTarget.\n"; + if (Application.isEditor) { + msg += "Please also run the tests in real builds, not in the Editor, to measure the performance correctly.\n"; + } + msg += $"{Constants.buildWarningCanBeDisabledMessage(nameof(PrimeTweenConfig.warnBenchmarkWithAsserts))}\n"; + Debug.LogError(msg); + } + #endif + return new Tween(tween); + } + + internal static int processAll([CanBeNull] object onTarget, [NotNull] Predicate predicate, bool allowToProcessTweensInsideSequence) { + #if UNITY_EDITOR + if (Constants.warnNoInstance) { + return default; + } + #endif + return Instance.processAll_internal(onTarget, predicate, allowToProcessTweensInsideSequence); + } + + internal static bool logCantManipulateError = true; + + int processAll_internal([CanBeNull] object onTarget, [NotNull] Predicate predicate, bool allowToProcessTweensInsideSequence) { + return processInList(tweens) + processInList(lateUpdateTweens) + processInList(fixedUpdateTweens); + int processInList(List tweens) { + int numProcessed = 0; + int totalCount = 0; + var count = tweens.Count; // this is not an optimization, OnComplete() may create new tweens + for (var i = 0; i < count; i++) { + var tween = tweens[i]; + if (tween == null) { + continue; + } + totalCount++; + if (onTarget != null) { + if (tween.target != onTarget) { + continue; + } + if (!allowToProcessTweensInsideSequence && tween.IsInSequence()) { + // To support stopping sequences by target, I can add new API 'Sequence.Create(object sequenceTarget)'. + // But 'sequenceTarget' is a different concept to tween's target, so I should not mix these two concepts together: + // 'sequenceTarget' serves the purpose of unique 'id', while tween's target is the animated object. + // In my opinion, the benefits of this new API don't outweigh the added complexity. A much more simpler approach is to store the Sequence reference and call sequence.Stop() directly. + Assert.IsFalse(tween.isMainSequenceRoot()); + if (logCantManipulateError) { + Assert.LogError(Constants.cantManipulateNested, tween.id); + } + continue; + } + } + if (tween._isAlive && predicate(tween)) { + numProcessed++; + } + } + if (onTarget == null) { + return totalCount; + } + return numProcessed; + } + } + + internal void SetTweensCapacity(int capacity) { + var runningTweens = tweensCount; + if (capacity < runningTweens) { + Debug.LogError($"New capacity ({capacity}) should be greater than the number of currently running tweens ({runningTweens}).\n" + + $"You can use {nameof(Tween)}.{nameof(Tween.StopAll)}() to stop all running tweens."); + return; + } + tweens.Capacity = capacity; + lateUpdateTweens.Capacity = capacity; + fixedUpdateTweens.Capacity = capacity; + #if UNITY_2021_2_OR_NEWER + shakes.EnsureCapacity(capacity); + #endif + resizeAndSetCapacity(pool, capacity - runningTweens, capacity); + currentPoolCapacity = capacity; + Assert.AreEqual(capacity, tweens.Capacity); + Assert.AreEqual(capacity, lateUpdateTweens.Capacity); + Assert.AreEqual(capacity, fixedUpdateTweens.Capacity); + Assert.AreEqual(capacity, pool.Capacity); + } + + internal int tweensCount => tweens.Count + lateUpdateTweens.Count + fixedUpdateTweens.Count; + + internal static void resizeAndSetCapacity([NotNull] List list, int newCount, int newCapacity) { + Assert.IsTrue(newCapacity >= newCount); + int curCount = list.Count; + if (curCount > newCount) { + var numToRemove = curCount - newCount; + list.RemoveRange(newCount, numToRemove); + list.Capacity = newCapacity; + } else { + list.Capacity = newCapacity; + if (newCount > curCount) { + var numToCreate = newCount - curCount; + for (int i = 0; i < numToCreate; i++) { + list.Add(new ReusableTween()); + } + } + } + Assert.AreEqual(newCount, list.Count); + Assert.AreEqual(newCapacity, list.Capacity); + } + + [Conditional("UNITY_ASSERTIONS")] + internal void warnStructBoxingInCoroutineOnce(long id) { + if (!warnStructBoxingAllocationInCoroutine) { + return; + } + warnStructBoxingAllocationInCoroutine = false; + Assert.LogWarning("Please use Tween/Sequence." + nameof(Tween.ToYieldInstruction) + "() when waiting for a Tween/Sequence in coroutines to prevent struct boxing.\n" + + Constants.buildWarningCanBeDisabledMessage(nameof(PrimeTweenConfig.warnStructBoxingAllocationInCoroutine)) + "\n", id); + } + } +} diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/PrimeTweenManager.cs.meta b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/PrimeTweenManager.cs.meta new file mode 100644 index 00000000..ea264f3e --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/PrimeTweenManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f3f57bce977c474ba249eb63545eff3c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: -2000 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/PropType.cs b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/PropType.cs new file mode 100644 index 00000000..5705fcd6 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/PropType.cs @@ -0,0 +1,15 @@ + +namespace PrimeTween { + internal enum PropType { + None = 0, + Float, + Color, + Vector2, + Vector3, + Vector4, + Quaternion, + Rect, + Int, + Double + } +} \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/PropType.cs.meta b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/PropType.cs.meta new file mode 100644 index 00000000..766fda29 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/PropType.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 4eb6f75d186a4c3e88cdf4a5b2b36332 +timeCreated: 1674162838 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/ReusableTween.cs b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/ReusableTween.cs new file mode 100644 index 00000000..0d376011 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/ReusableTween.cs @@ -0,0 +1,853 @@ +#if PRIME_TWEEN_SAFETY_CHECKS && UNITY_ASSERTIONS +#define SAFETY_CHECKS +#endif +using System; +using JetBrains.Annotations; +using UnityEngine; +using Debug = UnityEngine.Debug; + +namespace PrimeTween { + [Serializable] + internal class ReusableTween { + #if UNITY_EDITOR + [SerializeField, HideInInspector] internal string debugDescription; + [SerializeField, CanBeNull, UsedImplicitly] internal UnityEngine.Object unityTarget; + #endif + internal long id = -1; + /// Holds a reference to tween's target. If the target is UnityEngine.Object, the tween will gracefully stop when the target is destroyed. That is, destroying object with running tweens is perfectly ok. + /// Keep in mind: when animating plain C# objects (not derived from UnityEngine.Object), the plugin will hold a strong reference to the object for the entire tween duration. + /// If plain C# target holds a reference to UnityEngine.Object and animates its properties, then it's user's responsibility to ensure that UnityEngine.Object still exists. + [CanBeNull] internal object target; + [SerializeField] internal bool _isPaused; + internal bool _isAlive; + [SerializeField] internal float elapsedTimeTotal; + [SerializeField] internal float easedInterpolationFactor; + internal float cycleDuration; + + [SerializeField] internal ValueContainerStartEnd startEndValue; + + internal PropType propType => Utils.TweenTypeToTweenData(startEndValue.tweenType).Item1; + internal ref TweenType tweenType => ref startEndValue.tweenType; + internal ref ValueContainer startValue => ref startEndValue.startValue; + internal ref ValueContainer endValue => ref startEndValue.endValue; + internal ValueContainer diff; + internal bool isAdditive; + internal ValueContainer prevVal; + [SerializeField] internal TweenSettings settings; + [SerializeField] int cyclesDone; + const int iniCyclesDone = -1; + + internal object customOnValueChange; + internal long longParam; + internal int intParam { + get => (int)longParam; + set => longParam = value; + } + Action onValueChange; + + [CanBeNull] Action onComplete; + [CanBeNull] object onCompleteCallback; + [CanBeNull] object onCompleteTarget; + + internal float waitDelay; + internal Sequence sequence; + internal Tween prev; + internal Tween next; + internal Tween prevSibling; + internal Tween nextSibling; + + internal Func getter; + internal ref bool startFromCurrent => ref startEndValue.startFromCurrent; + + bool stoppedEmergently; + internal readonly TweenCoroutineEnumerator coroutineEnumerator = new TweenCoroutineEnumerator(); + internal float timeScale = 1f; + bool warnIgnoredOnCompleteIfTargetDestroyed = true; + internal ShakeData shakeData; + State state; + bool warnEndValueEqualsCurrent; + + internal bool updateAndCheckIfRunning(float dt) { + if (!_isAlive) { + return sequence.IsCreated; // don't release a tween until sequence.releaseTweens() + } + if (!_isPaused) { + SetElapsedTimeTotal(elapsedTimeTotal + dt * timeScale); + } else if (isUnityTargetDestroyed()) { + EmergencyStop(true); + return false; + } + return _isAlive; + } + + bool isUpdating; // todo place this check only on calls that come from Tween.Custom()? no, then it would not be possible to call .Complete() on custom tweens + + internal void SetElapsedTimeTotal(float newElapsedTimeTotal, bool earlyExitSequenceIfPaused = true) { + if (isUpdating) { + Debug.LogError(Constants.recursiveCallError); + return; + } + isUpdating = true; + if (!sequence.IsCreated) { + setElapsedTimeTotal(newElapsedTimeTotal, out int cyclesDiff); + if (!stoppedEmergently && _isAlive && isDone(cyclesDiff)) { + if (!_isPaused) { + kill(); + } + ReportOnComplete(); + } + } else { + Assert.IsTrue(sequence.isAlive, id); + if (isMainSequenceRoot()) { + Assert.IsTrue(sequence.root.id == id, id); + updateSequence(newElapsedTimeTotal, false, earlyExitSequenceIfPaused); + } + } + isUpdating = false; + } + + internal void updateSequence(float _elapsedTimeTotal, bool isRestart, bool earlyExitSequenceIfPaused = true, bool allowSkipChildrenUpdate = true) { + Assert.IsTrue(isSequenceRoot()); + float prevEasedT = easedInterpolationFactor; + if (!setElapsedTimeTotal(_elapsedTimeTotal, out int cyclesDiff) && allowSkipChildrenUpdate) { // update sequence root + return; + } + + bool isRestartToBeginning = isRestart && cyclesDiff < 0; + Assert.IsTrue(!isRestartToBeginning || cyclesDone == 0 || cyclesDone == iniCyclesDone); + if (cyclesDiff != 0 && !isRestartToBeginning) { + // print($" sequence cyclesDiff: {cyclesDiff}"); + if (isRestart) { + Assert.IsTrue(cyclesDiff > 0 && cyclesDone == settings.cycles); + cyclesDiff = 1; + } + int cyclesDiffAbs = Mathf.Abs(cyclesDiff); + int newCyclesDone = cyclesDone; + cyclesDone -= cyclesDiff; + int cyclesDelta = cyclesDiff > 0 ? 1 : -1; + var interpolationFactor = cyclesDelta > 0 ? 1f : 0f; + for (int i = 0; i < cyclesDiffAbs; i++) { + Assert.IsTrue(!isRestart || i == 0); + if (cyclesDone == settings.cycles || cyclesDone == iniCyclesDone) { + // do nothing when moving backward from the last cycle or forward from the -1 cycle + cyclesDone += cyclesDelta; + continue; + } + + var easedT = calcEasedT(interpolationFactor, cyclesDone); + var isForwardCycle = easedT > 0.5f; + const float negativeElapsedTime = -1000f; + if (!forceChildrenToPos()) { + return; + } + bool forceChildrenToPos() { + // complete the previous cycles by forcing all children tweens to 0f or 1f + // print($" (i:{i}) force to pos: {isForwardCycle}"); + var simulatedSequenceElapsedTime = isForwardCycle ? float.MaxValue : negativeElapsedTime; + foreach (var t in getSequenceSelfChildren(isForwardCycle)) { + var tween = t.tween; + tween.updateSequenceChild(simulatedSequenceElapsedTime, isRestart); + if (isEarlyExitAfterChildUpdate()) { + return false; + } + } + return true; + } + + cyclesDone += cyclesDelta; + var sequenceCycleMode = settings.cycleMode; + if (sequenceCycleMode == CycleMode.Restart && cyclesDone != settings.cycles && cyclesDone != iniCyclesDone) { // '&& cyclesDone != 0' check is wrong because we should do the restart when moving from 1 to 0 cyclesDone + if (!restartChildren()) { + return; + } + bool restartChildren() { + // print($"restart to pos: {!isForwardCycle}"); + var simulatedSequenceElapsedTime = !isForwardCycle ? float.MaxValue : negativeElapsedTime; + prevEasedT = simulatedSequenceElapsedTime; + foreach (var t in getSequenceSelfChildren(!isForwardCycle)) { + var tween = t.tween; + tween.updateSequenceChild(simulatedSequenceElapsedTime, true); + if (isEarlyExitAfterChildUpdate()) { + return false; + } + Assert.IsTrue(isForwardCycle || tween.cyclesDone == tween.settings.cycles, id); + Assert.IsTrue(!isForwardCycle || tween.cyclesDone <= 0, id); + Assert.IsTrue(isForwardCycle || tween.state == State.After, id); + Assert.IsTrue(!isForwardCycle || tween.state == State.Before, id); + } + return true; + } + } + } + Assert.IsTrue(newCyclesDone == cyclesDone, id); + if (isDone(cyclesDiff)) { + if (isMainSequenceRoot() && !_isPaused) { + sequence.releaseTweens(); + } + ReportOnComplete(); + return; + } + } + + easedInterpolationFactor = Mathf.Clamp01(easedInterpolationFactor); + bool isForward = easedInterpolationFactor > prevEasedT; + float sequenceElapsedTime = easedInterpolationFactor * cycleDuration; + foreach (var t in getSequenceSelfChildren(isForward)) { + t.tween.updateSequenceChild(sequenceElapsedTime, isRestart); + if (isEarlyExitAfterChildUpdate()) { + return; + } + } + + bool isEarlyExitAfterChildUpdate() { + if (!sequence.isAlive) { + return true; + } + return earlyExitSequenceIfPaused && sequence.root.tween._isPaused; // access isPaused via root tween to bypass the cantManipulateNested check + } + } + + Sequence.SequenceDirectEnumerator getSequenceSelfChildren(bool isForward) { + Assert.IsTrue(sequence.isAlive, id); + return sequence.getSelfChildren(isForward); + } + + bool isDone(int cyclesDiff) { + Assert.IsTrue(settings.cycles == -1 || cyclesDone <= settings.cycles); + if (timeScale > 0f) { + return cyclesDiff > 0 && cyclesDone == settings.cycles; + } + return cyclesDiff < 0 && cyclesDone == iniCyclesDone; + } + + void updateSequenceChild(float encompassingElapsedTime, bool isRestart) { + if (isSequenceRoot()) { + updateSequence(encompassingElapsedTime, isRestart); + } else { + setElapsedTimeTotal(encompassingElapsedTime, out var cyclesDiff); + if (!stoppedEmergently && _isAlive && isDone(cyclesDiff)) { + ReportOnComplete(); + } + } + } + + internal bool isMainSequenceRoot() => tweenType == TweenType.MainSequence; + internal bool isSequenceRoot() => tweenType == TweenType.MainSequence || tweenType == TweenType.NestedSequence; + + bool setElapsedTimeTotal(float _elapsedTimeTotal, out int cyclesDiff) { + elapsedTimeTotal = _elapsedTimeTotal; + int oldCyclesDone = cyclesDone; + float t = calcTFromElapsedTimeTotal(_elapsedTimeTotal, out var newState); + cyclesDiff = cyclesDone - oldCyclesDone; + if (newState == State.Running || state != newState) { + if (isUnityTargetDestroyed()) { + EmergencyStop(true); + return false; + } + float easedT = calcEasedT(t, cyclesDone); + // print($"state: {state}/{newState}, cycles: {cyclesDone}/{settings.cycles} (diff: {cyclesDiff}), elapsedTimeTotal: {elapsedTimeTotal}, interpolation: {t}/{easedT}"); + state = newState; + ReportOnValueChange(easedT); + return true; + } + return false; + } + + float calcTFromElapsedTimeTotal(float _elapsedTimeTotal, out State newState) { + // key timeline points: 0 | startDelay | duration | 1 | endDelay | onComplete + var cyclesTotal = settings.cycles; + // ReSharper disable once CompareOfFloatsByEqualityOperator + if (_elapsedTimeTotal == float.MaxValue) { + Assert.AreNotEqual(-1, cyclesTotal); + Assert.IsTrue(cyclesDone <= cyclesTotal); + cyclesDone = cyclesTotal; + newState = State.After; + return 1f; + } + _elapsedTimeTotal -= waitDelay; // waitDelay is applied before calculating cycles + if (_elapsedTimeTotal < 0f) { + cyclesDone = iniCyclesDone; + newState = State.Before; + return 0f; + } + Assert.IsTrue(_elapsedTimeTotal >= 0f); + Assert.AreNotEqual(float.MaxValue, _elapsedTimeTotal); + var duration = settings.duration; + if (duration == 0f) { + if (cyclesTotal == -1) { + // add max one cycle per frame + if (timeScale > 0f) { + if (cyclesDone == iniCyclesDone) { + cyclesDone = 1; + } else { + cyclesDone++; + } + } else if (timeScale != 0f) { + cyclesDone--; + if (cyclesDone == iniCyclesDone) { + newState = State.Before; + return 0f; + } + } + newState = State.Running; + return 1f; + } + Assert.AreNotEqual(-1, cyclesTotal); + if (_elapsedTimeTotal == 0f) { + cyclesDone = iniCyclesDone; + newState = State.Before; + return 0f; + } + Assert.IsTrue(cyclesDone <= cyclesTotal); + cyclesDone = cyclesTotal; + newState = State.After; + return 1f; + } + Assert.AreNotEqual(0f, cycleDuration); + cyclesDone = (int) (_elapsedTimeTotal / cycleDuration); + if (cyclesTotal != -1 && cyclesDone > cyclesTotal) { + cyclesDone = cyclesTotal; + } + if (cyclesTotal != -1 && cyclesDone == cyclesTotal) { + newState = State.After; + return 1f; + } + var elapsedTimeInCycle = _elapsedTimeTotal - cycleDuration * cyclesDone - settings.startDelay; + if (elapsedTimeInCycle < 0f) { + newState = State.Before; + return 0f; + } + Assert.IsTrue(elapsedTimeInCycle >= 0f); + Assert.AreNotEqual(0f, duration); + var result = elapsedTimeInCycle / duration; + if (result > 1f) { + newState = State.After; + return 1f; + } + newState = State.Running; + Assert.IsTrue(result >= 0f); + return result; + } + + // void print(string msg) => Debug.Log($"[{Time.frameCount}] id {id} {msg}"); + + internal void Reset() { + Assert.IsFalse(isUpdating); + Assert.IsFalse(_isAlive); + Assert.IsFalse(sequence.IsCreated); + Assert.IsFalse(prev.IsCreated); + Assert.IsFalse(next.IsCreated); + Assert.IsFalse(prevSibling.IsCreated); + Assert.IsFalse(nextSibling.IsCreated); + Assert.IsFalse(IsInSequence()); + if (shakeData.isAlive) { + shakeData.Reset(this); + } + #if UNITY_EDITOR + debugDescription = null; + unityTarget = null; + #endif + id = -1; + target = null; + settings.customEase = null; + customOnValueChange = null; + onValueChange = null; + onComplete = null; + onCompleteCallback = null; + onCompleteTarget = null; + getter = null; + stoppedEmergently = false; + waitDelay = 0f; + coroutineEnumerator.resetEnumerator(); + tweenType = TweenType.None; + timeScale = 1f; + warnIgnoredOnCompleteIfTargetDestroyed = true; + clearOnUpdate(); + } + + /// https://github.com/KyryloKuzyk/PrimeTween/discussions/4 + internal void OnComplete([NotNull] Action _onComplete, bool warnIfTargetDestroyed) { + Assert.IsNotNull(_onComplete); + validateOnCompleteAssignment(); + warnIgnoredOnCompleteIfTargetDestroyed = warnIfTargetDestroyed; + onCompleteCallback = _onComplete; + onComplete = tween => { + var callback = tween.onCompleteCallback as Action; + Assert.IsNotNull(callback); + try { + callback(); + } catch (Exception e) { + tween.handleOnCompleteException(e); + } + }; + } + + internal void OnComplete([CanBeNull] T _target, [NotNull] Action _onComplete, bool warnIfTargetDestroyed) where T : class { + if (_target == null || isDestroyedUnityObject(_target)) { + Debug.LogError($"{nameof(_target)} is null or has been destroyed. {Constants.onCompleteCallbackIgnored}"); + return; + } + Assert.IsNotNull(_onComplete); + validateOnCompleteAssignment(); + warnIgnoredOnCompleteIfTargetDestroyed = warnIfTargetDestroyed; + onCompleteTarget = _target; + onCompleteCallback = _onComplete; + onComplete = tween => { + var callback = tween.onCompleteCallback as Action; + Assert.IsNotNull(callback); + var _onCompleteTarget = tween.onCompleteTarget as T; + if (isDestroyedUnityObject(_onCompleteTarget)) { + tween.warnOnCompleteIgnored(true); + return; + } + try { + callback(_onCompleteTarget); + } catch (Exception e) { + tween.handleOnCompleteException(e); + } + }; + } + + void handleOnCompleteException(Exception e) { + // Design decision: if a tween is inside a Sequence and user's tween.OnComplete() throws an exception, the Sequence should continue + Assert.LogError($"Tween's onComplete callback raised exception, tween: {GetDescription()}, exception:\n{e}\n", id, target as UnityEngine.Object); + } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "ConditionIsAlwaysTrueOrFalse")] + static bool isDestroyedUnityObject(T obj) where T: class => obj is UnityEngine.Object unityObject && unityObject == null; + + void validateOnCompleteAssignment() { + const string msg = "Tween already has an onComplete callback. Adding more callbacks is not allowed.\n" + + "Workaround: wrap a tween in a Sequence by calling Sequence.Create(tween) and use multiple ChainCallback().\n"; + Assert.IsNull(onCompleteTarget, msg); + Assert.IsNull(onCompleteCallback, msg); + Assert.IsNull(onComplete, msg); + } + + /// _getter is null for custom tweens + internal void Setup([CanBeNull] object _target, ref TweenSettings _settings, [NotNull] Action _onValueChange, [CanBeNull] Func _getter, bool _startFromCurrent, TweenType _tweenType) { + Assert.IsTrue(_settings.cycles >= -1); + Assert.IsNotNull(_onValueChange); + Assert.IsNull(getter); + tweenType = _tweenType; + var propertyType = propType; + Assert.AreNotEqual(PropType.None, propertyType); + #if UNITY_EDITOR + if (Constants.noInstance) { + return; + } + #endif + if (_settings.ease == Ease.Default) { + _settings.ease = PrimeTweenManager.Instance.defaultEase; + } else if (_settings.ease == Ease.Custom && _settings.parametricEase == ParametricEase.None) { + if (_settings.customEase == null || !TweenSettings.ValidateCustomCurveKeyframes(_settings.customEase)) { + Debug.LogError($"Ease type is Ease.Custom, but {nameof(TweenSettings.customEase)} is not configured correctly."); + _settings.ease = PrimeTweenManager.Instance.defaultEase; + } + } + state = State.Before; + target = _target; + setUnityTarget(_target); + elapsedTimeTotal = 0f; + easedInterpolationFactor = float.MinValue; + _isPaused = false; + revive(); + + cyclesDone = iniCyclesDone; + _settings.SetValidValues(); + settings.CopyFrom(ref _settings); + recalculateTotalDuration(); + Assert.IsTrue(cycleDuration >= 0); + onValueChange = _onValueChange; + Assert.IsFalse(_startFromCurrent && _getter == null); + startFromCurrent = _startFromCurrent; + getter = _getter; + if (!_startFromCurrent) { + cacheDiff(); + } + if (propertyType == PropType.Quaternion) { + prevVal.QuaternionVal = Quaternion.identity; + } else { + prevVal.Reset(); + } + warnEndValueEqualsCurrent = PrimeTweenManager.Instance.warnEndValueEqualsCurrent; + } + + internal void setUnityTarget(object _target) { + #if UNITY_EDITOR + unityTarget = _target as UnityEngine.Object; + #endif + } + + /// Tween.Custom and Tween.ShakeCustom try-catch the and calls if an exception occurs. + /// sets to true. + internal void ReportOnValueChange(float _easedInterpolationFactor) { + // Debug.Log($"id {id}, ReportOnValueChange {_easedInterpolationFactor}"); + Assert.IsFalse(isUnityTargetDestroyed()); + if (startFromCurrent) { + startFromCurrent = false; + if (!ShakeData.TryTakeStartValueFromOtherShake(this)) { + startValue = getter(this); + } + if (startValue.Vector4Val == endValue.Vector4Val && warnEndValueEqualsCurrent && !shakeData.isAlive) { + Assert.LogWarning($"Tween's 'endValue' equals to the current animated value: {startValue.Vector4Val}, tween: {GetDescription()}.\n" + + $"{Constants.buildWarningCanBeDisabledMessage(nameof(PrimeTweenConfig.warnEndValueEqualsCurrent))}\n", id); + } + cacheDiff(); + } + easedInterpolationFactor = _easedInterpolationFactor; + onValueChange(this); + if (stoppedEmergently || !_isAlive) { + return; + } + onUpdate?.Invoke(this); + } + + void ReportOnComplete() { + // Debug.Log($"[{Time.frameCount}] id {id} ReportOnComplete() {easedInterpolationFactor}"); + Assert.IsFalse(startFromCurrent); + Assert.IsTrue(timeScale < 0 || cyclesDone == settings.cycles); + Assert.IsTrue(timeScale >= 0 || cyclesDone == iniCyclesDone); + onComplete?.Invoke(this); + } + + internal bool isUnityTargetDestroyed() { + // must use target here instead of unityTarget + // unityTarget has the SerializeField attribute, so if ReferenceEquals(unityTarget, null), then Unity will populate the field with non-null UnityEngine.Object when a new scene is loaded in the Editor + // https://github.com/KyryloKuzyk/PrimeTween/issues/32 + return isDestroyedUnityObject(target); + } + + internal bool HasOnComplete => onComplete != null; + + [NotNull] + internal string GetDescription() { + string result = ""; + if (!_isAlive) { + result += " - "; + } + if (target != PrimeTweenManager.dummyTarget) { + // ReSharper disable once ConditionIsAlwaysTrueOrFalse + result += $"{(target is UnityEngine.Object unityObject && unityObject != null ? unityObject.name : target?.GetType().Name)} / "; + } + var duration = settings.duration; + if (tweenType == TweenType.Delay) { + if (duration == 0f && onComplete != null) { + result += "Callback"; + } else { + result += $"Delay / duration {duration}"; + } + } else { + if (tweenType == TweenType.MainSequence) { + result += $"Sequence {id}"; + } else if (tweenType == TweenType.NestedSequence) { + result += $"Sequence {id} (nested)"; + } else { + result += tweenType.ToString() ; + } + result += " / duration "; + /*if (waitDelay != 0f) { + result += $"{waitDelay}+"; + }*/ + result += $"{duration}"; + } + result += $" / id {id}"; + if (sequence.IsCreated && tweenType != TweenType.MainSequence) { + result += $" / sequence {sequence.root.id}"; + } + return result; + } + + internal float calcDurationWithWaitDependencies() { + var cycles = settings.cycles; + Assert.AreNotEqual(-1, cycles, "It's impossible to calculate the duration of an infinite tween (cycles == -1)."); + Assert.AreNotEqual(0, cycles); + return waitDelay + cycleDuration * cycles; + } + + internal void recalculateTotalDuration() { + cycleDuration = settings.startDelay + settings.duration + settings.endDelay; + } + + internal float FloatVal => startValue.x + diff.x * easedInterpolationFactor; + internal double DoubleVal => startValue.DoubleVal + diff.DoubleVal * easedInterpolationFactor; + internal Vector2 Vector2Val { + get { + var easedT = easedInterpolationFactor; + return new Vector2( + startValue.x + diff.x * easedT, + startValue.y + diff.y * easedT); + } + } + internal Vector3 Vector3Val { + get { + var easedT = easedInterpolationFactor; + return new Vector3( + startValue.x + diff.x * easedT, + startValue.y + diff.y * easedT, + startValue.z + diff.z * easedT); + } + } + internal Vector4 Vector4Val { + get { + var easedT = easedInterpolationFactor; + return new Vector4( + startValue.x + diff.x * easedT, + startValue.y + diff.y * easedT, + startValue.z + diff.z * easedT, + startValue.w + diff.w * easedT); + } + } + internal Color ColorVal { + get { + var easedT = easedInterpolationFactor; + return new Color( + startValue.x + diff.x * easedT, + startValue.y + diff.y * easedT, + startValue.z + diff.z * easedT, + startValue.w + diff.w * easedT); + } + } + internal Rect RectVal { + get { + var easedT = easedInterpolationFactor; + return new Rect( + startValue.x + diff.x * easedT, + startValue.y + diff.y * easedT, + startValue.z + diff.z * easedT, + startValue.w + diff.w * easedT); + } + } + internal Quaternion QuaternionVal => Quaternion.SlerpUnclamped(startValue.QuaternionVal, endValue.QuaternionVal, easedInterpolationFactor); + + float calcEasedT(float t, int cyclesDone) { + switch (settings.cycleMode) { + case CycleMode.Restart: + return evaluate(t); + case CycleMode.Incremental: + return evaluate(t) + clampCyclesDone(); + case CycleMode.Yoyo: { + var isForwardCycle = clampCyclesDone() % 2 == 0; + return isForwardCycle ? evaluate(t) : 1 - evaluate(t); + } + case CycleMode.Rewind: { + var isForwardCycle = clampCyclesDone() % 2 == 0; + return isForwardCycle ? evaluate(t) : evaluate(1 - t); + } + default: + throw new Exception(); + } + + int clampCyclesDone() { + if (cyclesDone == iniCyclesDone) { + return 0; + } + int cyclesTotal = settings.cycles; + if (cyclesDone == cyclesTotal) { + Assert.AreNotEqual(-1, cyclesTotal); + return cyclesTotal - 1; + } + return cyclesDone; + } + } + + float evaluate(float t) { + if (settings.ease == Ease.Custom) { + if (settings.parametricEase != ParametricEase.None) { + return Easing.Evaluate(t, this); + } + return settings.customEase.Evaluate(t); + } + return StandardEasing.Evaluate(t, settings.ease); + } + + internal void cacheDiff() { + Assert.IsFalse(startFromCurrent); + var propertyType = propType; + Assert.AreNotEqual(PropType.None, propertyType); + switch (propertyType) { + case PropType.Quaternion: + startValue.QuaternionVal.Normalize(); + endValue.QuaternionVal.Normalize(); + break; + case PropType.Double: + diff.DoubleVal = endValue.DoubleVal - startValue.DoubleVal; + diff.z = 0; + diff.w = 0; + break; + default: + diff.x = endValue.x - startValue.x; + diff.y = endValue.y - startValue.y; + diff.z = endValue.z - startValue.z; + diff.w = endValue.w - startValue.w; + break; + } + } + + internal void ForceComplete() { + Assert.IsFalse(sequence.IsCreated); + kill(); // protects from recursive call + if (isUnityTargetDestroyed()) { + warnOnCompleteIgnored(true); + return; + } + var cyclesTotal = settings.cycles; + if (cyclesTotal == -1) { + // same as SetRemainingCycles(1) + cyclesTotal = getCyclesDone() + 1; + settings.cycles = cyclesTotal; + } + cyclesDone = cyclesTotal; + ReportOnValueChange(calcEasedT(1f, cyclesTotal)); + if (stoppedEmergently) { + return; + } + ReportOnComplete(); + Assert.IsFalse(_isAlive); + } + + internal void warnOnCompleteIgnored(bool isTargetDestroyed) { + if (HasOnComplete && warnIgnoredOnCompleteIfTargetDestroyed) { + onComplete = null; + var msg = $"{Constants.onCompleteCallbackIgnored} Tween: {GetDescription()}.\n"; + if (isTargetDestroyed) { + msg += "\nIf you use tween.OnComplete(), Tween.Delay(), or sequence.ChainDelay() only for cosmetic purposes, you can turn off this error by passing 'warnIfTargetDestroyed: false' to the method.\n" + + "More info: https://github.com/KyryloKuzyk/PrimeTween/discussions/4\n"; + } + Assert.LogError(msg, id, target as UnityEngine.Object); + } + } + + internal void EmergencyStop(bool isTargetDestroyed = false) { + if (sequence.IsCreated) { + var mainSequence = sequence; + while (true) { + var _prev = mainSequence.root.tween.prev; + if (!_prev.IsCreated) { + break; + } + var parent = _prev.tween.sequence; + if (!parent.IsCreated) { + break; + } + mainSequence = parent; + } + Assert.IsTrue(mainSequence.isAlive); + Assert.IsTrue(mainSequence.root.tween.isMainSequenceRoot()); + mainSequence.emergencyStop(); + } else if (_isAlive) { + // EmergencyStop() can be called after ForceComplete() and a caught exception in Tween.Custom() + kill(); + } + stoppedEmergently = true; + warnOnCompleteIgnored(isTargetDestroyed); + Assert.IsFalse(_isAlive); + Assert.IsFalse(sequence.isAlive); + } + + internal void kill() { + // print($"kill {GetDescription()}"); + Assert.IsTrue(_isAlive); + _isAlive = false; + #if UNITY_EDITOR + debugDescription = null; + #endif + } + + void revive() { + // print($"revive {GetDescription()}"); + Assert.IsFalse(_isAlive); + _isAlive = true; + #if UNITY_EDITOR + debugDescription = null; + #endif + } + + internal bool IsInSequence() { + var result = sequence.IsCreated; + Assert.IsTrue(result || !nextSibling.IsCreated); + return result; + } + + internal bool canManipulate() => !IsInSequence() || isMainSequenceRoot(); + + internal bool trySetPause(bool isPaused) { + if (_isPaused == isPaused) { + return false; + } + _isPaused = isPaused; + return true; + } + + [CanBeNull] object onUpdateTarget; + object onUpdateCallback; + Action onUpdate; + + internal void SetOnUpdate(T _target, [NotNull] Action _onUpdate) where T : class { + Assert.IsNull(onUpdate, "Only one OnUpdate() is allowed for one tween."); + Assert.IsNotNull(_onUpdate, nameof(_onUpdate) + " is null!"); + onUpdateTarget = _target; + onUpdateCallback = _onUpdate; + onUpdate = reusableTween => reusableTween.invokeOnUpdate(); + } + + void invokeOnUpdate() where T : class { + var callback = onUpdateCallback as Action; + Assert.IsNotNull(callback); + var _onUpdateTarget = onUpdateTarget as T; + if (isDestroyedUnityObject(_onUpdateTarget)) { + Assert.LogError($"OnUpdate() will not be called again because OnUpdate()'s target has been destroyed, tween: {GetDescription()}", id, target as UnityEngine.Object); + clearOnUpdate(); + return; + } + try { + callback(_onUpdateTarget, new Tween(this)); + } catch (Exception e) { + Assert.LogError($"OnUpdate() will not be called again because it thrown exception, tween: {GetDescription()}, exception:\n{e}", id, target as UnityEngine.Object); + clearOnUpdate(); + } + } + + void clearOnUpdate() { + onUpdateTarget = null; + onUpdateCallback = null; + onUpdate = null; + } + + public override string ToString() { + return GetDescription(); + } + + enum State : byte { + Before, Running, After + } + + internal float getElapsedTimeTotal() { + var result = elapsedTimeTotal; + var durationTotal = getDurationTotal(); + // ReSharper disable once CompareOfFloatsByEqualityOperator + if (result == float.MaxValue) { + return durationTotal; + } + return Mathf.Clamp(result, 0f, durationTotal); + } + + internal float getDurationTotal() { + var cyclesTotal = settings.cycles; + if (cyclesTotal == -1) { + return float.PositiveInfinity; + } + Assert.AreNotEqual(0, cyclesTotal); + return cycleDuration * cyclesTotal; + } + + internal int getCyclesDone() { + int result = cyclesDone; + if (result == iniCyclesDone) { + return 0; + } + Assert.IsTrue(result >= 0); + return result; + } + } +} diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/ReusableTween.cs.meta b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/ReusableTween.cs.meta new file mode 100644 index 00000000..4e3e3844 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/ReusableTween.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 257a3dcfeff44807bbedf9be546b410d +timeCreated: 1676595389 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/StackTraces.cs b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/StackTraces.cs new file mode 100644 index 00000000..202104a8 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/StackTraces.cs @@ -0,0 +1,137 @@ +#if PRIME_TWEEN_SAFETY_CHECKS && UNITY_ASSERTIONS +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using JetBrains.Annotations; +using UnityEngine; + +namespace PrimeTween { + internal static class StackTraces { + static readonly List idToHash = new List(1000); + static readonly Dictionary> hashToTraces = new Dictionary>(100); + static bool didWarn; + + /// https://github.com/Unity-Technologies/UnityCsReference/blob/6230ef8f9bed142ddf6a5e338d6e0faf3368d313/Runtime/Export/Scripting/StackTrace.cs#L31-L47 + internal static unsafe void Record(long id) { + if (!didWarn && ENABLE_IL2CPP) { + didWarn = true; + Debug.LogWarning("PRIME_TWEEN_SAFETY_CHECKS is used in IL2CPP build, which has negative performance impact in Development Builds. " + + "Please remove the PRIME_TWEEN_SAFETY_CHECKS from 'Project Settings/Player/Scripting Define Symbols' if you no longer need deep debugging support."); + } + if (id == 1) { + idToHash.Clear(); + idToHash.Add(0); + } + const int bufLength = 16 * 1024; + byte* buf = stackalloc byte[bufLength]; + int len; + #if UNITY_2019_4_OR_NEWER + len = Debug.ExtractStackTraceNoAlloc(buf, bufLength, Application.dataPath); + #else + Fallback(); + #endif + if (len <= 0) { + // ExtractStackTraceNoAlloc() doesn't work with IL2CPP, so use the allocating version instead + Fallback(); + } + void Fallback() { + string trace = StackTraceUtility.ExtractStackTrace(); + fixed (char* chars = trace) { + Encoding.UTF8.GetEncoder().Convert(chars, trace.Length, buf, bufLength, true, out _, out len, out _); + } + } + int hash = ComputeHash(buf, len); + Assert.AreEqual(id, idToHash.Count); + idToHash.Add(hash); + if (hashToTraces.TryGetValue(hash, out var traces)) { + if (!Contains(traces, buf, len)) { + traces.Add(BufToArray()); + } + } else { + hashToTraces.Add(hash, new List { BufToArray() }); + } + + byte[] BufToArray() { + var result = new byte[len]; + for (int i = 0; i < len; i++) { + result[i] = buf[i]; + } + return result; + } + } + + static bool ENABLE_IL2CPP { + get { + #if ENABLE_IL2CPP + return true; + #else + return false; + #endif + } + } + + static unsafe bool Contains([NotNull] List arrays, byte* data, int length) { + foreach (var arr in arrays) { + if (arr.Length == length) { + if (SequenceEqual()) { + return true; + } + + bool SequenceEqual() { + for (int i = 0; i < length; i++) { + if (arr[i] != data[i]) { + return false; + } + } + return true; + } + } + } + return false; + } + + /// https://stackoverflow.com/a/468084 + static unsafe int ComputeHash(byte* data, int length) { + unchecked { + const int p = 16777619; + int hash = (int)2166136261; + for (int i = 0; i < length; i++) { + hash = (hash ^ data[i]) * p; + } + return hash; + } + } + + [NotNull] + internal static string Get(long id) { + Assert.IsTrue(id < idToHash.Count); + // todo limit the max number of stack traces or wrap them around max value + bool isSuccess = hashToTraces.TryGetValue(idToHash[(int)id], out var traces); + Assert.IsTrue(isSuccess); + Assert.IsNotNull(traces); + return string.Join("\n\n", traces.Select(bytes => { + string str = Encoding.UTF8.GetString(bytes); + Assert.IsFalse(string.IsNullOrEmpty(str)); + int i = 0; + while (true) { + var prev = i; + i = str.IndexOf('\n', i); + if (i == -1) { + return str; + } + i++; + int j = str.IndexOf("PrimeTween.", i, StringComparison.Ordinal); + if (j != i) { + return str.Substring(prev); + } + } + })); + } + + internal static void logDebugInfo() { + Debug.Log($"idToHash.Count: {idToHash.Count}, hashToTraces.Count: {hashToTraces.Count}"); + } + } +} +#endif diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/StackTraces.cs.meta b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/StackTraces.cs.meta new file mode 100644 index 00000000..b73aca43 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/StackTraces.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 7a28f74456ca46d08fc316235384c5ee +timeCreated: 1703321204 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/StandardEasing.cs b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/StandardEasing.cs new file mode 100644 index 00000000..5c6a50e1 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/StandardEasing.cs @@ -0,0 +1,159 @@ +// Credits: http://robertpenner.com/easing/ +// Copyright © 2001 Robert Penner +// +// 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. + +// ReSharper disable PossibleNullReferenceException +// ReSharper disable CompareOfFloatsByEqualityOperator +using UnityEngine; + +namespace PrimeTween { + internal static class StandardEasing { + const float halfPi = Mathf.PI / 2f; + internal const float backEaseConst = 1.70158f; + internal const float defaultElasticEasePeriod = 0.3f; + + static float InElastic(float t) => 1 - OutElastic(1 - t); + + static float OutElastic(float t) { + const float decayFactor = 1f; + float decay = Mathf.Pow(2, -10f * t * decayFactor); + const float phase = defaultElasticEasePeriod / 4; + const float twoPi = Mathf.PI * 2f; + return t > 0.9999f ? 1 : decay * Mathf.Sin((t - phase) * twoPi / defaultElasticEasePeriod) + 1; + } + + static float OutBounce(float x) { + const float n1 = 7.5625f; + const float d1 = 2.75f; + if (x < 1 / d1) { + return n1 * x * x; + } + if (x < 2 / d1) { + return n1 * (x -= 1.5f / d1) * x + 0.75f; + } + if (x < 2.5 / d1) { + return n1 * (x -= 2.25f / d1) * x + 0.9375f; + } + return n1 * (x -= 2.625f / d1) * x + 0.984375f; + } + + internal static float Evaluate(float t, Ease ease) { + switch (ease) { + case Ease.Linear: + return t; + case Ease.InSine: + return 1 - Mathf.Cos(t * halfPi); + case Ease.OutSine: + return Mathf.Sin(t * halfPi); + case Ease.InOutSine: + return -0.5f * (Mathf.Cos(Mathf.PI * t) - 1); + case Ease.InQuad: + return t * t; + case Ease.OutQuad: + return -t * (t - 2); + case Ease.InOutQuad: + t *= 2f; + if (t < 1) { + return 0.5f * t * t; + } + return -0.5f * (--t * (t - 2) - 1); + case Ease.InCubic: + return t * t * t; + case Ease.OutCubic: + return (t -= 1) * t * t + 1; + case Ease.InOutCubic: + t *= 2f; + if (t < 1) { + return 0.5f * t * t * t; + } + return 0.5f * ((t -= 2) * t * t + 2); + case Ease.InQuart: + return t * t * t * t; + case Ease.OutQuart: + return -((t -= 1) * t * t * t - 1); + case Ease.InOutQuart: + t *= 2f; + if (t < 1) { + return 0.5f * t * t * t * t; + } + return -0.5f * ((t -= 2) * t * t * t - 2); + case Ease.InQuint: + return t * t * t * t * t; + case Ease.OutQuint: + return (t -= 1) * t * t * t * t + 1; + case Ease.InOutQuint: + t *= 2f; + if (t < 1) { + return 0.5f * t * t * t * t * t; + } + return 0.5f * ((t -= 2) * t * t * t * t + 2); + case Ease.InExpo: + return t == 0 ? 0 : Mathf.Pow(2, 10 * (t - 1)); + case Ease.OutExpo: + if (t == 1) { + return 1; + } + return -Mathf.Pow(2, -10 * t) + 1; + case Ease.InOutExpo: + if (t == 0) { + return 0; + } + if (t == 1) { + return 1; + } + t *= 2f; + if (t < 1) { + return 0.5f * Mathf.Pow(2, 10 * (t - 1)); + } + return 0.5f * (-Mathf.Pow(2, -10 * --t) + 2); + case Ease.InCirc: + return -(Mathf.Sqrt(1 - t * t) - 1); + case Ease.OutCirc: + return Mathf.Sqrt(1 - (t -= 1) * t); + case Ease.InOutCirc: + t *= 2f; + if (t < 1) { + return -0.5f * (Mathf.Sqrt(1 - t * t) - 1); + } + return 0.5f * (Mathf.Sqrt(1 - (t -= 2) * t) + 1); + case Ease.InBack: + return t * t * ((backEaseConst + 1) * t - backEaseConst); + case Ease.OutBack: + return (t -= 1) * t * ((backEaseConst + 1) * t + backEaseConst) + 1; + case Ease.InOutBack: + t *= 2f; + const float c1 = backEaseConst * 1.525f; + if (t < 1) { + return 0.5f * (t * t * ((c1 + 1) * t - c1)); + } + return 0.5f * ((t -= 2) * t * ((c1 + 1) * t + c1) + 2); + case Ease.InElastic: + return InElastic(t); + case Ease.OutElastic: + return OutElastic(t); + case Ease.InOutElastic: + if (t < 0.5f) { + return InElastic(t * 2) * 0.5f; + } + return 0.5f + OutElastic((t - 0.5f) * 2f) * 0.5f; + case Ease.InBounce: + return 1 - OutBounce(1 - t); + case Ease.OutBounce: + return OutBounce(t); + case Ease.InOutBounce: + return t < 0.5 + ? (1 - OutBounce(1 - 2 * t)) / 2 + : (1 + OutBounce(2 * t - 1)) / 2; + case Ease.Custom: + case Ease.Default: + default: + throw new System.Exception($"Invalid ease type: {ease}."); + } + } + } +} diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/StandardEasing.cs.meta b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/StandardEasing.cs.meta new file mode 100644 index 00000000..ded7f935 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/StandardEasing.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: e7f65c344edd417ebef88555406178af +timeCreated: 1673270662 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/TweenGenerated.cs b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/TweenGenerated.cs new file mode 100644 index 00000000..3f185948 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/TweenGenerated.cs @@ -0,0 +1,2528 @@ +// This file is generated by CodeGenerator.cs +// ReSharper disable PossibleNullReferenceException +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedMember.Global +// ReSharper disable UnusedMember.Local +// ReSharper disable UnusedMethodReturnValue.Global +using System; +using JetBrains.Annotations; + +namespace PrimeTween { + internal enum TweenType { + None, + MainSequence, + NestedSequence, + TweenComponent, + + Delay, + Callback, + + ShakeLocalPosition, + ShakeLocalRotation, + ShakeScale, + ShakeCustom, + ShakeCamera, + + CustomFloat, + CustomColor, + CustomVector2, + CustomVector3, + CustomVector4, + CustomQuaternion, + CustomRect, + CustomDouble, + + MaterialColorProperty, + MaterialProperty, + MaterialAlphaProperty, + MaterialTextureOffset, + MaterialTextureScale, + MaterialPropertyVector4, + + EulerAngles, + LocalEulerAngles, + GlobalTimeScale, + + // CODE GENERATOR BEGIN + LightRange, + LightShadowStrength, + LightIntensity, + LightColor, + CameraOrthographicSize, + CameraBackgroundColor, + CameraAspect, + CameraFarClipPlane, + CameraFieldOfView, + CameraNearClipPlane, + CameraPixelRect, + CameraRect, + LocalRotation, + ScaleUniform, + Rotation, + Position, + PositionX, + PositionY, + PositionZ, + LocalPosition, + LocalPositionX, + LocalPositionY, + LocalPositionZ, + RotationQuaternion, + LocalRotationQuaternion, + Scale, + ScaleX, + ScaleY, + ScaleZ, + Color, + Alpha, + TweenTimeScale, + TweenTimeScaleSequence, + UISliderValue, + UINormalizedPosition, + UIHorizontalNormalizedPosition, + UIVerticalNormalizedPosition, + UIPivotX, + UIPivotY, + UIPivot, + UIAnchorMax, + UIAnchorMin, + UIAnchoredPosition3D, + UIAnchoredPosition3DX, + UIAnchoredPosition3DY, + UIAnchoredPosition3DZ, + UIEffectDistance, + UIAlphaShadow, + UIColorShadow, + UIPreferredSize, + UIPreferredWidth, + UIPreferredHeight, + UIFlexibleSize, + UIFlexibleWidth, + UIFlexibleHeight, + UIMinSize, + UIMinWidth, + UIMinHeight, + UIColorGraphic, + UIAnchoredPosition, + UIAnchoredPositionX, + UIAnchoredPositionY, + UISizeDelta, + UIAlphaCanvasGroup, + UIAlphaGraphic, + UIFillAmount, + UIOffsetMin, + UIOffsetMinX, + UIOffsetMinY, + UIOffsetMax, + UIOffsetMaxX, + UIOffsetMaxY, + RigidbodyMovePosition, + RigidbodyMoveRotation, + RigidbodyMovePosition2D, + RigidbodyMoveRotation2D, + MaterialColor, + MaterialAlpha, + MaterialMainTextureOffset, + MaterialMainTextureScale, + AudioVolume, + AudioPitch, + AudioPanStereo, + VisualElementLayout, + VisualElementPosition, + VisualElementRotationQuaternion, + VisualElementScale, + VisualElementSize, + VisualElementTopLeft, + VisualElementColor, + VisualElementBackgroundColor, + TextMaxVisibleCharacters, + TextFontSize, + } + + public partial struct Tween { + public static Tween LightRange([NotNull] UnityEngine.Light target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LightRange(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LightRange([NotNull] UnityEngine.Light target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LightRange(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LightRange([NotNull] UnityEngine.Light target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LightRange(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LightRange([NotNull] UnityEngine.Light target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LightRange(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LightRange([NotNull] UnityEngine.Light target, Single endValue, TweenSettings settings) => LightRange(target, new TweenSettings(endValue, settings)); + public static Tween LightRange([NotNull] UnityEngine.Light target, Single startValue, Single endValue, TweenSettings settings) => LightRange(target, new TweenSettings(startValue, endValue, settings)); + public static Tween LightRange([NotNull] UnityEngine.Light target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.Light; + var val = _tween.FloatVal; + _target.range = val; + }, t => (t.target as UnityEngine.Light).range.ToContainer(), TweenType.LightRange); + } + + public static Tween LightShadowStrength([NotNull] UnityEngine.Light target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LightShadowStrength(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LightShadowStrength([NotNull] UnityEngine.Light target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LightShadowStrength(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LightShadowStrength([NotNull] UnityEngine.Light target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LightShadowStrength(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LightShadowStrength([NotNull] UnityEngine.Light target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LightShadowStrength(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LightShadowStrength([NotNull] UnityEngine.Light target, Single endValue, TweenSettings settings) => LightShadowStrength(target, new TweenSettings(endValue, settings)); + public static Tween LightShadowStrength([NotNull] UnityEngine.Light target, Single startValue, Single endValue, TweenSettings settings) => LightShadowStrength(target, new TweenSettings(startValue, endValue, settings)); + public static Tween LightShadowStrength([NotNull] UnityEngine.Light target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.Light; + var val = _tween.FloatVal; + _target.shadowStrength = val; + }, t => (t.target as UnityEngine.Light).shadowStrength.ToContainer(), TweenType.LightShadowStrength); + } + + public static Tween LightIntensity([NotNull] UnityEngine.Light target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LightIntensity(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LightIntensity([NotNull] UnityEngine.Light target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LightIntensity(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LightIntensity([NotNull] UnityEngine.Light target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LightIntensity(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LightIntensity([NotNull] UnityEngine.Light target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LightIntensity(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LightIntensity([NotNull] UnityEngine.Light target, Single endValue, TweenSettings settings) => LightIntensity(target, new TweenSettings(endValue, settings)); + public static Tween LightIntensity([NotNull] UnityEngine.Light target, Single startValue, Single endValue, TweenSettings settings) => LightIntensity(target, new TweenSettings(startValue, endValue, settings)); + public static Tween LightIntensity([NotNull] UnityEngine.Light target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.Light; + var val = _tween.FloatVal; + _target.intensity = val; + }, t => (t.target as UnityEngine.Light).intensity.ToContainer(), TweenType.LightIntensity); + } + + public static Tween LightColor([NotNull] UnityEngine.Light target, UnityEngine.Color endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LightColor(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LightColor([NotNull] UnityEngine.Light target, UnityEngine.Color endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LightColor(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LightColor([NotNull] UnityEngine.Light target, UnityEngine.Color startValue, UnityEngine.Color endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LightColor(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LightColor([NotNull] UnityEngine.Light target, UnityEngine.Color startValue, UnityEngine.Color endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LightColor(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LightColor([NotNull] UnityEngine.Light target, UnityEngine.Color endValue, TweenSettings settings) => LightColor(target, new TweenSettings(endValue, settings)); + public static Tween LightColor([NotNull] UnityEngine.Light target, UnityEngine.Color startValue, UnityEngine.Color endValue, TweenSettings settings) => LightColor(target, new TweenSettings(startValue, endValue, settings)); + public static Tween LightColor([NotNull] UnityEngine.Light target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.Light; + var val = _tween.ColorVal; + _target.color = val; + }, t => (t.target as UnityEngine.Light).color.ToContainer(), TweenType.LightColor); + } + + public static Tween CameraOrthographicSize([NotNull] UnityEngine.Camera target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => CameraOrthographicSize(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween CameraOrthographicSize([NotNull] UnityEngine.Camera target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => CameraOrthographicSize(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween CameraOrthographicSize([NotNull] UnityEngine.Camera target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => CameraOrthographicSize(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween CameraOrthographicSize([NotNull] UnityEngine.Camera target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => CameraOrthographicSize(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween CameraOrthographicSize([NotNull] UnityEngine.Camera target, Single endValue, TweenSettings settings) => CameraOrthographicSize(target, new TweenSettings(endValue, settings)); + public static Tween CameraOrthographicSize([NotNull] UnityEngine.Camera target, Single startValue, Single endValue, TweenSettings settings) => CameraOrthographicSize(target, new TweenSettings(startValue, endValue, settings)); + public static Tween CameraOrthographicSize([NotNull] UnityEngine.Camera target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.Camera; + var val = _tween.FloatVal; + _target.orthographicSize = val; + }, t => (t.target as UnityEngine.Camera).orthographicSize.ToContainer(), TweenType.CameraOrthographicSize); + } + + public static Tween CameraBackgroundColor([NotNull] UnityEngine.Camera target, UnityEngine.Color endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => CameraBackgroundColor(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween CameraBackgroundColor([NotNull] UnityEngine.Camera target, UnityEngine.Color endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => CameraBackgroundColor(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween CameraBackgroundColor([NotNull] UnityEngine.Camera target, UnityEngine.Color startValue, UnityEngine.Color endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => CameraBackgroundColor(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween CameraBackgroundColor([NotNull] UnityEngine.Camera target, UnityEngine.Color startValue, UnityEngine.Color endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => CameraBackgroundColor(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween CameraBackgroundColor([NotNull] UnityEngine.Camera target, UnityEngine.Color endValue, TweenSettings settings) => CameraBackgroundColor(target, new TweenSettings(endValue, settings)); + public static Tween CameraBackgroundColor([NotNull] UnityEngine.Camera target, UnityEngine.Color startValue, UnityEngine.Color endValue, TweenSettings settings) => CameraBackgroundColor(target, new TweenSettings(startValue, endValue, settings)); + public static Tween CameraBackgroundColor([NotNull] UnityEngine.Camera target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.Camera; + var val = _tween.ColorVal; + _target.backgroundColor = val; + }, t => (t.target as UnityEngine.Camera).backgroundColor.ToContainer(), TweenType.CameraBackgroundColor); + } + + public static Tween CameraAspect([NotNull] UnityEngine.Camera target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => CameraAspect(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween CameraAspect([NotNull] UnityEngine.Camera target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => CameraAspect(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween CameraAspect([NotNull] UnityEngine.Camera target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => CameraAspect(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween CameraAspect([NotNull] UnityEngine.Camera target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => CameraAspect(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween CameraAspect([NotNull] UnityEngine.Camera target, Single endValue, TweenSettings settings) => CameraAspect(target, new TweenSettings(endValue, settings)); + public static Tween CameraAspect([NotNull] UnityEngine.Camera target, Single startValue, Single endValue, TweenSettings settings) => CameraAspect(target, new TweenSettings(startValue, endValue, settings)); + public static Tween CameraAspect([NotNull] UnityEngine.Camera target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.Camera; + var val = _tween.FloatVal; + _target.aspect = val; + }, t => (t.target as UnityEngine.Camera).aspect.ToContainer(), TweenType.CameraAspect); + } + + public static Tween CameraFarClipPlane([NotNull] UnityEngine.Camera target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => CameraFarClipPlane(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween CameraFarClipPlane([NotNull] UnityEngine.Camera target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => CameraFarClipPlane(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween CameraFarClipPlane([NotNull] UnityEngine.Camera target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => CameraFarClipPlane(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween CameraFarClipPlane([NotNull] UnityEngine.Camera target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => CameraFarClipPlane(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween CameraFarClipPlane([NotNull] UnityEngine.Camera target, Single endValue, TweenSettings settings) => CameraFarClipPlane(target, new TweenSettings(endValue, settings)); + public static Tween CameraFarClipPlane([NotNull] UnityEngine.Camera target, Single startValue, Single endValue, TweenSettings settings) => CameraFarClipPlane(target, new TweenSettings(startValue, endValue, settings)); + public static Tween CameraFarClipPlane([NotNull] UnityEngine.Camera target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.Camera; + var val = _tween.FloatVal; + _target.farClipPlane = val; + }, t => (t.target as UnityEngine.Camera).farClipPlane.ToContainer(), TweenType.CameraFarClipPlane); + } + + public static Tween CameraFieldOfView([NotNull] UnityEngine.Camera target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => CameraFieldOfView(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween CameraFieldOfView([NotNull] UnityEngine.Camera target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => CameraFieldOfView(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween CameraFieldOfView([NotNull] UnityEngine.Camera target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => CameraFieldOfView(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween CameraFieldOfView([NotNull] UnityEngine.Camera target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => CameraFieldOfView(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween CameraFieldOfView([NotNull] UnityEngine.Camera target, Single endValue, TweenSettings settings) => CameraFieldOfView(target, new TweenSettings(endValue, settings)); + public static Tween CameraFieldOfView([NotNull] UnityEngine.Camera target, Single startValue, Single endValue, TweenSettings settings) => CameraFieldOfView(target, new TweenSettings(startValue, endValue, settings)); + public static Tween CameraFieldOfView([NotNull] UnityEngine.Camera target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.Camera; + var val = _tween.FloatVal; + _target.fieldOfView = val; + }, t => (t.target as UnityEngine.Camera).fieldOfView.ToContainer(), TweenType.CameraFieldOfView); + } + + public static Tween CameraNearClipPlane([NotNull] UnityEngine.Camera target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => CameraNearClipPlane(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween CameraNearClipPlane([NotNull] UnityEngine.Camera target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => CameraNearClipPlane(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween CameraNearClipPlane([NotNull] UnityEngine.Camera target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => CameraNearClipPlane(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween CameraNearClipPlane([NotNull] UnityEngine.Camera target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => CameraNearClipPlane(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween CameraNearClipPlane([NotNull] UnityEngine.Camera target, Single endValue, TweenSettings settings) => CameraNearClipPlane(target, new TweenSettings(endValue, settings)); + public static Tween CameraNearClipPlane([NotNull] UnityEngine.Camera target, Single startValue, Single endValue, TweenSettings settings) => CameraNearClipPlane(target, new TweenSettings(startValue, endValue, settings)); + public static Tween CameraNearClipPlane([NotNull] UnityEngine.Camera target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.Camera; + var val = _tween.FloatVal; + _target.nearClipPlane = val; + }, t => (t.target as UnityEngine.Camera).nearClipPlane.ToContainer(), TweenType.CameraNearClipPlane); + } + + public static Tween CameraPixelRect([NotNull] UnityEngine.Camera target, UnityEngine.Rect endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => CameraPixelRect(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween CameraPixelRect([NotNull] UnityEngine.Camera target, UnityEngine.Rect endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => CameraPixelRect(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween CameraPixelRect([NotNull] UnityEngine.Camera target, UnityEngine.Rect startValue, UnityEngine.Rect endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => CameraPixelRect(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween CameraPixelRect([NotNull] UnityEngine.Camera target, UnityEngine.Rect startValue, UnityEngine.Rect endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => CameraPixelRect(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween CameraPixelRect([NotNull] UnityEngine.Camera target, UnityEngine.Rect endValue, TweenSettings settings) => CameraPixelRect(target, new TweenSettings(endValue, settings)); + public static Tween CameraPixelRect([NotNull] UnityEngine.Camera target, UnityEngine.Rect startValue, UnityEngine.Rect endValue, TweenSettings settings) => CameraPixelRect(target, new TweenSettings(startValue, endValue, settings)); + public static Tween CameraPixelRect([NotNull] UnityEngine.Camera target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.Camera; + var val = _tween.RectVal; + _target.pixelRect = val; + }, t => (t.target as UnityEngine.Camera).pixelRect.ToContainer(), TweenType.CameraPixelRect); + } + + public static Tween CameraRect([NotNull] UnityEngine.Camera target, UnityEngine.Rect endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => CameraRect(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween CameraRect([NotNull] UnityEngine.Camera target, UnityEngine.Rect endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => CameraRect(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween CameraRect([NotNull] UnityEngine.Camera target, UnityEngine.Rect startValue, UnityEngine.Rect endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => CameraRect(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween CameraRect([NotNull] UnityEngine.Camera target, UnityEngine.Rect startValue, UnityEngine.Rect endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => CameraRect(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween CameraRect([NotNull] UnityEngine.Camera target, UnityEngine.Rect endValue, TweenSettings settings) => CameraRect(target, new TweenSettings(endValue, settings)); + public static Tween CameraRect([NotNull] UnityEngine.Camera target, UnityEngine.Rect startValue, UnityEngine.Rect endValue, TweenSettings settings) => CameraRect(target, new TweenSettings(startValue, endValue, settings)); + public static Tween CameraRect([NotNull] UnityEngine.Camera target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.Camera; + var val = _tween.RectVal; + _target.rect = val; + }, t => (t.target as UnityEngine.Camera).rect.ToContainer(), TweenType.CameraRect); + } + + public static Tween LocalRotation([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalRotation(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LocalRotation([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalRotation(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LocalRotation([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalRotation(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LocalRotation([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalRotation(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LocalRotation([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 endValue, TweenSettings settings) => LocalRotation(target, new TweenSettings(endValue, settings)); + public static Tween LocalRotation([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, TweenSettings settings) => LocalRotation(target, new TweenSettings(startValue, endValue, settings)); + + public static Tween Scale([NotNull] UnityEngine.Transform target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Scale(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Scale([NotNull] UnityEngine.Transform target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Scale(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Scale([NotNull] UnityEngine.Transform target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Scale(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Scale([NotNull] UnityEngine.Transform target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Scale(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Scale([NotNull] UnityEngine.Transform target, Single endValue, TweenSettings settings) => Scale(target, new TweenSettings(endValue, settings)); + public static Tween Scale([NotNull] UnityEngine.Transform target, Single startValue, Single endValue, TweenSettings settings) => Scale(target, new TweenSettings(startValue, endValue, settings)); + + public static Tween Rotation([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Rotation(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Rotation([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Rotation(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Rotation([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Rotation(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Rotation([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Rotation(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Rotation([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 endValue, TweenSettings settings) => Rotation(target, new TweenSettings(endValue, settings)); + public static Tween Rotation([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, TweenSettings settings) => Rotation(target, new TweenSettings(startValue, endValue, settings)); + + public static Tween Position([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Position(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Position([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Position(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Position([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Position(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Position([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Position(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Position([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 endValue, TweenSettings settings) => Position(target, new TweenSettings(endValue, settings)); + public static Tween Position([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, TweenSettings settings) => Position(target, new TweenSettings(startValue, endValue, settings)); + public static Tween Position([NotNull] UnityEngine.Transform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.Transform; + var val = _tween.Vector3Val; + _target.position = val; + }, t => (t.target as UnityEngine.Transform).position.ToContainer(), TweenType.Position); + } + + public static Tween PositionX([NotNull] UnityEngine.Transform target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => PositionX(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween PositionX([NotNull] UnityEngine.Transform target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => PositionX(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween PositionX([NotNull] UnityEngine.Transform target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => PositionX(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween PositionX([NotNull] UnityEngine.Transform target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => PositionX(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween PositionX([NotNull] UnityEngine.Transform target, Single endValue, TweenSettings settings) => PositionX(target, new TweenSettings(endValue, settings)); + public static Tween PositionX([NotNull] UnityEngine.Transform target, Single startValue, Single endValue, TweenSettings settings) => PositionX(target, new TweenSettings(startValue, endValue, settings)); + public static Tween PositionX([NotNull] UnityEngine.Transform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.Transform; + var val = _tween.FloatVal; + _target.position = _target.position.WithComponent(0, val); + }, t => (t.target as UnityEngine.Transform).position.x.ToContainer(), TweenType.PositionX); + } + + public static Tween PositionY([NotNull] UnityEngine.Transform target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => PositionY(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween PositionY([NotNull] UnityEngine.Transform target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => PositionY(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween PositionY([NotNull] UnityEngine.Transform target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => PositionY(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween PositionY([NotNull] UnityEngine.Transform target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => PositionY(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween PositionY([NotNull] UnityEngine.Transform target, Single endValue, TweenSettings settings) => PositionY(target, new TweenSettings(endValue, settings)); + public static Tween PositionY([NotNull] UnityEngine.Transform target, Single startValue, Single endValue, TweenSettings settings) => PositionY(target, new TweenSettings(startValue, endValue, settings)); + public static Tween PositionY([NotNull] UnityEngine.Transform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.Transform; + var val = _tween.FloatVal; + _target.position = _target.position.WithComponent(1, val); + }, t => (t.target as UnityEngine.Transform).position.y.ToContainer(), TweenType.PositionY); + } + + public static Tween PositionZ([NotNull] UnityEngine.Transform target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => PositionZ(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween PositionZ([NotNull] UnityEngine.Transform target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => PositionZ(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween PositionZ([NotNull] UnityEngine.Transform target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => PositionZ(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween PositionZ([NotNull] UnityEngine.Transform target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => PositionZ(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween PositionZ([NotNull] UnityEngine.Transform target, Single endValue, TweenSettings settings) => PositionZ(target, new TweenSettings(endValue, settings)); + public static Tween PositionZ([NotNull] UnityEngine.Transform target, Single startValue, Single endValue, TweenSettings settings) => PositionZ(target, new TweenSettings(startValue, endValue, settings)); + public static Tween PositionZ([NotNull] UnityEngine.Transform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.Transform; + var val = _tween.FloatVal; + _target.position = _target.position.WithComponent(2, val); + }, t => (t.target as UnityEngine.Transform).position.z.ToContainer(), TweenType.PositionZ); + } + + public static Tween LocalPosition([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalPosition(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LocalPosition([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalPosition(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LocalPosition([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalPosition(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LocalPosition([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalPosition(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LocalPosition([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 endValue, TweenSettings settings) => LocalPosition(target, new TweenSettings(endValue, settings)); + public static Tween LocalPosition([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, TweenSettings settings) => LocalPosition(target, new TweenSettings(startValue, endValue, settings)); + public static Tween LocalPosition([NotNull] UnityEngine.Transform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.Transform; + var val = _tween.Vector3Val; + _target.localPosition = val; + }, t => (t.target as UnityEngine.Transform).localPosition.ToContainer(), TweenType.LocalPosition); + } + + public static Tween LocalPositionX([NotNull] UnityEngine.Transform target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalPositionX(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LocalPositionX([NotNull] UnityEngine.Transform target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalPositionX(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LocalPositionX([NotNull] UnityEngine.Transform target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalPositionX(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LocalPositionX([NotNull] UnityEngine.Transform target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalPositionX(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LocalPositionX([NotNull] UnityEngine.Transform target, Single endValue, TweenSettings settings) => LocalPositionX(target, new TweenSettings(endValue, settings)); + public static Tween LocalPositionX([NotNull] UnityEngine.Transform target, Single startValue, Single endValue, TweenSettings settings) => LocalPositionX(target, new TweenSettings(startValue, endValue, settings)); + public static Tween LocalPositionX([NotNull] UnityEngine.Transform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.Transform; + var val = _tween.FloatVal; + _target.localPosition = _target.localPosition.WithComponent(0, val); + }, t => (t.target as UnityEngine.Transform).localPosition.x.ToContainer(), TweenType.LocalPositionX); + } + + public static Tween LocalPositionY([NotNull] UnityEngine.Transform target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalPositionY(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LocalPositionY([NotNull] UnityEngine.Transform target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalPositionY(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LocalPositionY([NotNull] UnityEngine.Transform target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalPositionY(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LocalPositionY([NotNull] UnityEngine.Transform target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalPositionY(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LocalPositionY([NotNull] UnityEngine.Transform target, Single endValue, TweenSettings settings) => LocalPositionY(target, new TweenSettings(endValue, settings)); + public static Tween LocalPositionY([NotNull] UnityEngine.Transform target, Single startValue, Single endValue, TweenSettings settings) => LocalPositionY(target, new TweenSettings(startValue, endValue, settings)); + public static Tween LocalPositionY([NotNull] UnityEngine.Transform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.Transform; + var val = _tween.FloatVal; + _target.localPosition = _target.localPosition.WithComponent(1, val); + }, t => (t.target as UnityEngine.Transform).localPosition.y.ToContainer(), TweenType.LocalPositionY); + } + + public static Tween LocalPositionZ([NotNull] UnityEngine.Transform target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalPositionZ(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LocalPositionZ([NotNull] UnityEngine.Transform target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalPositionZ(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LocalPositionZ([NotNull] UnityEngine.Transform target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalPositionZ(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LocalPositionZ([NotNull] UnityEngine.Transform target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalPositionZ(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LocalPositionZ([NotNull] UnityEngine.Transform target, Single endValue, TweenSettings settings) => LocalPositionZ(target, new TweenSettings(endValue, settings)); + public static Tween LocalPositionZ([NotNull] UnityEngine.Transform target, Single startValue, Single endValue, TweenSettings settings) => LocalPositionZ(target, new TweenSettings(startValue, endValue, settings)); + public static Tween LocalPositionZ([NotNull] UnityEngine.Transform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.Transform; + var val = _tween.FloatVal; + _target.localPosition = _target.localPosition.WithComponent(2, val); + }, t => (t.target as UnityEngine.Transform).localPosition.z.ToContainer(), TweenType.LocalPositionZ); + } + + public static Tween Rotation([NotNull] UnityEngine.Transform target, UnityEngine.Quaternion endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Rotation(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Rotation([NotNull] UnityEngine.Transform target, UnityEngine.Quaternion endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Rotation(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Rotation([NotNull] UnityEngine.Transform target, UnityEngine.Quaternion startValue, UnityEngine.Quaternion endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Rotation(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Rotation([NotNull] UnityEngine.Transform target, UnityEngine.Quaternion startValue, UnityEngine.Quaternion endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Rotation(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Rotation([NotNull] UnityEngine.Transform target, UnityEngine.Quaternion endValue, TweenSettings settings) => Rotation(target, new TweenSettings(endValue, settings)); + public static Tween Rotation([NotNull] UnityEngine.Transform target, UnityEngine.Quaternion startValue, UnityEngine.Quaternion endValue, TweenSettings settings) => Rotation(target, new TweenSettings(startValue, endValue, settings)); + public static Tween Rotation([NotNull] UnityEngine.Transform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.Transform; + var val = _tween.QuaternionVal; + _target.rotation = val; + }, t => (t.target as UnityEngine.Transform).rotation.ToContainer(), TweenType.RotationQuaternion); + } + + public static Tween LocalRotation([NotNull] UnityEngine.Transform target, UnityEngine.Quaternion endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalRotation(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LocalRotation([NotNull] UnityEngine.Transform target, UnityEngine.Quaternion endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalRotation(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LocalRotation([NotNull] UnityEngine.Transform target, UnityEngine.Quaternion startValue, UnityEngine.Quaternion endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalRotation(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LocalRotation([NotNull] UnityEngine.Transform target, UnityEngine.Quaternion startValue, UnityEngine.Quaternion endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalRotation(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LocalRotation([NotNull] UnityEngine.Transform target, UnityEngine.Quaternion endValue, TweenSettings settings) => LocalRotation(target, new TweenSettings(endValue, settings)); + public static Tween LocalRotation([NotNull] UnityEngine.Transform target, UnityEngine.Quaternion startValue, UnityEngine.Quaternion endValue, TweenSettings settings) => LocalRotation(target, new TweenSettings(startValue, endValue, settings)); + public static Tween LocalRotation([NotNull] UnityEngine.Transform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.Transform; + var val = _tween.QuaternionVal; + _target.localRotation = val; + }, t => (t.target as UnityEngine.Transform).localRotation.ToContainer(), TweenType.LocalRotationQuaternion); + } + + public static Tween Scale([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Scale(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Scale([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Scale(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Scale([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Scale(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Scale([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Scale(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Scale([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 endValue, TweenSettings settings) => Scale(target, new TweenSettings(endValue, settings)); + public static Tween Scale([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, TweenSettings settings) => Scale(target, new TweenSettings(startValue, endValue, settings)); + public static Tween Scale([NotNull] UnityEngine.Transform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.Transform; + var val = _tween.Vector3Val; + _target.localScale = val; + }, t => (t.target as UnityEngine.Transform).localScale.ToContainer(), TweenType.Scale); + } + + public static Tween ScaleX([NotNull] UnityEngine.Transform target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => ScaleX(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween ScaleX([NotNull] UnityEngine.Transform target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => ScaleX(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween ScaleX([NotNull] UnityEngine.Transform target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => ScaleX(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween ScaleX([NotNull] UnityEngine.Transform target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => ScaleX(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween ScaleX([NotNull] UnityEngine.Transform target, Single endValue, TweenSettings settings) => ScaleX(target, new TweenSettings(endValue, settings)); + public static Tween ScaleX([NotNull] UnityEngine.Transform target, Single startValue, Single endValue, TweenSettings settings) => ScaleX(target, new TweenSettings(startValue, endValue, settings)); + public static Tween ScaleX([NotNull] UnityEngine.Transform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.Transform; + var val = _tween.FloatVal; + _target.localScale = _target.localScale.WithComponent(0, val); + }, t => (t.target as UnityEngine.Transform).localScale.x.ToContainer(), TweenType.ScaleX); + } + + public static Tween ScaleY([NotNull] UnityEngine.Transform target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => ScaleY(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween ScaleY([NotNull] UnityEngine.Transform target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => ScaleY(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween ScaleY([NotNull] UnityEngine.Transform target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => ScaleY(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween ScaleY([NotNull] UnityEngine.Transform target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => ScaleY(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween ScaleY([NotNull] UnityEngine.Transform target, Single endValue, TweenSettings settings) => ScaleY(target, new TweenSettings(endValue, settings)); + public static Tween ScaleY([NotNull] UnityEngine.Transform target, Single startValue, Single endValue, TweenSettings settings) => ScaleY(target, new TweenSettings(startValue, endValue, settings)); + public static Tween ScaleY([NotNull] UnityEngine.Transform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.Transform; + var val = _tween.FloatVal; + _target.localScale = _target.localScale.WithComponent(1, val); + }, t => (t.target as UnityEngine.Transform).localScale.y.ToContainer(), TweenType.ScaleY); + } + + public static Tween ScaleZ([NotNull] UnityEngine.Transform target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => ScaleZ(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween ScaleZ([NotNull] UnityEngine.Transform target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => ScaleZ(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween ScaleZ([NotNull] UnityEngine.Transform target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => ScaleZ(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween ScaleZ([NotNull] UnityEngine.Transform target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => ScaleZ(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween ScaleZ([NotNull] UnityEngine.Transform target, Single endValue, TweenSettings settings) => ScaleZ(target, new TweenSettings(endValue, settings)); + public static Tween ScaleZ([NotNull] UnityEngine.Transform target, Single startValue, Single endValue, TweenSettings settings) => ScaleZ(target, new TweenSettings(startValue, endValue, settings)); + public static Tween ScaleZ([NotNull] UnityEngine.Transform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.Transform; + var val = _tween.FloatVal; + _target.localScale = _target.localScale.WithComponent(2, val); + }, t => (t.target as UnityEngine.Transform).localScale.z.ToContainer(), TweenType.ScaleZ); + } + + public static Tween Color([NotNull] UnityEngine.SpriteRenderer target, UnityEngine.Color endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Color(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Color([NotNull] UnityEngine.SpriteRenderer target, UnityEngine.Color endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Color(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Color([NotNull] UnityEngine.SpriteRenderer target, UnityEngine.Color startValue, UnityEngine.Color endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Color(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Color([NotNull] UnityEngine.SpriteRenderer target, UnityEngine.Color startValue, UnityEngine.Color endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Color(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Color([NotNull] UnityEngine.SpriteRenderer target, UnityEngine.Color endValue, TweenSettings settings) => Color(target, new TweenSettings(endValue, settings)); + public static Tween Color([NotNull] UnityEngine.SpriteRenderer target, UnityEngine.Color startValue, UnityEngine.Color endValue, TweenSettings settings) => Color(target, new TweenSettings(startValue, endValue, settings)); + public static Tween Color([NotNull] UnityEngine.SpriteRenderer target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.SpriteRenderer; + var val = _tween.ColorVal; + _target.color = val; + }, t => (t.target as UnityEngine.SpriteRenderer).color.ToContainer(), TweenType.Color); + } + + public static Tween Alpha([NotNull] UnityEngine.SpriteRenderer target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Alpha(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Alpha([NotNull] UnityEngine.SpriteRenderer target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Alpha(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Alpha([NotNull] UnityEngine.SpriteRenderer target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Alpha(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Alpha([NotNull] UnityEngine.SpriteRenderer target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Alpha(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Alpha([NotNull] UnityEngine.SpriteRenderer target, Single endValue, TweenSettings settings) => Alpha(target, new TweenSettings(endValue, settings)); + public static Tween Alpha([NotNull] UnityEngine.SpriteRenderer target, Single startValue, Single endValue, TweenSettings settings) => Alpha(target, new TweenSettings(startValue, endValue, settings)); + public static Tween Alpha([NotNull] UnityEngine.SpriteRenderer target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.SpriteRenderer; + var val = _tween.FloatVal; + _target.color = _target.color.WithAlpha(val); + }, t => (t.target as UnityEngine.SpriteRenderer).color.a.ToContainer(), TweenType.Alpha); + } + + public static Tween TweenTimeScale([NotNull] PrimeTween.Tween target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => TweenTimeScale(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween TweenTimeScale([NotNull] PrimeTween.Tween target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => TweenTimeScale(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween TweenTimeScale([NotNull] PrimeTween.Tween target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => TweenTimeScale(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween TweenTimeScale([NotNull] PrimeTween.Tween target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => TweenTimeScale(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween TweenTimeScale([NotNull] PrimeTween.Tween target, Single endValue, TweenSettings settings) => TweenTimeScale(target, new TweenSettings(endValue, settings)); + public static Tween TweenTimeScale([NotNull] PrimeTween.Tween target, Single startValue, Single endValue, TweenSettings settings) => TweenTimeScale(target, new TweenSettings(startValue, endValue, settings)); + + public static Tween TweenTimeScale([NotNull] PrimeTween.Sequence target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => TweenTimeScale(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween TweenTimeScale([NotNull] PrimeTween.Sequence target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => TweenTimeScale(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween TweenTimeScale([NotNull] PrimeTween.Sequence target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => TweenTimeScale(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween TweenTimeScale([NotNull] PrimeTween.Sequence target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => TweenTimeScale(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween TweenTimeScale([NotNull] PrimeTween.Sequence target, Single endValue, TweenSettings settings) => TweenTimeScale(target, new TweenSettings(endValue, settings)); + public static Tween TweenTimeScale([NotNull] PrimeTween.Sequence target, Single startValue, Single endValue, TweenSettings settings) => TweenTimeScale(target, new TweenSettings(startValue, endValue, settings)); + + #if !UNITY_2019_1_OR_NEWER || UNITY_UGUI_INSTALLED + public static Tween UISliderValue([NotNull] UnityEngine.UI.Slider target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UISliderValue(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UISliderValue([NotNull] UnityEngine.UI.Slider target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UISliderValue(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UISliderValue([NotNull] UnityEngine.UI.Slider target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UISliderValue(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UISliderValue([NotNull] UnityEngine.UI.Slider target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UISliderValue(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UISliderValue([NotNull] UnityEngine.UI.Slider target, Single endValue, TweenSettings settings) => UISliderValue(target, new TweenSettings(endValue, settings)); + public static Tween UISliderValue([NotNull] UnityEngine.UI.Slider target, Single startValue, Single endValue, TweenSettings settings) => UISliderValue(target, new TweenSettings(startValue, endValue, settings)); + public static Tween UISliderValue([NotNull] UnityEngine.UI.Slider target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.UI.Slider; + var val = _tween.FloatVal; + _target.value = val; + }, t => (t.target as UnityEngine.UI.Slider).value.ToContainer(), TweenType.UISliderValue); + } + + public static Tween UINormalizedPosition([NotNull] UnityEngine.UI.ScrollRect target, UnityEngine.Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UINormalizedPosition(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UINormalizedPosition([NotNull] UnityEngine.UI.ScrollRect target, UnityEngine.Vector2 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UINormalizedPosition(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UINormalizedPosition([NotNull] UnityEngine.UI.ScrollRect target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UINormalizedPosition(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UINormalizedPosition([NotNull] UnityEngine.UI.ScrollRect target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UINormalizedPosition(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UINormalizedPosition([NotNull] UnityEngine.UI.ScrollRect target, UnityEngine.Vector2 endValue, TweenSettings settings) => UINormalizedPosition(target, new TweenSettings(endValue, settings)); + public static Tween UINormalizedPosition([NotNull] UnityEngine.UI.ScrollRect target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, TweenSettings settings) => UINormalizedPosition(target, new TweenSettings(startValue, endValue, settings)); + public static Tween UINormalizedPosition([NotNull] UnityEngine.UI.ScrollRect target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.UI.ScrollRect; + var val = _tween.Vector2Val; + _target.SetNormalizedPosition(val); + }, t => (t.target as UnityEngine.UI.ScrollRect).GetNormalizedPosition().ToContainer(), TweenType.UINormalizedPosition); + } + + public static Tween UIHorizontalNormalizedPosition([NotNull] UnityEngine.UI.ScrollRect target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIHorizontalNormalizedPosition(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIHorizontalNormalizedPosition([NotNull] UnityEngine.UI.ScrollRect target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIHorizontalNormalizedPosition(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIHorizontalNormalizedPosition([NotNull] UnityEngine.UI.ScrollRect target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIHorizontalNormalizedPosition(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIHorizontalNormalizedPosition([NotNull] UnityEngine.UI.ScrollRect target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIHorizontalNormalizedPosition(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIHorizontalNormalizedPosition([NotNull] UnityEngine.UI.ScrollRect target, Single endValue, TweenSettings settings) => UIHorizontalNormalizedPosition(target, new TweenSettings(endValue, settings)); + public static Tween UIHorizontalNormalizedPosition([NotNull] UnityEngine.UI.ScrollRect target, Single startValue, Single endValue, TweenSettings settings) => UIHorizontalNormalizedPosition(target, new TweenSettings(startValue, endValue, settings)); + public static Tween UIHorizontalNormalizedPosition([NotNull] UnityEngine.UI.ScrollRect target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.UI.ScrollRect; + var val = _tween.FloatVal; + _target.horizontalNormalizedPosition = val; + }, t => (t.target as UnityEngine.UI.ScrollRect).horizontalNormalizedPosition.ToContainer(), TweenType.UIHorizontalNormalizedPosition); + } + + public static Tween UIVerticalNormalizedPosition([NotNull] UnityEngine.UI.ScrollRect target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIVerticalNormalizedPosition(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIVerticalNormalizedPosition([NotNull] UnityEngine.UI.ScrollRect target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIVerticalNormalizedPosition(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIVerticalNormalizedPosition([NotNull] UnityEngine.UI.ScrollRect target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIVerticalNormalizedPosition(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIVerticalNormalizedPosition([NotNull] UnityEngine.UI.ScrollRect target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIVerticalNormalizedPosition(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIVerticalNormalizedPosition([NotNull] UnityEngine.UI.ScrollRect target, Single endValue, TweenSettings settings) => UIVerticalNormalizedPosition(target, new TweenSettings(endValue, settings)); + public static Tween UIVerticalNormalizedPosition([NotNull] UnityEngine.UI.ScrollRect target, Single startValue, Single endValue, TweenSettings settings) => UIVerticalNormalizedPosition(target, new TweenSettings(startValue, endValue, settings)); + public static Tween UIVerticalNormalizedPosition([NotNull] UnityEngine.UI.ScrollRect target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.UI.ScrollRect; + var val = _tween.FloatVal; + _target.verticalNormalizedPosition = val; + }, t => (t.target as UnityEngine.UI.ScrollRect).verticalNormalizedPosition.ToContainer(), TweenType.UIVerticalNormalizedPosition); + } + + public static Tween UIPivotX([NotNull] UnityEngine.RectTransform target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIPivotX(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIPivotX([NotNull] UnityEngine.RectTransform target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIPivotX(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIPivotX([NotNull] UnityEngine.RectTransform target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIPivotX(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIPivotX([NotNull] UnityEngine.RectTransform target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIPivotX(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIPivotX([NotNull] UnityEngine.RectTransform target, Single endValue, TweenSettings settings) => UIPivotX(target, new TweenSettings(endValue, settings)); + public static Tween UIPivotX([NotNull] UnityEngine.RectTransform target, Single startValue, Single endValue, TweenSettings settings) => UIPivotX(target, new TweenSettings(startValue, endValue, settings)); + public static Tween UIPivotX([NotNull] UnityEngine.RectTransform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.RectTransform; + var val = _tween.FloatVal; + _target.pivot = _target.pivot.WithComponent(0, val); + }, t => (t.target as UnityEngine.RectTransform).pivot[0].ToContainer(), TweenType.UIPivotX); + } + + public static Tween UIPivotY([NotNull] UnityEngine.RectTransform target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIPivotY(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIPivotY([NotNull] UnityEngine.RectTransform target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIPivotY(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIPivotY([NotNull] UnityEngine.RectTransform target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIPivotY(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIPivotY([NotNull] UnityEngine.RectTransform target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIPivotY(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIPivotY([NotNull] UnityEngine.RectTransform target, Single endValue, TweenSettings settings) => UIPivotY(target, new TweenSettings(endValue, settings)); + public static Tween UIPivotY([NotNull] UnityEngine.RectTransform target, Single startValue, Single endValue, TweenSettings settings) => UIPivotY(target, new TweenSettings(startValue, endValue, settings)); + public static Tween UIPivotY([NotNull] UnityEngine.RectTransform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.RectTransform; + var val = _tween.FloatVal; + _target.pivot = _target.pivot.WithComponent(1, val); + }, t => (t.target as UnityEngine.RectTransform).pivot[1].ToContainer(), TweenType.UIPivotY); + } + + public static Tween UIPivot([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIPivot(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIPivot([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIPivot(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIPivot([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIPivot(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIPivot([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIPivot(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIPivot([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 endValue, TweenSettings settings) => UIPivot(target, new TweenSettings(endValue, settings)); + public static Tween UIPivot([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, TweenSettings settings) => UIPivot(target, new TweenSettings(startValue, endValue, settings)); + public static Tween UIPivot([NotNull] UnityEngine.RectTransform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.RectTransform; + var val = _tween.Vector2Val; + _target.pivot = val; + }, t => (t.target as UnityEngine.RectTransform).pivot.ToContainer(), TweenType.UIPivot); + } + + public static Tween UIAnchorMax([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIAnchorMax(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIAnchorMax([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIAnchorMax(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIAnchorMax([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIAnchorMax(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIAnchorMax([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIAnchorMax(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIAnchorMax([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 endValue, TweenSettings settings) => UIAnchorMax(target, new TweenSettings(endValue, settings)); + public static Tween UIAnchorMax([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, TweenSettings settings) => UIAnchorMax(target, new TweenSettings(startValue, endValue, settings)); + public static Tween UIAnchorMax([NotNull] UnityEngine.RectTransform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.RectTransform; + var val = _tween.Vector2Val; + _target.anchorMax = val; + }, t => (t.target as UnityEngine.RectTransform).anchorMax.ToContainer(), TweenType.UIAnchorMax); + } + + public static Tween UIAnchorMin([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIAnchorMin(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIAnchorMin([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIAnchorMin(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIAnchorMin([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIAnchorMin(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIAnchorMin([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIAnchorMin(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIAnchorMin([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 endValue, TweenSettings settings) => UIAnchorMin(target, new TweenSettings(endValue, settings)); + public static Tween UIAnchorMin([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, TweenSettings settings) => UIAnchorMin(target, new TweenSettings(startValue, endValue, settings)); + public static Tween UIAnchorMin([NotNull] UnityEngine.RectTransform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.RectTransform; + var val = _tween.Vector2Val; + _target.anchorMin = val; + }, t => (t.target as UnityEngine.RectTransform).anchorMin.ToContainer(), TweenType.UIAnchorMin); + } + + public static Tween UIAnchoredPosition3D([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector3 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIAnchoredPosition3D(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIAnchoredPosition3D([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector3 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIAnchoredPosition3D(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIAnchoredPosition3D([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIAnchoredPosition3D(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIAnchoredPosition3D([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIAnchoredPosition3D(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIAnchoredPosition3D([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector3 endValue, TweenSettings settings) => UIAnchoredPosition3D(target, new TweenSettings(endValue, settings)); + public static Tween UIAnchoredPosition3D([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, TweenSettings settings) => UIAnchoredPosition3D(target, new TweenSettings(startValue, endValue, settings)); + public static Tween UIAnchoredPosition3D([NotNull] UnityEngine.RectTransform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.RectTransform; + var val = _tween.Vector3Val; + _target.anchoredPosition3D = val; + }, t => (t.target as UnityEngine.RectTransform).anchoredPosition3D.ToContainer(), TweenType.UIAnchoredPosition3D); + } + + public static Tween UIAnchoredPosition3DX([NotNull] UnityEngine.RectTransform target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIAnchoredPosition3DX(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIAnchoredPosition3DX([NotNull] UnityEngine.RectTransform target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIAnchoredPosition3DX(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIAnchoredPosition3DX([NotNull] UnityEngine.RectTransform target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIAnchoredPosition3DX(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIAnchoredPosition3DX([NotNull] UnityEngine.RectTransform target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIAnchoredPosition3DX(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIAnchoredPosition3DX([NotNull] UnityEngine.RectTransform target, Single endValue, TweenSettings settings) => UIAnchoredPosition3DX(target, new TweenSettings(endValue, settings)); + public static Tween UIAnchoredPosition3DX([NotNull] UnityEngine.RectTransform target, Single startValue, Single endValue, TweenSettings settings) => UIAnchoredPosition3DX(target, new TweenSettings(startValue, endValue, settings)); + public static Tween UIAnchoredPosition3DX([NotNull] UnityEngine.RectTransform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.RectTransform; + var val = _tween.FloatVal; + _target.anchoredPosition3D = _target.anchoredPosition3D.WithComponent(0, val); + }, t => (t.target as UnityEngine.RectTransform).anchoredPosition3D[0].ToContainer(), TweenType.UIAnchoredPosition3DX); + } + + public static Tween UIAnchoredPosition3DY([NotNull] UnityEngine.RectTransform target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIAnchoredPosition3DY(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIAnchoredPosition3DY([NotNull] UnityEngine.RectTransform target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIAnchoredPosition3DY(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIAnchoredPosition3DY([NotNull] UnityEngine.RectTransform target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIAnchoredPosition3DY(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIAnchoredPosition3DY([NotNull] UnityEngine.RectTransform target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIAnchoredPosition3DY(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIAnchoredPosition3DY([NotNull] UnityEngine.RectTransform target, Single endValue, TweenSettings settings) => UIAnchoredPosition3DY(target, new TweenSettings(endValue, settings)); + public static Tween UIAnchoredPosition3DY([NotNull] UnityEngine.RectTransform target, Single startValue, Single endValue, TweenSettings settings) => UIAnchoredPosition3DY(target, new TweenSettings(startValue, endValue, settings)); + public static Tween UIAnchoredPosition3DY([NotNull] UnityEngine.RectTransform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.RectTransform; + var val = _tween.FloatVal; + _target.anchoredPosition3D = _target.anchoredPosition3D.WithComponent(1, val); + }, t => (t.target as UnityEngine.RectTransform).anchoredPosition3D[1].ToContainer(), TweenType.UIAnchoredPosition3DY); + } + + public static Tween UIAnchoredPosition3DZ([NotNull] UnityEngine.RectTransform target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIAnchoredPosition3DZ(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIAnchoredPosition3DZ([NotNull] UnityEngine.RectTransform target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIAnchoredPosition3DZ(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIAnchoredPosition3DZ([NotNull] UnityEngine.RectTransform target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIAnchoredPosition3DZ(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIAnchoredPosition3DZ([NotNull] UnityEngine.RectTransform target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIAnchoredPosition3DZ(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIAnchoredPosition3DZ([NotNull] UnityEngine.RectTransform target, Single endValue, TweenSettings settings) => UIAnchoredPosition3DZ(target, new TweenSettings(endValue, settings)); + public static Tween UIAnchoredPosition3DZ([NotNull] UnityEngine.RectTransform target, Single startValue, Single endValue, TweenSettings settings) => UIAnchoredPosition3DZ(target, new TweenSettings(startValue, endValue, settings)); + public static Tween UIAnchoredPosition3DZ([NotNull] UnityEngine.RectTransform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.RectTransform; + var val = _tween.FloatVal; + _target.anchoredPosition3D = _target.anchoredPosition3D.WithComponent(2, val); + }, t => (t.target as UnityEngine.RectTransform).anchoredPosition3D[2].ToContainer(), TweenType.UIAnchoredPosition3DZ); + } + + public static Tween UIEffectDistance([NotNull] UnityEngine.UI.Shadow target, UnityEngine.Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIEffectDistance(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIEffectDistance([NotNull] UnityEngine.UI.Shadow target, UnityEngine.Vector2 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIEffectDistance(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIEffectDistance([NotNull] UnityEngine.UI.Shadow target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIEffectDistance(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIEffectDistance([NotNull] UnityEngine.UI.Shadow target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIEffectDistance(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIEffectDistance([NotNull] UnityEngine.UI.Shadow target, UnityEngine.Vector2 endValue, TweenSettings settings) => UIEffectDistance(target, new TweenSettings(endValue, settings)); + public static Tween UIEffectDistance([NotNull] UnityEngine.UI.Shadow target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, TweenSettings settings) => UIEffectDistance(target, new TweenSettings(startValue, endValue, settings)); + public static Tween UIEffectDistance([NotNull] UnityEngine.UI.Shadow target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.UI.Shadow; + var val = _tween.Vector2Val; + _target.effectDistance = val; + }, t => (t.target as UnityEngine.UI.Shadow).effectDistance.ToContainer(), TweenType.UIEffectDistance); + } + + public static Tween Alpha([NotNull] UnityEngine.UI.Shadow target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Alpha(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Alpha([NotNull] UnityEngine.UI.Shadow target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Alpha(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Alpha([NotNull] UnityEngine.UI.Shadow target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Alpha(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Alpha([NotNull] UnityEngine.UI.Shadow target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Alpha(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Alpha([NotNull] UnityEngine.UI.Shadow target, Single endValue, TweenSettings settings) => Alpha(target, new TweenSettings(endValue, settings)); + public static Tween Alpha([NotNull] UnityEngine.UI.Shadow target, Single startValue, Single endValue, TweenSettings settings) => Alpha(target, new TweenSettings(startValue, endValue, settings)); + public static Tween Alpha([NotNull] UnityEngine.UI.Shadow target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.UI.Shadow; + var val = _tween.FloatVal; + _target.effectColor = _target.effectColor.WithAlpha(val); + }, t => (t.target as UnityEngine.UI.Shadow).effectColor.a.ToContainer(), TweenType.UIAlphaShadow); + } + + public static Tween Color([NotNull] UnityEngine.UI.Shadow target, UnityEngine.Color endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Color(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Color([NotNull] UnityEngine.UI.Shadow target, UnityEngine.Color endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Color(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Color([NotNull] UnityEngine.UI.Shadow target, UnityEngine.Color startValue, UnityEngine.Color endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Color(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Color([NotNull] UnityEngine.UI.Shadow target, UnityEngine.Color startValue, UnityEngine.Color endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Color(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Color([NotNull] UnityEngine.UI.Shadow target, UnityEngine.Color endValue, TweenSettings settings) => Color(target, new TweenSettings(endValue, settings)); + public static Tween Color([NotNull] UnityEngine.UI.Shadow target, UnityEngine.Color startValue, UnityEngine.Color endValue, TweenSettings settings) => Color(target, new TweenSettings(startValue, endValue, settings)); + public static Tween Color([NotNull] UnityEngine.UI.Shadow target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.UI.Shadow; + var val = _tween.ColorVal; + _target.effectColor = val; + }, t => (t.target as UnityEngine.UI.Shadow).effectColor.ToContainer(), TweenType.UIColorShadow); + } + + public static Tween UIPreferredSize([NotNull] UnityEngine.UI.LayoutElement target, UnityEngine.Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIPreferredSize(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIPreferredSize([NotNull] UnityEngine.UI.LayoutElement target, UnityEngine.Vector2 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIPreferredSize(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIPreferredSize([NotNull] UnityEngine.UI.LayoutElement target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIPreferredSize(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIPreferredSize([NotNull] UnityEngine.UI.LayoutElement target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIPreferredSize(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIPreferredSize([NotNull] UnityEngine.UI.LayoutElement target, UnityEngine.Vector2 endValue, TweenSettings settings) => UIPreferredSize(target, new TweenSettings(endValue, settings)); + public static Tween UIPreferredSize([NotNull] UnityEngine.UI.LayoutElement target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, TweenSettings settings) => UIPreferredSize(target, new TweenSettings(startValue, endValue, settings)); + public static Tween UIPreferredSize([NotNull] UnityEngine.UI.LayoutElement target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.UI.LayoutElement; + var val = _tween.Vector2Val; + _target.SetPreferredSize(val); + }, t => (t.target as UnityEngine.UI.LayoutElement).GetPreferredSize().ToContainer(), TweenType.UIPreferredSize); + } + + public static Tween UIPreferredWidth([NotNull] UnityEngine.UI.LayoutElement target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIPreferredWidth(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIPreferredWidth([NotNull] UnityEngine.UI.LayoutElement target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIPreferredWidth(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIPreferredWidth([NotNull] UnityEngine.UI.LayoutElement target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIPreferredWidth(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIPreferredWidth([NotNull] UnityEngine.UI.LayoutElement target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIPreferredWidth(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIPreferredWidth([NotNull] UnityEngine.UI.LayoutElement target, Single endValue, TweenSettings settings) => UIPreferredWidth(target, new TweenSettings(endValue, settings)); + public static Tween UIPreferredWidth([NotNull] UnityEngine.UI.LayoutElement target, Single startValue, Single endValue, TweenSettings settings) => UIPreferredWidth(target, new TweenSettings(startValue, endValue, settings)); + public static Tween UIPreferredWidth([NotNull] UnityEngine.UI.LayoutElement target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.UI.LayoutElement; + var val = _tween.FloatVal; + _target.preferredWidth = val; + }, t => (t.target as UnityEngine.UI.LayoutElement).preferredWidth.ToContainer(), TweenType.UIPreferredWidth); + } + + public static Tween UIPreferredHeight([NotNull] UnityEngine.UI.LayoutElement target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIPreferredHeight(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIPreferredHeight([NotNull] UnityEngine.UI.LayoutElement target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIPreferredHeight(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIPreferredHeight([NotNull] UnityEngine.UI.LayoutElement target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIPreferredHeight(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIPreferredHeight([NotNull] UnityEngine.UI.LayoutElement target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIPreferredHeight(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIPreferredHeight([NotNull] UnityEngine.UI.LayoutElement target, Single endValue, TweenSettings settings) => UIPreferredHeight(target, new TweenSettings(endValue, settings)); + public static Tween UIPreferredHeight([NotNull] UnityEngine.UI.LayoutElement target, Single startValue, Single endValue, TweenSettings settings) => UIPreferredHeight(target, new TweenSettings(startValue, endValue, settings)); + public static Tween UIPreferredHeight([NotNull] UnityEngine.UI.LayoutElement target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.UI.LayoutElement; + var val = _tween.FloatVal; + _target.preferredHeight = val; + }, t => (t.target as UnityEngine.UI.LayoutElement).preferredHeight.ToContainer(), TweenType.UIPreferredHeight); + } + + public static Tween UIFlexibleSize([NotNull] UnityEngine.UI.LayoutElement target, UnityEngine.Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIFlexibleSize(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIFlexibleSize([NotNull] UnityEngine.UI.LayoutElement target, UnityEngine.Vector2 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIFlexibleSize(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIFlexibleSize([NotNull] UnityEngine.UI.LayoutElement target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIFlexibleSize(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIFlexibleSize([NotNull] UnityEngine.UI.LayoutElement target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIFlexibleSize(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIFlexibleSize([NotNull] UnityEngine.UI.LayoutElement target, UnityEngine.Vector2 endValue, TweenSettings settings) => UIFlexibleSize(target, new TweenSettings(endValue, settings)); + public static Tween UIFlexibleSize([NotNull] UnityEngine.UI.LayoutElement target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, TweenSettings settings) => UIFlexibleSize(target, new TweenSettings(startValue, endValue, settings)); + public static Tween UIFlexibleSize([NotNull] UnityEngine.UI.LayoutElement target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.UI.LayoutElement; + var val = _tween.Vector2Val; + _target.SetFlexibleSize(val); + }, t => (t.target as UnityEngine.UI.LayoutElement).GetFlexibleSize().ToContainer(), TweenType.UIFlexibleSize); + } + + public static Tween UIFlexibleWidth([NotNull] UnityEngine.UI.LayoutElement target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIFlexibleWidth(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIFlexibleWidth([NotNull] UnityEngine.UI.LayoutElement target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIFlexibleWidth(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIFlexibleWidth([NotNull] UnityEngine.UI.LayoutElement target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIFlexibleWidth(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIFlexibleWidth([NotNull] UnityEngine.UI.LayoutElement target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIFlexibleWidth(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIFlexibleWidth([NotNull] UnityEngine.UI.LayoutElement target, Single endValue, TweenSettings settings) => UIFlexibleWidth(target, new TweenSettings(endValue, settings)); + public static Tween UIFlexibleWidth([NotNull] UnityEngine.UI.LayoutElement target, Single startValue, Single endValue, TweenSettings settings) => UIFlexibleWidth(target, new TweenSettings(startValue, endValue, settings)); + public static Tween UIFlexibleWidth([NotNull] UnityEngine.UI.LayoutElement target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.UI.LayoutElement; + var val = _tween.FloatVal; + _target.flexibleWidth = val; + }, t => (t.target as UnityEngine.UI.LayoutElement).flexibleWidth.ToContainer(), TweenType.UIFlexibleWidth); + } + + public static Tween UIFlexibleHeight([NotNull] UnityEngine.UI.LayoutElement target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIFlexibleHeight(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIFlexibleHeight([NotNull] UnityEngine.UI.LayoutElement target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIFlexibleHeight(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIFlexibleHeight([NotNull] UnityEngine.UI.LayoutElement target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIFlexibleHeight(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIFlexibleHeight([NotNull] UnityEngine.UI.LayoutElement target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIFlexibleHeight(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIFlexibleHeight([NotNull] UnityEngine.UI.LayoutElement target, Single endValue, TweenSettings settings) => UIFlexibleHeight(target, new TweenSettings(endValue, settings)); + public static Tween UIFlexibleHeight([NotNull] UnityEngine.UI.LayoutElement target, Single startValue, Single endValue, TweenSettings settings) => UIFlexibleHeight(target, new TweenSettings(startValue, endValue, settings)); + public static Tween UIFlexibleHeight([NotNull] UnityEngine.UI.LayoutElement target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.UI.LayoutElement; + var val = _tween.FloatVal; + _target.flexibleHeight = val; + }, t => (t.target as UnityEngine.UI.LayoutElement).flexibleHeight.ToContainer(), TweenType.UIFlexibleHeight); + } + + public static Tween UIMinSize([NotNull] UnityEngine.UI.LayoutElement target, UnityEngine.Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIMinSize(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIMinSize([NotNull] UnityEngine.UI.LayoutElement target, UnityEngine.Vector2 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIMinSize(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIMinSize([NotNull] UnityEngine.UI.LayoutElement target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIMinSize(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIMinSize([NotNull] UnityEngine.UI.LayoutElement target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIMinSize(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIMinSize([NotNull] UnityEngine.UI.LayoutElement target, UnityEngine.Vector2 endValue, TweenSettings settings) => UIMinSize(target, new TweenSettings(endValue, settings)); + public static Tween UIMinSize([NotNull] UnityEngine.UI.LayoutElement target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, TweenSettings settings) => UIMinSize(target, new TweenSettings(startValue, endValue, settings)); + public static Tween UIMinSize([NotNull] UnityEngine.UI.LayoutElement target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.UI.LayoutElement; + var val = _tween.Vector2Val; + _target.SetMinSize(val); + }, t => (t.target as UnityEngine.UI.LayoutElement).GetMinSize().ToContainer(), TweenType.UIMinSize); + } + + public static Tween UIMinWidth([NotNull] UnityEngine.UI.LayoutElement target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIMinWidth(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIMinWidth([NotNull] UnityEngine.UI.LayoutElement target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIMinWidth(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIMinWidth([NotNull] UnityEngine.UI.LayoutElement target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIMinWidth(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIMinWidth([NotNull] UnityEngine.UI.LayoutElement target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIMinWidth(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIMinWidth([NotNull] UnityEngine.UI.LayoutElement target, Single endValue, TweenSettings settings) => UIMinWidth(target, new TweenSettings(endValue, settings)); + public static Tween UIMinWidth([NotNull] UnityEngine.UI.LayoutElement target, Single startValue, Single endValue, TweenSettings settings) => UIMinWidth(target, new TweenSettings(startValue, endValue, settings)); + public static Tween UIMinWidth([NotNull] UnityEngine.UI.LayoutElement target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.UI.LayoutElement; + var val = _tween.FloatVal; + _target.minWidth = val; + }, t => (t.target as UnityEngine.UI.LayoutElement).minWidth.ToContainer(), TweenType.UIMinWidth); + } + + public static Tween UIMinHeight([NotNull] UnityEngine.UI.LayoutElement target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIMinHeight(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIMinHeight([NotNull] UnityEngine.UI.LayoutElement target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIMinHeight(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIMinHeight([NotNull] UnityEngine.UI.LayoutElement target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIMinHeight(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIMinHeight([NotNull] UnityEngine.UI.LayoutElement target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIMinHeight(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIMinHeight([NotNull] UnityEngine.UI.LayoutElement target, Single endValue, TweenSettings settings) => UIMinHeight(target, new TweenSettings(endValue, settings)); + public static Tween UIMinHeight([NotNull] UnityEngine.UI.LayoutElement target, Single startValue, Single endValue, TweenSettings settings) => UIMinHeight(target, new TweenSettings(startValue, endValue, settings)); + public static Tween UIMinHeight([NotNull] UnityEngine.UI.LayoutElement target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.UI.LayoutElement; + var val = _tween.FloatVal; + _target.minHeight = val; + }, t => (t.target as UnityEngine.UI.LayoutElement).minHeight.ToContainer(), TweenType.UIMinHeight); + } + + public static Tween Color([NotNull] UnityEngine.UI.Graphic target, UnityEngine.Color endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Color(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Color([NotNull] UnityEngine.UI.Graphic target, UnityEngine.Color endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Color(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Color([NotNull] UnityEngine.UI.Graphic target, UnityEngine.Color startValue, UnityEngine.Color endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Color(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Color([NotNull] UnityEngine.UI.Graphic target, UnityEngine.Color startValue, UnityEngine.Color endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Color(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Color([NotNull] UnityEngine.UI.Graphic target, UnityEngine.Color endValue, TweenSettings settings) => Color(target, new TweenSettings(endValue, settings)); + public static Tween Color([NotNull] UnityEngine.UI.Graphic target, UnityEngine.Color startValue, UnityEngine.Color endValue, TweenSettings settings) => Color(target, new TweenSettings(startValue, endValue, settings)); + public static Tween Color([NotNull] UnityEngine.UI.Graphic target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.UI.Graphic; + var val = _tween.ColorVal; + _target.color = val; + }, t => (t.target as UnityEngine.UI.Graphic).color.ToContainer(), TweenType.UIColorGraphic); + } + + public static Tween UIAnchoredPosition([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIAnchoredPosition(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIAnchoredPosition([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIAnchoredPosition(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIAnchoredPosition([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIAnchoredPosition(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIAnchoredPosition([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIAnchoredPosition(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIAnchoredPosition([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 endValue, TweenSettings settings) => UIAnchoredPosition(target, new TweenSettings(endValue, settings)); + public static Tween UIAnchoredPosition([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, TweenSettings settings) => UIAnchoredPosition(target, new TweenSettings(startValue, endValue, settings)); + public static Tween UIAnchoredPosition([NotNull] UnityEngine.RectTransform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.RectTransform; + var val = _tween.Vector2Val; + _target.anchoredPosition = val; + }, t => (t.target as UnityEngine.RectTransform).anchoredPosition.ToContainer(), TweenType.UIAnchoredPosition); + } + + public static Tween UIAnchoredPositionX([NotNull] UnityEngine.RectTransform target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIAnchoredPositionX(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIAnchoredPositionX([NotNull] UnityEngine.RectTransform target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIAnchoredPositionX(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIAnchoredPositionX([NotNull] UnityEngine.RectTransform target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIAnchoredPositionX(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIAnchoredPositionX([NotNull] UnityEngine.RectTransform target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIAnchoredPositionX(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIAnchoredPositionX([NotNull] UnityEngine.RectTransform target, Single endValue, TweenSettings settings) => UIAnchoredPositionX(target, new TweenSettings(endValue, settings)); + public static Tween UIAnchoredPositionX([NotNull] UnityEngine.RectTransform target, Single startValue, Single endValue, TweenSettings settings) => UIAnchoredPositionX(target, new TweenSettings(startValue, endValue, settings)); + public static Tween UIAnchoredPositionX([NotNull] UnityEngine.RectTransform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.RectTransform; + var val = _tween.FloatVal; + _target.anchoredPosition = _target.anchoredPosition.WithComponent(0, val); + }, t => (t.target as UnityEngine.RectTransform).anchoredPosition.x.ToContainer(), TweenType.UIAnchoredPositionX); + } + + public static Tween UIAnchoredPositionY([NotNull] UnityEngine.RectTransform target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIAnchoredPositionY(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIAnchoredPositionY([NotNull] UnityEngine.RectTransform target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIAnchoredPositionY(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIAnchoredPositionY([NotNull] UnityEngine.RectTransform target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIAnchoredPositionY(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIAnchoredPositionY([NotNull] UnityEngine.RectTransform target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIAnchoredPositionY(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIAnchoredPositionY([NotNull] UnityEngine.RectTransform target, Single endValue, TweenSettings settings) => UIAnchoredPositionY(target, new TweenSettings(endValue, settings)); + public static Tween UIAnchoredPositionY([NotNull] UnityEngine.RectTransform target, Single startValue, Single endValue, TweenSettings settings) => UIAnchoredPositionY(target, new TweenSettings(startValue, endValue, settings)); + public static Tween UIAnchoredPositionY([NotNull] UnityEngine.RectTransform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.RectTransform; + var val = _tween.FloatVal; + _target.anchoredPosition = _target.anchoredPosition.WithComponent(1, val); + }, t => (t.target as UnityEngine.RectTransform).anchoredPosition.y.ToContainer(), TweenType.UIAnchoredPositionY); + } + + public static Tween UISizeDelta([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UISizeDelta(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UISizeDelta([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UISizeDelta(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UISizeDelta([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UISizeDelta(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UISizeDelta([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UISizeDelta(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UISizeDelta([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 endValue, TweenSettings settings) => UISizeDelta(target, new TweenSettings(endValue, settings)); + public static Tween UISizeDelta([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, TweenSettings settings) => UISizeDelta(target, new TweenSettings(startValue, endValue, settings)); + public static Tween UISizeDelta([NotNull] UnityEngine.RectTransform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.RectTransform; + var val = _tween.Vector2Val; + _target.sizeDelta = val; + }, t => (t.target as UnityEngine.RectTransform).sizeDelta.ToContainer(), TweenType.UISizeDelta); + } + + public static Tween Alpha([NotNull] UnityEngine.CanvasGroup target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Alpha(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Alpha([NotNull] UnityEngine.CanvasGroup target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Alpha(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Alpha([NotNull] UnityEngine.CanvasGroup target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Alpha(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Alpha([NotNull] UnityEngine.CanvasGroup target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Alpha(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Alpha([NotNull] UnityEngine.CanvasGroup target, Single endValue, TweenSettings settings) => Alpha(target, new TweenSettings(endValue, settings)); + public static Tween Alpha([NotNull] UnityEngine.CanvasGroup target, Single startValue, Single endValue, TweenSettings settings) => Alpha(target, new TweenSettings(startValue, endValue, settings)); + public static Tween Alpha([NotNull] UnityEngine.CanvasGroup target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.CanvasGroup; + var val = _tween.FloatVal; + _target.alpha = val; + }, t => (t.target as UnityEngine.CanvasGroup).alpha.ToContainer(), TweenType.UIAlphaCanvasGroup); + } + + public static Tween Alpha([NotNull] UnityEngine.UI.Graphic target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Alpha(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Alpha([NotNull] UnityEngine.UI.Graphic target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Alpha(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Alpha([NotNull] UnityEngine.UI.Graphic target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Alpha(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Alpha([NotNull] UnityEngine.UI.Graphic target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Alpha(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Alpha([NotNull] UnityEngine.UI.Graphic target, Single endValue, TweenSettings settings) => Alpha(target, new TweenSettings(endValue, settings)); + public static Tween Alpha([NotNull] UnityEngine.UI.Graphic target, Single startValue, Single endValue, TweenSettings settings) => Alpha(target, new TweenSettings(startValue, endValue, settings)); + public static Tween Alpha([NotNull] UnityEngine.UI.Graphic target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.UI.Graphic; + var val = _tween.FloatVal; + _target.color = _target.color.WithAlpha(val); + }, t => (t.target as UnityEngine.UI.Graphic).color.a.ToContainer(), TweenType.UIAlphaGraphic); + } + + public static Tween UIFillAmount([NotNull] UnityEngine.UI.Image target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIFillAmount(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIFillAmount([NotNull] UnityEngine.UI.Image target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIFillAmount(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIFillAmount([NotNull] UnityEngine.UI.Image target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIFillAmount(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIFillAmount([NotNull] UnityEngine.UI.Image target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIFillAmount(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIFillAmount([NotNull] UnityEngine.UI.Image target, Single endValue, TweenSettings settings) => UIFillAmount(target, new TweenSettings(endValue, settings)); + public static Tween UIFillAmount([NotNull] UnityEngine.UI.Image target, Single startValue, Single endValue, TweenSettings settings) => UIFillAmount(target, new TweenSettings(startValue, endValue, settings)); + public static Tween UIFillAmount([NotNull] UnityEngine.UI.Image target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.UI.Image; + var val = _tween.FloatVal; + _target.fillAmount = val; + }, t => (t.target as UnityEngine.UI.Image).fillAmount.ToContainer(), TweenType.UIFillAmount); + } + + public static Tween UIOffsetMin([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIOffsetMin(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIOffsetMin([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIOffsetMin(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIOffsetMin([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIOffsetMin(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIOffsetMin([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIOffsetMin(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIOffsetMin([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 endValue, TweenSettings settings) => UIOffsetMin(target, new TweenSettings(endValue, settings)); + public static Tween UIOffsetMin([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, TweenSettings settings) => UIOffsetMin(target, new TweenSettings(startValue, endValue, settings)); + public static Tween UIOffsetMin([NotNull] UnityEngine.RectTransform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.RectTransform; + var val = _tween.Vector2Val; + _target.offsetMin = val; + }, t => (t.target as UnityEngine.RectTransform).offsetMin.ToContainer(), TweenType.UIOffsetMin); + } + + public static Tween UIOffsetMinX([NotNull] UnityEngine.RectTransform target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIOffsetMinX(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIOffsetMinX([NotNull] UnityEngine.RectTransform target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIOffsetMinX(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIOffsetMinX([NotNull] UnityEngine.RectTransform target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIOffsetMinX(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIOffsetMinX([NotNull] UnityEngine.RectTransform target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIOffsetMinX(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIOffsetMinX([NotNull] UnityEngine.RectTransform target, Single endValue, TweenSettings settings) => UIOffsetMinX(target, new TweenSettings(endValue, settings)); + public static Tween UIOffsetMinX([NotNull] UnityEngine.RectTransform target, Single startValue, Single endValue, TweenSettings settings) => UIOffsetMinX(target, new TweenSettings(startValue, endValue, settings)); + public static Tween UIOffsetMinX([NotNull] UnityEngine.RectTransform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.RectTransform; + var val = _tween.FloatVal; + _target.offsetMin = _target.offsetMin.WithComponent(0, val); + }, t => (t.target as UnityEngine.RectTransform).offsetMin[0].ToContainer(), TweenType.UIOffsetMinX); + } + + public static Tween UIOffsetMinY([NotNull] UnityEngine.RectTransform target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIOffsetMinY(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIOffsetMinY([NotNull] UnityEngine.RectTransform target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIOffsetMinY(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIOffsetMinY([NotNull] UnityEngine.RectTransform target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIOffsetMinY(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIOffsetMinY([NotNull] UnityEngine.RectTransform target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIOffsetMinY(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIOffsetMinY([NotNull] UnityEngine.RectTransform target, Single endValue, TweenSettings settings) => UIOffsetMinY(target, new TweenSettings(endValue, settings)); + public static Tween UIOffsetMinY([NotNull] UnityEngine.RectTransform target, Single startValue, Single endValue, TweenSettings settings) => UIOffsetMinY(target, new TweenSettings(startValue, endValue, settings)); + public static Tween UIOffsetMinY([NotNull] UnityEngine.RectTransform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.RectTransform; + var val = _tween.FloatVal; + _target.offsetMin = _target.offsetMin.WithComponent(1, val); + }, t => (t.target as UnityEngine.RectTransform).offsetMin[1].ToContainer(), TweenType.UIOffsetMinY); + } + + public static Tween UIOffsetMax([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIOffsetMax(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIOffsetMax([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIOffsetMax(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIOffsetMax([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIOffsetMax(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIOffsetMax([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIOffsetMax(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIOffsetMax([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 endValue, TweenSettings settings) => UIOffsetMax(target, new TweenSettings(endValue, settings)); + public static Tween UIOffsetMax([NotNull] UnityEngine.RectTransform target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, TweenSettings settings) => UIOffsetMax(target, new TweenSettings(startValue, endValue, settings)); + public static Tween UIOffsetMax([NotNull] UnityEngine.RectTransform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.RectTransform; + var val = _tween.Vector2Val; + _target.offsetMax = val; + }, t => (t.target as UnityEngine.RectTransform).offsetMax.ToContainer(), TweenType.UIOffsetMax); + } + + public static Tween UIOffsetMaxX([NotNull] UnityEngine.RectTransform target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIOffsetMaxX(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIOffsetMaxX([NotNull] UnityEngine.RectTransform target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIOffsetMaxX(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIOffsetMaxX([NotNull] UnityEngine.RectTransform target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIOffsetMaxX(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIOffsetMaxX([NotNull] UnityEngine.RectTransform target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIOffsetMaxX(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIOffsetMaxX([NotNull] UnityEngine.RectTransform target, Single endValue, TweenSettings settings) => UIOffsetMaxX(target, new TweenSettings(endValue, settings)); + public static Tween UIOffsetMaxX([NotNull] UnityEngine.RectTransform target, Single startValue, Single endValue, TweenSettings settings) => UIOffsetMaxX(target, new TweenSettings(startValue, endValue, settings)); + public static Tween UIOffsetMaxX([NotNull] UnityEngine.RectTransform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.RectTransform; + var val = _tween.FloatVal; + _target.offsetMax = _target.offsetMax.WithComponent(0, val); + }, t => (t.target as UnityEngine.RectTransform).offsetMax[0].ToContainer(), TweenType.UIOffsetMaxX); + } + + public static Tween UIOffsetMaxY([NotNull] UnityEngine.RectTransform target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIOffsetMaxY(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIOffsetMaxY([NotNull] UnityEngine.RectTransform target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIOffsetMaxY(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIOffsetMaxY([NotNull] UnityEngine.RectTransform target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIOffsetMaxY(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIOffsetMaxY([NotNull] UnityEngine.RectTransform target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => UIOffsetMaxY(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween UIOffsetMaxY([NotNull] UnityEngine.RectTransform target, Single endValue, TweenSettings settings) => UIOffsetMaxY(target, new TweenSettings(endValue, settings)); + public static Tween UIOffsetMaxY([NotNull] UnityEngine.RectTransform target, Single startValue, Single endValue, TweenSettings settings) => UIOffsetMaxY(target, new TweenSettings(startValue, endValue, settings)); + public static Tween UIOffsetMaxY([NotNull] UnityEngine.RectTransform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.RectTransform; + var val = _tween.FloatVal; + _target.offsetMax = _target.offsetMax.WithComponent(1, val); + }, t => (t.target as UnityEngine.RectTransform).offsetMax[1].ToContainer(), TweenType.UIOffsetMaxY); + } + + #endif + #if !UNITY_2019_1_OR_NEWER || PHYSICS_MODULE_INSTALLED + public static Tween RigidbodyMovePosition([NotNull] UnityEngine.Rigidbody target, UnityEngine.Vector3 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => RigidbodyMovePosition(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween RigidbodyMovePosition([NotNull] UnityEngine.Rigidbody target, UnityEngine.Vector3 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => RigidbodyMovePosition(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween RigidbodyMovePosition([NotNull] UnityEngine.Rigidbody target, UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => RigidbodyMovePosition(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween RigidbodyMovePosition([NotNull] UnityEngine.Rigidbody target, UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => RigidbodyMovePosition(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween RigidbodyMovePosition([NotNull] UnityEngine.Rigidbody target, UnityEngine.Vector3 endValue, TweenSettings settings) => RigidbodyMovePosition(target, new TweenSettings(endValue, settings)); + public static Tween RigidbodyMovePosition([NotNull] UnityEngine.Rigidbody target, UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, TweenSettings settings) => RigidbodyMovePosition(target, new TweenSettings(startValue, endValue, settings)); + public static Tween RigidbodyMovePosition([NotNull] UnityEngine.Rigidbody target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.Rigidbody; + var val = _tween.Vector3Val; + _target.MovePosition(val); + }, t => (t.target as UnityEngine.Rigidbody).position.ToContainer(), TweenType.RigidbodyMovePosition); + } + + public static Tween RigidbodyMoveRotation([NotNull] UnityEngine.Rigidbody target, UnityEngine.Quaternion endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => RigidbodyMoveRotation(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween RigidbodyMoveRotation([NotNull] UnityEngine.Rigidbody target, UnityEngine.Quaternion endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => RigidbodyMoveRotation(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween RigidbodyMoveRotation([NotNull] UnityEngine.Rigidbody target, UnityEngine.Quaternion startValue, UnityEngine.Quaternion endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => RigidbodyMoveRotation(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween RigidbodyMoveRotation([NotNull] UnityEngine.Rigidbody target, UnityEngine.Quaternion startValue, UnityEngine.Quaternion endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => RigidbodyMoveRotation(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween RigidbodyMoveRotation([NotNull] UnityEngine.Rigidbody target, UnityEngine.Quaternion endValue, TweenSettings settings) => RigidbodyMoveRotation(target, new TweenSettings(endValue, settings)); + public static Tween RigidbodyMoveRotation([NotNull] UnityEngine.Rigidbody target, UnityEngine.Quaternion startValue, UnityEngine.Quaternion endValue, TweenSettings settings) => RigidbodyMoveRotation(target, new TweenSettings(startValue, endValue, settings)); + public static Tween RigidbodyMoveRotation([NotNull] UnityEngine.Rigidbody target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.Rigidbody; + var val = _tween.QuaternionVal; + _target.MoveRotation(val); + }, t => (t.target as UnityEngine.Rigidbody).rotation.ToContainer(), TweenType.RigidbodyMoveRotation); + } + + #endif + #if !UNITY_2019_1_OR_NEWER || PHYSICS2D_MODULE_INSTALLED + public static Tween RigidbodyMovePosition([NotNull] UnityEngine.Rigidbody2D target, UnityEngine.Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => RigidbodyMovePosition(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween RigidbodyMovePosition([NotNull] UnityEngine.Rigidbody2D target, UnityEngine.Vector2 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => RigidbodyMovePosition(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween RigidbodyMovePosition([NotNull] UnityEngine.Rigidbody2D target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => RigidbodyMovePosition(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween RigidbodyMovePosition([NotNull] UnityEngine.Rigidbody2D target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => RigidbodyMovePosition(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween RigidbodyMovePosition([NotNull] UnityEngine.Rigidbody2D target, UnityEngine.Vector2 endValue, TweenSettings settings) => RigidbodyMovePosition(target, new TweenSettings(endValue, settings)); + public static Tween RigidbodyMovePosition([NotNull] UnityEngine.Rigidbody2D target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, TweenSettings settings) => RigidbodyMovePosition(target, new TweenSettings(startValue, endValue, settings)); + public static Tween RigidbodyMovePosition([NotNull] UnityEngine.Rigidbody2D target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.Rigidbody2D; + var val = _tween.Vector2Val; + _target.MovePosition(val); + }, t => (t.target as UnityEngine.Rigidbody2D).position.ToContainer(), TweenType.RigidbodyMovePosition2D); + } + + public static Tween RigidbodyMoveRotation([NotNull] UnityEngine.Rigidbody2D target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => RigidbodyMoveRotation(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween RigidbodyMoveRotation([NotNull] UnityEngine.Rigidbody2D target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => RigidbodyMoveRotation(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween RigidbodyMoveRotation([NotNull] UnityEngine.Rigidbody2D target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => RigidbodyMoveRotation(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween RigidbodyMoveRotation([NotNull] UnityEngine.Rigidbody2D target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => RigidbodyMoveRotation(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween RigidbodyMoveRotation([NotNull] UnityEngine.Rigidbody2D target, Single endValue, TweenSettings settings) => RigidbodyMoveRotation(target, new TweenSettings(endValue, settings)); + public static Tween RigidbodyMoveRotation([NotNull] UnityEngine.Rigidbody2D target, Single startValue, Single endValue, TweenSettings settings) => RigidbodyMoveRotation(target, new TweenSettings(startValue, endValue, settings)); + public static Tween RigidbodyMoveRotation([NotNull] UnityEngine.Rigidbody2D target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.Rigidbody2D; + var val = _tween.FloatVal; + _target.MoveRotation(val); + }, t => (t.target as UnityEngine.Rigidbody2D).rotation.ToContainer(), TweenType.RigidbodyMoveRotation2D); + } + + #endif + public static Tween MaterialColor([NotNull] UnityEngine.Material target, UnityEngine.Color endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialColor(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialColor([NotNull] UnityEngine.Material target, UnityEngine.Color endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialColor(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialColor([NotNull] UnityEngine.Material target, UnityEngine.Color startValue, UnityEngine.Color endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialColor(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialColor([NotNull] UnityEngine.Material target, UnityEngine.Color startValue, UnityEngine.Color endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialColor(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialColor([NotNull] UnityEngine.Material target, UnityEngine.Color endValue, TweenSettings settings) => MaterialColor(target, new TweenSettings(endValue, settings)); + public static Tween MaterialColor([NotNull] UnityEngine.Material target, UnityEngine.Color startValue, UnityEngine.Color endValue, TweenSettings settings) => MaterialColor(target, new TweenSettings(startValue, endValue, settings)); + public static Tween MaterialColor([NotNull] UnityEngine.Material target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.Material; + var val = _tween.ColorVal; + _target.color = val; + }, t => (t.target as UnityEngine.Material).color.ToContainer(), TweenType.MaterialColor); + } + + public static Tween MaterialAlpha([NotNull] UnityEngine.Material target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialAlpha(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialAlpha([NotNull] UnityEngine.Material target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialAlpha(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialAlpha([NotNull] UnityEngine.Material target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialAlpha(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialAlpha([NotNull] UnityEngine.Material target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialAlpha(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialAlpha([NotNull] UnityEngine.Material target, Single endValue, TweenSettings settings) => MaterialAlpha(target, new TweenSettings(endValue, settings)); + public static Tween MaterialAlpha([NotNull] UnityEngine.Material target, Single startValue, Single endValue, TweenSettings settings) => MaterialAlpha(target, new TweenSettings(startValue, endValue, settings)); + public static Tween MaterialAlpha([NotNull] UnityEngine.Material target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.Material; + var val = _tween.FloatVal; + _target.color = _target.color.WithAlpha(val); + }, t => (t.target as UnityEngine.Material).color.a.ToContainer(), TweenType.MaterialAlpha); + } + + public static Tween MaterialMainTextureOffset([NotNull] UnityEngine.Material target, UnityEngine.Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialMainTextureOffset(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialMainTextureOffset([NotNull] UnityEngine.Material target, UnityEngine.Vector2 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialMainTextureOffset(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialMainTextureOffset([NotNull] UnityEngine.Material target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialMainTextureOffset(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialMainTextureOffset([NotNull] UnityEngine.Material target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialMainTextureOffset(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialMainTextureOffset([NotNull] UnityEngine.Material target, UnityEngine.Vector2 endValue, TweenSettings settings) => MaterialMainTextureOffset(target, new TweenSettings(endValue, settings)); + public static Tween MaterialMainTextureOffset([NotNull] UnityEngine.Material target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, TweenSettings settings) => MaterialMainTextureOffset(target, new TweenSettings(startValue, endValue, settings)); + public static Tween MaterialMainTextureOffset([NotNull] UnityEngine.Material target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.Material; + var val = _tween.Vector2Val; + _target.mainTextureOffset = val; + }, t => (t.target as UnityEngine.Material).mainTextureOffset.ToContainer(), TweenType.MaterialMainTextureOffset); + } + + public static Tween MaterialMainTextureScale([NotNull] UnityEngine.Material target, UnityEngine.Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialMainTextureScale(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialMainTextureScale([NotNull] UnityEngine.Material target, UnityEngine.Vector2 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialMainTextureScale(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialMainTextureScale([NotNull] UnityEngine.Material target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialMainTextureScale(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialMainTextureScale([NotNull] UnityEngine.Material target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialMainTextureScale(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialMainTextureScale([NotNull] UnityEngine.Material target, UnityEngine.Vector2 endValue, TweenSettings settings) => MaterialMainTextureScale(target, new TweenSettings(endValue, settings)); + public static Tween MaterialMainTextureScale([NotNull] UnityEngine.Material target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, TweenSettings settings) => MaterialMainTextureScale(target, new TweenSettings(startValue, endValue, settings)); + public static Tween MaterialMainTextureScale([NotNull] UnityEngine.Material target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.Material; + var val = _tween.Vector2Val; + _target.mainTextureScale = val; + }, t => (t.target as UnityEngine.Material).mainTextureScale.ToContainer(), TweenType.MaterialMainTextureScale); + } + + #if !UNITY_2019_1_OR_NEWER || AUDIO_MODULE_INSTALLED + public static Tween AudioVolume([NotNull] UnityEngine.AudioSource target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => AudioVolume(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween AudioVolume([NotNull] UnityEngine.AudioSource target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => AudioVolume(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween AudioVolume([NotNull] UnityEngine.AudioSource target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => AudioVolume(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween AudioVolume([NotNull] UnityEngine.AudioSource target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => AudioVolume(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween AudioVolume([NotNull] UnityEngine.AudioSource target, Single endValue, TweenSettings settings) => AudioVolume(target, new TweenSettings(endValue, settings)); + public static Tween AudioVolume([NotNull] UnityEngine.AudioSource target, Single startValue, Single endValue, TweenSettings settings) => AudioVolume(target, new TweenSettings(startValue, endValue, settings)); + public static Tween AudioVolume([NotNull] UnityEngine.AudioSource target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.AudioSource; + var val = _tween.FloatVal; + _target.volume = val; + }, t => (t.target as UnityEngine.AudioSource).volume.ToContainer(), TweenType.AudioVolume); + } + + public static Tween AudioPitch([NotNull] UnityEngine.AudioSource target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => AudioPitch(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween AudioPitch([NotNull] UnityEngine.AudioSource target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => AudioPitch(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween AudioPitch([NotNull] UnityEngine.AudioSource target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => AudioPitch(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween AudioPitch([NotNull] UnityEngine.AudioSource target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => AudioPitch(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween AudioPitch([NotNull] UnityEngine.AudioSource target, Single endValue, TweenSettings settings) => AudioPitch(target, new TweenSettings(endValue, settings)); + public static Tween AudioPitch([NotNull] UnityEngine.AudioSource target, Single startValue, Single endValue, TweenSettings settings) => AudioPitch(target, new TweenSettings(startValue, endValue, settings)); + public static Tween AudioPitch([NotNull] UnityEngine.AudioSource target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.AudioSource; + var val = _tween.FloatVal; + _target.pitch = val; + }, t => (t.target as UnityEngine.AudioSource).pitch.ToContainer(), TweenType.AudioPitch); + } + + public static Tween AudioPanStereo([NotNull] UnityEngine.AudioSource target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => AudioPanStereo(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween AudioPanStereo([NotNull] UnityEngine.AudioSource target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => AudioPanStereo(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween AudioPanStereo([NotNull] UnityEngine.AudioSource target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => AudioPanStereo(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween AudioPanStereo([NotNull] UnityEngine.AudioSource target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => AudioPanStereo(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween AudioPanStereo([NotNull] UnityEngine.AudioSource target, Single endValue, TweenSettings settings) => AudioPanStereo(target, new TweenSettings(endValue, settings)); + public static Tween AudioPanStereo([NotNull] UnityEngine.AudioSource target, Single startValue, Single endValue, TweenSettings settings) => AudioPanStereo(target, new TweenSettings(startValue, endValue, settings)); + public static Tween AudioPanStereo([NotNull] UnityEngine.AudioSource target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.AudioSource; + var val = _tween.FloatVal; + _target.panStereo = val; + }, t => (t.target as UnityEngine.AudioSource).panStereo.ToContainer(), TweenType.AudioPanStereo); + } + + #endif + #if UI_ELEMENTS_MODULE_INSTALLED + public static Tween VisualElementLayout([NotNull] UnityEngine.UIElements.VisualElement target, UnityEngine.Rect endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => VisualElementLayout(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween VisualElementLayout([NotNull] UnityEngine.UIElements.VisualElement target, UnityEngine.Rect endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => VisualElementLayout(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween VisualElementLayout([NotNull] UnityEngine.UIElements.VisualElement target, UnityEngine.Rect startValue, UnityEngine.Rect endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => VisualElementLayout(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween VisualElementLayout([NotNull] UnityEngine.UIElements.VisualElement target, UnityEngine.Rect startValue, UnityEngine.Rect endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => VisualElementLayout(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween VisualElementLayout([NotNull] UnityEngine.UIElements.VisualElement target, UnityEngine.Rect endValue, TweenSettings settings) => VisualElementLayout(target, new TweenSettings(endValue, settings)); + public static Tween VisualElementLayout([NotNull] UnityEngine.UIElements.VisualElement target, UnityEngine.Rect startValue, UnityEngine.Rect endValue, TweenSettings settings) => VisualElementLayout(target, new TweenSettings(startValue, endValue, settings)); + public static Tween VisualElementLayout([NotNull] UnityEngine.UIElements.VisualElement target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.UIElements.VisualElement; + var val = _tween.RectVal; + _target.SetStyleRect(val); + }, t => (t.target as UnityEngine.UIElements.VisualElement).GetResolvedStyleRect().ToContainer(), TweenType.VisualElementLayout); + } + + public static Tween Position([NotNull] UnityEngine.UIElements.ITransform target, UnityEngine.Vector3 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Position(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Position([NotNull] UnityEngine.UIElements.ITransform target, UnityEngine.Vector3 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Position(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Position([NotNull] UnityEngine.UIElements.ITransform target, UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Position(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Position([NotNull] UnityEngine.UIElements.ITransform target, UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Position(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Position([NotNull] UnityEngine.UIElements.ITransform target, UnityEngine.Vector3 endValue, TweenSettings settings) => Position(target, new TweenSettings(endValue, settings)); + public static Tween Position([NotNull] UnityEngine.UIElements.ITransform target, UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, TweenSettings settings) => Position(target, new TweenSettings(startValue, endValue, settings)); + public static Tween Position([NotNull] UnityEngine.UIElements.ITransform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.UIElements.ITransform; + var val = _tween.Vector3Val; + _target.position = val; + }, t => (t.target as UnityEngine.UIElements.ITransform).position.ToContainer(), TweenType.VisualElementPosition); + } + + public static Tween Rotation([NotNull] UnityEngine.UIElements.ITransform target, UnityEngine.Quaternion endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Rotation(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Rotation([NotNull] UnityEngine.UIElements.ITransform target, UnityEngine.Quaternion endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Rotation(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Rotation([NotNull] UnityEngine.UIElements.ITransform target, UnityEngine.Quaternion startValue, UnityEngine.Quaternion endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Rotation(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Rotation([NotNull] UnityEngine.UIElements.ITransform target, UnityEngine.Quaternion startValue, UnityEngine.Quaternion endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Rotation(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Rotation([NotNull] UnityEngine.UIElements.ITransform target, UnityEngine.Quaternion endValue, TweenSettings settings) => Rotation(target, new TweenSettings(endValue, settings)); + public static Tween Rotation([NotNull] UnityEngine.UIElements.ITransform target, UnityEngine.Quaternion startValue, UnityEngine.Quaternion endValue, TweenSettings settings) => Rotation(target, new TweenSettings(startValue, endValue, settings)); + public static Tween Rotation([NotNull] UnityEngine.UIElements.ITransform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.UIElements.ITransform; + var val = _tween.QuaternionVal; + _target.rotation = val; + }, t => (t.target as UnityEngine.UIElements.ITransform).rotation.ToContainer(), TweenType.VisualElementRotationQuaternion); + } + + public static Tween Scale([NotNull] UnityEngine.UIElements.ITransform target, UnityEngine.Vector3 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Scale(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Scale([NotNull] UnityEngine.UIElements.ITransform target, UnityEngine.Vector3 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Scale(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Scale([NotNull] UnityEngine.UIElements.ITransform target, UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Scale(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Scale([NotNull] UnityEngine.UIElements.ITransform target, UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Scale(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween Scale([NotNull] UnityEngine.UIElements.ITransform target, UnityEngine.Vector3 endValue, TweenSettings settings) => Scale(target, new TweenSettings(endValue, settings)); + public static Tween Scale([NotNull] UnityEngine.UIElements.ITransform target, UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, TweenSettings settings) => Scale(target, new TweenSettings(startValue, endValue, settings)); + public static Tween Scale([NotNull] UnityEngine.UIElements.ITransform target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.UIElements.ITransform; + var val = _tween.Vector3Val; + _target.scale = val; + }, t => (t.target as UnityEngine.UIElements.ITransform).scale.ToContainer(), TweenType.VisualElementScale); + } + + public static Tween VisualElementSize([NotNull] UnityEngine.UIElements.VisualElement target, UnityEngine.Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => VisualElementSize(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween VisualElementSize([NotNull] UnityEngine.UIElements.VisualElement target, UnityEngine.Vector2 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => VisualElementSize(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween VisualElementSize([NotNull] UnityEngine.UIElements.VisualElement target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => VisualElementSize(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween VisualElementSize([NotNull] UnityEngine.UIElements.VisualElement target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => VisualElementSize(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween VisualElementSize([NotNull] UnityEngine.UIElements.VisualElement target, UnityEngine.Vector2 endValue, TweenSettings settings) => VisualElementSize(target, new TweenSettings(endValue, settings)); + public static Tween VisualElementSize([NotNull] UnityEngine.UIElements.VisualElement target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, TweenSettings settings) => VisualElementSize(target, new TweenSettings(startValue, endValue, settings)); + public static Tween VisualElementSize([NotNull] UnityEngine.UIElements.VisualElement target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.UIElements.VisualElement; + var val = _tween.Vector2Val; + _target.style.width = val.x; _target.style.height = val.y; + }, t => (t.target as UnityEngine.UIElements.VisualElement).layout.size.ToContainer(), TweenType.VisualElementSize); + } + + public static Tween VisualElementTopLeft([NotNull] UnityEngine.UIElements.VisualElement target, UnityEngine.Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => VisualElementTopLeft(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween VisualElementTopLeft([NotNull] UnityEngine.UIElements.VisualElement target, UnityEngine.Vector2 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => VisualElementTopLeft(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween VisualElementTopLeft([NotNull] UnityEngine.UIElements.VisualElement target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => VisualElementTopLeft(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween VisualElementTopLeft([NotNull] UnityEngine.UIElements.VisualElement target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => VisualElementTopLeft(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween VisualElementTopLeft([NotNull] UnityEngine.UIElements.VisualElement target, UnityEngine.Vector2 endValue, TweenSettings settings) => VisualElementTopLeft(target, new TweenSettings(endValue, settings)); + public static Tween VisualElementTopLeft([NotNull] UnityEngine.UIElements.VisualElement target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, TweenSettings settings) => VisualElementTopLeft(target, new TweenSettings(startValue, endValue, settings)); + public static Tween VisualElementTopLeft([NotNull] UnityEngine.UIElements.VisualElement target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.UIElements.VisualElement; + var val = _tween.Vector2Val; + _target.SetTopLeft(val); + }, t => (t.target as UnityEngine.UIElements.VisualElement).GetTopLeft().ToContainer(), TweenType.VisualElementTopLeft); + } + + public static Tween VisualElementColor([NotNull] UnityEngine.UIElements.VisualElement target, UnityEngine.Color endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => VisualElementColor(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween VisualElementColor([NotNull] UnityEngine.UIElements.VisualElement target, UnityEngine.Color endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => VisualElementColor(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween VisualElementColor([NotNull] UnityEngine.UIElements.VisualElement target, UnityEngine.Color startValue, UnityEngine.Color endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => VisualElementColor(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween VisualElementColor([NotNull] UnityEngine.UIElements.VisualElement target, UnityEngine.Color startValue, UnityEngine.Color endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => VisualElementColor(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween VisualElementColor([NotNull] UnityEngine.UIElements.VisualElement target, UnityEngine.Color endValue, TweenSettings settings) => VisualElementColor(target, new TweenSettings(endValue, settings)); + public static Tween VisualElementColor([NotNull] UnityEngine.UIElements.VisualElement target, UnityEngine.Color startValue, UnityEngine.Color endValue, TweenSettings settings) => VisualElementColor(target, new TweenSettings(startValue, endValue, settings)); + public static Tween VisualElementColor([NotNull] UnityEngine.UIElements.VisualElement target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.UIElements.VisualElement; + var val = _tween.ColorVal; + _target.style.color = val; + }, t => (t.target as UnityEngine.UIElements.VisualElement).style.color.value.ToContainer(), TweenType.VisualElementColor); + } + + public static Tween VisualElementBackgroundColor([NotNull] UnityEngine.UIElements.VisualElement target, UnityEngine.Color endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => VisualElementBackgroundColor(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween VisualElementBackgroundColor([NotNull] UnityEngine.UIElements.VisualElement target, UnityEngine.Color endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => VisualElementBackgroundColor(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween VisualElementBackgroundColor([NotNull] UnityEngine.UIElements.VisualElement target, UnityEngine.Color startValue, UnityEngine.Color endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => VisualElementBackgroundColor(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween VisualElementBackgroundColor([NotNull] UnityEngine.UIElements.VisualElement target, UnityEngine.Color startValue, UnityEngine.Color endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => VisualElementBackgroundColor(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween VisualElementBackgroundColor([NotNull] UnityEngine.UIElements.VisualElement target, UnityEngine.Color endValue, TweenSettings settings) => VisualElementBackgroundColor(target, new TweenSettings(endValue, settings)); + public static Tween VisualElementBackgroundColor([NotNull] UnityEngine.UIElements.VisualElement target, UnityEngine.Color startValue, UnityEngine.Color endValue, TweenSettings settings) => VisualElementBackgroundColor(target, new TweenSettings(startValue, endValue, settings)); + public static Tween VisualElementBackgroundColor([NotNull] UnityEngine.UIElements.VisualElement target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as UnityEngine.UIElements.VisualElement; + var val = _tween.ColorVal; + _target.style.backgroundColor = val; + }, t => (t.target as UnityEngine.UIElements.VisualElement).style.backgroundColor.value.ToContainer(), TweenType.VisualElementBackgroundColor); + } + + #endif + #if TEXT_MESH_PRO_INSTALLED + public static Tween TextMaxVisibleCharacters([NotNull] TMPro.TMP_Text target, int endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => TextMaxVisibleCharacters(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween TextMaxVisibleCharacters([NotNull] TMPro.TMP_Text target, int endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => TextMaxVisibleCharacters(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween TextMaxVisibleCharacters([NotNull] TMPro.TMP_Text target, int startValue, int endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => TextMaxVisibleCharacters(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween TextMaxVisibleCharacters([NotNull] TMPro.TMP_Text target, int startValue, int endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => TextMaxVisibleCharacters(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween TextMaxVisibleCharacters([NotNull] TMPro.TMP_Text target, int endValue, TweenSettings settings) => TextMaxVisibleCharacters(target, new TweenSettings(endValue, settings)); + public static Tween TextMaxVisibleCharacters([NotNull] TMPro.TMP_Text target, int startValue, int endValue, TweenSettings settings) => TextMaxVisibleCharacters(target, new TweenSettings(startValue, endValue, settings)); + + public static Tween TextFontSize([NotNull] TMPro.TMP_Text target, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => TextFontSize(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween TextFontSize([NotNull] TMPro.TMP_Text target, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => TextFontSize(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween TextFontSize([NotNull] TMPro.TMP_Text target, Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => TextFontSize(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween TextFontSize([NotNull] TMPro.TMP_Text target, Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => TextFontSize(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween TextFontSize([NotNull] TMPro.TMP_Text target, Single endValue, TweenSettings settings) => TextFontSize(target, new TweenSettings(endValue, settings)); + public static Tween TextFontSize([NotNull] TMPro.TMP_Text target, Single startValue, Single endValue, TweenSettings settings) => TextFontSize(target, new TweenSettings(startValue, endValue, settings)); + public static Tween TextFontSize([NotNull] TMPro.TMP_Text target, TweenSettings settings) { + return animate(target, ref settings, _tween => { + var _target = _tween.target as TMPro.TMP_Text; + var val = _tween.FloatVal; + _target.fontSize = val; + }, t => (t.target as TMPro.TMP_Text).fontSize.ToContainer(), TweenType.TextFontSize); + } + + #endif + + public static Tween Custom(float startValue, float endValue, float duration, [NotNull] Action onValueChange, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Custom(new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + public static Tween Custom(float startValue, float endValue, float duration, [NotNull] Action onValueChange, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Custom(new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + public static Tween Custom(float startValue, float endValue, TweenSettings settings, [NotNull] Action onValueChange) => Custom(new TweenSettings(startValue, endValue, settings), onValueChange); + public static Tween Custom(TweenSettings settings, [NotNull] Action onValueChange) { + Assert.IsNotNull(onValueChange); + if (settings.startFromCurrent) { + UnityEngine.Debug.LogWarning(Constants.customTweensDontSupportStartFromCurrentWarning); + } + var tween = PrimeTweenManager.fetchTween(); + tween.startValue.CopyFrom(ref settings.startValue); + tween.endValue.CopyFrom(ref settings.endValue); + tween.customOnValueChange = onValueChange; + tween.Setup(PrimeTweenManager.dummyTarget, ref settings.settings, _tween => { + var _onValueChange = _tween.customOnValueChange as Action; + var val = _tween.FloatVal; + try { + _onValueChange(val); + } catch (Exception e) { + UnityEngine.Debug.LogException(e); + Assert.LogWarning($"Tween was stopped because of exception in {nameof(onValueChange)} callback, tween: {_tween.GetDescription()}\n", _tween.id, _tween.target as UnityEngine.Object); + _tween.EmergencyStop(); + } + }, null, false, TweenType.CustomFloat); + return PrimeTweenManager.Animate(tween); + } + public static Tween Custom([NotNull] T target, float startValue, float endValue, float duration, [NotNull] Action onValueChange, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) where T : class + => Custom_internal(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + public static Tween Custom([NotNull] T target, float startValue, float endValue, float duration, [NotNull] Action onValueChange, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) where T : class + => Custom_internal(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + public static Tween Custom([NotNull] T target, float startValue, float endValue, TweenSettings settings, [NotNull] Action onValueChange) where T : class + => Custom_internal(target, new TweenSettings(startValue, endValue, settings), onValueChange); + public static Tween Custom([NotNull] T target, TweenSettings settings, [NotNull] Action onValueChange) where T : class + => Custom_internal(target, settings, onValueChange); + #if PRIME_TWEEN_EXPERIMENTAL + public static Tween CustomAdditive([NotNull] T target, float deltaValue, TweenSettings settings, [NotNull] Action onDeltaChange) where T : class + => Custom_internal(target, new TweenSettings(default, deltaValue, settings), onDeltaChange, true); + #endif + static Tween Custom_internal([NotNull] T target, TweenSettings settings, [NotNull] Action onValueChange, bool isAdditive = false) where T : class { + Assert.IsNotNull(onValueChange); + if (settings.startFromCurrent) { + UnityEngine.Debug.LogWarning(Constants.customTweensDontSupportStartFromCurrentWarning); + } + var tween = PrimeTweenManager.fetchTween(); + tween.startValue.CopyFrom(ref settings.startValue); + tween.endValue.CopyFrom(ref settings.endValue); + tween.customOnValueChange = onValueChange; + tween.isAdditive = isAdditive; + tween.Setup(target, ref settings.settings, _tween => { + var _onValueChange = _tween.customOnValueChange as Action; + var _target = _tween.target as T; + float val; + if (_tween.isAdditive) { + var newVal = _tween.FloatVal; + val = newVal.calcDelta(_tween.prevVal); + _tween.prevVal.FloatVal = newVal; + } else { + val = _tween.FloatVal; + } + try { + _onValueChange(_target, val); + } catch (Exception e) { + UnityEngine.Debug.LogException(e, _target as UnityEngine.Object); + Assert.LogWarning($"Tween was stopped because of exception in {nameof(onValueChange)} callback, tween: {_tween.GetDescription()}\n", _tween.id, _tween.target as UnityEngine.Object); + _tween.EmergencyStop(); + } + }, null, false, TweenType.CustomFloat); + return PrimeTweenManager.Animate(tween); + } + static Tween animate(object target, ref TweenSettings settings, [NotNull] Action setter, Func getter, TweenType _tweenType) { + var tween = PrimeTweenManager.fetchTween(); + tween.startValue.CopyFrom(ref settings.startValue); + tween.endValue.CopyFrom(ref settings.endValue); + tween.Setup(target, ref settings.settings, setter, getter, settings.startFromCurrent, _tweenType); + return PrimeTweenManager.Animate(tween); + } + static Tween animateWithIntParam([NotNull] object target, int intParam, ref TweenSettings settings, [NotNull] Action setter, [NotNull] Func getter, TweenType _tweenType) { + var tween = PrimeTweenManager.fetchTween(); + tween.intParam = intParam; + tween.startValue.CopyFrom(ref settings.startValue); + tween.endValue.CopyFrom(ref settings.endValue); + tween.Setup(target, ref settings.settings, setter, getter, settings.startFromCurrent, _tweenType); + return PrimeTweenManager.Animate(tween); + } + + public static Tween Custom(UnityEngine.Color startValue, UnityEngine.Color endValue, float duration, [NotNull] Action onValueChange, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Custom(new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + public static Tween Custom(UnityEngine.Color startValue, UnityEngine.Color endValue, float duration, [NotNull] Action onValueChange, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Custom(new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + public static Tween Custom(UnityEngine.Color startValue, UnityEngine.Color endValue, TweenSettings settings, [NotNull] Action onValueChange) => Custom(new TweenSettings(startValue, endValue, settings), onValueChange); + public static Tween Custom(TweenSettings settings, [NotNull] Action onValueChange) { + Assert.IsNotNull(onValueChange); + if (settings.startFromCurrent) { + UnityEngine.Debug.LogWarning(Constants.customTweensDontSupportStartFromCurrentWarning); + } + var tween = PrimeTweenManager.fetchTween(); + tween.startValue.CopyFrom(ref settings.startValue); + tween.endValue.CopyFrom(ref settings.endValue); + tween.customOnValueChange = onValueChange; + tween.Setup(PrimeTweenManager.dummyTarget, ref settings.settings, _tween => { + var _onValueChange = _tween.customOnValueChange as Action; + var val = _tween.ColorVal; + try { + _onValueChange(val); + } catch (Exception e) { + UnityEngine.Debug.LogException(e); + Assert.LogWarning($"Tween was stopped because of exception in {nameof(onValueChange)} callback, tween: {_tween.GetDescription()}\n", _tween.id, _tween.target as UnityEngine.Object); + _tween.EmergencyStop(); + } + }, null, false, TweenType.CustomColor); + return PrimeTweenManager.Animate(tween); + } + public static Tween Custom([NotNull] T target, UnityEngine.Color startValue, UnityEngine.Color endValue, float duration, [NotNull] Action onValueChange, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) where T : class + => Custom_internal(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + public static Tween Custom([NotNull] T target, UnityEngine.Color startValue, UnityEngine.Color endValue, float duration, [NotNull] Action onValueChange, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) where T : class + => Custom_internal(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + public static Tween Custom([NotNull] T target, UnityEngine.Color startValue, UnityEngine.Color endValue, TweenSettings settings, [NotNull] Action onValueChange) where T : class + => Custom_internal(target, new TweenSettings(startValue, endValue, settings), onValueChange); + public static Tween Custom([NotNull] T target, TweenSettings settings, [NotNull] Action onValueChange) where T : class + => Custom_internal(target, settings, onValueChange); + #if PRIME_TWEEN_EXPERIMENTAL + public static Tween CustomAdditive([NotNull] T target, UnityEngine.Color deltaValue, TweenSettings settings, [NotNull] Action onDeltaChange) where T : class + => Custom_internal(target, new TweenSettings(default, deltaValue, settings), onDeltaChange, true); + #endif + static Tween Custom_internal([NotNull] T target, TweenSettings settings, [NotNull] Action onValueChange, bool isAdditive = false) where T : class { + Assert.IsNotNull(onValueChange); + if (settings.startFromCurrent) { + UnityEngine.Debug.LogWarning(Constants.customTweensDontSupportStartFromCurrentWarning); + } + var tween = PrimeTweenManager.fetchTween(); + tween.startValue.CopyFrom(ref settings.startValue); + tween.endValue.CopyFrom(ref settings.endValue); + tween.customOnValueChange = onValueChange; + tween.isAdditive = isAdditive; + tween.Setup(target, ref settings.settings, _tween => { + var _onValueChange = _tween.customOnValueChange as Action; + var _target = _tween.target as T; + UnityEngine.Color val; + if (_tween.isAdditive) { + var newVal = _tween.ColorVal; + val = newVal.calcDelta(_tween.prevVal); + _tween.prevVal.ColorVal = newVal; + } else { + val = _tween.ColorVal; + } + try { + _onValueChange(_target, val); + } catch (Exception e) { + UnityEngine.Debug.LogException(e, _target as UnityEngine.Object); + Assert.LogWarning($"Tween was stopped because of exception in {nameof(onValueChange)} callback, tween: {_tween.GetDescription()}\n", _tween.id, _tween.target as UnityEngine.Object); + _tween.EmergencyStop(); + } + }, null, false, TweenType.CustomColor); + return PrimeTweenManager.Animate(tween); + } + static Tween animate(object target, ref TweenSettings settings, [NotNull] Action setter, Func getter, TweenType _tweenType) { + var tween = PrimeTweenManager.fetchTween(); + tween.startValue.CopyFrom(ref settings.startValue); + tween.endValue.CopyFrom(ref settings.endValue); + tween.Setup(target, ref settings.settings, setter, getter, settings.startFromCurrent, _tweenType); + return PrimeTweenManager.Animate(tween); + } + static Tween animateWithIntParam([NotNull] object target, int intParam, ref TweenSettings settings, [NotNull] Action setter, [NotNull] Func getter, TweenType _tweenType) { + var tween = PrimeTweenManager.fetchTween(); + tween.intParam = intParam; + tween.startValue.CopyFrom(ref settings.startValue); + tween.endValue.CopyFrom(ref settings.endValue); + tween.Setup(target, ref settings.settings, setter, getter, settings.startFromCurrent, _tweenType); + return PrimeTweenManager.Animate(tween); + } + + public static Tween Custom(UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, float duration, [NotNull] Action onValueChange, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Custom(new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + public static Tween Custom(UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, float duration, [NotNull] Action onValueChange, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Custom(new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + public static Tween Custom(UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, TweenSettings settings, [NotNull] Action onValueChange) => Custom(new TweenSettings(startValue, endValue, settings), onValueChange); + public static Tween Custom(TweenSettings settings, [NotNull] Action onValueChange) { + Assert.IsNotNull(onValueChange); + if (settings.startFromCurrent) { + UnityEngine.Debug.LogWarning(Constants.customTweensDontSupportStartFromCurrentWarning); + } + var tween = PrimeTweenManager.fetchTween(); + tween.startValue.CopyFrom(ref settings.startValue); + tween.endValue.CopyFrom(ref settings.endValue); + tween.customOnValueChange = onValueChange; + tween.Setup(PrimeTweenManager.dummyTarget, ref settings.settings, _tween => { + var _onValueChange = _tween.customOnValueChange as Action; + var val = _tween.Vector2Val; + try { + _onValueChange(val); + } catch (Exception e) { + UnityEngine.Debug.LogException(e); + Assert.LogWarning($"Tween was stopped because of exception in {nameof(onValueChange)} callback, tween: {_tween.GetDescription()}\n", _tween.id, _tween.target as UnityEngine.Object); + _tween.EmergencyStop(); + } + }, null, false, TweenType.CustomVector2); + return PrimeTweenManager.Animate(tween); + } + public static Tween Custom([NotNull] T target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, float duration, [NotNull] Action onValueChange, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) where T : class + => Custom_internal(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + public static Tween Custom([NotNull] T target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, float duration, [NotNull] Action onValueChange, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) where T : class + => Custom_internal(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + public static Tween Custom([NotNull] T target, UnityEngine.Vector2 startValue, UnityEngine.Vector2 endValue, TweenSettings settings, [NotNull] Action onValueChange) where T : class + => Custom_internal(target, new TweenSettings(startValue, endValue, settings), onValueChange); + public static Tween Custom([NotNull] T target, TweenSettings settings, [NotNull] Action onValueChange) where T : class + => Custom_internal(target, settings, onValueChange); + #if PRIME_TWEEN_EXPERIMENTAL + public static Tween CustomAdditive([NotNull] T target, UnityEngine.Vector2 deltaValue, TweenSettings settings, [NotNull] Action onDeltaChange) where T : class + => Custom_internal(target, new TweenSettings(default, deltaValue, settings), onDeltaChange, true); + #endif + static Tween Custom_internal([NotNull] T target, TweenSettings settings, [NotNull] Action onValueChange, bool isAdditive = false) where T : class { + Assert.IsNotNull(onValueChange); + if (settings.startFromCurrent) { + UnityEngine.Debug.LogWarning(Constants.customTweensDontSupportStartFromCurrentWarning); + } + var tween = PrimeTweenManager.fetchTween(); + tween.startValue.CopyFrom(ref settings.startValue); + tween.endValue.CopyFrom(ref settings.endValue); + tween.customOnValueChange = onValueChange; + tween.isAdditive = isAdditive; + tween.Setup(target, ref settings.settings, _tween => { + var _onValueChange = _tween.customOnValueChange as Action; + var _target = _tween.target as T; + UnityEngine.Vector2 val; + if (_tween.isAdditive) { + var newVal = _tween.Vector2Val; + val = newVal.calcDelta(_tween.prevVal); + _tween.prevVal.Vector2Val = newVal; + } else { + val = _tween.Vector2Val; + } + try { + _onValueChange(_target, val); + } catch (Exception e) { + UnityEngine.Debug.LogException(e, _target as UnityEngine.Object); + Assert.LogWarning($"Tween was stopped because of exception in {nameof(onValueChange)} callback, tween: {_tween.GetDescription()}\n", _tween.id, _tween.target as UnityEngine.Object); + _tween.EmergencyStop(); + } + }, null, false, TweenType.CustomVector2); + return PrimeTweenManager.Animate(tween); + } + static Tween animate(object target, ref TweenSettings settings, [NotNull] Action setter, Func getter, TweenType _tweenType) { + var tween = PrimeTweenManager.fetchTween(); + tween.startValue.CopyFrom(ref settings.startValue); + tween.endValue.CopyFrom(ref settings.endValue); + tween.Setup(target, ref settings.settings, setter, getter, settings.startFromCurrent, _tweenType); + return PrimeTweenManager.Animate(tween); + } + static Tween animateWithIntParam([NotNull] object target, int intParam, ref TweenSettings settings, [NotNull] Action setter, [NotNull] Func getter, TweenType _tweenType) { + var tween = PrimeTweenManager.fetchTween(); + tween.intParam = intParam; + tween.startValue.CopyFrom(ref settings.startValue); + tween.endValue.CopyFrom(ref settings.endValue); + tween.Setup(target, ref settings.settings, setter, getter, settings.startFromCurrent, _tweenType); + return PrimeTweenManager.Animate(tween); + } + + public static Tween Custom(UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, float duration, [NotNull] Action onValueChange, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Custom(new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + public static Tween Custom(UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, float duration, [NotNull] Action onValueChange, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Custom(new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + public static Tween Custom(UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, TweenSettings settings, [NotNull] Action onValueChange) => Custom(new TweenSettings(startValue, endValue, settings), onValueChange); + public static Tween Custom(TweenSettings settings, [NotNull] Action onValueChange) { + Assert.IsNotNull(onValueChange); + if (settings.startFromCurrent) { + UnityEngine.Debug.LogWarning(Constants.customTweensDontSupportStartFromCurrentWarning); + } + var tween = PrimeTweenManager.fetchTween(); + tween.startValue.CopyFrom(ref settings.startValue); + tween.endValue.CopyFrom(ref settings.endValue); + tween.customOnValueChange = onValueChange; + tween.Setup(PrimeTweenManager.dummyTarget, ref settings.settings, _tween => { + var _onValueChange = _tween.customOnValueChange as Action; + var val = _tween.Vector3Val; + try { + _onValueChange(val); + } catch (Exception e) { + UnityEngine.Debug.LogException(e); + Assert.LogWarning($"Tween was stopped because of exception in {nameof(onValueChange)} callback, tween: {_tween.GetDescription()}\n", _tween.id, _tween.target as UnityEngine.Object); + _tween.EmergencyStop(); + } + }, null, false, TweenType.CustomVector3); + return PrimeTweenManager.Animate(tween); + } + public static Tween Custom([NotNull] T target, UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, float duration, [NotNull] Action onValueChange, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) where T : class + => Custom_internal(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + public static Tween Custom([NotNull] T target, UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, float duration, [NotNull] Action onValueChange, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) where T : class + => Custom_internal(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + public static Tween Custom([NotNull] T target, UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, TweenSettings settings, [NotNull] Action onValueChange) where T : class + => Custom_internal(target, new TweenSettings(startValue, endValue, settings), onValueChange); + public static Tween Custom([NotNull] T target, TweenSettings settings, [NotNull] Action onValueChange) where T : class + => Custom_internal(target, settings, onValueChange); + #if PRIME_TWEEN_EXPERIMENTAL + public static Tween CustomAdditive([NotNull] T target, UnityEngine.Vector3 deltaValue, TweenSettings settings, [NotNull] Action onDeltaChange) where T : class + => Custom_internal(target, new TweenSettings(default, deltaValue, settings), onDeltaChange, true); + #endif + static Tween Custom_internal([NotNull] T target, TweenSettings settings, [NotNull] Action onValueChange, bool isAdditive = false) where T : class { + Assert.IsNotNull(onValueChange); + if (settings.startFromCurrent) { + UnityEngine.Debug.LogWarning(Constants.customTweensDontSupportStartFromCurrentWarning); + } + var tween = PrimeTweenManager.fetchTween(); + tween.startValue.CopyFrom(ref settings.startValue); + tween.endValue.CopyFrom(ref settings.endValue); + tween.customOnValueChange = onValueChange; + tween.isAdditive = isAdditive; + tween.Setup(target, ref settings.settings, _tween => { + var _onValueChange = _tween.customOnValueChange as Action; + var _target = _tween.target as T; + UnityEngine.Vector3 val; + if (_tween.isAdditive) { + var newVal = _tween.Vector3Val; + val = newVal.calcDelta(_tween.prevVal); + _tween.prevVal.Vector3Val = newVal; + } else { + val = _tween.Vector3Val; + } + try { + _onValueChange(_target, val); + } catch (Exception e) { + UnityEngine.Debug.LogException(e, _target as UnityEngine.Object); + Assert.LogWarning($"Tween was stopped because of exception in {nameof(onValueChange)} callback, tween: {_tween.GetDescription()}\n", _tween.id, _tween.target as UnityEngine.Object); + _tween.EmergencyStop(); + } + }, null, false, TweenType.CustomVector3); + return PrimeTweenManager.Animate(tween); + } + static Tween animate(object target, ref TweenSettings settings, [NotNull] Action setter, Func getter, TweenType _tweenType) { + var tween = PrimeTweenManager.fetchTween(); + tween.startValue.CopyFrom(ref settings.startValue); + tween.endValue.CopyFrom(ref settings.endValue); + tween.Setup(target, ref settings.settings, setter, getter, settings.startFromCurrent, _tweenType); + return PrimeTweenManager.Animate(tween); + } + static Tween animateWithIntParam([NotNull] object target, int intParam, ref TweenSettings settings, [NotNull] Action setter, [NotNull] Func getter, TweenType _tweenType) { + var tween = PrimeTweenManager.fetchTween(); + tween.intParam = intParam; + tween.startValue.CopyFrom(ref settings.startValue); + tween.endValue.CopyFrom(ref settings.endValue); + tween.Setup(target, ref settings.settings, setter, getter, settings.startFromCurrent, _tweenType); + return PrimeTweenManager.Animate(tween); + } + + public static Tween Custom(UnityEngine.Vector4 startValue, UnityEngine.Vector4 endValue, float duration, [NotNull] Action onValueChange, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Custom(new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + public static Tween Custom(UnityEngine.Vector4 startValue, UnityEngine.Vector4 endValue, float duration, [NotNull] Action onValueChange, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Custom(new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + public static Tween Custom(UnityEngine.Vector4 startValue, UnityEngine.Vector4 endValue, TweenSettings settings, [NotNull] Action onValueChange) => Custom(new TweenSettings(startValue, endValue, settings), onValueChange); + public static Tween Custom(TweenSettings settings, [NotNull] Action onValueChange) { + Assert.IsNotNull(onValueChange); + if (settings.startFromCurrent) { + UnityEngine.Debug.LogWarning(Constants.customTweensDontSupportStartFromCurrentWarning); + } + var tween = PrimeTweenManager.fetchTween(); + tween.startValue.CopyFrom(ref settings.startValue); + tween.endValue.CopyFrom(ref settings.endValue); + tween.customOnValueChange = onValueChange; + tween.Setup(PrimeTweenManager.dummyTarget, ref settings.settings, _tween => { + var _onValueChange = _tween.customOnValueChange as Action; + var val = _tween.Vector4Val; + try { + _onValueChange(val); + } catch (Exception e) { + UnityEngine.Debug.LogException(e); + Assert.LogWarning($"Tween was stopped because of exception in {nameof(onValueChange)} callback, tween: {_tween.GetDescription()}\n", _tween.id, _tween.target as UnityEngine.Object); + _tween.EmergencyStop(); + } + }, null, false, TweenType.CustomVector4); + return PrimeTweenManager.Animate(tween); + } + public static Tween Custom([NotNull] T target, UnityEngine.Vector4 startValue, UnityEngine.Vector4 endValue, float duration, [NotNull] Action onValueChange, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) where T : class + => Custom_internal(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + public static Tween Custom([NotNull] T target, UnityEngine.Vector4 startValue, UnityEngine.Vector4 endValue, float duration, [NotNull] Action onValueChange, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) where T : class + => Custom_internal(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + public static Tween Custom([NotNull] T target, UnityEngine.Vector4 startValue, UnityEngine.Vector4 endValue, TweenSettings settings, [NotNull] Action onValueChange) where T : class + => Custom_internal(target, new TweenSettings(startValue, endValue, settings), onValueChange); + public static Tween Custom([NotNull] T target, TweenSettings settings, [NotNull] Action onValueChange) where T : class + => Custom_internal(target, settings, onValueChange); + #if PRIME_TWEEN_EXPERIMENTAL + public static Tween CustomAdditive([NotNull] T target, UnityEngine.Vector4 deltaValue, TweenSettings settings, [NotNull] Action onDeltaChange) where T : class + => Custom_internal(target, new TweenSettings(default, deltaValue, settings), onDeltaChange, true); + #endif + static Tween Custom_internal([NotNull] T target, TweenSettings settings, [NotNull] Action onValueChange, bool isAdditive = false) where T : class { + Assert.IsNotNull(onValueChange); + if (settings.startFromCurrent) { + UnityEngine.Debug.LogWarning(Constants.customTweensDontSupportStartFromCurrentWarning); + } + var tween = PrimeTweenManager.fetchTween(); + tween.startValue.CopyFrom(ref settings.startValue); + tween.endValue.CopyFrom(ref settings.endValue); + tween.customOnValueChange = onValueChange; + tween.isAdditive = isAdditive; + tween.Setup(target, ref settings.settings, _tween => { + var _onValueChange = _tween.customOnValueChange as Action; + var _target = _tween.target as T; + UnityEngine.Vector4 val; + if (_tween.isAdditive) { + var newVal = _tween.Vector4Val; + val = newVal.calcDelta(_tween.prevVal); + _tween.prevVal.Vector4Val = newVal; + } else { + val = _tween.Vector4Val; + } + try { + _onValueChange(_target, val); + } catch (Exception e) { + UnityEngine.Debug.LogException(e, _target as UnityEngine.Object); + Assert.LogWarning($"Tween was stopped because of exception in {nameof(onValueChange)} callback, tween: {_tween.GetDescription()}\n", _tween.id, _tween.target as UnityEngine.Object); + _tween.EmergencyStop(); + } + }, null, false, TweenType.CustomVector4); + return PrimeTweenManager.Animate(tween); + } + static Tween animate(object target, ref TweenSettings settings, [NotNull] Action setter, Func getter, TweenType _tweenType) { + var tween = PrimeTweenManager.fetchTween(); + tween.startValue.CopyFrom(ref settings.startValue); + tween.endValue.CopyFrom(ref settings.endValue); + tween.Setup(target, ref settings.settings, setter, getter, settings.startFromCurrent, _tweenType); + return PrimeTweenManager.Animate(tween); + } + static Tween animateWithIntParam([NotNull] object target, int intParam, ref TweenSettings settings, [NotNull] Action setter, [NotNull] Func getter, TweenType _tweenType) { + var tween = PrimeTweenManager.fetchTween(); + tween.intParam = intParam; + tween.startValue.CopyFrom(ref settings.startValue); + tween.endValue.CopyFrom(ref settings.endValue); + tween.Setup(target, ref settings.settings, setter, getter, settings.startFromCurrent, _tweenType); + return PrimeTweenManager.Animate(tween); + } + + public static Tween Custom(UnityEngine.Quaternion startValue, UnityEngine.Quaternion endValue, float duration, [NotNull] Action onValueChange, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Custom(new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + public static Tween Custom(UnityEngine.Quaternion startValue, UnityEngine.Quaternion endValue, float duration, [NotNull] Action onValueChange, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Custom(new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + public static Tween Custom(UnityEngine.Quaternion startValue, UnityEngine.Quaternion endValue, TweenSettings settings, [NotNull] Action onValueChange) => Custom(new TweenSettings(startValue, endValue, settings), onValueChange); + public static Tween Custom(TweenSettings settings, [NotNull] Action onValueChange) { + Assert.IsNotNull(onValueChange); + if (settings.startFromCurrent) { + UnityEngine.Debug.LogWarning(Constants.customTweensDontSupportStartFromCurrentWarning); + } + var tween = PrimeTweenManager.fetchTween(); + tween.startValue.CopyFrom(ref settings.startValue); + tween.endValue.CopyFrom(ref settings.endValue); + tween.customOnValueChange = onValueChange; + tween.Setup(PrimeTweenManager.dummyTarget, ref settings.settings, _tween => { + var _onValueChange = _tween.customOnValueChange as Action; + var val = _tween.QuaternionVal; + try { + _onValueChange(val); + } catch (Exception e) { + UnityEngine.Debug.LogException(e); + Assert.LogWarning($"Tween was stopped because of exception in {nameof(onValueChange)} callback, tween: {_tween.GetDescription()}\n", _tween.id, _tween.target as UnityEngine.Object); + _tween.EmergencyStop(); + } + }, null, false, TweenType.CustomQuaternion); + return PrimeTweenManager.Animate(tween); + } + public static Tween Custom([NotNull] T target, UnityEngine.Quaternion startValue, UnityEngine.Quaternion endValue, float duration, [NotNull] Action onValueChange, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) where T : class + => Custom_internal(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + public static Tween Custom([NotNull] T target, UnityEngine.Quaternion startValue, UnityEngine.Quaternion endValue, float duration, [NotNull] Action onValueChange, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) where T : class + => Custom_internal(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + public static Tween Custom([NotNull] T target, UnityEngine.Quaternion startValue, UnityEngine.Quaternion endValue, TweenSettings settings, [NotNull] Action onValueChange) where T : class + => Custom_internal(target, new TweenSettings(startValue, endValue, settings), onValueChange); + public static Tween Custom([NotNull] T target, TweenSettings settings, [NotNull] Action onValueChange) where T : class + => Custom_internal(target, settings, onValueChange); + #if PRIME_TWEEN_EXPERIMENTAL + public static Tween CustomAdditive([NotNull] T target, UnityEngine.Quaternion deltaValue, TweenSettings settings, [NotNull] Action onDeltaChange) where T : class + => Custom_internal(target, new TweenSettings(default, deltaValue, settings), onDeltaChange, true); + #endif + static Tween Custom_internal([NotNull] T target, TweenSettings settings, [NotNull] Action onValueChange, bool isAdditive = false) where T : class { + Assert.IsNotNull(onValueChange); + if (settings.startFromCurrent) { + UnityEngine.Debug.LogWarning(Constants.customTweensDontSupportStartFromCurrentWarning); + } + var tween = PrimeTweenManager.fetchTween(); + tween.startValue.CopyFrom(ref settings.startValue); + tween.endValue.CopyFrom(ref settings.endValue); + tween.customOnValueChange = onValueChange; + tween.isAdditive = isAdditive; + tween.Setup(target, ref settings.settings, _tween => { + var _onValueChange = _tween.customOnValueChange as Action; + var _target = _tween.target as T; + UnityEngine.Quaternion val; + if (_tween.isAdditive) { + var newVal = _tween.QuaternionVal; + val = newVal.calcDelta(_tween.prevVal); + _tween.prevVal.QuaternionVal = newVal; + } else { + val = _tween.QuaternionVal; + } + try { + _onValueChange(_target, val); + } catch (Exception e) { + UnityEngine.Debug.LogException(e, _target as UnityEngine.Object); + Assert.LogWarning($"Tween was stopped because of exception in {nameof(onValueChange)} callback, tween: {_tween.GetDescription()}\n", _tween.id, _tween.target as UnityEngine.Object); + _tween.EmergencyStop(); + } + }, null, false, TweenType.CustomQuaternion); + return PrimeTweenManager.Animate(tween); + } + static Tween animate(object target, ref TweenSettings settings, [NotNull] Action setter, Func getter, TweenType _tweenType) { + var tween = PrimeTweenManager.fetchTween(); + tween.startValue.CopyFrom(ref settings.startValue); + tween.endValue.CopyFrom(ref settings.endValue); + tween.Setup(target, ref settings.settings, setter, getter, settings.startFromCurrent, _tweenType); + return PrimeTweenManager.Animate(tween); + } + static Tween animateWithIntParam([NotNull] object target, int intParam, ref TweenSettings settings, [NotNull] Action setter, [NotNull] Func getter, TweenType _tweenType) { + var tween = PrimeTweenManager.fetchTween(); + tween.intParam = intParam; + tween.startValue.CopyFrom(ref settings.startValue); + tween.endValue.CopyFrom(ref settings.endValue); + tween.Setup(target, ref settings.settings, setter, getter, settings.startFromCurrent, _tweenType); + return PrimeTweenManager.Animate(tween); + } + + public static Tween Custom(UnityEngine.Rect startValue, UnityEngine.Rect endValue, float duration, [NotNull] Action onValueChange, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Custom(new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + public static Tween Custom(UnityEngine.Rect startValue, UnityEngine.Rect endValue, float duration, [NotNull] Action onValueChange, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Custom(new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + public static Tween Custom(UnityEngine.Rect startValue, UnityEngine.Rect endValue, TweenSettings settings, [NotNull] Action onValueChange) => Custom(new TweenSettings(startValue, endValue, settings), onValueChange); + public static Tween Custom(TweenSettings settings, [NotNull] Action onValueChange) { + Assert.IsNotNull(onValueChange); + if (settings.startFromCurrent) { + UnityEngine.Debug.LogWarning(Constants.customTweensDontSupportStartFromCurrentWarning); + } + var tween = PrimeTweenManager.fetchTween(); + tween.startValue.CopyFrom(ref settings.startValue); + tween.endValue.CopyFrom(ref settings.endValue); + tween.customOnValueChange = onValueChange; + tween.Setup(PrimeTweenManager.dummyTarget, ref settings.settings, _tween => { + var _onValueChange = _tween.customOnValueChange as Action; + var val = _tween.RectVal; + try { + _onValueChange(val); + } catch (Exception e) { + UnityEngine.Debug.LogException(e); + Assert.LogWarning($"Tween was stopped because of exception in {nameof(onValueChange)} callback, tween: {_tween.GetDescription()}\n", _tween.id, _tween.target as UnityEngine.Object); + _tween.EmergencyStop(); + } + }, null, false, TweenType.CustomRect); + return PrimeTweenManager.Animate(tween); + } + public static Tween Custom([NotNull] T target, UnityEngine.Rect startValue, UnityEngine.Rect endValue, float duration, [NotNull] Action onValueChange, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) where T : class + => Custom_internal(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + public static Tween Custom([NotNull] T target, UnityEngine.Rect startValue, UnityEngine.Rect endValue, float duration, [NotNull] Action onValueChange, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) where T : class + => Custom_internal(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + public static Tween Custom([NotNull] T target, UnityEngine.Rect startValue, UnityEngine.Rect endValue, TweenSettings settings, [NotNull] Action onValueChange) where T : class + => Custom_internal(target, new TweenSettings(startValue, endValue, settings), onValueChange); + public static Tween Custom([NotNull] T target, TweenSettings settings, [NotNull] Action onValueChange) where T : class + => Custom_internal(target, settings, onValueChange); + #if PRIME_TWEEN_EXPERIMENTAL + public static Tween CustomAdditive([NotNull] T target, UnityEngine.Rect deltaValue, TweenSettings settings, [NotNull] Action onDeltaChange) where T : class + => Custom_internal(target, new TweenSettings(default, deltaValue, settings), onDeltaChange, true); + #endif + static Tween Custom_internal([NotNull] T target, TweenSettings settings, [NotNull] Action onValueChange, bool isAdditive = false) where T : class { + Assert.IsNotNull(onValueChange); + if (settings.startFromCurrent) { + UnityEngine.Debug.LogWarning(Constants.customTweensDontSupportStartFromCurrentWarning); + } + var tween = PrimeTweenManager.fetchTween(); + tween.startValue.CopyFrom(ref settings.startValue); + tween.endValue.CopyFrom(ref settings.endValue); + tween.customOnValueChange = onValueChange; + tween.isAdditive = isAdditive; + tween.Setup(target, ref settings.settings, _tween => { + var _onValueChange = _tween.customOnValueChange as Action; + var _target = _tween.target as T; + UnityEngine.Rect val; + if (_tween.isAdditive) { + var newVal = _tween.RectVal; + val = newVal.calcDelta(_tween.prevVal); + _tween.prevVal.RectVal = newVal; + } else { + val = _tween.RectVal; + } + try { + _onValueChange(_target, val); + } catch (Exception e) { + UnityEngine.Debug.LogException(e, _target as UnityEngine.Object); + Assert.LogWarning($"Tween was stopped because of exception in {nameof(onValueChange)} callback, tween: {_tween.GetDescription()}\n", _tween.id, _tween.target as UnityEngine.Object); + _tween.EmergencyStop(); + } + }, null, false, TweenType.CustomRect); + return PrimeTweenManager.Animate(tween); + } + static Tween animate(object target, ref TweenSettings settings, [NotNull] Action setter, Func getter, TweenType _tweenType) { + var tween = PrimeTweenManager.fetchTween(); + tween.startValue.CopyFrom(ref settings.startValue); + tween.endValue.CopyFrom(ref settings.endValue); + tween.Setup(target, ref settings.settings, setter, getter, settings.startFromCurrent, _tweenType); + return PrimeTweenManager.Animate(tween); + } + static Tween animateWithIntParam([NotNull] object target, int intParam, ref TweenSettings settings, [NotNull] Action setter, [NotNull] Func getter, TweenType _tweenType) { + var tween = PrimeTweenManager.fetchTween(); + tween.intParam = intParam; + tween.startValue.CopyFrom(ref settings.startValue); + tween.endValue.CopyFrom(ref settings.endValue); + tween.Setup(target, ref settings.settings, setter, getter, settings.startFromCurrent, _tweenType); + return PrimeTweenManager.Animate(tween); + } +#if PRIME_TWEEN_EXPERIMENTAL + public static Tween PositionAdditive([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 deltaValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => PositionAdditive(target, deltaValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)); + public static Tween PositionAdditive([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 deltaValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => PositionAdditive(target, deltaValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)); + public static Tween PositionAdditive([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 deltaValue, TweenSettings settings) + => CustomAdditive(target, deltaValue, settings, (_target, delta) => _target.position += delta); + + public static Tween LocalPositionAdditive([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 deltaValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalPositionAdditive(target, deltaValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)); + public static Tween LocalPositionAdditive([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 deltaValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalPositionAdditive(target, deltaValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)); + public static Tween LocalPositionAdditive([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 deltaValue, TweenSettings settings) + => CustomAdditive(target, deltaValue, settings, (_target, delta) => _target.localPosition += delta); + + public static Tween ScaleAdditive([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 deltaValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => ScaleAdditive(target, deltaValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)); + public static Tween ScaleAdditive([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 deltaValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => ScaleAdditive(target, deltaValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)); + public static Tween ScaleAdditive([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 deltaValue, TweenSettings settings) + => CustomAdditive(target, deltaValue, settings, (_target, delta) => _target.localScale += delta); + + public static Tween RotationAdditive([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 deltaValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => RotationAdditive(target, deltaValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)); + public static Tween RotationAdditive([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 deltaValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => RotationAdditive(target, deltaValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)); + public static Tween RotationAdditive([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 deltaValue, TweenSettings settings) + => CustomAdditive(target, deltaValue, settings, (_target, delta) => _target.rotation *= UnityEngine.Quaternion.Euler(delta)); + + public static Tween LocalRotationAdditive([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 deltaValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalRotationAdditive(target, deltaValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)); + public static Tween LocalRotationAdditive([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 deltaValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalRotationAdditive(target, deltaValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)); + public static Tween LocalRotationAdditive([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 deltaValue, TweenSettings settings) + => CustomAdditive(target, deltaValue, settings, (_target, delta) => _target.localRotation *= UnityEngine.Quaternion.Euler(delta)); + + public static Tween RotationAdditive([NotNull] UnityEngine.Transform target, UnityEngine.Quaternion deltaValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => RotationAdditive(target, deltaValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)); + public static Tween RotationAdditive([NotNull] UnityEngine.Transform target, UnityEngine.Quaternion deltaValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => RotationAdditive(target, deltaValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)); + public static Tween RotationAdditive([NotNull] UnityEngine.Transform target, UnityEngine.Quaternion deltaValue, TweenSettings settings) + => CustomAdditive(target, deltaValue, settings, (_target, delta) => _target.rotation *= delta); + + public static Tween LocalRotationAdditive([NotNull] UnityEngine.Transform target, UnityEngine.Quaternion deltaValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalRotationAdditive(target, deltaValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)); + public static Tween LocalRotationAdditive([NotNull] UnityEngine.Transform target, UnityEngine.Quaternion deltaValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalRotationAdditive(target, deltaValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)); + public static Tween LocalRotationAdditive([NotNull] UnityEngine.Transform target, UnityEngine.Quaternion deltaValue, TweenSettings settings) + => CustomAdditive(target, deltaValue, settings, (_target, delta) => _target.localRotation *= delta); +#endif + public static Tween PositionAtSpeed([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 endValue, float averageSpeed, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => PositionAtSpeed(target, new TweenSettings(endValue, new TweenSettings(averageSpeed, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween PositionAtSpeed([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 endValue, float averageSpeed, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => PositionAtSpeed(target, new TweenSettings(endValue, new TweenSettings(averageSpeed, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween PositionAtSpeed([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, float averageSpeed, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => PositionAtSpeed(target, new TweenSettings(startValue, endValue, new TweenSettings(averageSpeed, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween PositionAtSpeed([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, float averageSpeed, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => PositionAtSpeed(target, new TweenSettings(startValue, endValue, new TweenSettings(averageSpeed, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + static Tween PositionAtSpeed([NotNull] UnityEngine.Transform target, TweenSettings settings) { + var speed = settings.settings.duration; + if (speed <= 0) { + UnityEngine.Debug.LogError($"Invalid speed provided to the Tween.{nameof(PositionAtSpeed)}() method: {speed}."); + return default; + } + if (settings.startFromCurrent) { + settings.startFromCurrent = false; + settings.startValue = target.position; + } + settings.settings.duration = Extensions.CalcDistance(settings.startValue, settings.endValue) / speed; + return Position(target, settings); + } + + public static Tween LocalPositionAtSpeed([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 endValue, float averageSpeed, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalPositionAtSpeed(target, new TweenSettings(endValue, new TweenSettings(averageSpeed, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LocalPositionAtSpeed([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 endValue, float averageSpeed, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalPositionAtSpeed(target, new TweenSettings(endValue, new TweenSettings(averageSpeed, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LocalPositionAtSpeed([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, float averageSpeed, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalPositionAtSpeed(target, new TweenSettings(startValue, endValue, new TweenSettings(averageSpeed, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LocalPositionAtSpeed([NotNull] UnityEngine.Transform target, UnityEngine.Vector3 startValue, UnityEngine.Vector3 endValue, float averageSpeed, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalPositionAtSpeed(target, new TweenSettings(startValue, endValue, new TweenSettings(averageSpeed, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + static Tween LocalPositionAtSpeed([NotNull] UnityEngine.Transform target, TweenSettings settings) { + var speed = settings.settings.duration; + if (speed <= 0) { + UnityEngine.Debug.LogError($"Invalid speed provided to the Tween.{nameof(LocalPositionAtSpeed)}() method: {speed}."); + return default; + } + if (settings.startFromCurrent) { + settings.startFromCurrent = false; + settings.startValue = target.localPosition; + } + settings.settings.duration = Extensions.CalcDistance(settings.startValue, settings.endValue) / speed; + return LocalPosition(target, settings); + } + + public static Tween RotationAtSpeed([NotNull] UnityEngine.Transform target, UnityEngine.Quaternion endValue, float averageAngularSpeed, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => RotationAtSpeed(target, new TweenSettings(endValue, new TweenSettings(averageAngularSpeed, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween RotationAtSpeed([NotNull] UnityEngine.Transform target, UnityEngine.Quaternion endValue, float averageAngularSpeed, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => RotationAtSpeed(target, new TweenSettings(endValue, new TweenSettings(averageAngularSpeed, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween RotationAtSpeed([NotNull] UnityEngine.Transform target, UnityEngine.Quaternion startValue, UnityEngine.Quaternion endValue, float averageAngularSpeed, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => RotationAtSpeed(target, new TweenSettings(startValue, endValue, new TweenSettings(averageAngularSpeed, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween RotationAtSpeed([NotNull] UnityEngine.Transform target, UnityEngine.Quaternion startValue, UnityEngine.Quaternion endValue, float averageAngularSpeed, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => RotationAtSpeed(target, new TweenSettings(startValue, endValue, new TweenSettings(averageAngularSpeed, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + static Tween RotationAtSpeed([NotNull] UnityEngine.Transform target, TweenSettings settings) { + var speed = settings.settings.duration; + if (speed <= 0) { + UnityEngine.Debug.LogError($"Invalid speed provided to the Tween.{nameof(RotationAtSpeed)}() method: {speed}."); + return default; + } + if (settings.startFromCurrent) { + settings.startFromCurrent = false; + settings.startValue = target.rotation; + } + settings.settings.duration = Extensions.CalcDistance(settings.startValue, settings.endValue) / speed; + return Rotation(target, settings); + } + + public static Tween LocalRotationAtSpeed([NotNull] UnityEngine.Transform target, UnityEngine.Quaternion endValue, float averageAngularSpeed, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalRotationAtSpeed(target, new TweenSettings(endValue, new TweenSettings(averageAngularSpeed, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LocalRotationAtSpeed([NotNull] UnityEngine.Transform target, UnityEngine.Quaternion endValue, float averageAngularSpeed, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalRotationAtSpeed(target, new TweenSettings(endValue, new TweenSettings(averageAngularSpeed, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LocalRotationAtSpeed([NotNull] UnityEngine.Transform target, UnityEngine.Quaternion startValue, UnityEngine.Quaternion endValue, float averageAngularSpeed, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalRotationAtSpeed(target, new TweenSettings(startValue, endValue, new TweenSettings(averageAngularSpeed, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LocalRotationAtSpeed([NotNull] UnityEngine.Transform target, UnityEngine.Quaternion startValue, UnityEngine.Quaternion endValue, float averageAngularSpeed, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalRotationAtSpeed(target, new TweenSettings(startValue, endValue, new TweenSettings(averageAngularSpeed, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + static Tween LocalRotationAtSpeed([NotNull] UnityEngine.Transform target, TweenSettings settings) { + var speed = settings.settings.duration; + if (speed <= 0) { + UnityEngine.Debug.LogError($"Invalid speed provided to the Tween.{nameof(LocalRotationAtSpeed)}() method: {speed}."); + return default; + } + if (settings.startFromCurrent) { + settings.startFromCurrent = false; + settings.startValue = target.localRotation; + } + settings.settings.duration = Extensions.CalcDistance(settings.startValue, settings.endValue) / speed; + return LocalRotation(target, settings); + } + + } +} \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/TweenGenerated.cs.meta b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/TweenGenerated.cs.meta new file mode 100644 index 00000000..0e433cfd --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/TweenGenerated.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 51610f0e9d8e4ccead49e9fcc96d54e3 +timeCreated: 1673617985 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/TweenMethods.cs b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/TweenMethods.cs new file mode 100644 index 00000000..05396f2e --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/TweenMethods.cs @@ -0,0 +1,480 @@ +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedMember.Global +// ReSharper disable UnusedMethodReturnValue.Global +using System; +using JetBrains.Annotations; +using UnityEngine; + +namespace PrimeTween { + public partial struct Tween { + /// Returns the number of alive tweens. + /// If specified, returns the number of running tweens on the target. Please note: if target is specified, this method call has O(n) complexity where n is the total number of running tweens. + public static int GetTweensCount([CanBeNull] object onTarget = null) { + #if UNITY_EDITOR + if (Constants.warnNoInstance) { + return default; + } + #endif + var manager = PrimeTweenManager.Instance; + if (onTarget == null && manager.updateDepth == 0) { + int result = manager.tweensCount; + #if PRIME_TWEEN_SAFETY_CHECKS && UNITY_ASSERTIONS + Assert.AreEqual(result, PrimeTweenManager.processAll(null, _ => true, true)); + #endif + return result; + } + return PrimeTweenManager.processAll(onTarget, _ => true, true); // call processAll to filter null tweens + } + + #if PRIME_TWEEN_EXPERIMENTAL + public static int GetTweensCapacity() { + var instance = PrimeTweenConfig.Instance; + if (instance == null) { + return PrimeTweenManager.customInitialCapacity; + } + return instance.currentPoolCapacity; + } + + public static Tween Custom(Double startValue, Double endValue, float duration, [NotNull] Action onValueChange, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Custom(new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + + public static Tween Custom(Double startValue, Double endValue, float duration, [NotNull] Action onValueChange, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => Custom(new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + + public static Tween Custom(Double startValue, Double endValue, TweenSettings settings, [NotNull] Action onValueChange) => Custom(new TweenSettings(startValue, endValue, settings), onValueChange); + + public static Tween Custom(TweenSettings settings, [NotNull] Action onValueChange) { + Assert.IsNotNull(onValueChange); + if (settings.startFromCurrent) { + Debug.LogWarning(Constants.customTweensDontSupportStartFromCurrentWarning); + } + var tween = PrimeTweenManager.fetchTween(); + tween.startValue.CopyFrom(ref settings.startValue); + tween.endValue.CopyFrom(ref settings.endValue); + tween.customOnValueChange = onValueChange; + tween.Setup(PrimeTweenManager.dummyTarget, ref settings.settings, _tween => { + var _onValueChange = _tween.customOnValueChange as Action; + var val = _tween.DoubleVal; + try { + _onValueChange(val); + } catch (Exception e) { + Assert.LogError($"Tween was stopped because of exception in {nameof(onValueChange)} callback, tween: {_tween.GetDescription()}, exception:\n{e}\n", _tween.id, _tween.target as UnityEngine.Object); + _tween.EmergencyStop(); + } + }, null, false, TweenType.CustomDouble); + return PrimeTweenManager.Animate(tween); + } + + public static Tween Custom([NotNull] T target, Double startValue, Double endValue, float duration, [NotNull] Action onValueChange, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) where T : class + => Custom_internal(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + + public static Tween Custom([NotNull] T target, Double startValue, Double endValue, float duration, [NotNull] Action onValueChange, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) where T : class + => Custom_internal(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime)), onValueChange); + + public static Tween Custom([NotNull] T target, Double startValue, Double endValue, TweenSettings settings, [NotNull] Action onValueChange) where T : class + => Custom_internal(target, new TweenSettings(startValue, endValue, settings), onValueChange); + + public static Tween Custom([NotNull] T target, TweenSettings settings, [NotNull] Action onValueChange) where T : class + => Custom_internal(target, settings, onValueChange); + + public static Tween CustomAdditive([NotNull] T target, Double deltaValue, TweenSettings settings, [NotNull] Action onDeltaChange) where T : class + => Custom_internal(target, new TweenSettings(default, deltaValue, settings), onDeltaChange, true); + + static Tween Custom_internal([NotNull] T target, TweenSettings settings, [NotNull] Action onValueChange, bool isAdditive = false) where T : class { + Assert.IsNotNull(onValueChange); + if (settings.startFromCurrent) { + Debug.LogWarning(Constants.customTweensDontSupportStartFromCurrentWarning); + } + var tween = PrimeTweenManager.fetchTween(); + tween.startValue.CopyFrom(ref settings.startValue); + tween.endValue.CopyFrom(ref settings.endValue); + tween.customOnValueChange = onValueChange; + tween.isAdditive = isAdditive; + tween.Setup(target, ref settings.settings, _tween => { + var _onValueChange = _tween.customOnValueChange as Action; + var _target = _tween.target as T; + Double val; + if (_tween.isAdditive) { + var newVal = _tween.DoubleVal; + val = newVal.calcDelta(_tween.prevVal); + _tween.prevVal.DoubleVal = newVal; + } else { + val = _tween.DoubleVal; + } + try { + _onValueChange(_target, val); + } catch (Exception e) { + Assert.LogError($"Tween was stopped because of exception in {nameof(onValueChange)} callback, tween: {_tween.GetDescription()}, exception:\n{e}\n", _tween.id, _tween.target as UnityEngine.Object); + _tween.EmergencyStop(); + } + }, null, false, TweenType.CustomDouble); + return PrimeTweenManager.Animate(tween); + } + #endif + + /// Stops all tweens and sequences.
+ /// If is provided, stops only tweens on this target (stopping a tween inside a Sequence is not allowed).
+ /// The number of stopped tweens. + public static int StopAll([CanBeNull] object onTarget = null) { + var result = PrimeTweenManager.processAll(onTarget, tween => { + if (tween.IsInSequence()) { + if (tween.isMainSequenceRoot()) { + tween.sequence.Stop(); + } + // do nothing with nested tween or sequence. The main sequence root will process it + } else { + tween.kill(); + } + return true; + }, false); + forceUpdateManagerIfTargetIsNull(onTarget); + return result; + } + + /// Completes all tweens and sequences.
+ /// If is provided, completes only tweens on this target (completing a tween inside a Sequence is not allowed).
+ /// The number of completed tweens. + public static int CompleteAll([CanBeNull] object onTarget = null) { + var result = PrimeTweenManager.processAll(onTarget, tween => { + if (tween.IsInSequence()) { + if (tween.isMainSequenceRoot()) { + tween.sequence.Complete(); + } + // do nothing with nested tween or sequence. The main sequence root will process it + } else { + tween.ForceComplete(); + } + return true; + }, false); + forceUpdateManagerIfTargetIsNull(onTarget); + return result; + } + + static void forceUpdateManagerIfTargetIsNull([CanBeNull] object onTarget) { + if (onTarget == null) { + var manager = PrimeTweenManager.Instance; + if (manager != null) { + if (manager.updateDepth == 0) { + manager.Update(); + manager.LateUpdate(); + manager.FixedUpdate(); + } + // Assert.AreEqual(0, manager.tweens.Count); // fails if user's OnComplete() creates new tweens + } + } + } + + /// Pauses/unpauses all tweens and sequences.
+ /// If is provided, pauses/unpauses only tweens on this target (pausing/unpausing a tween inside a Sequence is not allowed).
+ /// The number of paused/unpaused tweens. + public static int SetPausedAll(bool isPaused, [CanBeNull] object onTarget = null) { + if (isPaused) { + return PrimeTweenManager.processAll(onTarget, tween => { + return tween.trySetPause(true); + }, false); + } + return PrimeTweenManager.processAll(onTarget, tween => { + return tween.trySetPause(false); + }, false); + } + + /// Please note: delay may outlive the caller (the calling UnityEngine.Object may already be destroyed). + /// When using this overload, it's user's responsibility to ensure that is safe to execute once the delay is finished. + /// It's preferable to use the overload because it checks if the UnityEngine.Object target is still alive before calling the . + /// https://github.com/KyryloKuzyk/PrimeTween/discussions/4 + public static Tween Delay(float duration, [CanBeNull] Action onComplete = null, bool useUnscaledTime = false, bool warnIfTargetDestroyed = true) { + return delay(PrimeTweenManager.dummyTarget, duration, onComplete, useUnscaledTime, warnIfTargetDestroyed); + } + /// https://github.com/KyryloKuzyk/PrimeTween/discussions/4 + public static Tween Delay([NotNull] object target, float duration, [CanBeNull] Action onComplete = null, bool useUnscaledTime = false, bool warnIfTargetDestroyed = true) { + return delay(target, duration, onComplete, useUnscaledTime, warnIfTargetDestroyed); + } + static Tween delay([CanBeNull] object target, float duration, [CanBeNull] Action onComplete, bool useUnscaledTime, bool warnIfTargetDestroyed) { + var result = delay_internal(target, duration, useUnscaledTime); + if (onComplete != null) { + result?.tween.OnComplete(onComplete, warnIfTargetDestroyed); + } + return result ?? default; + } + + /// This is the most preferable overload of all Delay functions:
+ /// - It checks if UnityEngine.Object target is still alive before calling the callback.
+ /// - It allows to call any method on without producing garbage.
+ /// + /// + /// Tween.Delay(this, duration: 1f, onComplete: _this => { + /// // Please note: we're using '_this' variable from the onComplete callback. Calling DoSomething() directly will implicitly capture 'this' variable (creating a closure) and generate garbage. + /// _this.DoSomething(); + /// }); + /// + /// + /// https://github.com/KyryloKuzyk/PrimeTween/discussions/4 + public static Tween Delay([NotNull] T target, float duration, [NotNull] Action onComplete, bool useUnscaledTime = false, bool warnIfTargetDestroyed = true) where T : class { + var maybeDelay = delay_internal(target, duration, useUnscaledTime); + if (!maybeDelay.HasValue) { + return default; + } + var delay = maybeDelay.Value; + delay.tween.OnComplete(target, onComplete, warnIfTargetDestroyed); + return delay; + } + + static Tween? delay_internal([CanBeNull] object target, float duration, bool useUnscaledTime) { + PrimeTweenManager.checkDuration(target, duration); + return PrimeTweenManager.delayWithoutDurationCheck(target, duration, useUnscaledTime); + } + + public static Tween MaterialColor([NotNull] Material target, int propertyId, Color endValue, float duration, Ease ease = default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialColor(target, propertyId, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialColor([NotNull] Material target, int propertyId, Color endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialColor(target, propertyId, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialColor([NotNull] Material target, int propertyId, Color startValue, Color endValue, float duration, Ease ease = default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialColor(target, propertyId, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialColor([NotNull] Material target, int propertyId, Color startValue, Color endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialColor(target, propertyId, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialColor([NotNull] Material target, int propertyId, Color endValue, TweenSettings settings) => MaterialColor(target, propertyId, new TweenSettings(endValue, settings)); + public static Tween MaterialColor([NotNull] Material target, int propertyId, Color startValue, Color endValue, TweenSettings settings) => MaterialColor(target, propertyId, new TweenSettings(startValue, endValue, settings)); + public static Tween MaterialColor([NotNull] Material target, int propertyId, TweenSettings settings) { + return animateWithIntParam(target, propertyId, ref settings, + tween => (tween.target as Material).SetColor(tween.intParam, tween.ColorVal), + tween => (tween.target as Material).GetColor(tween.intParam).ToContainer(), TweenType.MaterialColorProperty); + } + + public static Tween MaterialProperty([NotNull] Material target, int propertyId, float endValue, float duration, Ease ease = default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialProperty(target, propertyId, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialProperty([NotNull] Material target, int propertyId, float endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialProperty(target, propertyId, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialProperty([NotNull] Material target, int propertyId, float startValue, float endValue, float duration, Ease ease = default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialProperty(target, propertyId, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialProperty([NotNull] Material target, int propertyId, float startValue, float endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialProperty(target, propertyId, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialProperty([NotNull] Material target, int propertyId, float endValue, TweenSettings settings) => MaterialProperty(target, propertyId, new TweenSettings(endValue, settings)); + public static Tween MaterialProperty([NotNull] Material target, int propertyId, float startValue, float endValue, TweenSettings settings) => MaterialProperty(target, propertyId, new TweenSettings(startValue, endValue, settings)); + public static Tween MaterialProperty([NotNull] Material target, int propertyId, TweenSettings settings) { + return animateWithIntParam(target, propertyId, ref settings, + tween => (tween.target as Material).SetFloat(tween.intParam, tween.FloatVal), + tween => (tween.target as Material).GetFloat(tween.intParam).ToContainer(), TweenType.MaterialProperty); + } + + public static Tween MaterialAlpha([NotNull] Material target, int propertyId, float endValue, float duration, Ease ease = default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialAlpha(target, propertyId, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialAlpha([NotNull] Material target, int propertyId, float endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialAlpha(target, propertyId, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialAlpha([NotNull] Material target, int propertyId, float startValue, float endValue, float duration, Ease ease = default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialAlpha(target, propertyId, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialAlpha([NotNull] Material target, int propertyId, float startValue, float endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialAlpha(target, propertyId, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialAlpha([NotNull] Material target, int propertyId, float endValue, TweenSettings settings) => MaterialAlpha(target, propertyId, new TweenSettings(endValue, settings)); + public static Tween MaterialAlpha([NotNull] Material target, int propertyId, float startValue, float endValue, TweenSettings settings) => MaterialAlpha(target, propertyId, new TweenSettings(startValue, endValue, settings)); + public static Tween MaterialAlpha([NotNull] Material target, int propertyId, TweenSettings settings) { + return animateWithIntParam(target, propertyId, ref settings, + tween => { + var _target = tween.target as Material; + var _propId = tween.intParam; + _target.SetColor(_propId, _target.GetColor(_propId).WithAlpha(tween.FloatVal)); + }, + tween => (tween.target as Material).GetColor(tween.intParam).a.ToContainer(), TweenType.MaterialAlphaProperty); + } + + public static Tween MaterialTextureOffset([NotNull] Material target, int propertyId, Vector2 endValue, float duration, Ease ease = default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialTextureOffset(target, propertyId, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialTextureOffset([NotNull] Material target, int propertyId, Vector2 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialTextureOffset(target, propertyId, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialTextureOffset([NotNull] Material target, int propertyId, Vector2 startValue, Vector2 endValue, float duration, Ease ease = default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialTextureOffset(target, propertyId, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialTextureOffset([NotNull] Material target, int propertyId, Vector2 startValue, Vector2 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialTextureOffset(target, propertyId, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialTextureOffset([NotNull] Material target, int propertyId, Vector2 endValue, TweenSettings settings) => MaterialTextureOffset(target, propertyId, new TweenSettings(endValue, settings)); + public static Tween MaterialTextureOffset([NotNull] Material target, int propertyId, Vector2 startValue, Vector2 endValue, TweenSettings settings) => MaterialTextureOffset(target, propertyId, new TweenSettings(startValue, endValue, settings)); + public static Tween MaterialTextureOffset([NotNull] Material target, int propertyId, TweenSettings settings) { + return animateWithIntParam(target, propertyId, ref settings, + tween => (tween.target as Material).SetTextureOffset(tween.intParam, tween.Vector2Val), + tween => (tween.target as Material).GetTextureOffset(tween.intParam).ToContainer(), TweenType.MaterialTextureOffset); + } + + public static Tween MaterialTextureScale([NotNull] Material target, int propertyId, Vector2 endValue, float duration, Ease ease = default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialTextureScale(target, propertyId, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialTextureScale([NotNull] Material target, int propertyId, Vector2 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialTextureScale(target, propertyId, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialTextureScale([NotNull] Material target, int propertyId, Vector2 startValue, Vector2 endValue, float duration, Ease ease = default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialTextureScale(target, propertyId, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialTextureScale([NotNull] Material target, int propertyId, Vector2 startValue, Vector2 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialTextureScale(target, propertyId, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialTextureScale([NotNull] Material target, int propertyId, Vector2 endValue, TweenSettings settings) => MaterialTextureScale(target, propertyId, new TweenSettings(endValue, settings)); + public static Tween MaterialTextureScale([NotNull] Material target, int propertyId, Vector2 startValue, Vector2 endValue, TweenSettings settings) => MaterialTextureScale(target, propertyId, new TweenSettings(startValue, endValue, settings)); + public static Tween MaterialTextureScale([NotNull] Material target, int propertyId, TweenSettings settings) { + return animateWithIntParam(target, propertyId, ref settings, + tween => (tween.target as Material).SetTextureScale(tween.intParam, tween.Vector2Val), + tween => (tween.target as Material).GetTextureScale(tween.intParam).ToContainer(), TweenType.MaterialTextureScale); + } + + public static Tween MaterialProperty([NotNull] Material target, int propertyId, Vector4 endValue, float duration, Ease ease = default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialProperty(target, propertyId, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialProperty([NotNull] Material target, int propertyId, Vector4 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialProperty(target, propertyId, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialProperty([NotNull] Material target, int propertyId, Vector4 startValue, Vector4 endValue, float duration, Ease ease = default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialProperty(target, propertyId, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialProperty([NotNull] Material target, int propertyId, Vector4 startValue, Vector4 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => MaterialProperty(target, propertyId, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween MaterialProperty([NotNull] Material target, int propertyId, Vector4 endValue, TweenSettings settings) => MaterialProperty(target, propertyId, new TweenSettings(endValue, settings)); + public static Tween MaterialProperty([NotNull] Material target, int propertyId, Vector4 startValue, Vector4 endValue, TweenSettings settings) => MaterialProperty(target, propertyId, new TweenSettings(startValue, endValue, settings)); + public static Tween MaterialProperty([NotNull] Material target, int propertyId, TweenSettings settings) { + return animateWithIntParam(target, propertyId, ref settings, + tween => (tween.target as Material).SetVector(tween.intParam, tween.Vector4Val), + tween => (tween.target as Material).GetVector(tween.intParam).ToContainer(), TweenType.MaterialPropertyVector4); + } + + // No 'startFromCurrent' overload because euler angles animation should always have the startValue to prevent ambiguous results + public static Tween EulerAngles([NotNull] Transform target, Vector3 startValue, Vector3 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => EulerAngles(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween EulerAngles([NotNull] Transform target, Vector3 startValue, Vector3 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => EulerAngles(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween EulerAngles([NotNull] Transform target, Vector3 startValue, Vector3 endValue, TweenSettings settings) => EulerAngles(target, new TweenSettings(startValue, endValue, settings)); + public static Tween EulerAngles([NotNull] Transform target, TweenSettings settings) { + validateEulerAnglesData(ref settings); + return animate(target, ref settings, _ => { (_.target as Transform).eulerAngles = _.Vector3Val; }, _ => (_.target as Transform).eulerAngles.ToContainer(), TweenType.EulerAngles); + } + + public static Tween LocalEulerAngles([NotNull] Transform target, Vector3 startValue, Vector3 endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalEulerAngles(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LocalEulerAngles([NotNull] Transform target, Vector3 startValue, Vector3 endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalEulerAngles(target, new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LocalEulerAngles([NotNull] Transform target, Vector3 startValue, Vector3 endValue, TweenSettings settings) => LocalEulerAngles(target, new TweenSettings(startValue, endValue, settings)); + public static Tween LocalEulerAngles([NotNull] Transform target, TweenSettings settings) { + validateEulerAnglesData(ref settings); + return animate(target, ref settings, _ => { (_.target as Transform).localEulerAngles = _.Vector3Val; }, _ => (_.target as Transform).localEulerAngles.ToContainer(), TweenType.LocalEulerAngles); + } + static void validateEulerAnglesData(ref TweenSettings settings) { + if (settings.startFromCurrent) { + settings.startFromCurrent = false; + Debug.LogWarning("Animating euler angles from the current value may produce unexpected results because there is more than one way to represent the current rotation using Euler angles.\n" + + "'" + nameof(TweenSettings.startFromCurrent) + "' was ignored.\n" + + "More info: https://docs.unity3d.com/ScriptReference/Transform-eulerAngles.html\n"); + } + } + + // Called from TweenGenerated.cs + public static Tween Scale([NotNull] Transform target, TweenSettings uniformScaleSettings) { + var remapped = new TweenSettings(uniformScaleSettings.startValue * Vector3.one, uniformScaleSettings.endValue * Vector3.one, uniformScaleSettings.settings) { startFromCurrent = uniformScaleSettings.startFromCurrent }; + return Scale(target, remapped); + } + public static Tween Rotation([NotNull] Transform target, TweenSettings eulerAnglesSettings) => Rotation(target, toQuaternion(eulerAnglesSettings)); + public static Tween LocalRotation([NotNull] Transform target, TweenSettings localEulerAnglesSettings) => LocalRotation(target, toQuaternion(localEulerAnglesSettings)); + static TweenSettings toQuaternion(TweenSettings s) => new TweenSettings(Quaternion.Euler(s.startValue), Quaternion.Euler(s.endValue), s.settings) { startFromCurrent = s.startFromCurrent }; + #if TEXT_MESH_PRO_INSTALLED + public static Tween TextMaxVisibleCharacters([NotNull] TMPro.TMP_Text target, TweenSettings settings) { + int oldCount = target.textInfo.characterCount; + target.ForceMeshUpdate(); + if (oldCount != target.textInfo.characterCount) { + Debug.LogWarning("Please call TMP_Text.ForceMeshUpdate() before animating maxVisibleCharacters."); + } + var floatSettings = new TweenSettings(settings.startValue, settings.endValue, settings.settings); + return animateIntAsFloat(target, ref floatSettings, _tween => { + var _target = _tween.target as TMPro.TMP_Text; + _target.maxVisibleCharacters = Mathf.RoundToInt(_tween.FloatVal); + }, t => new ValueContainer { FloatVal = (t.target as TMPro.TMP_Text).maxVisibleCharacters }, TweenType.TextMaxVisibleCharacters); + } + // todo fix this correctly + static Tween animateIntAsFloat(object target, ref TweenSettings settings, [NotNull] Action setter, Func getter, TweenType _tweenType) { + var tween = PrimeTweenManager.fetchTween(); + tween.startValue.CopyFrom(ref settings.startValue); + tween.endValue.CopyFrom(ref settings.endValue); + tween.Setup(target, ref settings.settings, setter, getter, settings.startFromCurrent, _tweenType); + return PrimeTweenManager.Animate(tween); + } + #endif + + // not generated automatically because GlobalTimeScale() should have 'useUnscaledTime: true' + public static Tween GlobalTimeScale(Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0) + => GlobalTimeScale(new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, true))); + public static Tween GlobalTimeScale(Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0) + => GlobalTimeScale(new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, true))); + public static Tween GlobalTimeScale(Single startValue, Single endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0) + => GlobalTimeScale(new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, true))); + public static Tween GlobalTimeScale(Single startValue, Single endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0) + => GlobalTimeScale(new TweenSettings(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, true))); + public static Tween GlobalTimeScale(Single endValue, TweenSettings settings) => GlobalTimeScale(new TweenSettings(endValue, settings)); + public static Tween GlobalTimeScale(Single startValue, Single endValue, TweenSettings settings) => GlobalTimeScale(new TweenSettings(startValue, endValue, settings)); + public static Tween GlobalTimeScale(TweenSettings settings) { + clampTimescale(ref settings.startValue); + clampTimescale(ref settings.endValue); + if (!settings.settings.useUnscaledTime) { + Debug.LogWarning("Setting " + nameof(TweenSettings.useUnscaledTime) + " to true to animate Time.timeScale correctly."); + settings.settings.useUnscaledTime = true; + } + return animate(PrimeTweenManager.dummyTarget, ref settings, t => Time.timeScale = t.FloatVal, _ => Time.timeScale.ToContainer(), TweenType.GlobalTimeScale); + + void clampTimescale(ref float value) { + if (value < 0) { + Debug.LogError($"timeScale should be >= 0, but was {value}"); + value = 0; + } + } + } + + public static Tween TweenTimeScale(Tween tween, TweenSettings settings) => AnimateTimeScale(tween, settings, TweenType.TweenTimeScale); + static Tween AnimateTimeScale(Tween tween, TweenSettings settings, TweenType tweenType) { + if (!tween.tryManipulate()) { + return default; + } + var result = animate(tween.tween, ref settings, t => { + var target = t.target as ReusableTween; + if (t.longParam != target.id || !target._isAlive) { + t.EmergencyStop(); + return; + } + target.timeScale = t.FloatVal; + }, t => (t.target as ReusableTween).timeScale.ToContainer(), tweenType); + Assert.IsTrue(result.isAlive); + result.tween.longParam = tween.id; + return result; + } + public static Tween TweenTimeScale(Sequence sequence, TweenSettings settings) => AnimateTimeScale(sequence.root, settings, TweenType.TweenTimeScaleSequence); + + public static Tween RotationAtSpeed([NotNull] Transform target, Vector3 endValue, float averageAngularSpeed, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => RotationAtSpeed(target, new TweenSettings(endValue, new TweenSettings(averageAngularSpeed, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween RotationAtSpeed([NotNull] Transform target, Vector3 endValue, float averageAngularSpeed, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => RotationAtSpeed(target, new TweenSettings(endValue, new TweenSettings(averageAngularSpeed, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween RotationAtSpeed([NotNull] Transform target, Vector3 startValue, Vector3 endValue, float averageAngularSpeed, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => RotationAtSpeed(target, new TweenSettings(startValue, endValue, new TweenSettings(averageAngularSpeed, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween RotationAtSpeed([NotNull] Transform target, Vector3 startValue, Vector3 endValue, float averageAngularSpeed, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => RotationAtSpeed(target, new TweenSettings(startValue, endValue, new TweenSettings(averageAngularSpeed, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + static Tween RotationAtSpeed([NotNull] Transform target, TweenSettings settingsVector3) { + var settings = toQuaternion(settingsVector3); + var speed = settings.settings.duration; + if (speed <= 0) { + Debug.LogError($"Invalid speed provided to the Tween.{nameof(RotationAtSpeed)}() method: {speed}."); + return default; + } + if (settings.startFromCurrent) { + settings.startFromCurrent = false; + settings.startValue = target.rotation; + } + settings.settings.duration = Extensions.CalcDistance(settings.startValue, settings.endValue) / speed; + return Rotation(target, settings); + } + + public static Tween LocalRotationAtSpeed([NotNull] Transform target, Vector3 endValue, float averageAngularSpeed, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalRotationAtSpeed(target, new TweenSettings(endValue, new TweenSettings(averageAngularSpeed, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LocalRotationAtSpeed([NotNull] Transform target, Vector3 endValue, float averageAngularSpeed, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalRotationAtSpeed(target, new TweenSettings(endValue, new TweenSettings(averageAngularSpeed, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LocalRotationAtSpeed([NotNull] Transform target, Vector3 startValue, Vector3 endValue, float averageAngularSpeed, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalRotationAtSpeed(target, new TweenSettings(startValue, endValue, new TweenSettings(averageAngularSpeed, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + public static Tween LocalRotationAtSpeed([NotNull] Transform target, Vector3 startValue, Vector3 endValue, float averageAngularSpeed, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) + => LocalRotationAtSpeed(target, new TweenSettings(startValue, endValue, new TweenSettings(averageAngularSpeed, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); + static Tween LocalRotationAtSpeed([NotNull] Transform target, TweenSettings settingsVector3) { + var settings = toQuaternion(settingsVector3); + var speed = settings.settings.duration; + if (speed <= 0) { + Debug.LogError($"Invalid speed provided to the Tween.{nameof(LocalRotationAtSpeed)}() method: {speed}."); + return default; + } + if (settings.startFromCurrent) { + settings.startFromCurrent = false; + settings.startValue = target.localRotation; + } + settings.settings.duration = Extensions.CalcDistance(settings.startValue, settings.endValue) / speed; + return LocalRotation(target, settings); + } + } +} diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/TweenMethods.cs.meta b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/TweenMethods.cs.meta new file mode 100644 index 00000000..0cf732b6 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/TweenMethods.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 964bf290d93964b8b9ab9ba1b3e231c7 +timeCreated: 1672225881 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/Utils.cs b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/Utils.cs new file mode 100644 index 00000000..4d818a59 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/Utils.cs @@ -0,0 +1,263 @@ +using System; +using PrimeTween; + +internal static class Utils { + internal static (PropType, Type) TweenTypeToTweenData(TweenType tweenType) { + switch (tweenType) { + case TweenType.LightRange: + return (PropType.Float, typeof(UnityEngine.Light)); + case TweenType.LightShadowStrength: + return (PropType.Float, typeof(UnityEngine.Light)); + case TweenType.LightIntensity: + return (PropType.Float, typeof(UnityEngine.Light)); + case TweenType.LightColor: + return (PropType.Color, typeof(UnityEngine.Light)); + case TweenType.CameraOrthographicSize: + return (PropType.Float, typeof(UnityEngine.Camera)); + case TweenType.CameraBackgroundColor: + return (PropType.Color, typeof(UnityEngine.Camera)); + case TweenType.CameraAspect: + return (PropType.Float, typeof(UnityEngine.Camera)); + case TweenType.CameraFarClipPlane: + return (PropType.Float, typeof(UnityEngine.Camera)); + case TweenType.CameraFieldOfView: + return (PropType.Float, typeof(UnityEngine.Camera)); + case TweenType.CameraNearClipPlane: + return (PropType.Float, typeof(UnityEngine.Camera)); + case TweenType.CameraPixelRect: + return (PropType.Rect, typeof(UnityEngine.Camera)); + case TweenType.CameraRect: + return (PropType.Rect, typeof(UnityEngine.Camera)); + case TweenType.LocalRotation: + return (PropType.Vector3, typeof(UnityEngine.Transform)); + case TweenType.ScaleUniform: + return (PropType.Float, typeof(UnityEngine.Transform)); + case TweenType.Rotation: + return (PropType.Vector3, typeof(UnityEngine.Transform)); + case TweenType.Position: + return (PropType.Vector3, typeof(UnityEngine.Transform)); + case TweenType.PositionX: + return (PropType.Float, typeof(UnityEngine.Transform)); + case TweenType.PositionY: + return (PropType.Float, typeof(UnityEngine.Transform)); + case TweenType.PositionZ: + return (PropType.Float, typeof(UnityEngine.Transform)); + case TweenType.LocalPosition: + return (PropType.Vector3, typeof(UnityEngine.Transform)); + case TweenType.LocalPositionX: + return (PropType.Float, typeof(UnityEngine.Transform)); + case TweenType.LocalPositionY: + return (PropType.Float, typeof(UnityEngine.Transform)); + case TweenType.LocalPositionZ: + return (PropType.Float, typeof(UnityEngine.Transform)); + case TweenType.RotationQuaternion: + return (PropType.Quaternion, typeof(UnityEngine.Transform)); + case TweenType.LocalRotationQuaternion: + return (PropType.Quaternion, typeof(UnityEngine.Transform)); + case TweenType.Scale: + return (PropType.Vector3, typeof(UnityEngine.Transform)); + case TweenType.ScaleX: + return (PropType.Float, typeof(UnityEngine.Transform)); + case TweenType.ScaleY: + return (PropType.Float, typeof(UnityEngine.Transform)); + case TweenType.ScaleZ: + return (PropType.Float, typeof(UnityEngine.Transform)); + case TweenType.Color: + return (PropType.Color, typeof(UnityEngine.SpriteRenderer)); + case TweenType.Alpha: + return (PropType.Float, typeof(UnityEngine.SpriteRenderer)); + case TweenType.TweenTimeScale: + return (PropType.Float, typeof(PrimeTween.Tween)); + case TweenType.TweenTimeScaleSequence: + return (PropType.Float, typeof(PrimeTween.Sequence)); + #if !UNITY_2019_1_OR_NEWER || UNITY_UGUI_INSTALLED + case TweenType.UISliderValue: + return (PropType.Float, typeof(UnityEngine.UI.Slider)); + case TweenType.UINormalizedPosition: + return (PropType.Vector2, typeof(UnityEngine.UI.ScrollRect)); + case TweenType.UIHorizontalNormalizedPosition: + return (PropType.Float, typeof(UnityEngine.UI.ScrollRect)); + case TweenType.UIVerticalNormalizedPosition: + return (PropType.Float, typeof(UnityEngine.UI.ScrollRect)); + case TweenType.UIPivotX: + return (PropType.Float, typeof(UnityEngine.RectTransform)); + case TweenType.UIPivotY: + return (PropType.Float, typeof(UnityEngine.RectTransform)); + case TweenType.UIPivot: + return (PropType.Vector2, typeof(UnityEngine.RectTransform)); + case TweenType.UIAnchorMax: + return (PropType.Vector2, typeof(UnityEngine.RectTransform)); + case TweenType.UIAnchorMin: + return (PropType.Vector2, typeof(UnityEngine.RectTransform)); + case TweenType.UIAnchoredPosition3D: + return (PropType.Vector3, typeof(UnityEngine.RectTransform)); + case TweenType.UIAnchoredPosition3DX: + return (PropType.Float, typeof(UnityEngine.RectTransform)); + case TweenType.UIAnchoredPosition3DY: + return (PropType.Float, typeof(UnityEngine.RectTransform)); + case TweenType.UIAnchoredPosition3DZ: + return (PropType.Float, typeof(UnityEngine.RectTransform)); + case TweenType.UIEffectDistance: + return (PropType.Vector2, typeof(UnityEngine.UI.Shadow)); + case TweenType.UIAlphaShadow: + return (PropType.Float, typeof(UnityEngine.UI.Shadow)); + case TweenType.UIColorShadow: + return (PropType.Color, typeof(UnityEngine.UI.Shadow)); + case TweenType.UIPreferredSize: + return (PropType.Vector2, typeof(UnityEngine.UI.LayoutElement)); + case TweenType.UIPreferredWidth: + return (PropType.Float, typeof(UnityEngine.UI.LayoutElement)); + case TweenType.UIPreferredHeight: + return (PropType.Float, typeof(UnityEngine.UI.LayoutElement)); + case TweenType.UIFlexibleSize: + return (PropType.Vector2, typeof(UnityEngine.UI.LayoutElement)); + case TweenType.UIFlexibleWidth: + return (PropType.Float, typeof(UnityEngine.UI.LayoutElement)); + case TweenType.UIFlexibleHeight: + return (PropType.Float, typeof(UnityEngine.UI.LayoutElement)); + case TweenType.UIMinSize: + return (PropType.Vector2, typeof(UnityEngine.UI.LayoutElement)); + case TweenType.UIMinWidth: + return (PropType.Float, typeof(UnityEngine.UI.LayoutElement)); + case TweenType.UIMinHeight: + return (PropType.Float, typeof(UnityEngine.UI.LayoutElement)); + case TweenType.UIColorGraphic: + return (PropType.Color, typeof(UnityEngine.UI.Graphic)); + case TweenType.UIAnchoredPosition: + return (PropType.Vector2, typeof(UnityEngine.RectTransform)); + case TweenType.UIAnchoredPositionX: + return (PropType.Float, typeof(UnityEngine.RectTransform)); + case TweenType.UIAnchoredPositionY: + return (PropType.Float, typeof(UnityEngine.RectTransform)); + case TweenType.UISizeDelta: + return (PropType.Vector2, typeof(UnityEngine.RectTransform)); + case TweenType.UIAlphaCanvasGroup: + return (PropType.Float, typeof(UnityEngine.CanvasGroup)); + case TweenType.UIAlphaGraphic: + return (PropType.Float, typeof(UnityEngine.UI.Graphic)); + case TweenType.UIFillAmount: + return (PropType.Float, typeof(UnityEngine.UI.Image)); + case TweenType.UIOffsetMin: + return (PropType.Vector2, typeof(UnityEngine.RectTransform)); + case TweenType.UIOffsetMinX: + return (PropType.Float, typeof(UnityEngine.RectTransform)); + case TweenType.UIOffsetMinY: + return (PropType.Float, typeof(UnityEngine.RectTransform)); + case TweenType.UIOffsetMax: + return (PropType.Vector2, typeof(UnityEngine.RectTransform)); + case TweenType.UIOffsetMaxX: + return (PropType.Float, typeof(UnityEngine.RectTransform)); + case TweenType.UIOffsetMaxY: + return (PropType.Float, typeof(UnityEngine.RectTransform)); + #endif + #if !UNITY_2019_1_OR_NEWER || PHYSICS_MODULE_INSTALLED + case TweenType.RigidbodyMovePosition: + return (PropType.Vector3, typeof(UnityEngine.Rigidbody)); + case TweenType.RigidbodyMoveRotation: + return (PropType.Quaternion, typeof(UnityEngine.Rigidbody)); + #endif + #if !UNITY_2019_1_OR_NEWER || PHYSICS2D_MODULE_INSTALLED + case TweenType.RigidbodyMovePosition2D: + return (PropType.Vector2, typeof(UnityEngine.Rigidbody2D)); + case TweenType.RigidbodyMoveRotation2D: + return (PropType.Float, typeof(UnityEngine.Rigidbody2D)); + #endif + case TweenType.MaterialColor: + return (PropType.Color, typeof(UnityEngine.Material)); + case TweenType.MaterialAlpha: + return (PropType.Float, typeof(UnityEngine.Material)); + case TweenType.MaterialMainTextureOffset: + return (PropType.Vector2, typeof(UnityEngine.Material)); + case TweenType.MaterialMainTextureScale: + return (PropType.Vector2, typeof(UnityEngine.Material)); + #if !UNITY_2019_1_OR_NEWER || AUDIO_MODULE_INSTALLED + case TweenType.AudioVolume: + return (PropType.Float, typeof(UnityEngine.AudioSource)); + case TweenType.AudioPitch: + return (PropType.Float, typeof(UnityEngine.AudioSource)); + case TweenType.AudioPanStereo: + return (PropType.Float, typeof(UnityEngine.AudioSource)); + #endif + #if UI_ELEMENTS_MODULE_INSTALLED + case TweenType.VisualElementLayout: + return (PropType.Rect, typeof(UnityEngine.UIElements.VisualElement)); + case TweenType.VisualElementPosition: + return (PropType.Vector3, typeof(UnityEngine.UIElements.ITransform)); + case TweenType.VisualElementRotationQuaternion: + return (PropType.Quaternion, typeof(UnityEngine.UIElements.ITransform)); + case TweenType.VisualElementScale: + return (PropType.Vector3, typeof(UnityEngine.UIElements.ITransform)); + case TweenType.VisualElementSize: + return (PropType.Vector2, typeof(UnityEngine.UIElements.VisualElement)); + case TweenType.VisualElementTopLeft: + return (PropType.Vector2, typeof(UnityEngine.UIElements.VisualElement)); + case TweenType.VisualElementColor: + return (PropType.Color, typeof(UnityEngine.UIElements.VisualElement)); + case TweenType.VisualElementBackgroundColor: + return (PropType.Color, typeof(UnityEngine.UIElements.VisualElement)); + #endif + #if TEXT_MESH_PRO_INSTALLED + case TweenType.TextMaxVisibleCharacters: + return (PropType.Int, typeof(TMPro.TMP_Text)); + case TweenType.TextFontSize: + return (PropType.Float, typeof(TMPro.TMP_Text)); + #endif + case TweenType.None: + return (PropType.None, null); + case TweenType.Delay: + return (PropType.Float, null); + case TweenType.Callback: + return (PropType.Float, null); + case TweenType.ShakeLocalPosition: + return (PropType.Vector3, typeof(UnityEngine.Transform)); + case TweenType.ShakeLocalRotation: + return (PropType.Quaternion, typeof(UnityEngine.Transform)); + case TweenType.ShakeScale: + return (PropType.Vector3, typeof(UnityEngine.Transform)); + case TweenType.ShakeCustom: + return (PropType.Vector3, typeof(UnityEngine.Transform)); + case TweenType.ShakeCamera: + return (PropType.Float, typeof(UnityEngine.Camera)); + case TweenType.CustomFloat: + return (PropType.Float, null); + case TweenType.CustomColor: + return (PropType.Color, null); + case TweenType.CustomVector2: + return (PropType.Vector2, null); + case TweenType.CustomVector3: + return (PropType.Vector3, null); + case TweenType.CustomVector4: + return (PropType.Vector4, null); + case TweenType.CustomQuaternion: + return (PropType.Quaternion, null); + case TweenType.CustomRect: + return (PropType.Rect, null); + case TweenType.CustomDouble: + return (PropType.Double, null); + case TweenType.MaterialColorProperty: + return (PropType.Color, typeof(UnityEngine.Material)); + case TweenType.MaterialProperty: + return (PropType.Float, typeof(UnityEngine.Material)); + case TweenType.MaterialAlphaProperty: + return (PropType.Float, typeof(UnityEngine.Material)); + case TweenType.MaterialTextureOffset: + return (PropType.Vector2, typeof(UnityEngine.Material)); + case TweenType.MaterialTextureScale: + return (PropType.Vector2, typeof(UnityEngine.Material)); + case TweenType.MaterialPropertyVector4: + return (PropType.Vector4, typeof(UnityEngine.Material)); + case TweenType.EulerAngles: + return (PropType.Vector3, typeof(UnityEngine.Transform)); + case TweenType.LocalEulerAngles: + return (PropType.Vector3, typeof(UnityEngine.Transform)); + case TweenType.GlobalTimeScale: + return (PropType.Float, null); + case TweenType.MainSequence: + return (PropType.Float, null); + case TweenType.NestedSequence: + return (PropType.Float, null); + default: + throw new Exception(); + } + } +} diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/Utils.cs.meta b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/Utils.cs.meta new file mode 100644 index 00000000..9a0e5b63 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/Utils.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 7f3bfd9524c14644bfbab698076886f3 +timeCreated: 1711272020 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/ValueContainer.cs b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/ValueContainer.cs new file mode 100644 index 00000000..f4971cad --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/ValueContainer.cs @@ -0,0 +1,96 @@ +using System; +using System.Runtime.InteropServices; +using UnityEngine; + +namespace PrimeTween { + [Serializable] + internal struct ValueContainerStartEnd { + [SerializeField] internal TweenType tweenType; // todo HideInInspector? + [SerializeField, Tooltip(Constants.startFromCurrentTooltip)] internal bool startFromCurrent; + [SerializeField, Tooltip(Constants.startValueTooltip)] internal ValueContainer startValue; + [SerializeField, Tooltip(Constants.endValueTooltip)] internal ValueContainer endValue; + } + + [Serializable, StructLayout(LayoutKind.Explicit)] + internal struct ValueContainer { + // todo check if it was possible to modify ValueContainer in Debug Inspector before + [FieldOffset(sizeof(float) * 0), SerializeField] internal float x; + [FieldOffset(sizeof(float) * 1), SerializeField] internal float y; + [FieldOffset(sizeof(float) * 2), SerializeField] internal float z; + [FieldOffset(sizeof(float) * 3), SerializeField] internal float w; + [FieldOffset(0), NonSerialized] internal float FloatVal; + [FieldOffset(0), NonSerialized] internal Color ColorVal; + [FieldOffset(0), NonSerialized] internal Vector2 Vector2Val; + [FieldOffset(0), NonSerialized] internal Vector3 Vector3Val; + [FieldOffset(0), NonSerialized] internal Vector4 Vector4Val; + [FieldOffset(0), NonSerialized] internal Quaternion QuaternionVal; + [FieldOffset(0), NonSerialized] internal Rect RectVal; + [FieldOffset(0), NonSerialized] internal double DoubleVal; + + internal void CopyFrom(ref float val) { + x = val; + y = 0f; + z = 0f; + w = 0f; + } + + internal void CopyFrom(ref Color val) { + x = val.r; + y = val.g; + z = val.b; + w = val.a; + } + + internal void CopyFrom(ref Vector2 val) { + x = val.x; + y = val.y; + z = 0f; + w = 0f; + } + + internal void CopyFrom(ref Vector3 val) { + x = val.x; + y = val.y; + z = val.z; + w = 0f; + } + + internal void CopyFrom(ref Vector4 val) { + x = val.x; + y = val.y; + z = val.z; + w = val.w; + } + + internal void CopyFrom(ref Rect val) { + x = val.x; + y = val.y; + z = val.width; + w = val.height; + } + + internal void CopyFrom(ref Quaternion val) { + x = val.x; + y = val.y; + z = val.z; + w = val.w; + } + + internal void CopyFrom(ref double val) { + DoubleVal = val; + z = 0f; + w = 0f; + } + + internal void Reset() { + x = y = z = w = 0f; + } + + internal float this[int i] { + get => Vector4Val[i]; + set => Vector4Val[i] = value; + } + + public override string ToString() => Vector4Val.ToString(); + } +} diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/ValueContainer.cs.meta b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/ValueContainer.cs.meta new file mode 100644 index 00000000..70d5f692 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Internal/ValueContainer.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 483fe305105a484489884630559c0d62 +timeCreated: 1676455173 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/PrimeTween.Runtime.asmdef b/FactoryNumeric/Packages/PrimeTween/Runtime/PrimeTween.Runtime.asmdef new file mode 100644 index 00000000..93227322 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/PrimeTween.Runtime.asmdef @@ -0,0 +1,52 @@ +{ + "name": "PrimeTween.Runtime", + "rootNamespace": "", + "references": [ + "Unity.TextMeshPro" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": true, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [ + { + "name": "com.unity.ugui", + "expression": "1.0.0", + "define": "UNITY_UGUI_INSTALLED" + }, + { + "name": "com.unity.modules.audio", + "expression": "1.0.0", + "define": "AUDIO_MODULE_INSTALLED" + }, + { + "name": "com.unity.modules.physics", + "expression": "1.0.0", + "define": "PHYSICS_MODULE_INSTALLED" + }, + { + "name": "com.unity.modules.physics2d", + "expression": "1.0.0", + "define": "PHYSICS2D_MODULE_INSTALLED" + }, + { + "name": "com.unity.modules.uielements", + "expression": "1.0.0", + "define": "UI_ELEMENTS_MODULE_INSTALLED" + }, + { + "name": "com.unity.textmeshpro", + "expression": "1.0.0", + "define": "TEXT_MESH_PRO_INSTALLED" + }, + { + "name": "com.unity.ugui", + "expression": "2.0.0", + "define": "TEXT_MESH_PRO_INSTALLED" + } + ], + "noEngineReferences": false +} \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/PrimeTween.Runtime.asmdef.meta b/FactoryNumeric/Packages/PrimeTween/Runtime/PrimeTween.Runtime.asmdef.meta new file mode 100644 index 00000000..eea2af12 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/PrimeTween.Runtime.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 80ecb87cae9c44d19824e70ea7229748 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/PrimeTweenConfig.cs b/FactoryNumeric/Packages/PrimeTween/Runtime/PrimeTweenConfig.cs new file mode 100644 index 00000000..ea7f723d --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/PrimeTweenConfig.cs @@ -0,0 +1,106 @@ +using JetBrains.Annotations; +using UnityEngine; + +namespace PrimeTween { + /// Global PrimeTween configuration. + [PublicAPI] + public static partial class PrimeTweenConfig { + internal static PrimeTweenManager Instance { + get { + #if UNITY_EDITOR + Assert.IsFalse(Constants.noInstance, Constants.editModeWarning); + #endif + return PrimeTweenManager.Instance; + } + } + + /// + /// If instance is already created, will allocate garbage, + /// so it's recommended to use it when no active gameplay is happening. For example, on game launch or when loading a level. + /// To set initial capacity before is created, call from a method + /// with and . See example below. + /// + /// + /// + /// [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSplashScreen)] + /// static void beforeSplashScreen() { + /// PrimeTweenConfig.SetTweensCapacity(42); + /// } + /// + /// + public static void SetTweensCapacity(int capacity) { + Assert.IsTrue(capacity >= 0); + var instance = PrimeTweenManager.Instance; // should use PrimeTweenManager.Instance because Instance property has a built-in null check + if (instance == null) { + PrimeTweenManager.customInitialCapacity = capacity; + } else { + instance.SetTweensCapacity(capacity); + } + } + + public static Ease defaultEase { + get => Instance.defaultEase; + set { + if (value == Ease.Custom || value == Ease.Default) { + Debug.LogError("defaultEase can't be Ease.Custom or Ease.Default."); + return; + } + Instance.defaultEase = value; + } + } + + public static UpdateType defaultUpdateType { + get => new UpdateType(Instance.defaultUpdateType); + set { + if (value == UpdateType.Default) { + Debug.LogError(nameof(defaultUpdateType) + " can't be " + nameof(_UpdateType.Default) + "."); + return; + } + Instance.defaultUpdateType = value.enumValue; + } + } + + public static bool warnTweenOnDisabledTarget { + set => Instance.warnTweenOnDisabledTarget = value; + } + + public static bool warnZeroDuration { + internal get => Instance.warnZeroDuration; + set => Instance.warnZeroDuration = value; + } + + public static bool warnStructBoxingAllocationInCoroutine { + set => Instance.warnStructBoxingAllocationInCoroutine = value; + } + + public static bool validateCustomCurves { + set => Instance.validateCustomCurves = value; + } + + public static bool warnBenchmarkWithAsserts { + set => Instance.warnBenchmarkWithAsserts = value; + } + + internal const bool defaultUseUnscaledTimeForShakes = false; + + public static bool warnEndValueEqualsCurrent { + set => Instance.warnEndValueEqualsCurrent = value; + } + + #if PRIME_TWEEN_EXPERIMENTAL + public + #endif + static void ManualUpdate(UpdateType updateType, float? deltaTime = null, float? unscaledDeltaTime = null) { + Instance.enabled = false; + Instance.UpdateTweens(updateType.enumValue, deltaTime, unscaledDeltaTime); + } + + #if PRIME_TWEEN_EXPERIMENTAL + public + #endif + static void ManualUpdateApplyStartValues(UpdateType updateType) { + Instance.enabled = false; + Instance.ApplyStartValues(updateType.enumValue); + } + } +} diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/PrimeTweenConfig.cs.meta b/FactoryNumeric/Packages/PrimeTween/Runtime/PrimeTweenConfig.cs.meta new file mode 100644 index 00000000..e2317866 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/PrimeTweenConfig.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 9a87535e581e4e4a85e83b154ee80edb +timeCreated: 1679991780 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Sequence.cs b/FactoryNumeric/Packages/PrimeTween/Runtime/Sequence.cs new file mode 100644 index 00000000..eda036dc --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Sequence.cs @@ -0,0 +1,617 @@ +#if PRIME_TWEEN_SAFETY_CHECKS && UNITY_ASSERTIONS +#define SAFETY_CHECKS +#endif +#if PRIME_TWEEN_INSPECTOR_DEBUGGING && UNITY_EDITOR +#define ENABLE_SERIALIZATION +#endif +using System; +using System.Collections.Generic; +using System.Linq; +using JetBrains.Annotations; +using UnityEngine; + +namespace PrimeTween { + /// An ordered group of tweens and callbacks. Tweens in a sequence can run in parallel to one another with and sequentially with .
+ /// To make tweens in a Sequence overlap each other, use and .
+ /// + /// Sequence.Create() + /// .Group(Tween.PositionX(transform, endValue: 10f, duration: 1.5f)) + /// .Group(Tween.Scale(transform, endValue: 2f, duration: 0.5f)) // position and localScale tweens will run in parallel because they are 'grouped' + /// .Chain(Tween.Rotation(transform, endValue: new Vector3(0f, 0f, 45f), duration: 1f)) // rotation tween is 'chained' so it will start when both previous tweens are finished (after 1.5 seconds) + /// .ChainCallback(() => Debug.Log("Sequence completed")); + /// + #if ENABLE_SERIALIZATION + [Serializable] + #endif + public + #if !ENABLE_SERIALIZATION && UNITY_2020_3_OR_NEWER + readonly // duration setter produces error in Unity <= 2019.4.40: error CS1604: Cannot assign to 'this' because it is read-only + #endif + partial struct Sequence : IEquatable { + const int emptySequenceTag = -43; + internal + #if !ENABLE_SERIALIZATION && UNITY_2020_3_OR_NEWER + readonly + #endif + Tween root; + internal bool IsCreated => root.IsCreated; + long id => root.id; + + /// Sequence is 'alive' when any of its tweens is 'alive'. + public bool isAlive => root.isAlive; + + /// Elapsed time of the current cycle. + public float elapsedTime { + get => root.elapsedTime; + set => root.elapsedTime = value; + } + + /// The total number of cycles. Returns -1 to indicate infinite number cycles. + public int cyclesTotal => root.cyclesTotal; + public int cyclesDone => root.cyclesDone; + /// The duration of one cycle. + public float duration { + get => root.duration; + private set { + Assert.IsTrue(isAlive); + Assert.IsTrue(root.tween.isMainSequenceRoot()); + var rootTween = root.tween; + Assert.AreEqual(0f, elapsedTimeTotal); + Assert.IsTrue(value >= rootTween.cycleDuration); + Assert.IsTrue(value >= rootTween.settings.duration); + Assert.AreEqual(0f, rootTween.settings.startDelay); + Assert.AreEqual(0f, rootTween.settings.endDelay); + rootTween.settings.duration = value; + rootTween.cycleDuration = value; + } + } + + /// Elapsed time of all cycles. + public float elapsedTimeTotal { + get => root.elapsedTimeTotal; + set => root.elapsedTimeTotal = value; + } + + /// The duration of all cycles. If cycles == -1, returns . + public float durationTotal => root.durationTotal; + + /// Normalized progress of the current cycle expressed in 0..1 range. + public float progress { + get => root.progress; + set => root.progress = value; + } + + /// Normalized progress of all cycles expressed in 0..1 range. + public float progressTotal { + get => root.progressTotal; + set => root.progressTotal = value; + } + + bool tryManipulate() => root.tryManipulate(); + + bool ValidateCanManipulateSequence() { + if (!tryManipulate()) { + return false; + } + if (root.elapsedTimeTotal != 0f) { + Debug.LogError(Constants.animationAlreadyStarted); + return false; + } + return true; + } + + public static Sequence Create(int cycles = 1, CycleMode cycleMode = CycleMode.Restart, Ease sequenceEase = Ease.Linear, bool useUnscaledTime = false, UpdateType updateType = default) { + #if UNITY_EDITOR + if (Constants.warnNoInstance) { + return default; + } + #endif + var tween = PrimeTweenManager.fetchTween(); + if (cycleMode == CycleMode.Incremental) { + Debug.LogError($"Sequence doesn't support CycleMode.Incremental. Parameter {nameof(sequenceEase)} is applied to the sequence's 'timeline', and incrementing the 'timeline' doesn't make sense. For the same reason, {nameof(sequenceEase)} is clamped to [0:1] range."); + cycleMode = CycleMode.Restart; + } + if (sequenceEase == Ease.Custom) { + Debug.LogError("Sequence doesn't support Ease.Custom."); + sequenceEase = Ease.Linear; + } + if (sequenceEase == Ease.Default) { // todo this is questionable + sequenceEase = Ease.Linear; + } + var settings = new TweenSettings(0f, sequenceEase, cycles, cycleMode, 0f, 0f, useUnscaledTime, updateType); + tween.Setup(PrimeTweenManager.dummyTarget, ref settings, _ => {}, null, false, TweenType.MainSequence); + tween.intParam = emptySequenceTag; + var root = PrimeTweenManager.addTween(tween); + Assert.IsTrue(root.isAlive); + return new Sequence(root); + } + + public static Sequence Create(Tween firstTween) { + #if UNITY_EDITOR + if (Constants.warnNoInstance) { + return default; + } + #endif + return Create().Group(firstTween); + } + + Sequence(Tween rootTween) { + root = rootTween; + setSequence(rootTween); + Assert.IsTrue(isAlive); + Assert.AreEqual(0f, duration); + Assert.IsTrue(durationTotal == 0f || float.IsPositiveInfinity(durationTotal)); + } + + /// Groups with the 'previous' animation in this Sequence.
+ /// The 'previous' animation is the animation used in the preceding Group/Chain/Insert() method call.
+ /// Grouped animations start at the same time and run in parallel.
+ public Sequence Group(Tween tween) { + if (tryManipulate()) { + Insert(getLastInSelfOrRoot().tween.waitDelay, tween); + } + return this; + } + + void addLinkedReference(Tween tween) { + Tween last; + if (root.tween.next.IsCreated) { + last = getLast(); + var lastInSelf = getLastInSelfOrRoot(); + Assert.AreNotEqual(root.id, lastInSelf.id); + Assert.IsFalse(lastInSelf.tween.nextSibling.IsCreated); + lastInSelf.tween.nextSibling = tween; + Assert.IsFalse(tween.tween.prevSibling.IsCreated); + tween.tween.prevSibling = lastInSelf; + } else { + last = root; + } + + Assert.IsFalse(last.tween.next.IsCreated); + Assert.IsFalse(tween.tween.prev.IsCreated); + last.tween.next = tween; + tween.tween.prev = last; + root.tween.intParam = emptySequenceTag - emptySequenceTag; // set to 0 in a way to be able to search the code better + } + + Tween getLast() { + Tween result = default; + foreach (var current in getAllTweens()) { + result = current; + } + Assert.IsTrue(result.IsCreated); + Assert.IsFalse(result.tween.next.IsCreated); + return result; + } + + /// Places after all previously added animations in this sequence. Chained animations run sequentially after one another. + public Sequence Chain(Tween tween) { + if (tryManipulate()) { + Insert(duration, tween); + } + return this; + } + + /// Places inside this Sequence at time , overlapping with other animations.
+ /// The total sequence duration is increased if the inserted doesn't fit inside the current sequence duration.
+ public Sequence Insert(float atTime, Tween tween) { + if (!ValidateCanAdd(tween)) { + return this; + } + if (tween.tween.sequence.IsCreated) { + Debug.LogError($"{Constants.nestTweenTwiceError} Tween: {tween.tween.GetDescription()}"); + return this; + } + setSequence(tween); + Insert_internal(atTime, tween); + return this; + } + + void Insert_internal(float atTime, Tween other) { + Assert.AreEqual(0f, other.tween.waitDelay); + other.tween.waitDelay = atTime; + duration = Mathf.Max(duration, other.durationWithWaitDelay); + addLinkedReference(other); + } + + /// Schedules after all previously added tweens. + /// https://github.com/KyryloKuzyk/PrimeTween/discussions/4 + public Sequence ChainCallback([NotNull] Action callback, bool warnIfTargetDestroyed = true) { + if (tryManipulate()) { + InsertCallback(duration, callback, warnIfTargetDestroyed); + } + return this; + } + + public Sequence InsertCallback(float atTime, Action callback, bool warnIfTargetDestroyed = true) { + if (!tryManipulate()) { + return this; + } + var delay = PrimeTweenManager.delayWithoutDurationCheck(PrimeTweenManager.dummyTarget, 0f, false); + Assert.IsTrue(delay.HasValue); + delay.Value.tween.OnComplete(callback, warnIfTargetDestroyed); + return Insert(atTime, delay.Value); + } + + /// Schedules after all previously added tweens. Passing 'target' allows to write a non-allocating callback. + /// https://github.com/KyryloKuzyk/PrimeTween/discussions/4 + public Sequence ChainCallback([NotNull] T target, [NotNull] Action callback, bool warnIfTargetDestroyed = true) where T: class { + if (tryManipulate()) { + InsertCallback(duration, target, callback, warnIfTargetDestroyed); + } + return this; + } + + public Sequence InsertCallback(float atTime, [NotNull] T target, Action callback, bool warnIfTargetDestroyed = true) where T: class { + if (!tryManipulate()) { + return this; + } + var delay = PrimeTweenManager.delayWithoutDurationCheck(target, 0f, false); + if (!delay.HasValue) { + return this; + } + delay.Value.tween.OnComplete(target, callback, warnIfTargetDestroyed); + return Insert(atTime, delay.Value); + } + + /// Schedules delay after all previously added tweens. + public Sequence ChainDelay(float duration) { + return Chain(Tween.Delay(duration)); + } + + Tween getLastInSelfOrRoot() { + Assert.IsTrue(isAlive); + var result = root; + foreach (var current in getSelfChildren()) { + result = current; + } + Assert.IsTrue(result.IsCreated); + Assert.IsFalse(result.tween.nextSibling.IsCreated); + return result; + } + + void setSequence(Tween handle) { + Assert.IsTrue(IsCreated); + Assert.IsTrue(handle.isAlive); + var tween = handle.tween; + Assert.IsFalse(tween.sequence.IsCreated); + tween.sequence = this; + } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] + bool ValidateCanAdd(Tween other) { + if (!ValidateCanManipulateSequence()) { + return false; + } + if (!other.isAlive) { + Debug.LogError(Constants.addDeadTweenToSequenceError); + return false; + } + var tween = other.tween; + if (tween.settings.cycles == -1) { + Debug.LogError(Constants.infiniteTweenInSequenceError); + return false; + } + var rootTween = root.tween; + if (tween._isPaused && tween._isPaused != rootTween._isPaused) { + warnIgnoredChildrenSetting(nameof(isPaused)); + } + if (tween.timeScale != 1f && tween.timeScale != rootTween.timeScale) { + warnIgnoredChildrenSetting(nameof(timeScale)); + } + if (tween.settings.useUnscaledTime && tween.settings.useUnscaledTime != rootTween.settings.useUnscaledTime) { + warnIgnoredChildrenSetting(nameof(TweenSettings.useUnscaledTime)); + } + if (tween.settings._updateType != _UpdateType.Default && tween.settings._updateType != rootTween.settings._updateType) { + warnIgnoredChildrenSetting(nameof(TweenSettings.updateType)); + } + void warnIgnoredChildrenSetting(string settingName) { + Debug.LogError($"'{settingName}' was ignored after adding child animation to the Sequence. Parent Sequence controls '{settingName}' of all its children animations.\n" + + "To prevent this error:\n" + + $"- Use the default value of '{settingName}' in child animation.\n" + + $"- OR use the same '{settingName}' in child animation.\n\n"); + } + return true; + } + + /// Stops all tweens in the Sequence, ignoring callbacks. + public void Stop() { + if (isAlive && tryManipulate()) { + Assert.IsTrue(root.tween.isMainSequenceRoot()); + releaseTweens(); + Assert.IsFalse(isAlive); + } + } + + /// Immediately completes the sequence.
+ /// If the sequence has infinite cycles (cycles == -1), completes only the current cycle. To choose where the sequence should stop (at the 'start' or at the 'end') in the case of infinite cycles, use before calling Complete().
+ public void Complete() { + if (isAlive && tryManipulate()) { + if (cyclesTotal == -1 || root.tween.settings.cycleMode == CycleMode.Restart) { + SetRemainingCycles(1); + } else { + int cyclesLeft = cyclesTotal - cyclesDone; + SetRemainingCycles(cyclesLeft % 2 == 1 ? 1 : 2); + } + root.isPaused = false; + Assert.IsTrue(root.tween.isMainSequenceRoot()); + root.tween.updateSequence(float.MaxValue, false, allowSkipChildrenUpdate: false); + Assert.IsFalse(isAlive); + } + } + + internal void emergencyStop() { + Assert.IsTrue(isAlive); + Assert.IsTrue(root.tween.isMainSequenceRoot()); + releaseTweens(t => t.warnOnCompleteIgnored(false)); + } + + internal void releaseTweens([CanBeNull] Action beforeKill = null) { + var enumerator = getAllTweens(); + enumerator.MoveNext(); + var current = enumerator.Current; + Assert.IsTrue(current.isAlive); + while (true) { + // ReSharper disable once RedundantCast + Tween? next = enumerator.MoveNext() ? enumerator.Current : (Tween?)null; + var tween = current.tween; + Assert.IsTrue(tween._isAlive); + beforeKill?.Invoke(tween); + tween.kill(); + Assert.IsFalse(tween._isAlive); + releaseTween(tween); + if (!next.HasValue) { + break; + } + current = next.Value; + } + Assert.IsFalse(isAlive); // not IsCreated because this may be a local variable in the user's codebase + } + + static void releaseTween([NotNull] ReusableTween tween) { + // Debug.Log($"[{Time.frameCount}] releaseTween {tween.id}"); + Assert.AreNotEqual(0, tween.sequence.root.id); + tween.next = default; + tween.prev = default; + tween.prevSibling = default; + tween.nextSibling = default; + tween.sequence = default; + if (tween.isSequenceRoot()) { + tween.tweenType = TweenType.None; + Assert.IsFalse(tween.isSequenceRoot()); + } + } + + internal SequenceChildrenEnumerator getAllChildren() { + var enumerator = getAllTweens(); + var movedNext = enumerator.MoveNext(); // skip self + Assert.IsTrue(movedNext); + Assert.AreEqual(root, enumerator.Current); + return enumerator; + } + + /// Stops the sequence when it reaches the 'end' or returns to the 'start' for the next time.
+ /// For example, if you have an infinite sequence (cycles == -1) with CycleMode.Yoyo/Rewind, and you wish to stop it when it reaches the 'end', then set to true. + /// To stop the animation at the 'beginning', set to false.
+ public void SetRemainingCycles(bool stopAtEndValue) { + root.SetRemainingCycles(stopAtEndValue); + } + + /// Sets the number of remaining cycles.
+ /// This method modifies the so that the sequence will complete after the number of .
+ /// To set the initial number of cycles, use Sequence.Create(cycles: numCycles) instead.

+ /// Setting cycles to -1 will repeat the sequence indefinitely.
+ ///
+ public void SetRemainingCycles(int cycles) { + root.SetRemainingCycles(cycles); + } + + public bool isPaused { + get => root.isPaused; + set => root.isPaused = value; + } + + internal SequenceDirectEnumerator getSelfChildren(bool isForward = true) => new SequenceDirectEnumerator(this, isForward); + internal SequenceChildrenEnumerator getAllTweens() => new SequenceChildrenEnumerator(this); + + public override string ToString() => root.ToString(); + + internal struct SequenceDirectEnumerator { + readonly Sequence sequence; + Tween current; + readonly bool isEmpty; + readonly bool isForward; + bool isStarted; + + internal SequenceDirectEnumerator(Sequence s, bool isForward) { + Assert.IsTrue(s.isAlive, s.id); + sequence = s; + this.isForward = isForward; + isStarted = false; + isEmpty = isSequenceEmpty(s); + if (isEmpty) { + current = default; + return; + } + current = sequence.root.tween.next; + Assert.IsTrue(current.IsCreated && current.id != sequence.root.tween.nextSibling.id); + if (!isForward) { + while (true) { + var next = current.tween.nextSibling; + if (!next.IsCreated) { + break; + } + current = next; + } + } + Assert.IsTrue(current.IsCreated); + } + + static bool isSequenceEmpty(Sequence s) { + // tests: SequenceNestingDifferentSettings(), TestSequenceEnumeratorWithEmptySequences() + return s.root.tween.intParam == emptySequenceTag; + } + + public + #if UNITY_2020_2_OR_NEWER + readonly + #endif + SequenceDirectEnumerator GetEnumerator() { + Assert.IsTrue(sequence.isAlive); + return this; + } + + public + #if UNITY_2020_2_OR_NEWER + readonly + #endif + Tween Current { + get { + Assert.IsTrue(sequence.isAlive); + Assert.IsTrue(current.IsCreated); + Assert.IsNotNull(current.tween); + Assert.AreEqual(current.id, current.tween.id); + Assert.IsTrue(current.tween.sequence.IsCreated); + return current; + } + } + + public bool MoveNext() { + if (isEmpty) { + return false; + } + Assert.IsTrue(current.isAlive); + if (!isStarted) { + isStarted = true; + return true; + } + current = isForward ? current.tween.nextSibling : current.tween.prevSibling; + return current.IsCreated; + } + } + + internal struct SequenceChildrenEnumerator { + readonly Sequence sequence; + Tween current; + bool isStarted; + + internal SequenceChildrenEnumerator(Sequence s) { + Assert.IsTrue(s.isAlive); + Assert.IsTrue(s.root.tween.isMainSequenceRoot()); + sequence = s; + current = default; + isStarted = false; + } + + public + #if UNITY_2020_2_OR_NEWER + readonly + #endif + SequenceChildrenEnumerator GetEnumerator() { + Assert.IsTrue(sequence.isAlive); + return this; + } + + public + #if UNITY_2020_2_OR_NEWER + readonly + #endif + Tween Current { + get { + Assert.IsTrue(current.IsCreated); + Assert.IsNotNull(current.tween); + Assert.AreEqual(current.id, current.tween.id); + Assert.IsTrue(current.tween.sequence.IsCreated); + return current; + } + } + + public bool MoveNext() { + if (!isStarted) { + Assert.IsFalse(current.IsCreated); + current = sequence.root; + isStarted = true; + return true; + } + Assert.IsTrue(current.isAlive); + current = current.tween.next; + return current.IsCreated; + } + } + + /// Places after all previously added animations in this sequence. Chained animations run sequentially after one another. + public Sequence Chain(Sequence sequence) { + if (tryManipulate()) { + Insert(duration, sequence); + } + return this; + } + + /// Groups with the 'previous' animation in this Sequence.
+ /// The 'previous' animation is the animation used in the preceding Group/Chain/Insert() method call.
+ /// Grouped animations start at the same time and run in parallel.
+ public Sequence Group(Sequence sequence) { + if (tryManipulate()) { + Insert(getLastInSelfOrRoot().tween.waitDelay, sequence); + } + return this; + } + + /// Places inside this Sequence at time , overlapping with other animations.
+ /// The total sequence duration is increased if the inserted doesn't fit inside the current sequence duration.
+ public Sequence Insert(float atTime, Sequence sequence) { + if (!ValidateCanAdd(sequence.root)) { + return this; + } + + ref var otherTweenType = ref sequence.root.tween.tweenType; + if (otherTweenType != TweenType.MainSequence) { + Debug.LogError(Constants.nestSequenceTwiceError); + return this; + } + otherTweenType = TweenType.NestedSequence; + + Insert_internal(atTime, sequence.root); + validateSequenceEnumerator(); + return this; + } + + /// Custom timeScale. To smoothly animate timeScale over time, use method. + public float timeScale { + get => root.timeScale; + set => root.timeScale = value; + } + + [System.Diagnostics.Conditional("SAFETY_CHECKS")] + void validateSequenceEnumerator() { + var buffer = new List { + root.tween + }; + foreach (var t in getAllTweens()) { + // Debug.Log($"----- {t}"); + if (t.tween.isSequenceRoot()) { + foreach (var ch in t.tween.sequence.getSelfChildren()) { + // Debug.Log(ch); + buffer.Add(ch.tween); + } + } + } + if (buffer.Count != buffer.Select(_ => _.id).Distinct().Count()) { + Debug.LogError($"{root.id}, duplicates in validateSequenceEnumerator():\n{string.Join("\n", buffer)}"); + } + } + + public Sequence OnComplete(Action onComplete, bool warnIfTargetDestroyed = true) { + root.OnComplete(onComplete, warnIfTargetDestroyed); + return this; + } + + public Sequence OnComplete(T target, Action onComplete, bool warnIfTargetDestroyed = true) where T : class { + root.OnComplete(target, onComplete, warnIfTargetDestroyed); + return this; + } + + public override int GetHashCode() => root.GetHashCode(); + public bool Equals(Sequence other) => root.Equals(other.root); + } +} diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Sequence.cs.meta b/FactoryNumeric/Packages/PrimeTween/Runtime/Sequence.cs.meta new file mode 100644 index 00000000..9834672d --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Sequence.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 8a2d3576d8ee453a9d515299e94e87bc +timeCreated: 1675416609 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Shake.cs b/FactoryNumeric/Packages/PrimeTween/Runtime/Shake.cs new file mode 100644 index 00000000..ba7da6f7 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Shake.cs @@ -0,0 +1,377 @@ +// ReSharper disable UnusedMember.Global +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedMethodReturnValue.Global +using System; +using JetBrains.Annotations; +using UnityEngine; +using Random = UnityEngine.Random; +using SuppressMessage = System.Diagnostics.CodeAnalysis.SuppressMessageAttribute; + +namespace PrimeTween { + public partial struct Tween { + /// Shakes the camera.
+ /// If the camera is perspective, shakes all angles.
+ /// If the camera is orthographic, shakes the z angle and x/y coordinates.
+ /// Reference strengthFactor values - light: 0.2, medium: 0.5, heavy: 1.0.
+ public static Sequence ShakeCamera([NotNull] Camera camera, float strengthFactor, float duration = 0.5f, float frequency = ShakeSettings.defaultFrequency, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = PrimeTweenConfig.defaultUseUnscaledTimeForShakes) { + var transform = camera.transform; + if (camera.orthographic) { + float orthoPosStrength = strengthFactor * camera.orthographicSize * 0.03f; + return Sequence.Create() + .Group(ShakeLocalPosition(transform, new ShakeSettings(new Vector3(orthoPosStrength, orthoPosStrength), duration, frequency, startDelay: startDelay, endDelay: endDelay, useUnscaledTime: useUnscaledTime))) + .Group(ShakeLocalRotation(transform, new ShakeSettings(new Vector3(0, 0, strengthFactor * 0.6f), duration, frequency, startDelay: startDelay, endDelay: endDelay, useUnscaledTime: useUnscaledTime))); + } + return Sequence.Create() + .Group(ShakeLocalRotation(transform, new ShakeSettings(strengthFactor * Vector3.one, duration, frequency, startDelay: startDelay, endDelay: endDelay, useUnscaledTime: useUnscaledTime))); + } + + public static Tween ShakeLocalPosition([NotNull] Transform target, Vector3 strength, float duration, float frequency = ShakeSettings.defaultFrequency, bool enableFalloff = true, Ease easeBetweenShakes = Ease.Default, float asymmetryFactor = 0f, int cycles = 1, + float startDelay = 0, float endDelay = 0, bool useUnscaledTime = PrimeTweenConfig.defaultUseUnscaledTimeForShakes) + => ShakeLocalPosition(target, new ShakeSettings(strength, duration, frequency, enableFalloff, easeBetweenShakes, asymmetryFactor, cycles, startDelay, endDelay, useUnscaledTime)); + [SuppressMessage("ReSharper", "PossibleNullReferenceException")] + public static Tween ShakeLocalPosition([NotNull] Transform target, ShakeSettings settings) { + return shake(TweenType.ShakeLocalPosition, PropType.Vector3, target, settings, (state, shakeVal) => { + (state.target as Transform).localPosition = state.startValue.Vector3Val + shakeVal; + }, _ => (_.target as Transform).localPosition.ToContainer()); + } + public static Tween PunchLocalPosition([NotNull] Transform target, Vector3 strength, float duration, float frequency = ShakeSettings.defaultFrequency, bool enableFalloff = true, Ease easeBetweenShakes = Ease.Default, float asymmetryFactor = 0f, int cycles = 1, + float startDelay = 0, float endDelay = 0, bool useUnscaledTime = PrimeTweenConfig.defaultUseUnscaledTimeForShakes) + => PunchLocalPosition(target, new ShakeSettings(strength, duration, frequency, enableFalloff, easeBetweenShakes, asymmetryFactor, cycles, startDelay, endDelay, useUnscaledTime)); + public static Tween PunchLocalPosition([NotNull] Transform target, ShakeSettings settings) => ShakeLocalPosition(target, settings.WithPunch()); + + public static Tween ShakeLocalRotation([NotNull] Transform target, Vector3 strength, float duration, float frequency = ShakeSettings.defaultFrequency, bool enableFalloff = true, Ease easeBetweenShakes = Ease.Default, float asymmetryFactor = 0f, int cycles = 1, + float startDelay = 0, float endDelay = 0, bool useUnscaledTime = PrimeTweenConfig.defaultUseUnscaledTimeForShakes) + => ShakeLocalRotation(target, new ShakeSettings(strength, duration, frequency, enableFalloff, easeBetweenShakes, asymmetryFactor, cycles, startDelay, endDelay, useUnscaledTime)); + [SuppressMessage("ReSharper", "PossibleNullReferenceException")] + public static Tween ShakeLocalRotation([NotNull] Transform target, ShakeSettings settings) { + return shake(TweenType.ShakeLocalRotation, PropType.Quaternion, target, settings, (state, shakeVal) => { + (state.target as Transform).localRotation = state.startValue.QuaternionVal * Quaternion.Euler(shakeVal); + }, t => (t.target as Transform).localRotation.ToContainer()); + } + public static Tween PunchLocalRotation([NotNull] Transform target, Vector3 strength, float duration, float frequency = ShakeSettings.defaultFrequency, bool enableFalloff = true, Ease easeBetweenShakes = Ease.Default, float asymmetryFactor = 0f, int cycles = 1, + float startDelay = 0, float endDelay = 0, bool useUnscaledTime = PrimeTweenConfig.defaultUseUnscaledTimeForShakes) + => PunchLocalRotation(target, new ShakeSettings(strength, duration, frequency, enableFalloff, easeBetweenShakes, asymmetryFactor, cycles, startDelay, endDelay, useUnscaledTime)); + public static Tween PunchLocalRotation([NotNull] Transform target, ShakeSettings settings) => ShakeLocalRotation(target, settings.WithPunch()); + + public static Tween ShakeScale([NotNull] Transform target, Vector3 strength, float duration, float frequency = ShakeSettings.defaultFrequency, bool enableFalloff = true, Ease easeBetweenShakes = Ease.Default, float asymmetryFactor = 0f, int cycles = 1, + float startDelay = 0, float endDelay = 0, bool useUnscaledTime = PrimeTweenConfig.defaultUseUnscaledTimeForShakes) + => ShakeScale(target, new ShakeSettings(strength, duration, frequency, enableFalloff, easeBetweenShakes, asymmetryFactor, cycles, startDelay, endDelay, useUnscaledTime)); + [SuppressMessage("ReSharper", "PossibleNullReferenceException")] + public static Tween ShakeScale([NotNull] Transform target, ShakeSettings settings) { + return shake(TweenType.ShakeScale, PropType.Vector3, target, settings, (state, shakeVal) => { + (state.target as Transform).localScale = state.startValue.Vector3Val + shakeVal; + }, t => (t.target as Transform).localScale.ToContainer()); + } + public static Tween PunchScale([NotNull] Transform target, Vector3 strength, float duration, float frequency = ShakeSettings.defaultFrequency, bool enableFalloff = true, Ease easeBetweenShakes = Ease.Default, float asymmetryFactor = 0f, int cycles = 1, + float startDelay = 0, float endDelay = 0, bool useUnscaledTime = PrimeTweenConfig.defaultUseUnscaledTimeForShakes) + => PunchScale(target, new ShakeSettings(strength, duration, frequency, enableFalloff, easeBetweenShakes, asymmetryFactor, cycles, startDelay, endDelay, useUnscaledTime)); + public static Tween PunchScale([NotNull] Transform target, ShakeSettings settings) => ShakeScale(target, settings.WithPunch()); + + static Tween shake(TweenType tweenType, PropType propType, [NotNull] Transform target, ShakeSettings settings, [NotNull] Action onValueChange, [NotNull] Func getter) { + Assert.IsNotNull(onValueChange); + Assert.IsNotNull(getter); + var tween = PrimeTweenManager.fetchTween(); + prepareShakeData(settings, tween); + tween.customOnValueChange = onValueChange; + var tweenSettings = settings.tweenSettings; + tween.Setup(target, ref tweenSettings, state => { + var _onValueChange = state.customOnValueChange as Action; + Assert.IsNotNull(_onValueChange); + var shakeVal = getShakeVal(state); + _onValueChange(state, shakeVal); + }, getter, true, tweenType); + return PrimeTweenManager.Animate(tween); + } + + public static Tween ShakeCustom([NotNull] T target, Vector3 startValue, ShakeSettings settings, [NotNull] Action onValueChange) where T : class { + Assert.IsNotNull(onValueChange); + var tween = PrimeTweenManager.fetchTween(); + tween.startValue.CopyFrom(ref startValue); + prepareShakeData(settings, tween); + tween.customOnValueChange = onValueChange; + var tweenSettings = settings.tweenSettings; + tween.Setup(target, ref tweenSettings, _tween => { + var _onValueChange = _tween.customOnValueChange as Action; + Assert.IsNotNull(_onValueChange); + var _target = _tween.target as T; + var val = _tween.startValue.Vector3Val + getShakeVal(_tween); + try { + _onValueChange(_target, val); + } catch (Exception e) { + Debug.LogError($"Tween was stopped because of exception in {nameof(onValueChange)} callback, tween: {_tween.GetDescription()}, exception:\n{e}", _tween.target as UnityEngine.Object); + _tween.EmergencyStop(); + } + }, null, false, TweenType.ShakeCustom); + return PrimeTweenManager.Animate(tween); + } + public static Tween PunchCustom([NotNull] T target, Vector3 startValue, ShakeSettings settings, [NotNull] Action onValueChange) where T : class => ShakeCustom(target, startValue, settings.WithPunch(), onValueChange); + + static void prepareShakeData(ShakeSettings settings, [NotNull] ReusableTween tween) { + tween.endValue.Reset(); // not used + tween.shakeData.Setup(settings); + } + + static Vector3 getShakeVal([NotNull] ReusableTween tween) { + return tween.shakeData.getNextVal(tween) * calcFadeInOutFactor(); + float calcFadeInOutFactor() { + var elapsedTimeInterpolating = tween.easedInterpolationFactor * tween.settings.duration; + Assert.IsTrue(elapsedTimeInterpolating >= 0f); + var duration = tween.settings.duration; + if (duration == 0f) { + return 0f; + } + Assert.IsTrue(duration > 0f); + float halfDuration = duration * 0.5f; + var oneShakeDuration = 1f / tween.shakeData.frequency; + if (oneShakeDuration > halfDuration) { + oneShakeDuration = halfDuration; + } + float fadeInDuration = oneShakeDuration * 0.5f; + if (elapsedTimeInterpolating < fadeInDuration) { + return Mathf.InverseLerp(0f, fadeInDuration, elapsedTimeInterpolating); + } + var fadeoutStartTime = duration - oneShakeDuration; + Assert.IsTrue(fadeoutStartTime > 0f, tween.id); + if (elapsedTimeInterpolating > fadeoutStartTime) { + return Mathf.InverseLerp(duration, fadeoutStartTime, elapsedTimeInterpolating); + } + return 1f; + } + } + } + + #if PRIME_TWEEN_INSPECTOR_DEBUGGING && UNITY_EDITOR + [Serializable] + #endif + internal struct ShakeData { + float t; + bool sign; + Vector3 from, to; + float symmetryFactor; + int falloffEaseInt; + AnimationCurve customStrengthOverTime; + Ease easeBetweenShakes; + bool isPunch; + const int disabledFalloff = -42; + internal bool isAlive => frequency != 0f; + internal Vector3 strengthPerAxis { get; private set; } + internal float frequency { get; private set; } + float prevInterpolationFactor; + int prevCyclesDone; + + internal void Setup(ShakeSettings settings) { + isPunch = settings.isPunch; + symmetryFactor = Mathf.Clamp01(1 - settings.asymmetry); + { + var _strength = settings.strength; + if (_strength == Vector3.zero) { + Debug.LogError("Shake's strength is (0, 0, 0)."); + } + strengthPerAxis = _strength; + } + { + var _frequency = settings.frequency; + if (_frequency <= 0) { + Debug.LogError($"Shake's frequency should be > 0f, but was {_frequency}."); + _frequency = ShakeSettings.defaultFrequency; + } + frequency = _frequency; + } + { + if (settings.enableFalloff) { + var _falloffEase = settings.falloffEase; + var _customStrengthOverTime = settings.strengthOverTime; + if (_falloffEase == Ease.Default) { + _falloffEase = Ease.Linear; + } + if (_falloffEase == Ease.Custom) { + if (_customStrengthOverTime == null || !TweenSettings.ValidateCustomCurve(_customStrengthOverTime)) { + Debug.LogError($"Shake falloff is Ease.Custom, but {nameof(ShakeSettings.strengthOverTime)} is not configured correctly. Using Ease.Linear instead."); + _falloffEase = Ease.Linear; + } + } + falloffEaseInt = (int)_falloffEase; + customStrengthOverTime = _customStrengthOverTime; + } else { + falloffEaseInt = disabledFalloff; + } + } + { + var _easeBetweenShakes = settings.easeBetweenShakes; + if (_easeBetweenShakes == Ease.Custom) { + Debug.LogError($"{nameof(ShakeSettings.easeBetweenShakes)} doesn't support Ease.Custom."); + _easeBetweenShakes = Ease.OutQuad; + } + if (_easeBetweenShakes == Ease.Default) { + _easeBetweenShakes = PrimeTweenManager.defaultShakeEase; + } + easeBetweenShakes = _easeBetweenShakes; + } + onCycleComplete(); + } + + internal void onCycleComplete() { + Assert.IsTrue(isAlive); + resetAfterCycle(); + sign = isPunch || Random.value < 0.5f; + to = generateShakePoint(); + } + + static int getMainAxisIndex(Vector3 strengthByAxis) { + int mainAxisIndex = -1; + float maxStrength = float.NegativeInfinity; + for (int i = 0; i < 3; i++) { + var strength = Mathf.Abs(strengthByAxis[i]); + if (strength > maxStrength) { + maxStrength = strength; + mainAxisIndex = i; + } + } + Assert.IsTrue(mainAxisIndex >= 0); + return mainAxisIndex; + } + + internal Vector3 getNextVal([NotNull] ReusableTween tween) { + var interpolationFactor = tween.easedInterpolationFactor; + Assert.IsTrue(interpolationFactor <= 1); + + int cyclesDiff = tween.getCyclesDone() - prevCyclesDone; + prevCyclesDone = tween.getCyclesDone(); + if (interpolationFactor == 0f || (cyclesDiff > 0 && tween.getCyclesDone() != tween.settings.cycles)) { + onCycleComplete(); + prevInterpolationFactor = interpolationFactor; + } + + var dt = (interpolationFactor - prevInterpolationFactor) * tween.settings.duration; + prevInterpolationFactor = interpolationFactor; + + var strengthOverTime = calcStrengthOverTime(interpolationFactor); + var frequencyFactor = Mathf.Clamp01(strengthOverTime * 3f); // handpicked formula that describes the relationship between strength and frequency + float getIniVelFactor() { + // The initial velocity should twice as big because the first shake starts from zero (twice as short as total range). + var elapsedTimeInterpolating = tween.easedInterpolationFactor * tween.settings.duration; + var halfShakeDuration = 0.5f / tween.shakeData.frequency; + return elapsedTimeInterpolating < halfShakeDuration ? 2f : 1f; + } + t += frequency * dt * frequencyFactor * getIniVelFactor(); + if (t < 0f || t >= 1f) { + sign = !sign; + if (t < 0f) { + t = 1f; + to = from; + from = generateShakePoint(); + } else { + t = 0f; + from = to; + to = generateShakePoint(); + } + } + + Vector3 result = default; + for (int i = 0; i < 3; i++) { + result[i] = Mathf.Lerp(from[i], to[i], StandardEasing.Evaluate(t, easeBetweenShakes)) * strengthOverTime; + } + return result; + } + + Vector3 generateShakePoint() { + var mainAxisIndex = getMainAxisIndex(strengthPerAxis); + Vector3 result = default; + float signFloat = sign ? 1f : -1f; + for (int i = 0; i < 3; i++) { + var strength = strengthPerAxis[i]; + if (isPunch) { + result[i] = clampBySymmetryFactor(strength * signFloat, strength, symmetryFactor); + } else { + result[i] = i == mainAxisIndex ? calcMainAxisEndVal(signFloat, strength, symmetryFactor) : calcNonMainAxisEndVal(strength, symmetryFactor); + } + } + return result; + } + + float calcStrengthOverTime(float interpolationFactor) { + if (falloffEaseInt == disabledFalloff) { + return 1; + } + var falloffEase = (Ease)falloffEaseInt; + if (falloffEase != Ease.Custom) { + return 1 - StandardEasing.Evaluate(interpolationFactor, falloffEase); + } + Assert.IsNotNull(customStrengthOverTime); + return customStrengthOverTime.Evaluate(interpolationFactor); + } + + static float calcMainAxisEndVal(float velocity, float strength, float symmetryFactor) { + var result = Mathf.Sign(velocity) * strength * Random.Range(0.6f, 1f); // doesn't matter if we're using strength or its abs because velocity alternates + return clampBySymmetryFactor(result, strength, symmetryFactor); + } + + static float clampBySymmetryFactor(float val, float strength, float symmetryFactor) { + if (strength > 0) { + return Mathf.Clamp(val, -strength * symmetryFactor, strength); + } + return Mathf.Clamp(val, strength, -strength * symmetryFactor); + } + + static float calcNonMainAxisEndVal(float strength, float symmetryFactor) { + if (strength > 0) { + return Random.Range(-strength * symmetryFactor, strength); + } + return Random.Range(strength, -strength * symmetryFactor); + } + + internal static bool TryTakeStartValueFromOtherShake([NotNull] ReusableTween newTween) { + if (!newTween.shakeData.isAlive) { + return false; + } + var shakeTransform = newTween.target as Transform; + if (shakeTransform == null) { + return false; + } + var shakes = PrimeTweenManager.Instance.shakes; + var key = (shakeTransform, newTween.tweenType); + if (!shakes.TryGetValue(key, out var data)) { + shakes.Add(key, (newTween.getter(newTween), 1)); + return false; + } + Assert.IsTrue(data.count >= 1); + newTween.startValue = data.startValue; + // Debug.Log($"tryTakeStartValueFromOtherShake {data.startValue.Vector4Val}"); + data.count++; + shakes[key] = data; + return true; + } + + internal void Reset([NotNull] ReusableTween tween) { + Assert.IsTrue(isAlive); + var shakeTransform = tween.target as Transform; + if (shakeTransform != null) { + var key = (shakeTransform, tween.tweenType); + var shakes = PrimeTweenManager.Instance.shakes; + if (shakes.TryGetValue(key, out var data)) { + // no key present if it's a ShakeCustom() with Transform target because custom shakes have startFromCurrent == false and aren't added to shakes dict + Assert.IsTrue(data.count >= 1); + data.count--; + if (data.count == 0) { + bool isRemoved = shakes.Remove(key); + Assert.IsTrue(isRemoved); + } else { + shakes[key] = data; + } + } + } + + resetAfterCycle(); + customStrengthOverTime = null; + frequency = 0f; + prevInterpolationFactor = 0f; + prevCyclesDone = 0; + Assert.IsFalse(isAlive); + } + + void resetAfterCycle() { + t = 0f; + from = Vector3.zero; + } + } +} diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Shake.cs.meta b/FactoryNumeric/Packages/PrimeTween/Runtime/Shake.cs.meta new file mode 100644 index 00000000..8e7486b3 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Shake.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 570c6fe2825b44d7adcb65883493f007 +timeCreated: 1677514909 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/ShakeSettings.cs b/FactoryNumeric/Packages/PrimeTween/Runtime/ShakeSettings.cs new file mode 100644 index 00000000..9075b267 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/ShakeSettings.cs @@ -0,0 +1,118 @@ +using System; +using JetBrains.Annotations; +using UnityEngine; + +namespace PrimeTween { + /// + /// ShakeSettings contains all properties needed for a shake or punch (frequency, strength per axis, duration, etc.). Can be serialized and tweaked from the Inspector.
+ /// Shake methods are: Tween.ShakeLocalPosition(), Tween.ShakeLocalRotation(), Tween.ShakeScale(), and Tween.ShakeCustom().

+ /// Punch is a special case of a shake that a has a punch 'direction'. The punched value will oscillate back and forth in the direction of a punch.
+ /// Punch methods are: Tween.PunchLocalPosition(), Tween.PunchLocalRotation(), Tween.PunchScale(), and Tween.PunchCustom().
+ ///
+ [Serializable] + public struct ShakeSettings { + internal const float defaultFrequency = 10; + + [Tooltip("Strength is applied per-axis in local space coordinates.\n\n" + + "Shakes: the strongest strength component will be used as the main frequency axis. Shakes on secondary axes happen randomly instead of following the frequency.\n\n" + + "Punches: strength determines punch direction.\n\n" + + "Strength is measured in units (position/scale) or Euler angles (rotation).")] + public Vector3 strength; + public float duration; + [Tooltip("Number of shakes per second.")] + public float frequency; + [Tooltip("With enabled falloff shake starts at the highest strength and fades to the end.")] + public bool enableFalloff; + [Tooltip("Falloff ease is inverted to achieve the effect of shake 'fading' over time. Typically, eases go from 0 to 1, but falloff ease goes from 1 to 0.\n\n" + + "Default is Ease.Linear.\n\n" + + "Set to " + nameof(Ease) + "." + nameof(Ease.Custom) + " to have manual control over shake's 'strength' over time.")] + public Ease falloffEase; + [Tooltip("Shake's 'strength' over time.")] + [CanBeNull] public AnimationCurve strengthOverTime; + [Tooltip("Represents how asymmetrical the shake is.\n\n" + + "'0' means the shake is symmetrical around the initial value.\n\n" + + "'1' means the shake is asymmetrical and will happen between the initial position and the value of the '" + nameof(strength) + "' vector.\n\n" + + "When used with punches, can be treated as the resistance to 'recoil': '0' is full recoil, '1' is no recoil.")] + [Range(0f, 1f)] public float asymmetry; + /// + [Tooltip("Ease between adjacent shake points.\n\n" + + "Default is Ease.OutQuad.")] + public Ease easeBetweenShakes; + [Tooltip(Constants.cyclesTooltip)] + public int cycles; + [Tooltip(Constants.startDelayTooltip)] + public float startDelay; + [Tooltip(Constants.endDelayTooltip)] + public float endDelay; + [Tooltip(Constants.unscaledTimeTooltip)] + public bool useUnscaledTime; + + [Obsolete("use '" + nameof(updateType) + "' instead.")] + public bool useFixedUpdate { + get => updateType == UpdateType.FixedUpdate || _useFixedUpdate; + set { + _updateType = value ? _UpdateType.FixedUpdate : _UpdateType.Update; + _useFixedUpdate = value; + } + } + [SerializeField, UnityEngine.Serialization.FormerlySerializedAs("useFixedUpdate")] + [HideInInspector] + bool _useFixedUpdate; + + public UpdateType updateType { + get => _useFixedUpdate ? UpdateType.FixedUpdate : new UpdateType(_updateType); + set { + _updateType = value.enumValue; + _useFixedUpdate = value == UpdateType.FixedUpdate; + } + } + [SerializeField, Tooltip(Constants.updateTypeTooltip)] + internal _UpdateType _updateType; + + [field: NonSerialized] + internal bool isPunch { get; private set; } + + internal ShakeSettings(Vector3 strength, float duration, float frequency, Ease? falloffEase, [CanBeNull] AnimationCurve strengthOverTime, Ease easeBetweenShakes, float asymmetryFactor, int cycles, float startDelay, float endDelay, bool useUnscaledTime, UpdateType updateType) { + this.frequency = frequency; + this.strength = strength; + this.duration = duration; + if (falloffEase == Ease.Custom) { + if (strengthOverTime == null || !TweenSettings.ValidateCustomCurve(strengthOverTime)) { + Debug.LogError($"Shake falloff is Ease.Custom, but {nameof(this.strengthOverTime)} is not configured correctly. Using Ease.Linear instead."); + falloffEase = Ease.Linear; + } + } + this.falloffEase = falloffEase ?? default; + this.strengthOverTime = falloffEase == Ease.Custom ? strengthOverTime : null; + enableFalloff = falloffEase != null; + this.easeBetweenShakes = easeBetweenShakes; + this.cycles = cycles; + this.startDelay = startDelay; + this.endDelay = endDelay; + this.useUnscaledTime = useUnscaledTime; + asymmetry = asymmetryFactor; + isPunch = false; + _useFixedUpdate = updateType == UpdateType.FixedUpdate; + _updateType = updateType.enumValue; + } + + public ShakeSettings(Vector3 strength, float duration = 0.5f, float frequency = defaultFrequency, bool enableFalloff = true, Ease easeBetweenShakes = Ease.Default, float asymmetryFactor = 0f, int cycles = 1, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = PrimeTweenConfig.defaultUseUnscaledTimeForShakes, UpdateType updateType = default) + // ReSharper disable once RedundantCast + : this(strength, duration, frequency, enableFalloff ? Ease.Default : (Ease?)null, null, easeBetweenShakes, asymmetryFactor, cycles, startDelay, endDelay, useUnscaledTime, updateType) {} + + public ShakeSettings(Vector3 strength, float duration, float frequency, AnimationCurve strengthOverTime, Ease easeBetweenShakes = Ease.Default, float asymmetryFactor = 0f, int cycles = 1, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = PrimeTweenConfig.defaultUseUnscaledTimeForShakes, UpdateType updateType = default) + : this(strength, duration, frequency, Ease.Custom, strengthOverTime, easeBetweenShakes, asymmetryFactor, cycles, startDelay, endDelay, useUnscaledTime, updateType) { } + + internal TweenSettings tweenSettings => new TweenSettings(duration, Ease.Linear, cycles, CycleMode.Restart, startDelay, endDelay, useUnscaledTime, updateType); + + internal + #if UNITY_2020_2_OR_NEWER + readonly + #endif + ShakeSettings WithPunch() { + var result = this; + result.isPunch = true; + return result; + } + } +} diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/ShakeSettings.cs.meta b/FactoryNumeric/Packages/PrimeTween/Runtime/ShakeSettings.cs.meta new file mode 100644 index 00000000..9b1f3f48 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/ShakeSettings.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 06521c91fffc428a8de282cc2a0d7f01 +timeCreated: 1674160114 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Tween.cs b/FactoryNumeric/Packages/PrimeTween/Runtime/Tween.cs new file mode 100644 index 00000000..dba82ef5 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Tween.cs @@ -0,0 +1,348 @@ +// ReSharper disable CompareOfFloatsByEqualityOperator +#if PRIME_TWEEN_INSPECTOR_DEBUGGING && UNITY_EDITOR +#define ENABLE_SERIALIZATION +#endif +using System; +using JetBrains.Annotations; +using UnityEngine; + +namespace PrimeTween { + /// The main API of the PrimeTween library.

+ /// Use static Tween methods to start animations (tweens).
+ /// Use the returned Tween struct to control the running tween and access its properties.

+ /// Tweens are non-reusable. That is, when a tween completes (or is stopped manually), it becomes 'dead' ( == false) and can no longer be used to control the tween or access its properties.
+ /// To restart the animation from the beginning (or play in the opposite direction), simply start a new Tween. Starting tweens is very fast and doesn't allocate garbage, + /// so you can start hundreds of tweens per seconds with no performance overhead.
+ /// + /// var tween = Tween.LocalPositionX(transform, endValue: 1.5f, duration: 1f); + /// // Let the tween run for some time... + /// if (tween.isAlive) { + /// Debug.Log($"Animation is still running, elapsed time: {tween.elapsedTime}."); + /// } else { + /// Debug.Log("Animation is already completed."); + /// } + /// + #if ENABLE_SERIALIZATION + [Serializable] + #endif + public + #if !ENABLE_SERIALIZATION + readonly + #endif + partial struct Tween : IEquatable + { + + + + public long Id => id; + + /// Uniquely identifies the tween. + /// Can be observed from the Debug Inspector if PRIME_TWEEN_INSPECTOR_DEBUGGING is defined. Use only for debugging purposes. + internal + #if !ENABLE_SERIALIZATION + readonly + #endif + long id; + + internal readonly ReusableTween tween; + + internal bool IsCreated => id != 0; + + internal Tween([NotNull] ReusableTween tween) { + Assert.IsNotNull(tween); + Assert.AreNotEqual(-1, tween.id); + id = tween.id; + this.tween = tween; + } + + /// A tween is 'alive' when it has been created and is not stopped or completed yet. Paused tween is also considered 'alive'. + public bool isAlive => id != 0 && tween.id == id && tween._isAlive; + + + + /// Elapsed time of the current cycle. + public float elapsedTime { + get { + if (!validateIsAlive()) { + return 0; + } + if (cyclesDone == cyclesTotal) { + return duration; + } + var result = elapsedTimeTotal - duration * cyclesDone; + if (result < 0f) { + return 0f; + } + Assert.IsTrue(result >= 0f); + return result; + } + set => setElapsedTime(value); + } + + void setElapsedTime(float value) { + if (!tryManipulate()) { + return; + } + if (value < 0f || float.IsNaN(value)) { + Debug.LogError($"Invalid elapsedTime value: {value}, tween: {ToString()}"); + return; + } + var cycleDuration = duration; + if (value > cycleDuration) { + value = cycleDuration; + } + var _cyclesDone = cyclesDone; + if (_cyclesDone == cyclesTotal) { + _cyclesDone -= 1; + } + setElapsedTimeTotal(value + cycleDuration * _cyclesDone); + } + + /// The total number of cycles. Returns -1 to indicate infinite number cycles. + public int cyclesTotal => validateIsAlive() ? tween.settings.cycles : 0; + + public int cyclesDone => validateIsAlive() ? tween.getCyclesDone() : 0; + /// The duration of one cycle. + public float duration { + get { + if (!validateIsAlive()) { + return 0; + } + var result = tween.cycleDuration; + TweenSettings.validateFiniteDuration(result); + return result; + } + } + + [NotNull] + public override string ToString() => isAlive ? tween.GetDescription() : $"DEAD / id {id}"; + + /// Elapsed time of all cycles. + public float elapsedTimeTotal { + get => validateIsAlive() ? tween.getElapsedTimeTotal() : 0; + set => setElapsedTimeTotal(value); + } + + void setElapsedTimeTotal(float value) { + if (!tryManipulate()) { + return; + } + if (value < 0f || float.IsNaN(value) || (cyclesTotal == -1 && value >= float.MaxValue)) { // >= tests for positive infinity, see SetInfiniteTweenElapsedTime() test + Debug.LogError($"Invalid elapsedTimeTotal value: {value}, tween: {ToString()}"); + return; + } + tween.SetElapsedTimeTotal(value, false); + // SetElapsedTimeTotal may complete the tween, so isAlive check is needed + if (isAlive && value > durationTotal) { + tween.elapsedTimeTotal = durationTotal; + } + } + + /// The duration of all cycles. If cycles == -1, returns . + public float durationTotal => validateIsAlive() ? tween.getDurationTotal() : 0; + + /// Normalized progress of the current cycle expressed in 0..1 range. + public float progress { + get { + if (!validateIsAlive()) { + return 0; + } + if (duration == 0) { + return 0; + } + return Mathf.Min(elapsedTime / duration, 1f); + } + set { + value = Mathf.Clamp01(value); + if (value == 1f) { + bool isLastCycle = cyclesDone == cyclesTotal - 1; + if (isLastCycle) { + setElapsedTimeTotal(float.MaxValue); + return; + } + } + setElapsedTime(value * duration); + } + } + + /// Normalized progress of all cycles expressed in 0..1 range. + public float progressTotal { + get { + if (!validateIsAlive()) { + return 0; + } + if (cyclesTotal == -1) { + return 0; + } + var _totalDuration = durationTotal; + Assert.IsFalse(float.IsInfinity(_totalDuration)); + if (_totalDuration == 0) { + return 0; + } + return Mathf.Min(elapsedTimeTotal / _totalDuration, 1f); + } + set { + if (cyclesTotal == -1) { + Debug.LogError($"It's not allowed to set progressTotal on infinite tween (cyclesTotal == -1), tween: {ToString()}."); + return; + } + value = Mathf.Clamp01(value); + if (value == 1f) { + setElapsedTimeTotal(float.MaxValue); + return; + } + setElapsedTimeTotal(value * durationTotal); + } + } + + /// The current percentage of change between 'startValue' and 'endValue' values in 0..1 range. + public float interpolationFactor => validateIsAlive() ? Mathf.Max(0f, tween.easedInterpolationFactor) : 0f; + + public bool isPaused { + get => tryManipulate() && tween._isPaused; + set { + if (tryManipulate() && tween.trySetPause(value)) { + if (value) { + return; + } + if ((timeScale > 0 && progressTotal >= 1f) || + (timeScale < 0 && progressTotal == 0f)) { + if (tween.isMainSequenceRoot()) { + tween.sequence.releaseTweens(); + } else { + tween.kill(); + } + } + } + } + } + + /// Interrupts the tween, ignoring onComplete callback. + public void Stop() { + if (isAlive && tryManipulate()) { + tween.kill(); + } + } + + /// Immediately completes the tween.
+ /// If the tween has infinite cycles (cycles == -1), completes only the current cycle. To choose between 'startValue' and 'endValue' in the case of infinite cycles, use before calling Complete().
+ public void Complete() { + // don't warn that tween is dead because dead tween means that it's already 'completed' + if (isAlive && tryManipulate()) { + tween.ForceComplete(); + } + } + + internal bool tryManipulate() { + if (!validateIsAlive()) { + return false; + } + if (!tween.canManipulate()) { + Assert.LogError(Constants.cantManipulateNested, id); + return false; + } + return true; + } + + /// Stops the tween when it reaches 'startValue' or 'endValue' for the next time.
+ /// For example, if you have an infinite tween (cycles == -1) with CycleMode.Yoyo/Rewind, and you wish to stop it when it reaches the 'endValue', then set to true. + /// To stop the animation at the 'startValue', set to false.
+ public void SetRemainingCycles(bool stopAtEndValue) { + if (!tryManipulate()) { + return; + } + if (tween.settings.cycleMode == CycleMode.Restart || tween.settings.cycleMode == CycleMode.Incremental) { + Debug.LogWarning(nameof(SetRemainingCycles) + "(bool " + nameof(stopAtEndValue) + ") is meant to be used with CycleMode.Yoyo or Rewind. Please consider using the overload that accepts int instead."); + } + SetRemainingCycles(tween.getCyclesDone() % 2 == 0 == stopAtEndValue ? 1 : 2); + } + + /// Sets the number of remaining cycles.
+ /// This method modifies the so that the tween will complete after the number of .
+ /// To set the initial number of cycles, pass the 'cycles' parameter to 'Tween.' methods instead.

+ /// Setting cycles to -1 will repeat the tween indefinitely.
+ public void SetRemainingCycles(int cycles) { + Assert.IsTrue(cycles >= -1); + if (!tryManipulate()) { + return; + } + if (tween.timeScale < 0f) { + Debug.LogError(nameof(SetRemainingCycles) + "() doesn't work with negative " + nameof(tween.timeScale)); + } + if (tween.tweenType == TweenType.Delay && tween.HasOnComplete) { + Debug.LogError("Applying cycles to Delay will not repeat the OnComplete() callback, but instead will increase the Delay duration.\n" + + "OnComplete() is called only once when ALL tween cycles complete. To repeat the OnComplete() callback, please use the Sequence.Create(cycles: numCycles) and put the tween inside a Sequence.\n" + + "More info: https://discussions.unity.com/t/926420/101\n"); + } + if (cycles == -1) { + tween.settings.cycles = -1; + } else { + TweenSettings.setCyclesTo1If0(ref cycles); + tween.settings.cycles = tween.getCyclesDone() + cycles; + } + } + + /// Adds completion callback. Please consider using to prevent a possible capture of variable into a closure. + /// Set to 'false' to disable the error about target's destruction. Please note that the the callback will be silently ignored in the case of target's destruction. More info: https://github.com/KyryloKuzyk/PrimeTween/discussions/4 + public Tween OnComplete(Action onComplete, bool warnIfTargetDestroyed = true) { + if (validateIsAlive()) { + tween.OnComplete(onComplete, warnIfTargetDestroyed); + } + return this; + } + + /// Adds completion callback. + /// Set to 'false' to disable the error about target's destruction. Please note that the the callback will be silently ignored in the case of target's destruction. More info: https://github.com/KyryloKuzyk/PrimeTween/discussions/4 + /// The example shows how to destroy the object after the completion of a tween. + /// Please note: we're using the '_transform' variable from the onComplete callback to prevent garbage allocation. Using the 'transform' variable directly will capture it into a closure and generate garbage. + /// + /// Tween.PositionX(transform, endValue: 1.5f, duration: 1f) + /// .OnComplete(transform, _transform => Destroy(_transform.gameObject)); + /// + public Tween OnComplete([NotNull] T target, Action onComplete, bool warnIfTargetDestroyed = true) where T : class { + if (validateIsAlive()) { + tween.OnComplete(target, onComplete, warnIfTargetDestroyed); + } + return this; + } + + public Sequence Group(Tween _tween) => tryManipulate() ? Sequence.Create(this).Group(_tween) : default; + public Sequence Chain(Tween _tween) => tryManipulate() ? Sequence.Create(this).Chain(_tween) : default; + public Sequence Group(Sequence sequence) => tryManipulate() ? Sequence.Create(this).Group(sequence) : default; + public Sequence Chain(Sequence sequence) => tryManipulate() ? Sequence.Create(this).Chain(sequence) : default; + + bool validateIsAlive() { + if (!IsCreated) { + Debug.LogError(Constants.defaultCtorError); + } else if (!isAlive) { + Assert.LogError(Constants.isDeadMessage, id); + } + return isAlive; + } + + /// Custom timeScale. To smoothly animate timeScale over time, use method. + public float timeScale { + get => tryManipulate() ? tween.timeScale : 1; + set { + if (tryManipulate()) { + Assert.IsFalse(float.IsNaN(value)); + Assert.IsFalse(float.IsInfinity(value)); + tween.timeScale = value; + } + } + } + + public Tween OnUpdate(T target, Action onUpdate) where T : class { + if (validateIsAlive()) { + tween.SetOnUpdate(target, onUpdate); + } + return this; + } + + internal float durationWithWaitDelay => tween.calcDurationWithWaitDependencies(); + + public override int GetHashCode() => id.GetHashCode(); + /// https://www.jacksondunstan.com/articles/5148 + public bool Equals(Tween other) => isAlive && other.isAlive && id == other.id; + } +} diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/Tween.cs.meta b/FactoryNumeric/Packages/PrimeTween/Runtime/Tween.cs.meta new file mode 100644 index 00000000..c235edec --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/Tween.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 5f913a3a034a4c42b75653a290884c42 +timeCreated: 1673432255 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/TweenSettings.cs b/FactoryNumeric/Packages/PrimeTween/Runtime/TweenSettings.cs new file mode 100644 index 00000000..4089e705 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/TweenSettings.cs @@ -0,0 +1,270 @@ +using System; +using JetBrains.Annotations; +using UnityEngine; + +namespace PrimeTween { + /// TweenSettings contains animation properties (duration, ease, delay, etc.). Can be serialized and tweaked from the Inspector.
+ /// Use this struct when the 'start' and 'end' values of an animation are NOT known in advance and determined at runtime.
+ /// When the 'start' and 'end' values ARE known, consider using instead.
+ /// + /// Tweak an animation settings from the Inspector, then pass the settings to the Tween method: + /// + /// [SerializeField] TweenSettings animationSettings; + /// public void AnimatePositionX(float targetPosX) { + /// Tween.PositionX(transform, targetPosX, animationSettings); + /// } + /// + /// + [Serializable] + public struct TweenSettings { + public float duration; + [Tooltip(Constants.easeTooltip)] + public Ease ease; + [Tooltip("A custom Animation Curve that will work as an easing curve.")] + [CanBeNull] public AnimationCurve customEase; + [Tooltip(Constants.cyclesTooltip)] + public int cycles; + [Tooltip(Constants.cycleModeTooltip)] + public CycleMode cycleMode; + [Tooltip(Constants.startDelayTooltip)] + public float startDelay; + [Tooltip(Constants.endDelayTooltip)] + public float endDelay; + [Tooltip(Constants.unscaledTimeTooltip)] + public bool useUnscaledTime; + + [Obsolete("use '" + nameof(updateType) + "' instead.")] + public bool useFixedUpdate { + get => updateType == UpdateType.FixedUpdate || _useFixedUpdate; + set { + _updateType = value ? _UpdateType.FixedUpdate : _UpdateType.Update; + _useFixedUpdate = value; + } + } + [SerializeField, UnityEngine.Serialization.FormerlySerializedAs("useFixedUpdate")] + [HideInInspector] + bool _useFixedUpdate; + + public UpdateType updateType { + get => _useFixedUpdate ? UpdateType.FixedUpdate : new UpdateType(_updateType); + set { + _updateType = value.enumValue; + _useFixedUpdate = value == UpdateType.FixedUpdate; + } + } + [SerializeField, Tooltip(Constants.updateTypeTooltip)] + internal _UpdateType _updateType; + + [NonSerialized] internal ParametricEase parametricEase; + [NonSerialized] internal float parametricEaseStrength; + [NonSerialized] internal float parametricEasePeriod; + + internal TweenSettings(float duration, Ease ease, Easing? customEasing, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false, UpdateType updateType = default) { + this.duration = duration; + var curve = customEasing?.curve; + if (ease == Ease.Custom && customEasing?.parametricEase == ParametricEase.None) { + if (curve == null || !ValidateCustomCurveKeyframes(curve)) { + Debug.LogError("Ease is Ease.Custom, but AnimationCurve is not configured correctly. Using Ease.Default instead."); + ease = Ease.Default; + } + } + this.ease = ease; + customEase = ease == Ease.Custom ? curve : null; + this.cycles = cycles; + this.cycleMode = cycleMode; + this.startDelay = startDelay; + this.endDelay = endDelay; + this.useUnscaledTime = useUnscaledTime; + parametricEase = customEasing?.parametricEase ?? ParametricEase.None; + parametricEaseStrength = customEasing?.parametricEaseStrength ?? float.NaN; + parametricEasePeriod = customEasing?.parametricEasePeriod ?? float.NaN; + _useFixedUpdate = updateType == UpdateType.FixedUpdate; + _updateType = updateType.enumValue; + } + + #if PRIME_TWEEN_DOTWEEN_ADAPTER + internal void SetEasing(Easing easing) { + ease = easing.ease; + parametricEase = easing.parametricEase; + parametricEaseStrength = easing.parametricEaseStrength; + parametricEasePeriod = easing.parametricEasePeriod; + } + #endif + + public TweenSettings(float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false, UpdateType updateType = default) + : this(duration, ease, null, cycles, cycleMode, startDelay, endDelay, useUnscaledTime, updateType) { + } + + public TweenSettings(float duration, Easing easing, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false, UpdateType updateType = default) + : this(duration, easing.ease, easing, cycles, cycleMode, startDelay, endDelay, useUnscaledTime, updateType) { + } + + internal static void setCyclesTo1If0(ref int cycles) { + if (cycles == 0) { + cycles = 1; + } + } + + internal void CopyFrom(ref TweenSettings other) { + duration = other.duration; + ease = other.ease; + customEase = other.customEase; + cycles = other.cycles; + cycleMode = other.cycleMode; + startDelay = other.startDelay; + endDelay = other.endDelay; + useUnscaledTime = other.useUnscaledTime; + parametricEase = other.parametricEase; + parametricEaseStrength = other.parametricEaseStrength; + parametricEasePeriod = other.parametricEasePeriod; + updateType = other.updateType; + } + + internal const float minDuration = 0.0001f; + + internal void SetValidValues() { + validateFiniteDuration(duration); + validateFiniteDuration(startDelay); + validateFiniteDuration(endDelay); + setCyclesTo1If0(ref cycles); + if (duration != 0f) { + #if UNITY_EDITOR && PRIME_TWEEN_SAFETY_CHECKS + if (duration < minDuration) { + Debug.LogError("duration = Mathf.Max(minDuration, duration);"); + } + #endif + duration = Mathf.Max(minDuration, duration); + } + startDelay = Mathf.Max(0f, startDelay); + endDelay = Mathf.Max(0f, endDelay); + if (cycles == 1) { + cycleMode = CycleMode.Restart; + } + } + + internal static void validateFiniteDuration(float f) { + Assert.IsFalse(float.IsNaN(f), Constants.durationInvalidError); + Assert.IsFalse(float.IsInfinity(f), Constants.durationInvalidError); + } + + internal static bool ValidateCustomCurve([NotNull] AnimationCurve curve) { + #if UNITY_ASSERTIONS && !PRIME_TWEEN_DISABLE_ASSERTIONS + if (curve.length < 2) { + Debug.LogError("Custom animation curve should have at least 2 keyframes, please edit the curve in Inspector."); + return false; + } + return true; + #else + return true; + #endif + } + + internal static bool ValidateCustomCurveKeyframes([NotNull] AnimationCurve curve) { + #if UNITY_ASSERTIONS && !PRIME_TWEEN_DISABLE_ASSERTIONS + if (!ValidateCustomCurve(curve)) { + return false; + } + var instance = PrimeTweenManager.Instance; + if (instance == null || instance.validateCustomCurves) { + var error = getError(); + if (error != null) { + Debug.LogWarning($"Custom animation curve is not configured correctly which may have unexpected results: {error}. " + + Constants.buildWarningCanBeDisabledMessage(nameof(PrimeTweenConfig.validateCustomCurves))); + } + string getError() { + var start = curve[0]; + if (!Mathf.Approximately(start.time, 0)) { + return "start time is not 0"; + } + if (!Mathf.Approximately(start.value, 0) && !Mathf.Approximately(start.value, 1)) { + return "start value is not 0 or 1"; + } + var end = curve[curve.length - 1]; + if (!Mathf.Approximately(end.time, 1)) { + return "end time is not 1"; + } + if (!Mathf.Approximately(end.value, 0) && !Mathf.Approximately(end.value, 1)) { + return "end value is not 0 or 1"; + } + return null; + } + } + return true; + #else + return true; + #endif + } + } + + [Serializable] + public struct UpdateType : IEquatable { + /// Uses to control the default Unity's event function, which updates the animation. + public static readonly UpdateType Default = new UpdateType(_UpdateType.Default); + /// Updates the animation in MonoBehaviour.Update().
+ /// If the animation has 'startValue' and doesn't have a start delay, the 'startValue' is applied in . + /// This ensures the animation is rendered at the 'startValue' in the same frame it's created. + public static readonly UpdateType Update = new UpdateType(_UpdateType.Update); + /// Updates the animation in MonoBehaviour.LateUpdate().
+ /// If the animation has 'startValue' and doesn't have a start delay, the 'startValue' is applied in . + /// This ensures the animation is rendered at the 'startValue' in the same frame it's created. + public static readonly UpdateType LateUpdate = new UpdateType(_UpdateType.LateUpdate); + /// Updates the animation in MonoBehaviour.FixedUpdate().
+ /// Unlike Update and LateUpdate animations, FixedUpdate animations don't apply the 'startValue' before the first frame is rendered. + /// They receive their first update in the first FixedUpdate() after creation. + public static readonly UpdateType FixedUpdate = new UpdateType(_UpdateType.FixedUpdate); + + [SerializeField] + internal _UpdateType enumValue; + internal UpdateType(_UpdateType enumValue) { this.enumValue = enumValue; } + [Obsolete("use 'UpdateType.FixedUpdate' instead.")] + public static implicit operator UpdateType(bool isFixedUpdate) => isFixedUpdate ? FixedUpdate : Update; + public static bool operator==(UpdateType lhs, UpdateType rhs) => lhs.enumValue == rhs.enumValue; + public static bool operator !=(UpdateType lhs, UpdateType rhs) => lhs.enumValue != rhs.enumValue; + public bool Equals(UpdateType other) => enumValue == other.enumValue; + public override bool Equals(object obj) => obj is UpdateType other && Equals(other); + public override int GetHashCode() => ((int)enumValue).GetHashCode(); + } + + internal enum _UpdateType : byte { + [Tooltip("Uses 'PrimeTweenConfig.defaultUpdateType' to control the default Unity's event function, which updates the animation.")] + Default, + [Tooltip("Updates the animation in MonoBehaviour.Update().\n\n" + + "If the animation has 'startValue' and doesn't have a start delay, the 'startValue' is applied in 'PrimeTweenManager.LateUpdate'. This ensures the animation is rendered at the 'startValue' in the same frame it's created.")] + Update, + [Tooltip("Updates the animation in MonoBehaviour.LateUpdate().\n\n" + + "If the animation has 'startValue' and doesn't have a start delay, the 'startValue' is applied in 'PrimeTweenManager.LateUpdate'. This ensures the animation is rendered at the 'startValue' in the same frame it's created.")] + LateUpdate, + [Tooltip("Updates the animation in 'MonoBehaviour.FixedUpdate()'.\n\n" + + "Unlike Update and LateUpdate animations, FixedUpdate animations don't apply the 'startValue' before the first frame is rendered. They receive their first update in the first FixedUpdate() after creation.")] + FixedUpdate + } + + /// The standard animation easing types. Different easing curves produce a different animation 'feeling'.
+ /// Play around with different ease types to choose one that suites you the best. + /// You can also provide a custom AnimationCurve as an ease function or parametrize eases with the Easing.Overshoot/Elastic/BounceExact(...) methods.
+ public enum Ease { Custom = -1, Default = 0, Linear = 1, + InSine, OutSine, InOutSine, + InQuad, OutQuad, InOutQuad, + InCubic, OutCubic, InOutCubic, + InQuart, OutQuart, InOutQuart, + InQuint, OutQuint, InOutQuint, + InExpo, OutExpo, InOutExpo, + InCirc, OutCirc, InOutCirc, + InElastic, OutElastic, InOutElastic, + InBack, OutBack, InOutBack, + InBounce, OutBounce, InOutBounce + } + + /// Controls the behavior of subsequent cycles when a tween has more than one cycle. + public enum CycleMode { + [Tooltip("Restarts the tween from the beginning.")] + Restart, + [Tooltip("Animates forth and back, like a yoyo. Easing is the same on the backward cycle.")] + Yoyo, + [Tooltip("At the end of a cycle increments the `endValue` by the difference between `startValue` and `endValue`.\n\n" + + "For example, if a tween moves position.x from 0 to 1, then after the first cycle, the tween will move the position.x from 1 to 2, and so on.")] + Incremental, + [Tooltip("Rewinds the tween as if time was reversed. Easing is reversed on the backward cycle.")] + Rewind + } +} diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/TweenSettings.cs.meta b/FactoryNumeric/Packages/PrimeTween/Runtime/TweenSettings.cs.meta new file mode 100644 index 00000000..31412815 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/TweenSettings.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: a711147e8806494290f395316ea27b55 +timeCreated: 1673432104 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/TweenSettingsT.cs b/FactoryNumeric/Packages/PrimeTween/Runtime/TweenSettingsT.cs new file mode 100644 index 00000000..d92c120b --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/TweenSettingsT.cs @@ -0,0 +1,113 @@ +using System; +using UnityEngine; + +namespace PrimeTween { + /// Contains 'start' and 'end' values of an animation in addition to . Can be serialized and tweaked from the Inspector in Unity 2020.1+.
+ /// Use this struct when the 'start' and 'end' values of an animation are known in advance.
+ /// Tweak animation from the Inspector, then pass the settings to the Tween method: + /// + /// [SerializeField] TweenSettings<Vector3> tweenSettings; + /// public void AnimatePosition() { + /// Tween.Position(transform, tweenSettings); + /// } + /// + /// + ///
Or create the TweenSettings in code: + /// + /// var tweenSettings = new TweenSettings<Vector3>(startValue: Vector3.zero, endValue: Vector3.one, duration: 1f, Ease.OutQuad, startDelay: 0.5f); + /// Tween.Position(transform, tweenSettings); + ///
+ [Serializable] + public struct TweenSettings where T: struct { + [Tooltip(Constants.startFromCurrentTooltip)] public bool startFromCurrent; + [Tooltip(Constants.startValueTooltip)] public T startValue; + [Tooltip(Constants.endValueTooltip)] public T endValue; + public TweenSettings settings; + + public TweenSettings(T endValue, TweenSettings settings) { + startFromCurrent = true; + startValue = default; + this.endValue = endValue; + this.settings = settings; + } + + public TweenSettings(T startValue, T endValue, TweenSettings settings) { + startFromCurrent = false; + this.startValue = startValue; + this.endValue = endValue; + this.settings = settings; + } + + public TweenSettings(T endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false, UpdateType updateType = default) + : this(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime, updateType)) { + } + + public TweenSettings(T startValue, T endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false, UpdateType updateType = default) + : this(startValue, endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime, updateType)) { + } + + public TweenSettings(T endValue, float duration, Easing customEase, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false, UpdateType updateType = default) + : this(endValue, new TweenSettings(duration, customEase, cycles, cycleMode, startDelay, endDelay, useUnscaledTime, updateType)) { + } + + public TweenSettings(T startValue, T endValue, float duration, Easing customEase, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false, UpdateType updateType = default) + : this(startValue, endValue, new TweenSettings(duration, customEase, cycles, cycleMode, startDelay, endDelay, useUnscaledTime, updateType)) { + } + + /// Use this method to choose the direction of an animation based on the '' parameter. + /// If true, returns TweenSettings to animate towards the .
+ /// If false, returns TweenSettings to animate towards the . + /// If true (default), the animation will start from the current value. Useful to prevent abrupt changes in case the previous animation if still running.
+ /// If false, the animation will start from the or the depending on the parameter. + /// For example, to animate a window to an opened or closed position: + /// + /// // Tweak all animation properties from Inspector + /// [SerializeField] TweenSettings<Vector3> windowAnimationSettings; + /// public void SetWindowOpened(bool isOpened) { + /// // Pass isOpened to the WithDirection() method to animate the window towards opened or closed position + /// Tween.LocalPosition(transform, windowAnimationSettings.WithDirection(toEndValue: isOpened)); + /// } + /// + public + #if UNITY_2020_2_OR_NEWER + readonly + #endif + TweenSettings WithDirection(bool toEndValue, bool _startFromCurrent = true) { + if (startFromCurrent) { + Debug.LogWarning(nameof(startFromCurrent) + " is already enabled on this TweenSettings. The " + nameof(WithDirection) + "() should be called on the TweenSettings once to choose the direction."); + } + var result = this; + result.startFromCurrent = _startFromCurrent; + if (toEndValue) { + return result; + } + (result.startValue, result.endValue) = (result.endValue, result.startValue); + return result; + } + + /// Similar to , but intended for use with custom tweens.
+ /// Custom tweens (Tween.Custom) don't know the current value of the animated property, so this method addresses this limitation.
+ /// Pass the current value of the animated property to start the tween from the current value and prevent abrupt changes. + /// + /// [SerializeField] TweenSettings<float> tweenSettings; + /// float currentValue; + /// public void AnimateCustomField(bool toEndValue) { + /// Tween.Custom(this, tweenSettings.WithDirection(toEndValue, currentValue), (_this, val) => _this.currentValue = val); + /// } + /// + public + #if UNITY_2020_2_OR_NEWER + readonly + #endif + TweenSettings WithDirection(bool toEndValue, T currentValue) { + var result = this; + if (result.startFromCurrent) { + result.startFromCurrent = false; + Debug.LogWarning(Constants.customTweensDontSupportStartFromCurrentWarning); + } + result.startValue = currentValue; + result.endValue = toEndValue ? endValue : startValue; + return result; + } + } +} \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Runtime/TweenSettingsT.cs.meta b/FactoryNumeric/Packages/PrimeTween/Runtime/TweenSettingsT.cs.meta new file mode 100644 index 00000000..6c0c4b65 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Runtime/TweenSettingsT.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: e2e695fd1b8540c287178353a35071e9 +timeCreated: 1683451931 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Samples~/Examples.meta b/FactoryNumeric/Packages/PrimeTween/Samples~/Examples.meta new file mode 100644 index 00000000..2af32ee4 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Samples~/Examples.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c9d6486c97dab45f4ad302aff48b895a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/PrimeTween/Samples~/Examples/BasicExample.cs b/FactoryNumeric/Packages/PrimeTween/Samples~/Examples/BasicExample.cs new file mode 100644 index 00000000..1e151716 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Samples~/Examples/BasicExample.cs @@ -0,0 +1,39 @@ +using PrimeTween; +using UnityEngine; +#if INPUT_SYSTEM_INSTALLED && ENABLE_INPUT_SYSTEM +using UnityEngine.InputSystem; +using TouchPhase = UnityEngine.InputSystem.TouchPhase; +using Touch = UnityEngine.InputSystem.EnhancedTouch.Touch; +#endif + +namespace PrimeTweenDemo { + public class BasicExample : MonoBehaviour { + [Tooltip("Tweak the animation that will be played in Awake() right from the Inspector.\n\n" + + "Click with mouse to play the animation created from code.")] + [SerializeField] + TweenSettings tweenSettings = new TweenSettings(Vector3.zero, new Vector3(0, 5), 1); + + void Awake() { + Tween.LocalPosition(transform, tweenSettings); + } + + void Update() { + if (GetInputDown()) { + Tween.LocalPositionX(transform, 0, 3f, 1f, Ease.OutBounce, 2, CycleMode.Yoyo); + } + } + + public static bool GetInputDown() { + #if INPUT_SYSTEM_INSTALLED && ENABLE_INPUT_SYSTEM + if (Mouse.current != null) { + return Mouse.current.leftButton.wasPressedThisFrame; + } + return Touch.activeTouches.Count > 0 && Touch.activeTouches[0].phase == TouchPhase.Began; + #elif ENABLE_LEGACY_INPUT_MANAGER + return Input.GetMouseButtonDown(0); + #else + return false; + #endif + } + } +} diff --git a/FactoryNumeric/Packages/PrimeTween/Samples~/Examples/BasicExample.cs.meta b/FactoryNumeric/Packages/PrimeTween/Samples~/Examples/BasicExample.cs.meta new file mode 100644 index 00000000..74b9decc --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Samples~/Examples/BasicExample.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8315d8fd05c6e47af8fa4ab75931cfa8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/PrimeTween/Samples~/Examples/BasicExample.unity b/FactoryNumeric/Packages/PrimeTween/Samples~/Examples/BasicExample.unity new file mode 100644 index 00000000..5cb88308 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Samples~/Examples/BasicExample.unity @@ -0,0 +1,314 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.37311924, g: 0.38073963, b: 0.3587269, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &77432201 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 77432204} + - component: {fileID: 77432203} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!20 &77432203 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 77432201} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0.8632076, g: 1, b: 0.929281, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &77432204 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 77432201} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &856390611 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 856390615} + - component: {fileID: 856390614} + - component: {fileID: 856390613} + - component: {fileID: 856390612} + m_Layer: 0 + m_Name: BasicExample + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &856390612 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 856390611} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8315d8fd05c6e47af8fa4ab75931cfa8, type: 3} + m_Name: + m_EditorClassIdentifier: + tweenSettings: + startFromCurrent: 0 + startValue: {x: 0, y: 0, z: 0} + endValue: {x: 0, y: 5, z: 0} + settings: + duration: 1 + ease: 0 + customEase: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + cycles: 1 + cycleMode: 0 + startDelay: 0 + endDelay: 0 + useUnscaledTime: 0 +--- !u!23 &856390613 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 856390611} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &856390614 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 856390611} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &856390615 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 856390611} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.000012993813, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/FactoryNumeric/Packages/PrimeTween/Samples~/Examples/BasicExample.unity.meta b/FactoryNumeric/Packages/PrimeTween/Samples~/Examples/BasicExample.unity.meta new file mode 100644 index 00000000..0d862d0f --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Samples~/Examples/BasicExample.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c506d5c0ca3694ba0b7c40c5c180d5b1 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/PrimeTween/Samples~/Examples/PrimeTween.Samples.asmdef b/FactoryNumeric/Packages/PrimeTween/Samples~/Examples/PrimeTween.Samples.asmdef new file mode 100644 index 00000000..12f51e06 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Samples~/Examples/PrimeTween.Samples.asmdef @@ -0,0 +1,23 @@ +{ + "name": "PrimeTween.Samples", + "rootNamespace": "", + "references": [ + "PrimeTween.Runtime", + "Unity.InputSystem" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [ + { + "name": "com.unity.inputsystem", + "expression": "1.0.0", + "define": "INPUT_SYSTEM_INSTALLED" + } + ], + "noEngineReferences": false +} \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Samples~/Examples/PrimeTween.Samples.asmdef.meta b/FactoryNumeric/Packages/PrimeTween/Samples~/Examples/PrimeTween.Samples.asmdef.meta new file mode 100644 index 00000000..2d92b941 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Samples~/Examples/PrimeTween.Samples.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5ba42b9ce9d01442097b281770dd21b1 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/PrimeTween/Samples~/Examples/SequenceExample.cs b/FactoryNumeric/Packages/PrimeTween/Samples~/Examples/SequenceExample.cs new file mode 100644 index 00000000..8e8685ac --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Samples~/Examples/SequenceExample.cs @@ -0,0 +1,37 @@ +using PrimeTween; +using UnityEngine; + +namespace PrimeTweenDemo { + public class SequenceExample : MonoBehaviour { + [SerializeField] int sequenceCycles = 2; + [SerializeField] TweenSettings tweenSettings = new TweenSettings(0.15f, endDelay: 0.1f); + [SerializeField] Vector3[] points = { + new Vector3(1, 0), + new Vector3(1, 1), + new Vector3(0, 1), + new Vector3(0, 0), + }; + Sequence sequence; + + void Awake() { + StartSequence(); + } + + void Update() { + if (BasicExample.GetInputDown()) { + if (sequence.isAlive) { + sequence.Complete(); + } else { + StartSequence(); + } + } + } + + void StartSequence() { + sequence = Sequence.Create(sequenceCycles); + foreach (var point in points) { + sequence.Chain(Tween.Position(transform, point, tweenSettings)); + } + } + } +} diff --git a/FactoryNumeric/Packages/PrimeTween/Samples~/Examples/SequenceExample.cs.meta b/FactoryNumeric/Packages/PrimeTween/Samples~/Examples/SequenceExample.cs.meta new file mode 100644 index 00000000..bfe1d0d1 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Samples~/Examples/SequenceExample.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: a721a314a95a4abcb407b5f492c22215 +timeCreated: 1681993667 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Samples~/Examples/SequenceExample.unity b/FactoryNumeric/Packages/PrimeTween/Samples~/Examples/SequenceExample.unity new file mode 100644 index 00000000..7eff84ea --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Samples~/Examples/SequenceExample.unity @@ -0,0 +1,316 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.37311924, g: 0.38073963, b: 0.3587269, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &77432201 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 77432204} + - component: {fileID: 77432203} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!20 &77432203 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 77432201} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0.8632076, g: 1, b: 0.929281, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &77432204 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 77432201} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &856390611 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 856390615} + - component: {fileID: 856390614} + - component: {fileID: 856390613} + - component: {fileID: 856390616} + m_Layer: 0 + m_Name: SequenceExample + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!23 &856390613 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 856390611} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &856390614 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 856390611} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &856390615 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 856390611} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.000012993813, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &856390616 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 856390611} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a721a314a95a4abcb407b5f492c22215, type: 3} + m_Name: + m_EditorClassIdentifier: + sequenceCycles: 2 + tweenSettings: + duration: 0.15 + ease: 0 + customEase: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + cycles: 1 + cycleMode: 0 + startDelay: 0 + endDelay: 0.1 + useUnscaledTime: 0 + points: + - {x: 1, y: 0, z: 0} + - {x: 1, y: 1, z: 0} + - {x: 0, y: 1, z: 0} + - {x: 0, y: 0, z: 0} diff --git a/FactoryNumeric/Packages/PrimeTween/Samples~/Examples/SequenceExample.unity.meta b/FactoryNumeric/Packages/PrimeTween/Samples~/Examples/SequenceExample.unity.meta new file mode 100644 index 00000000..609b043d --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Samples~/Examples/SequenceExample.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9c1b6a2b91dc342688160fa7cdff0d44 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/PrimeTween/Tests.meta b/FactoryNumeric/Packages/PrimeTween/Tests.meta new file mode 100644 index 00000000..78317853 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Tests.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 534281bb054324de39aa5041681405cf +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/PrimeTween/Tests/DebugInspectorTest.cs b/FactoryNumeric/Packages/PrimeTween/Tests/DebugInspectorTest.cs new file mode 100644 index 00000000..e4c3b508 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Tests/DebugInspectorTest.cs @@ -0,0 +1,48 @@ +using JetBrains.Annotations; +using PrimeTween; +using UnityEngine; + +public class DebugInspectorTest : MonoBehaviour { + // [SerializeField] ReusableTween reusableTween; + // [SerializeField] ReusableTween reusableTween2; + [UsedImplicitly] string debug; + // [SerializeField] int serializedInt; + // int notSerializedInt; + // + // [ContextMenu(nameof(debugSerializedObject))] + // void debugSerializedObject() { + // var so = new SerializedObject(this); + // var prop = typeof(SerializedObject).GetProperty("inspectorMode", BindingFlags.Instance | BindingFlags.NonPublic); + // Assert.IsNotNull(prop); + // prop.SetValue(so, 1); + // var i = so.GetIterator(); + // do { + // print($"{i.propertyPath}"); + // } while (i.Next(true)); + // } + + void Update() { + if (Time.frameCount == 2) { + test(); + } + updateDebug(); + } + + [ContextMenu(nameof(updateDebug))] + void updateDebug() { + throw new System.Exception(); + /*var tweens = PrimeTweenManager.Instance.tweens; + if (tweens.Count == 0) { + debug = "no tweens"; + return; + } + debug = $"is destroyed {tweens[0].isUnityTargetDestroyed()}";*/ + } + + void test() { + Sequence.Create() + .Chain(Tween.Delay(0.5f)) + .Chain(Tween.Delay(0.5f)) + ; + } +} \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Tests/DebugInspectorTest.cs.meta b/FactoryNumeric/Packages/PrimeTween/Tests/DebugInspectorTest.cs.meta new file mode 100644 index 00000000..dfb2b1f6 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Tests/DebugInspectorTest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 60b0a19d855b345c3ab930c9e4462c98 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/PrimeTween/Tests/DestructionOrderTest.cs b/FactoryNumeric/Packages/PrimeTween/Tests/DestructionOrderTest.cs new file mode 100644 index 00000000..f3e1d01e --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Tests/DestructionOrderTest.cs @@ -0,0 +1,41 @@ +#if UNITY_EDITOR && TEST_FRAMEWORK_INSTALLED +using PrimeTween; +using UnityEngine; + +public class DestructionOrderTest : MonoBehaviour { + void OnDestroy() { + print($"PrimeTweenManager.Instance == null: {PrimeTweenManager.Instance == null}"); + Tween.StopAll(transform); + Tween.CompleteAll(transform); + Tween.Custom(0, 1, 1, delegate {}); + var go = new GameObject(); + { + Tween.Alpha(go.AddComponent(), 0, 1); + Tween.Delay(1); + Tween.SetPausedAll(true); + Tween.ShakeLocalPosition(go.transform, Vector3.one, 1); + Tween.ShakeCustom(go, Vector3.zero, new ShakeSettings(Vector3.one, 1), delegate {}); + Sequence.Create(); + Tween.GlobalTimeScale(0.5f, 0.1f); + Tween.GetTweensCount(this); + Tween.GetTweensCount(); + Sequence.Create(Tween.Delay(0.1f)); + Tween.GlobalTimeScale(2f, 1f); + Tween.TweenTimeScale(Tween.Delay(0.1f), 2f, 1f); + Tween.TweenTimeScale(Sequence.Create(), 2f, 1f); + Tween.StopAll(); + Tween.CompleteAll(); + + PrimeTweenConfig.SetTweensCapacity(20); + PrimeTweenConfig.defaultEase = Ease.InCirc; + PrimeTweenConfig.warnZeroDuration = true; + PrimeTweenConfig.warnTweenOnDisabledTarget = true; + PrimeTweenConfig.validateCustomCurves = true; + PrimeTweenConfig.warnBenchmarkWithAsserts = true; + PrimeTweenConfig.warnEndValueEqualsCurrent = true; + PrimeTweenConfig.warnStructBoxingAllocationInCoroutine = true; + } + DestroyImmediate(go); + } +} +#endif \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Tests/DestructionOrderTest.cs.meta b/FactoryNumeric/Packages/PrimeTween/Tests/DestructionOrderTest.cs.meta new file mode 100644 index 00000000..de52303e --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Tests/DestructionOrderTest.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: c5cea97c604d462fb6e91f4bb34da203 +timeCreated: 1701530957 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Tests/DestructionOrderTest.unity b/FactoryNumeric/Packages/PrimeTween/Tests/DestructionOrderTest.unity new file mode 100644 index 00000000..bcf7d0d7 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Tests/DestructionOrderTest.unity @@ -0,0 +1,174 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.37311924, g: 0.38073963, b: 0.3587269, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &640009685 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 640009687} + - component: {fileID: 640009686} + m_Layer: 0 + m_Name: ManagerDestructionOrder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &640009686 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 640009685} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c5cea97c604d462fb6e91f4bb34da203, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!4 &640009687 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 640009685} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -5.417555} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 640009687} diff --git a/FactoryNumeric/Packages/PrimeTween/Tests/DestructionOrderTest.unity.meta b/FactoryNumeric/Packages/PrimeTween/Tests/DestructionOrderTest.unity.meta new file mode 100644 index 00000000..76e91761 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Tests/DestructionOrderTest.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9175594a893ab47ddb4520a84ad3d4ff +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/PrimeTween/Tests/EditModeTest.cs b/FactoryNumeric/Packages/PrimeTween/Tests/EditModeTest.cs new file mode 100644 index 00000000..15dfee77 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Tests/EditModeTest.cs @@ -0,0 +1,54 @@ +#if UNITY_EDITOR && TEST_FRAMEWORK_INSTALLED +// ReSharper disable NotAccessedField.Local +// ReSharper disable UnusedMember.Local +// ReSharper disable PartialTypeWithSinglePart +using PrimeTween; +using UnityEngine; +using Assert = NUnit.Framework.Assert; +using AssertionException = UnityEngine.Assertions.AssertionException; + +[ExecuteInEditMode] +public partial class EditModeTest : MonoBehaviour { + [SerializeField] TweenSettings _settings = new TweenSettings(1, AnimationCurve.Linear(0, 0, 1, 1)); + Tween tween = test(); + Sequence sequence = Sequence.Create(); + + static Tween test() { + Assert.IsTrue(Constants.noInstance, "This test is designed only for Edit mode."); + PrimeTweenConfig.SetTweensCapacity(10); + Assert.Throws(() => PrimeTweenConfig.warnZeroDuration = false); + Tween.StopAll(); + Tween.GlobalTimeScale(0.5f, 0.1f); + Tween.GetTweensCount(); + Sequence.Create() + .ChainCallback(() => {}) + .InsertCallback(0f, delegate {}) + .Group(StartTween()) + .Chain(StartTween()) + .Insert(0f, Sequence.Create()) + .Insert(0, StartTween()); + Tween.Delay(new object(), 1f, () => { }); + Tween.Delay(new object(), 1f, _ => {}); + Tween.Delay(1f, () => { }); + return Tween.Custom(0, 1, 1, delegate {}); + } + + static Tween StartTween() => Tween.Custom(0f, 1f, 1f, delegate { }); + + void Awake() => test(); + void OnValidate() => test(); + void Reset() => test(); + void OnEnable() => test(); + void OnDisable() => test(); + void OnDestroy() => test(); +} + +/*[UnityEditor.InitializeOnLoad] +public partial class EditModeTest { + static EditModeTest() => test(); + EditModeTest() => test(); + + [RuntimeInitializeOnLoadMethod] + static void runtimeInitOnLoad() => test(); +}*/ +#endif \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Tests/EditModeTest.cs.meta b/FactoryNumeric/Packages/PrimeTween/Tests/EditModeTest.cs.meta new file mode 100644 index 00000000..44489667 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Tests/EditModeTest.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 7833e513ff3241dbb68c9788a43922c2 +timeCreated: 1692639345 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Tests/EditModeTest.unity b/FactoryNumeric/Packages/PrimeTween/Tests/EditModeTest.unity new file mode 100644 index 00000000..5f1f2a23 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Tests/EditModeTest.unity @@ -0,0 +1,206 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.3708708, g: 0.37838137, b: 0.35725543, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &529890444 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 529890446} + - component: {fileID: 529890445} + m_Layer: 0 + m_Name: EditModeTest + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &529890445 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 529890444} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7833e513ff3241dbb68c9788a43922c2, type: 3} + m_Name: + m_EditorClassIdentifier: + settings: + duration: 1 + ease: -1 + customEase: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + cycles: 1 + cycleMode: 0 + startDelay: 0 + endDelay: 0 + useUnscaledTime: 0 +--- !u!4 &529890446 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 529890444} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 529890446} diff --git a/FactoryNumeric/Packages/PrimeTween/Tests/EditModeTest.unity.meta b/FactoryNumeric/Packages/PrimeTween/Tests/EditModeTest.unity.meta new file mode 100644 index 00000000..bc9a4b83 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Tests/EditModeTest.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 37ae5fc39592d4318a6fe6a131733eac +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/PrimeTween/Tests/Experiments.cs b/FactoryNumeric/Packages/PrimeTween/Tests/Experiments.cs new file mode 100644 index 00000000..b84ce289 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Tests/Experiments.cs @@ -0,0 +1,58 @@ +/*// ReSharper disable UnusedParameter.Global +using System; +using JetBrains.Annotations; +using PrimeTween; +using UnityEngine; +using Object = UnityEngine.Object; + +[Serializable, PublicAPI] +public class ReusableTween where T : struct { + [SerializeField] TweenType tweenType; + [SerializeField] Object target; + [SerializeField] TweenSettings settings; + Tween tween; + readonly Action customSetter; + bool toEndValue; + + /*public ReusableTween(TweenType tweenType, Object target, TweenSettings data) { + this.tweenType = tweenType; + this.target = target; + this.data = data; + } + + public ReusableTween(TweenSettings data, Action customSetter) { + tweenType = TweenType.Custom; + this.data = data; + this.customSetter = customSetter; + }#1# + + public void Play(bool _toEndValue = true) { + if (tween._isAlive) { + if (isPaused && toEndValue == _toEndValue) { + isPaused = false; + return; + } + tween.Stop(); + } + toEndValue = _toEndValue; + // tween = ... + } + + public void Stop() { + tween.Stop(); + } + + public void Complete() { + tween.Complete(); + } + + public void OnComplete(Action callback) { + callback(); + throw new NotImplementedException(); + } + + public bool isPaused { + get => tween.isPaused; + set => tween.isPaused = value; + } +}*/ \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Tests/Experiments.cs.meta b/FactoryNumeric/Packages/PrimeTween/Tests/Experiments.cs.meta new file mode 100644 index 00000000..cfc40dbf --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Tests/Experiments.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: b8980c8986b2405f9b32d4672d3f9c6b +timeCreated: 1683303690 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Tests/FramePacingTest.cs b/FactoryNumeric/Packages/PrimeTween/Tests/FramePacingTest.cs new file mode 100644 index 00000000..408dcd0e --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Tests/FramePacingTest.cs @@ -0,0 +1,101 @@ +#if TEST_FRAMEWORK_INSTALLED +using System.Collections; +using PrimeTween; +using UnityEngine; +using Assert = NUnit.Framework.Assert; + +public class FramePacingTest : MonoBehaviour { + int frame; + int numRunning; + + void Update() { + if (frame == 0) { + StartCoroutine(delayCor()); + StartCoroutine(zeroFramesAnimationCor()); + StartCoroutine(DelaysInSequenceDurationTest()); + for (int i = 2; i <= 10; i++) { + StartCoroutine(testMult(i)); + } + Assert.AreEqual(numRunning, 12); + } + if (numRunning == 0) { + Assert.AreEqual(0, Tween.StopAll(this)); + Destroy(gameObject); + } + frame++; + } + + IEnumerator DelaysInSequenceDurationTest() { + for (int i = 0; i < 1; i++) { + yield return test(); + } + IEnumerator test() { + numRunning++; + int frameStart = Time.frameCount; + int numFrames = Random.Range(1, 3); + float duration = numFrames * (1f / Application.targetFrameRate); + yield return Tween.Delay(duration) + .Chain(Tween.Delay(duration)) + .ChainCallback(assert) + .ToYieldInstruction(); + assert(); + numRunning--; + + void assert() { + validate(numFrames * 2, frameStart); + } + } + } + + IEnumerator delayCor() { + numRunning++; + int frameStart = Time.frameCount; + float deltaTime = 1f / Application.targetFrameRate; + yield return Tween.Delay(this, deltaTime) + .OnComplete(() => validate(1, frameStart)) + .ToYieldInstruction(); + validate(1, frameStart); + numRunning--; + } + + static void validate(int expected, int frameStart) { + var frameDelta = Time.frameCount - frameStart; + var diff = frameDelta - expected; + /*if (diff != 0) { + Debug.LogWarning($"frameDelta: {frameDelta}, expected: {expected}"); + } else { + Debug.Log("ok"); + }*/ + Assert.IsTrue(diff == 0 || diff == 1, $"frameDelta: {frameDelta}, expected: {expected}"); + } + + IEnumerator zeroFramesAnimationCor() { + numRunning++; + int frameStart = Time.frameCount; + float duration = 1f / Application.targetFrameRate; + // print($"zeroFramesAnimationCor {duration}"); + yield return Tween.Custom(this, 0f, 0f, duration, delegate { + // Assert.AreEqual(Time.frameCount, frameStart + 1); + }) + .OnComplete(() => validate(1, frameStart)) + .ToYieldInstruction(); + validate(1, frameStart); + numRunning--; + } + + IEnumerator testMult(int numFrames) { + numRunning++; + int frameStart = Time.frameCount; + float duration = 1f / Application.targetFrameRate * numFrames; + // print($"multipleFrameAnimationCor {numFrames}, {duration}"); + yield return Tween.Custom(this, 0f, 0f, duration, delegate { + // print(Time.deltaTime); + }) + .OnComplete(() => validate(numFrames, frameStart)) + .ToYieldInstruction(); + validate(numFrames, frameStart); + // print($"multipleFrameAnimationCor done {numFrames}"); + numRunning--; + } +} +#endif \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Tests/FramePacingTest.cs.meta b/FactoryNumeric/Packages/PrimeTween/Tests/FramePacingTest.cs.meta new file mode 100644 index 00000000..0c8fa370 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Tests/FramePacingTest.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 4643b1740130499786513b590eacfe6b +timeCreated: 1685002071 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Tests/OnComplete.cs b/FactoryNumeric/Packages/PrimeTween/Tests/OnComplete.cs new file mode 100644 index 00000000..c9f5a966 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Tests/OnComplete.cs @@ -0,0 +1,82 @@ +#if TEST_FRAMEWORK_INSTALLED +using System; +using System.Collections; +using System.Threading.Tasks; +using NUnit.Framework; +using PrimeTween; +using UnityEngine; +using UnityEngine.TestTools; +using Assert = NUnit.Framework.Assert; +using Object = UnityEngine.Object; + +public partial class Tests { + [Test] + public void OnCompleteIsCalledImmediatelyAfterCallingComplete() { + var onCompleteIsCalled = false; + var t = createTween().OnComplete(() => onCompleteIsCalled = true); + Assert.IsFalse(onCompleteIsCalled); + t.Complete(); + Assert.IsTrue(onCompleteIsCalled); + } + + [Test] + public void OnCompleteDuplicationThrows() { + var t = createTween().OnComplete(() => {}); + try { + t.OnComplete(() => { }); + } catch (Exception e) { + Assert.IsTrue(e.Message.Contains("Tween already has an onComplete callback")); + return; + } + Assert.Fail(); + } + + [Test] + public void AddingOnCompleteToInfiniteTween() { + int numCompleted = 0; + createInfiniteTween().OnComplete(() => numCompleted++).Complete(); + Assert.AreEqual(1, numCompleted); + } + + Tween createInfiniteTween() { + return Tween.Custom(this, 0, 1, 0.01f, cycles: -1, onValueChange: delegate { }); + } + + [Test] + public void AddingOnCompleteOnDeadTweenDisplaysError() { + var t = createTween(); + Assert.IsTrue(t.isAlive); + t.Complete(); + Assert.IsFalse(t.isAlive); + expectIsDeadError(); + t.OnComplete(delegate { }); + expectIsDeadError(); + t.OnComplete(this, delegate { }); + } + + [Test] + public async Task OnCompleteTargetDestructionWhileTweenRunning() { + expectOnCompleteIgnored(); + LogAssert.NoUnexpectedReceived(); + var target = new GameObject(); + await Tween.Custom(0, 1, 0.001f, _ => { + Object.DestroyImmediate(target); + }).OnComplete(target, _ => Assert.Fail()); + } + + [Test] + public void PassingNullToOnComplete() { + expectOnCompleteIgnored(); + Tween.Delay(minDuration).OnComplete(null, _ => Assert.Fail()); + } + + [UnityTest] + public IEnumerator PassingDestroyedObjectToOnComplete() { + var target = new GameObject(); + Object.DestroyImmediate(target); + expectOnCompleteIgnored(); + yield return Tween.Delay(minDuration).OnComplete(target, _ => Assert.Fail()).ToYieldInstruction(); + LogAssert.NoUnexpectedReceived(); + } +} +#endif diff --git a/FactoryNumeric/Packages/PrimeTween/Tests/OnComplete.cs.meta b/FactoryNumeric/Packages/PrimeTween/Tests/OnComplete.cs.meta new file mode 100644 index 00000000..8a1a36eb --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Tests/OnComplete.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 4ec64d84bbd14dc39ef80db58d239b15 +timeCreated: 1676976211 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Tests/OnValueChangeExceptions.cs b/FactoryNumeric/Packages/PrimeTween/Tests/OnValueChangeExceptions.cs new file mode 100644 index 00000000..70f3331c --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Tests/OnValueChangeExceptions.cs @@ -0,0 +1,52 @@ +#if TEST_FRAMEWORK_INSTALLED +using System; +using System.Collections; +using System.Text.RegularExpressions; +using PrimeTween; +using UnityEngine; +using UnityEngine.TestTools; +using Assert = NUnit.Framework.Assert; + +public partial class Tests { + [UnityTest] + public IEnumerator ExceptionInTheMiddle() { + expectTweenWasStoppedBecauseException(); + expectOnCompleteIgnored(); + var onCompleteCalled = false; + var tweener = Tween.Custom(transform, 0, 1, 0.1f, delegate { + throw new Exception("TEST"); + }).OnComplete(() => { + onCompleteCalled = true; + }); + while (tweener.isAlive) { + yield return null; + } + Assert.IsFalse(onCompleteCalled); + } + + [UnityTest] + public IEnumerator ExceptionOnLastFrame() { + expectTweenWasStoppedBecauseException(); + expectOnCompleteIgnored(); + var onCompleteDidCalled = false; + var tweener = Tween.Custom(transform, 0, 1, getDt() * 4f, (_, val) => { + if (val > 0.99f) { + throw new Exception("TEST"); + } + }).OnComplete(() => { + onCompleteDidCalled = true; + }); + while (tweener.isAlive) { + yield return null; + } + Assert.IsFalse(onCompleteDidCalled); + } + + static void expectOnCompleteIgnored() => LogAssert.Expect(LogType.Error, new Regex(Constants.onCompleteCallbackIgnored)); + + static void expectTweenWasStoppedBecauseException() { + LogAssert.Expect(LogType.Exception, new Regex(".*")); + LogAssert.Expect(LogType.Warning, new Regex("Tween was stopped because of exception")); + } +} +#endif \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Tests/OnValueChangeExceptions.cs.meta b/FactoryNumeric/Packages/PrimeTween/Tests/OnValueChangeExceptions.cs.meta new file mode 100644 index 00000000..c09c96a5 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Tests/OnValueChangeExceptions.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: c0de4566773447f398b1b32aba71e895 +timeCreated: 1676975078 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Tests/PrimeTween.Tests.asmdef b/FactoryNumeric/Packages/PrimeTween/Tests/PrimeTween.Tests.asmdef new file mode 100644 index 00000000..f16aaa89 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Tests/PrimeTween.Tests.asmdef @@ -0,0 +1,29 @@ +{ + "name": "PrimeTween.Tests", + "rootNamespace": "", + "references": [ + "UnityEngine.TestRunner", + "UnityEditor.TestRunner", + "PrimeTween.Runtime", + "PrimeTween.Editor" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": true, + "overrideReferences": true, + "precompiledReferences": [ + "nunit.framework.dll" + ], + "autoReferenced": false, + "defineConstraints": [ + "UNITY_INCLUDE_TESTS" + ], + "versionDefines": [ + { + "name": "com.unity.test-framework", + "expression": "1.3.9", + "define": "TEST_FRAMEWORK_INSTALLED" + } + ], + "noEngineReferences": false +} \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Tests/PrimeTween.Tests.asmdef.meta b/FactoryNumeric/Packages/PrimeTween/Tests/PrimeTween.Tests.asmdef.meta new file mode 100644 index 00000000..95c7e5b2 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Tests/PrimeTween.Tests.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2f1f0462514f541c7851be3650ccd0ff +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/PrimeTween/Tests/SceneLoadSetsUnityObjectBug.unity b/FactoryNumeric/Packages/PrimeTween/Tests/SceneLoadSetsUnityObjectBug.unity new file mode 100644 index 00000000..0b5b2bc7 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Tests/SceneLoadSetsUnityObjectBug.unity @@ -0,0 +1,317 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &1184031815 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1184031817} + - component: {fileID: 1184031816} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &1184031816 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1184031815} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 1 + m_Shape: 0 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &1184031817 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1184031815} + serializedVersion: 2 + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!1 &1570041033 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1570041036} + - component: {fileID: 1570041035} + - component: {fileID: 1570041034} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &1570041034 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1570041033} + m_Enabled: 1 +--- !u!20 &1570041035 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1570041033} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &1570041036 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1570041033} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 1570041036} + - {fileID: 1184031817} diff --git a/FactoryNumeric/Packages/PrimeTween/Tests/SceneLoadSetsUnityObjectBug.unity.meta b/FactoryNumeric/Packages/PrimeTween/Tests/SceneLoadSetsUnityObjectBug.unity.meta new file mode 100644 index 00000000..cc1bcd9d --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Tests/SceneLoadSetsUnityObjectBug.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f3a9ab67dfe3449c4bc6816eda90d283 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/PrimeTween/Tests/Sequence.cs b/FactoryNumeric/Packages/PrimeTween/Tests/Sequence.cs new file mode 100644 index 00000000..cc313f90 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Tests/Sequence.cs @@ -0,0 +1,2295 @@ +// ReSharper disable AnnotateNotNullParameter +#if TEST_FRAMEWORK_INSTALLED +using System; +using System.Collections; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using JetBrains.Annotations; +using NUnit.Framework; +using PrimeTween; +using UnityEngine; +using UnityEngine.TestTools; +using Assert = NUnit.Framework.Assert; +using Object = UnityEngine.Object; +using Random = UnityEngine.Random; + +public partial class Tests { + [UnityTest] + public IEnumerator ElapsedTime() { + var timeStart = Time.time; + var d1 = getDt() * 4f; + var d2 = getDt() * 2f; + var c1 = 2; + var c2 = 3; + var c3 = 2; + var seq = Tween.Custom(0, 1, d1, delegate { }, cycles: c1) + .Chain(Tween.Custom(0, 1, d2, delegate { }, cycles: c2)); + seq.SetRemainingCycles(c3); + Assert.AreEqual((d1 * c1 + d2 * c2) * c3, seq.durationTotal, 0.00001f); + while (seq.isAlive) { + var expected = Time.time - timeStart; + // Debug.Log($"expected {expected} / elapsedTimeTotal {seq.elapsedTimeTotal}"); + if (seq.cyclesDone == 0) { + Assert.AreEqual(expected, seq.elapsedTime, 0.001f); + } + Assert.AreEqual(expected, seq.elapsedTimeTotal, getDt() * 2); // fails with lower tolerance because Sequence doesn't measure the elapsedTimeTotal, but calculates it from duration * cyclesDone + yield return null; + } + } + + [UnityTest] + public IEnumerator SequenceNestingCycles() { + float duration = getDt(); + { + int numCompleted = 0; + var s1 = Sequence.Create(Tween.Delay(duration, () => numCompleted++)); + yield return Sequence.Create(Tween.Delay(duration)) + .Chain(s1) + .ToYieldInstruction(); + Assert.AreEqual(1, numCompleted); + } + { + int numCompleted = 0; + var s1 = Sequence.Create(Tween.Delay(duration, () => numCompleted++)); + yield return Sequence.Create(2) + .Chain(Tween.Delay(duration)) + .Chain(s1) + .ToYieldInstruction(); + Assert.AreEqual(2, numCompleted); + } + { + int numCompleted = 0; + var s1 = Sequence.Create(2) + .Chain(Tween.Delay(duration, () => numCompleted++)); + + yield return Sequence.Create(2) + .Chain(Tween.Delay(duration)) + .Chain(s1) + .ToYieldInstruction(); + Assert.AreEqual(4, numCompleted); + } + } + + [UnityTest] + public IEnumerator SequenceNestingDepsChain() { + const float duration = 100f; + var s1 = Sequence.Create(Tween.Delay(duration)); + var t1 = Tween.Delay(duration); + var t2 = Tween.Delay(duration); + var s2 = Sequence.Create(t1).Group(t2); + s1.Chain(s2); + Assert.AreEqual(duration, s2.root.tween.waitDelay); + Assert.AreEqual(0f, t1.tween.waitDelay); + Assert.AreEqual(0f, t2.tween.waitDelay); + yield return null; + Assert.AreEqual(0f, t1.elapsedTime); + Assert.AreEqual(0f, t2.elapsedTime); + s1.Stop(); + } + + [UnityTest] + public IEnumerator SequenceNestingDepsGroup() { + const float duration = 100f; + var t1 = Tween.Delay(duration); + var t2 = Tween.Delay(duration); + var nested = Sequence.Create(t1).Group(t2); + var seq = Sequence.Create(Tween.Delay(duration)) + .ChainDelay(duration) + .Group(nested); + Assert.AreEqual(0, t1.tween.waitDelay); + Assert.AreEqual(0, t2.tween.waitDelay); + yield return null; + Assert.AreEqual(0, t1.elapsedTime); + Assert.AreEqual(0, t2.elapsedTime); + seq.Stop(); + } + + [UnityTest] + public IEnumerator SequenceNestingAfterTweenChainOp() { + var duration = 0.001f + Random.value * 0.05f; // longest + var s1 = Sequence.Create(Tween.Delay(duration)); + var s2 = Sequence.Create(); + s1.Chain(s2); + + var t1 = Tween.Delay(0.01f); + s1.Chain(t1); + Assert.AreEqual(duration, t1.tween.waitDelay); + + var t2 = Tween.Delay(0.01f); + s1.Group(t2); + Assert.AreEqual(duration, t2.tween.waitDelay); + + yield return s1.ToYieldInstruction(); + } + + [UnityTest] + public IEnumerator SequenceNestingChainOrder() { + var t1 = Tween.Delay(0.01f); + var s1 = Sequence.Create(t1); + var t2 = Tween.Delay(0.05f); + s1.Chain(t2); + + var t3 = Tween.Delay(0.01f); + var t4 = Tween.Delay(0.01f); + var s2 = Sequence.Create(t3).Group(t4); + s1.Chain(s2); + Assert.AreEqual(t2.durationWithWaitDelay, s2.root.tween.waitDelay); + Assert.AreEqual(0f, t3.tween.waitDelay); + Assert.AreEqual(0f, t4.tween.waitDelay); + var t5 = Tween.Delay(0.01f); + s1.Group(t5); + Assert.AreEqual(t2.durationWithWaitDelay, t5.tween.waitDelay); + yield return s1.ToYieldInstruction(); + } + + [UnityTest] + public IEnumerator SequenceNestingGroupOrder() { + const float t1Dur = 0.017f; + var t1 = Tween.Delay(t1Dur); + var s1 = Sequence.Create(t1); + const float longestDur = 0.05f; + var t2 = Tween.Delay(longestDur); + s1.Chain(t2); + Assert.AreEqual(t1.durationWithWaitDelay, t2.tween.waitDelay); + var t3 = Tween.Delay(0.01f); + s1.Group(t3); + Assert.AreEqual(t1.durationWithWaitDelay, t3.tween.waitDelay); + + var s2 = Sequence.Create(Tween.Delay(0.01f)); + var t4 = Tween.Delay(0.01f); + s2.Group(t4); + + s1.Group(s2); + Assert.AreEqual(0f, t4.tween.waitDelay); + + var t5 = Tween.Delay(0.01f); + s1.Group(t5); + Assert.AreEqual(t1Dur, t5.tween.waitDelay); + + var t6 = Tween.Delay(0.01f); + var seqDur = s1.durationTotal; + s1.Chain(t6); + Assert.AreEqual(seqDur, t6.tween.waitDelay); + + yield return s1.ToYieldInstruction(); + } + + [UnityTest] + public IEnumerator SequenceNestingRestart() { + int numCallback = 0; + yield return Sequence.Create(2) + .Chain(Tween.Delay(0.01f)) + .Chain(Sequence.Create(Tween.Delay(0.01f))) + .ChainCallback(() => numCallback++) + .ToYieldInstruction(); + Assert.AreEqual(2, numCallback); + } + + [Test] + public void SequenceNestingPause2() { + { + var s1 = Sequence.Create(); + + var s2 = Sequence.Create(); + s2.isPaused = true; + LogAssert.Expect(LogType.Error, new Regex("'isPaused' was ignored after adding")); + s1.Group(s2); + expectCantManipulateTweenInsideSequence(); + _ = s2.isPaused; + s1.Complete(); + } + { + var s1 = Sequence.Create(); + s1.isPaused = true; + var s2 = Sequence.Create(); + s2.isPaused = true; + s1.Chain(s2); + expectCantManipulateTweenInsideSequence(); + _ = s2.isPaused; + s1.Complete(); + LogAssert.NoUnexpectedReceived(); + } + } + + [Test] + public void SequenceNestingPause() { + var s = Sequence.Create(Tween.Delay(0.01f)) + .Chain(Sequence.Create(Tween.Delay(0.01f))); + Assert.AreEqual(1, numNestedSequences(s)); + s.isPaused = true; + int count = 0; + foreach (var t in s.getAllChildren()) { + count++; + var child = t; + + expectCantManipulateTweenInsideSequence(); + expectCantManipulateTweenInsideSequence(); + child.isPaused = !child.isPaused; + + expectCantManipulateTweenInsideSequence(); + expectCantManipulateTweenInsideSequence(); + child.timeScale += 1f; + } + Assert.AreEqual(3, count); + + s.isPaused = false; + count = 0; + foreach (var _ in s.getAllTweens()) { + count++; + } + Assert.AreEqual(4, count); + } + + [Test] + public void SequenceNestingLongestTween() { + float dur = Random.value + 0.1f; + var t = Tween.Delay(dur); + var sequence = Sequence.Create(Tween.Delay(dur)) + .Chain(Sequence.Create(Tween.Delay(dur))) + .Chain(Sequence.Create(t)); + Assert.AreEqual(dur * 3, sequence.durationTotal, 0.0001f); + sequence.Stop(); + Assert.IsFalse(t.isAlive); + } + + [UnityTest] + public IEnumerator SequenceNestingStopChildInTheMiddle() { + Tween.StopAll(); + int numS1Completed = 0; + int numS2Completed = 0; + int numS3Completed = 0; + float duration = minDuration * Random.Range(1f, 10f); + var s1 = Sequence.Create(Tween.Delay(duration, () => { + Assert.AreEqual(0, numS1Completed); + Assert.AreEqual(0, numS3Completed); + numS1Completed++; + })); + var s2 = Sequence.Create(Tween.Delay(duration, () => numS2Completed++)); + var s3 = Sequence.Create(Tween.Delay(duration, () => { + Assert.AreEqual(1, numS1Completed); + Assert.AreEqual(0, numS3Completed); + numS3Completed++; + })); + s1.Chain(s2).Chain(s3); + Assert.AreEqual(2, numNestedSequences(s1)); + expectCantManipulateTweenInsideSequence(); + s2.Stop(); + Assert.AreEqual(2, numNestedSequences(s1)); + yield return s1.ToYieldInstruction(); + Assert.AreEqual(1, numS1Completed); + Assert.AreEqual(1, numS2Completed); + Assert.AreEqual(1, numS3Completed); + yield return null; + Assert.AreEqual(0, tweensCount); + } + + [UnityTest] + public IEnumerator SequenceNestingCompleteLastChild() { + var duration = getDt(); + var s1 = Sequence.Create(Tween.Delay(duration)); + var s2 = Sequence.Create(Tween.Delay(duration)); + s1.Chain(s2); + Assert.AreEqual(1, numNestedSequences(s1)); + expectCantManipulateTweenInsideSequence(); + s2.Complete(); + Assert.AreEqual(1, numNestedSequences(s1)); + Assert.IsTrue(s2.isAlive); + Assert.IsTrue(s1.isAlive); + yield return s1.ToYieldInstruction(); + } + + static int numNestedSequences(Sequence seq) { + Assert.IsTrue(seq.isAlive); + int result = 0; + foreach (var t in seq.getAllTweens()) { + if (t.tween.isSequenceRoot() && !t.tween.isMainSequenceRoot()) { + result++; + } + } + Assert.IsTrue(result >= 0); + return result; + } + + [UnityTest] + public IEnumerator SequenceNesting() { + if (tweensCount > 0) { + Tween.StopAll(); + Assert.AreEqual(0, tweensCount); + } + int numS1Completed = 0; + int numS2Completed = 0; + var s1 = Sequence.Create(Tween.Delay(0.02f, () => { + // Debug.Log("1"); + Assert.AreEqual(0, numS1Completed); + Assert.AreEqual(0, numS2Completed); + numS1Completed++; + })); + var s2 = Sequence.Create(Tween.Delay(0.01f, () => { + // Debug.Log("2"); + Assert.AreEqual(1, numS1Completed); + Assert.AreEqual(0, numS2Completed); + numS2Completed++; + })); + s1.Chain(s2); + Assert.AreEqual(1, numNestedSequences(s1)); + yield return s1.ToYieldInstruction(); + Assert.AreEqual(1, numS1Completed); + Assert.AreEqual(1, numS2Completed); + yield return null; + Assert.AreEqual(0, tweensCount); + } + + [Test] + public void SequenceNestingDifferentSettings() { + var seq = Sequence.Create(); + seq.timeScale = Random.Range(0.01f, 1.5f); + + expectErrors(); + seq.Group(createSequenceWithNonDefaultSettings()); + + expectErrors(); + seq.Chain(createSequenceWithNonDefaultSettings()); + LogAssert.NoUnexpectedReceived(); + + return; + + static void expectErrors() { + LogAssert.Expect(LogType.Error, new Regex("'isPaused' was ignored after adding")); + LogAssert.Expect(LogType.Error, new Regex("'timeScale' was ignored after adding")); + LogAssert.Expect(LogType.Error, new Regex("'useUnscaledTime' was ignored after adding")); + LogAssert.Expect(LogType.Error, new Regex("'updateType' was ignored after adding")); + } + + static Sequence createSequenceWithNonDefaultSettings() { + var s2 = Sequence.Create(useUnscaledTime: true, updateType: UpdateType.FixedUpdate); + s2.isPaused = true; + s2.timeScale = 0.5f; + return s2; + } + } + + [UnityTest] + public IEnumerator SequenceNestingInfinite() { + var s1 = Sequence.Create(); + var infSeq = Sequence.Create(cycles: -1); + expectInfiniteTweenInSequenceError(); + s1.Group(infSeq); + + expectInfiniteTweenInSequenceError(); + s1.Chain(infSeq); + + yield return null; + infSeq.Complete(); + } + + [UnityTest] + public IEnumerator GetSequenceElapsedTimeWhenAllTargetsDestroyed() { + var target = new GameObject(); + var s = Sequence.Create(Tween.Delay(target, 0.1f)); + Object.DestroyImmediate(target); + Assert.IsTrue(s.isAlive); + var _ = s.elapsedTime; + yield return s.ToYieldInstruction(); + } + + [UnityTest] + public IEnumerator StopAllWhenSequenceHasCompletedTweenAndTargetDestroyed() { + var target = new GameObject(); + var duration = getDt() * 5f; + var t = Tween.Delay(target, duration); + int numCompleted = 0; + var s = Sequence.Create(t) + .Chain(Tween.Delay(target, duration, () => numCompleted++)); + while (t.interpolationFactor < 1f) { + yield return null; + } + Assert.IsTrue(t.isAlive); + Assert.IsTrue(s.isAlive); + int aliveCount = 0; + foreach (var _ in s.getAllTweens()) { + if (_.isAlive) { + aliveCount++; + } + } + Assert.AreEqual(3, aliveCount, "tweens now always alive while their sequence is alive"); + Object.DestroyImmediate(target); + Assert.AreEqual(3, tweensCount); + expectOnCompleteIgnored(); + var numCompleteAll = Tween.CompleteAll(); + Assert.AreEqual(3, numCompleteAll); + Assert.AreEqual(0, numCompleted); + Assert.AreEqual(0, tweensCount); + Assert.AreEqual(0, numCompleted); + LogAssert.NoUnexpectedReceived(); + } + + [UnityTest] + public IEnumerator StopAllWhenSequenceHasCompletedTween() { + var duration = getDt() * 10f; + var t = Tween.Delay(duration); + var s = Sequence.Create(t) + .ChainDelay(duration); + while (t.interpolationFactor < 1f) { + yield return null; + } + Assert.IsTrue(t.isAlive); + Assert.IsTrue(s.isAlive); + Assert.AreEqual(3, tweensCount); + Tween.StopAll(); + Assert.AreEqual(0, tweensCount); + } + + [UnityTest] + public IEnumerator StopSequenceFromCallback() { + var aliveCount = tweensCount; + if (aliveCount > 0) { + Assert.AreEqual(Tween.StopAll(null), aliveCount); + } + Sequence s = default; + s = Sequence.Create() + .ChainCallback(() => { + s.Stop(); + Assert.IsFalse(s.isAlive); + }); + yield return s.ToYieldInstruction(); + yield return null; + Assert.AreEqual(0, tweensCount); + } + + [UnityTest] + public IEnumerator ExceptionInOnCompleteNestedSequence() { + var aliveCount = tweensCount; + if (aliveCount > 0) { + Assert.AreEqual(Tween.StopAll(), aliveCount); + } + var main = Sequence.Create(Tween.Delay(getDt() * 2)); + expectOnCompleteException(); + var nested = Sequence.Create().ChainCallback(() => throw new Exception()); + main.Group(nested); + yield return main.ToYieldInstruction(); + yield return null; + Assert.AreEqual(0, tweensCount); + LogAssert.NoUnexpectedReceived(); + } + + static void expectOnCompleteException() { + LogAssert.Expect(LogType.Error, new Regex("Tween's onComplete callback raised exception")); + } + + [UnityTest] + public IEnumerator ExceptionInOnValueChangeNestedSequence() { + var aliveCount = tweensCount; + if (aliveCount > 0) { + Assert.AreEqual(Tween.StopAll(null), aliveCount); + } + var main = Sequence.Create(Tween.Delay(getDt() * 2)); + expectTweenWasStoppedBecauseException(); + var nested = Sequence.Create(Tween.Custom(0f, 1f, getDt() * 2, delegate { throw new Exception(); })); + main.Group(nested); + yield return main.ToYieldInstruction(); + yield return null; + Assert.AreEqual(0, tweensCount); + LogAssert.NoUnexpectedReceived(); + } + + [Test] + public async Task SequenceLongestTween() { + { + var t1 = Tween.Delay(0.01f); + var t2 = Tween.Delay(0.02f); + var s = t1.Group(t2); + Assert.AreEqual(t2.durationTotal, s.durationTotal); + await s; + } + { + var t1 = Tween.Delay(0.01f); + var t2 = Tween.Delay(0.02f); + var s = t2.Group(t1); + Assert.AreEqual(t2.durationTotal, s.durationTotal); + } + { + var t1 = Tween.Delay(0.01f); + var t2 = Tween.Delay(0.02f); + var s = t1.Chain(t2); + Assert.AreEqual(t1.durationTotal + t2.durationTotal, s.durationTotal); + } + { + var t1 = Tween.Delay(0.01f); + var t2 = Tween.Delay(0.02f); + var s = t2.Chain(t1); + Assert.AreEqual(t1.durationTotal + t2.durationTotal, s.durationTotal); + } + { + var t1 = Tween.PositionX(transform, 1f, 0.1f, cycles: 3); // longest + var t2 = Tween.PositionX(transform, 1f, 0.1f); + var s = t1.Group(t2); + Assert.AreEqual(t1.durationTotal, s.durationTotal); + } + { + var t1 = Tween.PositionX(transform, 1f, 0.1f, cycles: 3); + var t2 = Tween.PositionX(transform, 1f, 0.1f); + var s = t1.Chain(t2); + Assert.AreEqual(t1.durationTotal + t2.durationTotal, s.durationTotal); + } + } + + [Test] + public async Task AwaitFinishedSequence() { + var t = Tween.Delay(0.01f); + var s = Sequence.Create(t); + await s; + Assert.IsTrue(s.IsCreated); + Assert.IsFalse(s.isAlive); + await s; + } + + [UnityTest] + public IEnumerator SequenceRestartFromTo() { + for (int i = 0; i < 1; i++) { + var target = new GameObject(nameof(SequenceRestartFromTo)).transform; + Assert.AreEqual(Vector3.zero, target.localPosition); + var s = Tween.LocalPositionX(target, new TweenSettings(0f, 1f, getDt() * 2f)) + .Chain(Tween.LocalPositionX(target, new TweenSettings(1f, 0.5f, getDt()))); + s.SetRemainingCycles(2); + if (Random.value < 0.5f) { + s.Complete(); + } else { + yield return s.ToYieldInstruction(); + } + UnityEngine.Assertions.Assert.AreApproximatelyEqual(0.5f, target.localPosition.x); + Object.Destroy(target.gameObject); + } + } + + [UnityTest] + public IEnumerator SequenceRestartTo() { + var target = new GameObject(nameof(SequenceRestartTo)).transform; + Assert.AreEqual(Vector3.zero, target.localPosition); + var duration = getDt() * 3f; + var s = Tween.LocalPositionX(target, 1f, duration) + .Chain(Tween.LocalPositionX(target, 0.5f, duration)); + s.SetRemainingCycles(2); + if (Random.value < 0.5f) { + s.Complete(); + } else { + yield return s.ToYieldInstruction(); + } + UnityEngine.Assertions.Assert.AreApproximatelyEqual(0.5f, target.localPosition.x); + Object.Destroy(target.gameObject); + } + + [UnityTest] + public IEnumerator SequenceRestartWhenTweenHaveStartDelay() { + var data = new TweenSettings(Vector3.zero, Vector3.one, getDt() * Random.Range(0.5f, 2f), startDelay: getDt() * Random.Range(0.5f, 2f)); + var t1 = Tween.Position(transform, data); + var t2 = Tween.Position(transform, data); + PrimeTweenConfig.warnStructBoxingAllocationInCoroutine = true; + expectCoroutineBoxingWarning(); + var seq = t1.Chain(t2); + seq.SetRemainingCycles(2); + yield return seq; + LogAssert.NoUnexpectedReceived(); + } + + static void expectCoroutineBoxingWarning() { + LogAssert.Expect(LogType.Warning, new Regex("Please use Tween/Sequence.ToYieldInstruction")); + } + + [UnityTest] + public IEnumerator StopAllWhenTweenInSequenceIsCompleted() { + var target = new object(); + var duration = getDt() * 2f; + var t1 = Tween.Delay(target, duration); + var t2 = Tween.Delay(target, duration); + yield return t1.Chain(t2).ToYieldInstruction(); + Tween.StopAll(target); + Tween.SetPausedAll(true, target); + Tween.SetPausedAll(false, target); + } + + [UnityTest] + public IEnumerator SequenceElapsedTime() { + yield return null; + float dt = getDt(); + var dur1 = dt * Random.Range(2, 5); + var dur2 = dt * Random.Range(2, 5); + var cycles1 = Random.Range(1, 4); + var cycles2 = Random.Range(1, 4); + var t1 = Tween.Position(transform, Vector3.one, dur1, cycles: cycles1); + var t2 = Tween.Position(transform, Vector3.one, dur2, cycles: cycles2); + var s = Sequence.Create(t1) + .Chain(t2); + + float timeStart = Time.time; + Assert.IsTrue(t1.isAlive); + while (t1.interpolationFactor < 1f) { + yield return null; + } + Assert.AreEqual(dur1 * cycles1, Time.time - timeStart, Time.deltaTime); + + Assert.IsTrue(s.isAlive); + yield return s; + Assert.AreEqual(dur1 * cycles1 + dur2 * cycles2, Time.time - timeStart, Time.deltaTime); + } + + [UnityTest] + public IEnumerator DefaultPropertiesOfSequence() { + { + Assert.AreEqual(0, tweensCount); + var duration = 0.001f; + var s = Sequence.Create(-1).Chain(Tween.Delay(duration)); + Assert.AreEqual(-1, s.cyclesTotal); + Assert.AreEqual(duration, s.duration); + Assert.IsTrue(float.IsPositiveInfinity(s.durationTotal)); + + yield return null; + const int expectedCount = 2; + Assert.AreEqual(expectedCount, tweensCount); + yield return null; + Assert.AreEqual(expectedCount, tweensCount); + yield return null; + Assert.AreEqual(expectedCount, tweensCount); + s.Stop(); + Assert.AreEqual(expectedCount, tweensCount); + yield return null; + Assert.AreEqual(0, tweensCount); + } + { + var s = Sequence.Create(); + Assert.AreEqual(1, s.cyclesTotal); + validate(s); + } + { + var s = Sequence.Create(); + validate(s); + } + + void validate(Sequence s) { + Assert.AreEqual(0, s.duration); + Assert.AreEqual(0, s.durationTotal); + Assert.AreEqual(0, s.progress); + Assert.AreEqual(0, s.progressTotal); + Assert.AreEqual(0, s.cyclesDone); + Assert.AreEqual(0, s.elapsedTime); + Assert.AreEqual(0, s.elapsedTimeTotal); + } + } + + [Test] + public async Task SequenceProperties() { + for (int i = 0; i < 1; i++) { + int cyclesDone = 0; + Tween tween = default; + var duration = Mathf.Max(TweenSettings.minDuration, getDt() * Random.Range(0.5f, 6f)); + var sequenceCycles = Random.Range(2, 5); + // const float duration = 0.1f; + // const int sequenceCycles = 2; + Sequence sequence = default; + validateSequenceDefaultProps(false); + sequence = Sequence.Create(sequenceCycles); + float timeStart = Time.time; + tween = Tween.Custom(transform, 0, 1, duration, ease: Ease.Linear, onValueChange: (_, val) => { + // Debug.Log($"elapsedTimeTotal: {sequence.elapsedTimeTotal}, val: {val}"); + Assert.IsTrue(tween.isAlive); + Assert.IsTrue(sequence.isAlive); + UnityEngine.Assertions.Assert.AreApproximatelyEqual(sequence.duration, duration); + var durationTotalExpected = duration * sequenceCycles; + UnityEngine.Assertions.Assert.AreApproximatelyEqual(sequence.durationTotal, durationTotalExpected); + Assert.AreEqual(tween.duration, duration); + Assert.AreEqual(tween.durationTotal, duration); + var elapsedTimeExpected = Time.time - timeStart; + if (val < 1f) { + if (sequence.cyclesDone == 0) { + UnityEngine.Assertions.Assert.AreApproximatelyEqual(sequence.elapsedTime, tween.elapsedTime); + UnityEngine.Assertions.Assert.AreApproximatelyEqual(tween.elapsedTime, elapsedTimeExpected); + UnityEngine.Assertions.Assert.AreApproximatelyEqual(sequence.elapsedTime, elapsedTimeExpected); + } + if (sequence.root.tween.elapsedTimeTotal >= 0f) { + Assert.AreEqual(elapsedTimeExpected, sequence.elapsedTimeTotal, getDt()); + Assert.AreEqual(sequence.progress, Mathf.Clamp01(sequence.elapsedTime / sequence.duration)); + Assert.AreEqual(sequence.progressTotal, Mathf.Clamp01(elapsedTimeExpected / durationTotalExpected), 0.001f); + } + } + }); + #pragma warning disable 4014 + sequence.Group(tween); + #pragma warning restore + await sequence.ChainCallback(() => cyclesDone++); + Assert.AreEqual(sequenceCycles, cyclesDone); + Assert.IsFalse(sequence.isAlive); + validateSequenceDefaultProps(true); + Assert.IsFalse(tween.isAlive); + + void validateSequenceDefaultProps(bool isCreated) { + for (int j = 0; j < 8; j++) { + expectIsDeadError(isCreated); + } + Assert.AreEqual(0, sequence.elapsedTime); + Assert.AreEqual(0, sequence.elapsedTimeTotal); + Assert.AreEqual(0, sequence.cyclesDone); + Assert.AreEqual(0, sequence.cyclesTotal); + Assert.AreEqual(0, sequence.duration); + Assert.AreEqual(0, sequence.durationTotal); + Assert.AreEqual(0, sequence.progress); + Assert.AreEqual(0, sequence.progressTotal); + } + } + } + + [UnityTest] + public IEnumerator ExceptionInSequenceOnCycleComplete() { + int numExceptions = 0; + Sequence s = default; + s = Sequence.Create(2, CycleMode.Restart) + .Chain(Tween.Delay(getDt())) + .Chain(Tween.Custom(0f, 1f, getDt(), val => { + // print($"{s.cyclesDone}, {val}"); + if (s.cyclesDone == 1 && val == 0f) { + numExceptions++; + expectTweenWasStoppedBecauseException(); + throw new Exception(); + } + })) + .Chain(Tween.Delay(getDt())); + yield return s; + Assert.AreEqual(1, numExceptions); + } + + [Test] + public async Task SequenceIncrementalTween() { + await Tween.Delay(getDt()); + float dur = getDt() * (Random.value + 0.1f); + var t = Tween.Position(transform, Vector3.one, dur, cycles: 2, cycleMode: CycleMode.Incremental); + int cyclesDone = 0; + const int sequenceCycles = 4; + await Sequence.Create(sequenceCycles) + .Chain(t) + .ChainCallback(() => { + cyclesDone++; + Assert.AreEqual(0f, t.interpolationFactor % 1f); + }); + Assert.AreEqual(sequenceCycles, cyclesDone); + } + + [Test] + public void SettingInfiniteLoopsToTweenInSequence() { + var t = createTween(); + var s = Sequence.Create(t); + expectCantManipulateTweenInsideSequence(); + t.SetRemainingCycles(-1); + s.Complete(); + } + + [Test] + public void TweenIsReleasedFromSequenceOnReleaseAll() { + test(true); + test(false); + void test(bool isStop) { + var t = createTween(); + var s = Sequence.Create(t); + Assert.IsTrue(t.isAlive); + Assert.IsTrue(s.isAlive); + if (isStop) { + Tween.StopAll(); + } else { + Tween.CompleteAll(); + } + Assert.IsFalse(t.isAlive); + Assert.IsFalse(s.isAlive); + Assert.IsFalse(t.tween.sequence.IsCreated); + } + } + + [Test] + public void SequenceComplete() { + int numTweenCompleted = 0; + var s = Sequence.Create(createCustomTween(0.01f).OnComplete(() => numTweenCompleted++)); + Assert.IsTrue(s.isAlive); + s.Complete(); + Assert.IsFalse(s.isAlive); + Assert.AreEqual(1, numTweenCompleted); + } + + [Test] + public void SequenceStop() { + var s = Sequence.Create(createCustomTween(0.01f)); + Assert.IsTrue(s.isAlive); + s.Stop(); + Assert.IsFalse(s.isAlive); + s.Stop(); + Assert.IsFalse(s.isAlive); + } + + /*[UnityTest] + public IEnumerator SequenceRevert() { + var val = 0f; + var t = Tween.Custom(this, 0, 1, 1, (_, newVal) => { + val = newVal; + }); + var s = Sequence.Create(t); + yield return null; + Assert.AreNotEqual(0, val); + s.Revert(); + Assert.IsFalse(s.isAlive); + Assert.AreEqual(0, val); + }*/ + + [UnityTest] + public IEnumerator CompletedTweenInsideSequenceDoesntCompleteSecondTimeOnCompletingSequence() { + var numFirstCompleted = 0; + var numSecondCompleted = 0; + Tween first = createCustomTween(getDt()).OnComplete(() => numFirstCompleted++); + Tween second = createCustomTween(getDt() * 5f).OnComplete(() => numSecondCompleted++); + var sequence = Sequence.Create(first) + .Group(second); + while (first.interpolationFactor < 1f) { + yield return null; + } + Assert.IsTrue(first.isAlive); + Assert.IsTrue(first.tween._isAlive); + Assert.AreEqual(1, numFirstCompleted); + + Assert.IsTrue(second.isAlive); + Assert.IsTrue(sequence.isAlive); + sequence.Complete(); + Assert.AreEqual(1, numFirstCompleted); + Assert.AreEqual(1, numSecondCompleted); + } + + static Tween createCustomTween(float duration) { + return Tween.Custom(PrimeTweenManager.Instance, 0, 1, duration, delegate{}); + } + + [Test] + public void CompletingSequenceCompletesAllTweensInside() { + var numFirstCompleted = 0; + var numSecondCompleted = 0; + Sequence.Create(createTween().OnComplete(() => numFirstCompleted++)) + .Group(createTween().OnComplete(() => numSecondCompleted++)) + .Complete(); + Assert.AreEqual(1, numFirstCompleted); + Assert.AreEqual(1, numSecondCompleted); + } + + [UnityTest] + public IEnumerator Cycles() { + var tweenCyclesDone = 0; + var sequenceCyclesDone = 0; + const int sequenceCycles = 5; + const int tweenCycles = 3; + // tween cycles doesn't matter because OnComplete will only be executed when all cycles complete + var tween = Tween.Custom(this, 0, 1, Mathf.Max(minDuration, getDt() * Random.Range(0.1f, 0.5f)), cycles: tweenCycles, onValueChange: delegate{}) + .OnComplete(() => { + // Debug.Log($"[{Time.frameCount}] tweenCycles++"); + tweenCyclesDone++; + }); + Sequence sequence = default; + sequence = Sequence.Create(sequenceCycles) + .Chain(tween) + .ChainCallback(() => { + // Debug.Log($"[{Time.frameCount}] sequenceCycles: {sequenceCyclesDone}, actual cyclesDone: {sequence.cyclesDone}"); + Assert.AreEqual(sequenceCyclesDone, sequence.cyclesDone); + Assert.AreEqual(sequenceCycles, sequence.cyclesTotal); + sequenceCyclesDone++; + }); + yield return sequence.ToYieldInstruction(); + Assert.IsFalse(tween.isAlive); + Assert.IsFalse(sequence.isAlive); + Assert.AreEqual(sequenceCycles, tweenCyclesDone); + Assert.AreEqual(sequenceCycles, sequenceCyclesDone); + } + + /*static IEnumerator Timeout([NotNull] Func continueWaiting, float timeout) { + var timeStarted = Time.time; + while (continueWaiting()) { + if (Time.time - timeStarted > timeout) { + throw new Exception($"Timeout of {timeout} seconds reached."); + } + yield return null; + } + }*/ + + [Test] + public void GroupDeadTweenToSequence() { + var deadTween = createTween(); + deadTween.Complete(); + expectAddDeadToSequenceError(); + Sequence.Create(Tween.Delay(0.001f)).Group(deadTween); + } + + Tween createTween() { + var t = Tween.LocalPosition(transform, Vector3.one, 1); + Assert.IsTrue(t.isAlive); + return t; + } + + [Test] + public void ChainDeadTweenToSequence() { + var tweener = Tween.LocalPosition(transform, Vector3.one, 1); + tweener.Complete(); + Assert.IsFalse(tweener.isAlive); + expectAddDeadToSequenceError(); + Sequence.Create(Tween.Delay(0.0001f)).Chain(tweener); + } + + static void expectAddDeadToSequenceError() { + LogAssert.Expect(LogType.Error, Constants.addDeadTweenToSequenceError); + } + + [UnityTest] + public IEnumerator SequenceRelease() { + Tween.StopAll(); + for (int i = 0; i < 5; i++) { + Assert.AreEqual(0, tweensCount); + var duration = Mathf.Max(TweenSettings.minDuration, getDt()); + var t = Tween.Delay(duration); + var s = Sequence.Create(t); + yield return null; + // Debug.Log($"duration: {duration}, dt {Time.deltaTime}"); + // print(Time.deltaTime > duration); + if (Time.deltaTime > duration) { + Assert.IsFalse(t.isAlive); + Assert.IsFalse(s.isAlive); + Tween.StopAll(); + continue; + } + Assert.IsTrue(t.isAlive); + Assert.IsTrue(s.isAlive); + s.Stop(); + Assert.AreEqual(2, tweensCount); + yield return null; + Assert.AreEqual(0, tweensCount); + } + } + + [UnityTest] + public IEnumerator ManipulatingTweensInsideSequenceCoroutine() { + { + var nestedTween = Tween.Delay(getDt()); + Sequence.Create(nestedTween); + expectCantManipulateTweenInsideSequence(); + yield return nestedTween.ToYieldInstruction(); + } + { + var nestedSequence = Sequence.Create(); + Sequence.Create().Chain(nestedSequence); + expectCantManipulateTweenInsideSequence(); + yield return nestedSequence.ToYieldInstruction(); + } + } + + [Test] + public async Task ManipulatingTweensInsideSequenceAsync() { + var t = Tween.Delay(getDt()); + #pragma warning disable 4014 + Sequence.Create(t); + #pragma warning restore + expectCantManipulateTweenInsideSequence(); + await t; + } + + [Test] + public void ManipulatingTweensInsideSequence() { + var go = new GameObject(); + var tween = Tween.Custom(go, 0, 1, 1, delegate{}, cycles: 3, cycleMode: CycleMode.Yoyo); + Sequence.Create(tween); + Assert.IsTrue(tween.isAlive); + + expectCantManipulateTweenInsideSequence(); + tween.Stop(); + + expectCantManipulateTweenInsideSequence(); + tween.Complete(); + + expectCantManipulateTweenInsideSequence(); + tween.SetRemainingCycles(5); + + expectCantManipulateTweenInsideSequence(); + tween.SetRemainingCycles(true); + + expectCantManipulateTweenInsideSequence(); + tween.Group(new Tween()); + + expectCantManipulateTweenInsideSequence(); + tween.Chain(new Tween()); + + expectCantManipulateTweenInsideSequence(); + tween.Group(new Sequence()); + + expectCantManipulateTweenInsideSequence(); + tween.Chain(new Sequence()); + + expectCantManipulateTweenInsideSequence(); + Assert.AreEqual(0 , Tween.StopAll(go)); + + expectCantManipulateTweenInsideSequence(); + Assert.AreEqual(0, Tween.CompleteAll(go)); + + expectCantManipulateTweenInsideSequence(); + Tween.SetPausedAll(true, go); + + expectCantManipulateTweenInsideSequence(); + Tween.SetPausedAll(false, go); + + expectCantManipulateTweenInsideSequence(); + expectCantManipulateTweenInsideSequence(); + tween.isPaused = !tween.isPaused; + + expectCantManipulateTweenInsideSequence(); + expectCantManipulateTweenInsideSequence(); + tween.timeScale += 0.5f; + + expectCantManipulateTweenInsideSequence(); + tween.elapsedTime += 0.1f; + + expectCantManipulateTweenInsideSequence(); + tween.elapsedTimeTotal += 0.1f; + + Tween.StopAll(); + Assert.AreEqual(0, tweensCount); + LogAssert.NoUnexpectedReceived(); + } + + static void expectCantManipulateTweenInsideSequence() { + LogAssert.Expect(LogType.Error, new Regex("It's not allowed to manipulate 'nested' tweens and sequences")); + } + + [Test] + public void AddingInfiniteTweenToSequenceThrows() { + var infiniteTween = createInfiniteTween(); + expectInfiniteTweenInSequenceError(); + Sequence.Create(infiniteTween); + + expectInfiniteTweenInSequenceError(); + Sequence.Create(infiniteTween); + + expectInfiniteTweenInSequenceError(); + Sequence.Create(Tween.Delay(minDuration)).Chain(infiniteTween); + } + + static void expectInfiniteTweenInSequenceError() => LogAssert.Expect(LogType.Error, Constants.infiniteTweenInSequenceError); + + static void expectException(Action code, [NotNull] string message) where T: Exception { + Assert.IsFalse(string.IsNullOrEmpty(message)); + try { + code(); + } catch (T e) { + if (!e.Message.Contains(message)) { + Debug.LogException(e); + Assert.Fail(); + } + return; + } + Assert.Fail($"Exception of type {typeof(T)} didn't appear: {message}"); + } + + [Test] + public void TestDeadSequence() { + var s = createDeadSequence(); + + expectError(); + s.Group(createCustomTween(1)); + + expectError(); + s.ChainCallback(delegate { }); + + expectError(); + s.ChainCallback(this, delegate { }); + + expectError(); + s.Chain(createTween()); + + #if PRIME_TWEEN_DOTWEEN_ADAPTER + expectError(); + s.ChainLast(createTween()); + #endif + + s.Stop(); + s.Complete(); + // s.Revert(); + + expectError(); + s.SetRemainingCycles(5); + + expectError(); + s.isPaused = true; + + void expectError() { + expectIsDeadError(); + } + } + + static Sequence createDeadSequence() { + var s = Sequence.Create(createCustomTween(1)); + s.Complete(); + Assert.IsFalse(s.isAlive); + return s; + } + + [UnityTest] + public IEnumerator AddingTweenToSequenceModifiesIsPausedToMatchSequence() { + Tween.StopAll(); + Assert.AreEqual(0, tweensCount); + var s = Sequence.Create(Tween.PositionY(transform,10f, 0.04f)); + Assert.IsFalse(s.isPaused); + + var t = Tween.Delay(0.04f); + Assert.IsFalse(t.isPaused); + t.isPaused = true; + Assert.IsTrue(t.isPaused); + + LogAssert.Expect(LogType.Error, new Regex("'isPaused' was ignored after adding")); + s.Group(t); + LogAssert.NoUnexpectedReceived(); + yield return s.ToYieldInstruction(); + } + + + [Test] + public void DuplicateTweenAddedToSequence() { + var t = createTween(); + var s = Sequence.Create(t); + expectNestTweenTwiceError(); + s.Group(t); + + expectNestTweenTwiceError(); + var s2 = Sequence.Create(); + s2.Group(t); + + expectNestTweenTwiceError(); + Sequence.Create(t); + } + + static void expectNestTweenTwiceError() => LogAssert.Expect(LogType.Error, new Regex(Constants.nestTweenTwiceError)); + + [UnityTest] + public IEnumerator TweenIsNotReleasedFromSequenceUntilSequenceReleasesAllTweens() { + var t = createCustomTween(minDuration); + var delay = Tween.Delay(getDt() * 4f); + var s = Sequence.Create(t).Group(delay); + Assert.IsTrue(t.isAlive); + yield return s.ToYieldInstruction(); + Assert.IsFalse(t.isAlive); + } + + [UnityTest] + public IEnumerator ProcessAllDoesntLeaveUnreleasableTweens() { + Tween.StopAll(); + Assert.AreEqual(0, tweensCount); + var t1 = createCustomTween(0.0001f); + var t2 = createCustomTween(0.1f); + if (Random.value < 0.5f) { + t1.Group(t2); + } else { + t1.Chain(t2); + } + while (t1.interpolationFactor < 1f) { + yield return null; + } + Assert.IsTrue(t1.isAlive); + Assert.IsTrue(t2.isAlive); + Assert.AreNotEqual(0, tweensCount); + Tween.StopAll(); + Assert.AreEqual(0, tweensCount); + } + + [Test] + public void ProcessAllDoesntLeaveUnreleasableTweensWhenTargetDestroyed() { + if (tweensCount != 0) { + Tween.StopAll(); + } + Assert.AreEqual(0, tweensCount); + var target1 = new GameObject(); + var t1 = Tween.Custom(target1, 0, 1,0.0001f, delegate{}); + var t2 = createCustomTween(0.1f); + t1.Group(t2); + Object.DestroyImmediate(target1); + Assert.AreEqual(3, tweensCount); + Assert.IsTrue(t1.isAlive); + Tween.StopAll(); + Assert.AreEqual(0, tweensCount); + } + + [Test] + public void SequenceCompleteWhenMoreThanTwo() { + createTween() + .Group(createTween()) + .Group(createTween()) + .Complete(); + } + + [Test] + public void SequenceDuration() { + var dur1 = Random.value; + var cycles1 = Random.Range(1, 5); + var s = Sequence.Create(Tween.Custom(this, 0, 1, dur1, cycles: cycles1, onValueChange: delegate{})); + Assert.AreEqual(dur1 * cycles1, s.duration); + Assert.AreEqual(dur1 * cycles1, s.durationTotal); + var dur2 = dur1 + Random.value; + var cycles2 = cycles1 + Random.Range(1, 5); + s.Group(Tween.Custom(this, 0, 1, dur2, cycles: cycles2, onValueChange: delegate{})); + Assert.AreEqual(dur2 * cycles2, s.duration); + Assert.AreEqual(dur2 * cycles2, s.durationTotal); + s.Chain(Tween.Delay(1)); + var expected = dur2 * cycles2 + 1; + const float tolerance = 0.0001f; + Assert.AreEqual(expected, s.duration, tolerance); + Assert.AreEqual(expected, s.durationTotal, tolerance); + var sequenceCycles = Random.Range(1, 100); + s.SetRemainingCycles(sequenceCycles); + Assert.AreEqual(expected, s.duration, tolerance); + Assert.AreEqual(expected * sequenceCycles, s.durationTotal, tolerance); + s.Complete(); + } + + [UnityTest] + public IEnumerator SequenceCycles() { + Application.targetFrameRate = 200; + int cyclesDone = 0; + var iniCycles = Random.Range(3, 10); + // const int iniCycles = 3; + var s = Sequence.Create(iniCycles) + .Chain(Tween.PositionX(transform, 3.14f, getDt() * 2f, cycles: 2)) + .ChainCallback(this, _ => cyclesDone++); + Assert.AreEqual(iniCycles, s.cyclesTotal); + Assert.AreEqual(0, s.cyclesDone); + while (s.cyclesDone == 0) { + yield return null; + } + Assert.AreEqual(iniCycles, s.cyclesTotal); + Assert.AreEqual(cyclesDone, s.cyclesDone); + var pendingCycles = Random.Range(2, 10); + // const int pendingCycles = 2; + s.SetRemainingCycles(pendingCycles); + var expectedCycles = cyclesDone + pendingCycles; + Assert.AreEqual(expectedCycles, s.cyclesTotal); + Assert.AreEqual(1, s.cyclesDone); + while (s.cyclesDone == 1) { + yield return null; + } + Assert.AreEqual(expectedCycles, s.cyclesTotal); + Assert.AreEqual(cyclesDone, s.cyclesDone); + s.Complete(); + Application.targetFrameRate = targetFrameRate; + } + + [Test] + public void AwaitNewlyCreatedSequenceDoesntCompleteSyncButInSameFrame() { + bool isCompleted = false; + #pragma warning disable CS4014 + AwaitNewlyCreatedSequenceDoesntCompleteSyncButInSameFrame_internal(() => isCompleted = true); + #pragma warning restore CS4014 + Assert.IsFalse(isCompleted); + } + + static async Task AwaitNewlyCreatedSequenceDoesntCompleteSyncButInSameFrame_internal([NotNull] Action callback) { + int frameStarted = Time.frameCount; + await Sequence.Create(); + Assert.AreEqual(frameStarted, Time.frameCount); // completes in same frame, but not immediately + callback(); + } + + [Test] + public void UsingDefaultSequenceCtor() { + for (int i = 0; i < 26; i++) { + expectDefaultCtorError(); + } + var seq = new Sequence(); + seq.elapsedTime += seq.elapsedTime; // +3 + _ = seq.cyclesTotal; + _ = seq.cyclesDone; + _ = seq.duration; + seq.elapsedTimeTotal += seq.elapsedTimeTotal; // +3 + _ = seq.durationTotal; + _ = seq.progress; + _ = seq.progressTotal; + var t = Tween.Delay(0.0001f); + seq.Group(t); + seq.Chain(t); + seq.ChainCallback(() => {}); + seq.ChainCallback(this, delegate {}); + seq.ChainDelay(1f); + seq.Stop(); // no error + seq.Complete(); // no error + seq.SetRemainingCycles(false); + seq.SetRemainingCycles(10); + seq.isPaused = !seq.isPaused; // +2 + seq.Chain(Sequence.Create()); + seq.Group(Sequence.Create()); + seq.timeScale += seq.timeScale; // +3 + + #if PRIME_TWEEN_DOTWEEN_ADAPTER + expectDefaultCtorError(); + seq.ChainLast(t); + #endif + Tween.StopAll(); + } + + static void expectDefaultCtorError() { + LogAssert.Expect(LogType.Error, Constants.defaultCtorError); + } + + [UnityTest] + public IEnumerator OnCompleteCallbackIsCalledOnlyOnce() { + int numT1Completed = 0; + var t1 = Tween.Delay(0.05f).OnComplete(() => numT1Completed++); + var s = t1.Chain(Tween.Delay(0.05f)); + while (t1.interpolationFactor < 1f) { + yield return null; + } + Assert.IsTrue(t1.isAlive); + Assert.AreEqual(1, numT1Completed); + s.Complete(); + Assert.AreEqual(1, numT1Completed); + } + + [UnityTest] + public IEnumerator SequenceElapsedTime2() { + Application.targetFrameRate = 200; + float dt = getDt(); + var cycleTimeStart = Time.time; + float duration = dt * 5f; + var s = Tween.Delay(duration) + .Chain(Tween.Delay(duration)) + .ChainCallback(() => cycleTimeStart = Time.time); + s.SetRemainingCycles(2); + var timeStart = Time.time; + while (s.isAlive) { + float tolerance = dt * 2; + Assert.AreEqual(Time.time - timeStart, s.elapsedTimeTotal, tolerance); + Assert.AreEqual(Time.time - cycleTimeStart, s.elapsedTime, tolerance); + yield return null; + } + Application.targetFrameRate = targetFrameRate; + } + + [Test] + public void SequenceTimeScale() { + var seq = Sequence.Create(); + const float seqTimeScale = 1.5f; + seq.timeScale = seqTimeScale; + var t2 = Tween.Delay(0.1f); + t2.timeScale = 0.5f; + LogAssert.Expect(LogType.Error, new Regex("'timeScale' was ignored after adding")); + seq.Chain(t2); + foreach (var t in seq.getAllChildren()) { + Assert.AreEqual(0.5f, t.tween.timeScale); + } + + seq.timeScale = 2f; + Assert.AreEqual(2f, seq.root.timeScale); + foreach (var t in seq.getAllChildren()) { + Assert.AreEqual(0.5f, t.tween.timeScale); + } + + LogAssert.NoUnexpectedReceived(); + Tween.StopAll(); + } + + [Test] + public void CompletingMainSequenceCompletesAllChildrenSequencesAndTweens() { + int numCallback = 0; + var nestedSeq2 = Sequence.Create() + .ChainDelay(1) + .ChainCallback(() => { + Assert.AreEqual(1, numCallback); + numCallback++; + }); + var nestedSeq1 = Sequence.Create() + .ChainDelay(1) + .ChainCallback(() => { + Assert.AreEqual(0, numCallback); + numCallback++; + }) + .Chain(nestedSeq2); + Sequence.Create(Tween.Delay(1)) + .Group(nestedSeq1) + .Complete(); + Assert.AreEqual(2, numCallback); + } + + [Test] + public void ManipulateNestedSequence() { + var nested = Sequence.Create(Tween.Delay(getDt())); + Sequence.Create().Group(nested); + + var tween = Tween.Delay(getDt()); + + expectCantManipulateTweenInsideSequence(); + nested.Group(tween); + + expectCantManipulateTweenInsideSequence(); + nested.Chain(Tween.Delay(getDt())); + + expectCantManipulateTweenInsideSequence(); + nested.ChainCallback(delegate {}); + + expectCantManipulateTweenInsideSequence(); + nested.ChainCallback(this, delegate {}); + + expectCantManipulateTweenInsideSequence(); + nested.ChainCallback(this, delegate {}); + + expectCantManipulateTweenInsideSequence(); + nested.ChainDelay(0.1f); + + expectCantManipulateTweenInsideSequence(); + nested.Stop(); + + expectCantManipulateTweenInsideSequence(); + nested.Complete(); + + expectCantManipulateTweenInsideSequence(); + nested.SetRemainingCycles(10); + + expectCantManipulateTweenInsideSequence(); + expectCantManipulateTweenInsideSequence(); + nested.isPaused = !nested.isPaused; + + expectCantManipulateTweenInsideSequence(); + nested.Chain(Sequence.Create()); + + expectCantManipulateTweenInsideSequence(); + nested.Group(Sequence.Create()); + + expectCantManipulateTweenInsideSequence(); + nested.elapsedTime += 0.1f; + + expectCantManipulateTweenInsideSequence(); + nested.elapsedTimeTotal += 0.1f; + + expectCantManipulateTweenInsideSequence(); + expectCantManipulateTweenInsideSequence(); + nested.timeScale += 1f; + } + + [Test] + public async Task OnCompleteExceptionInsideSequenceDoesntStopSequence() { + // by design: if one tween's onComplete throws exception, Sequence should continue to play further + { + int numCallbacks = 0; + expectOnCompleteException(); + await Sequence.Create(Tween.Delay(getDt(), () => throw new Exception())) + .Chain(Tween.Delay(getDt(), () => numCallbacks++)) + .ChainCallback(() => numCallbacks++); + Assert.AreEqual(2, numCallbacks); + } + { + int numCallbacks = 0; + expectOnCompleteException(); + await Sequence.Create(Tween.Delay(this, getDt(), _ => throw new Exception())) + .Chain(Tween.Delay(getDt(), () => numCallbacks++)) + .ChainCallback(() => numCallbacks++); + Assert.AreEqual(2, numCallbacks); + } + } + + [UnityTest] + public IEnumerator TestSequenceEnumerator() { + const float duration = 0.0001f; + var t1 = Tween.Delay(duration); + var s1 = Sequence.Create(t1); + + var t2 = Tween.Delay(duration); + var s2 = Sequence.Create(t2); + + var t3 = Tween.Delay(duration); + var s3 = Sequence.Create(t3); + + s2.Chain(s3); + s1.Chain(s2); + + var expected = new[] { + s1.root, t1, + s2.root, t2, + s3.root, t3 + }; + int i = 0; + foreach (var t in s1.getAllTweens()) { + Assert.AreEqual(expected[i], t); + i++; + } + Assert.AreEqual(6, i); + i = 1; + foreach (var t in s1.getSelfChildren()) { + Assert.AreEqual(expected[i], t); + i++; + } + Assert.AreEqual(3, i); + + i = 3; + foreach (var t in s2.getSelfChildren()) { + Assert.AreEqual(expected[i], t); + i++; + } + Assert.AreEqual(5, i); + + i = 5; + foreach (var t in s3.getSelfChildren()) { + Assert.AreEqual(expected[i], t); + i++; + } + Assert.AreEqual(6, i); + + yield return null; + } + + [Test] + public void TestSequenceEnumeratorWithEmptySequences() { + var s1 = Sequence.Create(); + var s2 = Sequence.Create(); + var s3 = Sequence.Create(); + s1.Chain(s2) + .Chain(s3); + + var expected = new[] { s1.root, s2.root, s3.root }; + + int i = 0; + foreach (var t in s1.getAllTweens()) { + Assert.AreEqual(expected[i], t); + i++; + } + + i = 1; + foreach (var t in s1.getSelfChildren()) { + Assert.AreEqual(expected[i], t); + i++; + } + + foreach (var _ in s2.getSelfChildren()) { + Assert.Fail(); + } + + foreach (var _ in s3.getSelfChildren()) { + Assert.Fail(); + } + } + + [Test] + public void MainSequenceSiblingShouldBeEmpty() { + var main = Sequence.Create(); + var nested1 = Sequence.Create(Tween.Delay(getDt())); + main.Chain(nested1); + Assert.AreEqual(main.root.tween.next, nested1.root); + Assert.IsFalse(main.root.tween.nextSibling.IsCreated); + var nested2 = Sequence.Create(Tween.Delay(getDt())); + main.Chain(nested2); + Assert.AreEqual(main.root.tween.next, nested1.root); + Assert.IsFalse(main.root.tween.nextSibling.IsCreated); + } + + [Test] + public void CompleteSequenceOnBackwardCycle() { + var target = new GameObject().transform; + const float duration = 1f; + Sequence.Create(2, CycleMode.Rewind) + .Chain(Tween.PositionY(target, 1, duration)) + .Chain(Tween.PositionY(target, 0, duration)).Complete(); + Assert.AreEqual(0f, target.position.y); + Object.Destroy(target.gameObject); + } + + [UnityTest] + public IEnumerator CompleteSequenceOnBackwardCycle2() { + var target = GameObject.CreatePrimitive(PrimitiveType.Cube).transform; + yield return test(2, false); + yield return test(2, true); + yield return test(3, false); + yield return test(3, true); + yield return test(4, false); + yield return test(4, true); + + IEnumerator test(int cycles, bool completeImmediately) { + // print($"test {cycles}, {completeImmediately}"); + const float duration = 0.0001f; + int numCompleted = 0; + var seq = Sequence.Create(cycles, CycleMode.Yoyo, Ease.OutBounce) + .Chain(Tween.PositionY(target, 1f, duration).OnComplete(() => numCompleted++)) + .Chain(Tween.PositionY(target, 0f, duration)); + if (completeImmediately) { + seq.Complete(); + } else { + yield return seq.ToYieldInstruction(); + } + if (completeImmediately) { + Assert.AreEqual(1, numCompleted); + } else { + Assert.AreEqual((cycles + 1) / 2, numCompleted); + } + Assert.AreEqual(0f, target.position.y); + } + + Object.Destroy(target.gameObject); + } + + [UnityTest] + public IEnumerator CompleteInfiniteSequence() { + int numCallbacks = 0; + var duration = Mathf.Max(minDuration, Random.Range(0f, getDt())); + Assert.IsTrue(duration >= minDuration); + var s = Sequence.Create(-1) + .ChainDelay(duration) + .ChainCallback(() => numCallbacks++); + float timeStart = Time.time; + yield return null; + yield return null; + var cyclesDoneExpected = Mathf.FloorToInt((Time.time - timeStart) / duration); + Assert.AreEqual(cyclesDoneExpected, s.cyclesDone); + s.Complete(); + Assert.AreEqual(cyclesDoneExpected + 1, numCallbacks); + } + + [Test] + public void OnCompleteWithSequenceBackward() { + int numCompleted = 0; + int cycles = Random.Range(1, 7); + var seq = Sequence.Create(cycles) + .Group(Sequence.Create(cycles) + .Group(Sequence.Create(cycles) + .Group(Tween.Delay(0.1f, () => numCompleted++)))); + seq.isPaused = true; + seq.elapsedTimeTotal = float.MaxValue; + int cyclesTotal = cycles * cycles * cycles; + int cyclesExpected = cyclesTotal; + Assert.AreEqual(cyclesExpected, numCompleted); + seq.elapsedTimeTotal = 0f; + cyclesExpected += cyclesTotal - 1; + Assert.AreEqual(cyclesExpected, numCompleted); + + seq.elapsedTimeTotal = float.MaxValue; + cyclesExpected += cyclesTotal; + Assert.AreEqual(cyclesExpected, numCompleted); + + seq.elapsedTimeTotal = 0f; + cyclesExpected += cyclesTotal - 1; + Assert.AreEqual(cyclesExpected, numCompleted); + + seq.Complete(); + cyclesExpected += cycles * cycles; + Assert.AreEqual(cyclesExpected, numCompleted); + } + + [UnityTest] + public IEnumerator UnpauseCompletedSequenceShouldRelease() { + var s = Tween.Delay(getDt()).Chain(Tween.Delay(getDt())); + s.isPaused = true; + s.elapsedTimeTotal = s.durationTotal; + yield return null; + yield return null; + Assert.IsTrue(s.isAlive); + s.isPaused = false; + Assert.IsFalse(s.isAlive); + } + + [UnityTest] + public IEnumerator UnpauseCompletedTweenShouldRelease() { + var t = Tween.Delay(getDt()); + t.isPaused = true; + t.elapsedTimeTotal = t.durationTotal; + yield return null; + yield return null; + Assert.IsTrue(t.isAlive); + t.isPaused = false; + Assert.IsFalse(t.isAlive); + } + + [UnityTest] + public IEnumerator NestedSequenceCycles() { + string result = ""; + void append(int i) => result += i.ToString(); + + yield return createNestedSequences(getDt()).ToYieldInstruction(); + Assert.AreEqual("12332331233233", result); + + createNestedSequences(getDt()).Complete(); + Assert.AreEqual("1233233", result); + + PrimeTweenConfig.warnZeroDuration = false; + yield return createNestedSequences(0f).ToYieldInstruction(); + Assert.AreEqual("12332331233233", result); + + createNestedSequences(0f).Complete(); + Assert.AreEqual("1233233", result); + + Sequence createNestedSequences(float duration) { + result = ""; + var s3 = Sequence.Create(2).ChainDelay(duration).ChainCallback(() => append(3)); + var s2 = Sequence.Create(2).ChainDelay(duration).ChainCallback(() => append(2)).Chain(s3); + var s1 = Sequence.Create(2).ChainDelay(duration).ChainCallback(() => append(1)).Chain(s2); + return s1; + } + } + + [UnityTest] + public IEnumerator AddTweenToStartedSequence() { + var s = Sequence.Create(Tween.Delay(1f)); + yield return null; + Assert.IsTrue(s.isAlive); + Assert.AreNotEqual(0f, s.elapsedTimeTotal); + + var t = Tween.Delay(0.1f); + + expectError(); + s.Chain(t); + expectError(); + s.Group(t); + expectError(); + s.Chain(Sequence.Create()); + expectError(); + s.Group(Sequence.Create()); + + Tween.StopAll(); + LogAssert.NoUnexpectedReceived(); + static void expectError() => LogAssert.Expect(LogType.Error, Constants.animationAlreadyStarted); + } + + [UnityTest] + public IEnumerator OnCompleteIgnoredErrorOnSequenceEmergencyStop() { + expectTweenWasStoppedBecauseException(); + expectOnCompleteIgnored(); + yield return Tween.Custom(0f, 1f, getDt(), _ => throw new Exception()) + .Chain(Tween.Delay(getDt(), Assert.Fail)) + .ToYieldInstruction(); + } + + [UnityTest] + public IEnumerator SequenceIsEmptyEnumerationBug() { + yield return Sequence.Create() + .Chain(Sequence.Create().Chain(Sequence.Create())) + .Chain(Sequence.Create().Chain(Sequence.Create())) + .ToYieldInstruction(); + } + + [UnityTest] + public IEnumerator SequenceIsEmptyEnumerationCausesStackOverflowBug() { + var duration = getDt() * 2f; + yield return Sequence.Create() + .Chain(Tween.Delay(duration).Chain(Sequence.Create())) + .Chain(Tween.Delay(duration).Chain(Sequence.Create())) + .ToYieldInstruction(); + } + + [UnityTest] + public IEnumerator SequenceOnComplete() { + int numCompleted = 0; + yield return Sequence.Create(2, CycleMode.Yoyo) + .ChainDelay(getDt()) + .OnComplete(() => numCompleted++) + .ToYieldInstruction(); + Assert.AreEqual(1, numCompleted); + + numCompleted = 0; + yield return Sequence.Create(2, CycleMode.Yoyo) + .ChainDelay(getDt()) + .OnComplete(this, _ => numCompleted++) + .ToYieldInstruction(); + Assert.AreEqual(1, numCompleted); + } + + [Test] + public void LongGroupAfterChainOpSequence() { + var seq = Tween.Delay(0.1f) + .Chain(Tween.Delay(0.1f)); + + seq.Group(Sequence.Create(Tween.Delay(1f))); + Assert.AreEqual(1.1f, seq.duration); + + seq.Group(Sequence.Create(Tween.Delay(2f))); + Assert.AreEqual(2.1f, seq.duration); + + seq.Chain(Sequence.Create(Tween.Delay(1f))); + Assert.AreEqual(3.1f, seq.duration); + + seq.Stop(); + } + + [Test] + public void LongGroupAfterChainOpTween() { + var seq = Tween.Delay(0.1f) + .Chain(Tween.Delay(0.1f)); + + seq.Group(Tween.Delay(1f)); + Assert.AreEqual(1.1f, seq.duration); + + seq.Group(Tween.Delay(2f)); + Assert.AreEqual(2.1f, seq.duration); + + seq.Chain(Tween.Delay(1f)); + Assert.AreEqual(3.1f, seq.duration); + + seq.Stop(); + } + [UnityTest] + public IEnumerator SequenceRecursiveCreate() { + var target = new GameObject(); + float duration = getDt() * 2f; + Sequence seq1 = default; + Sequence seq2 = default; + createSeq1(); + + void createSeq1() { + // print("createSeq1"); + seq1.Stop(); + seq1 = Sequence.Create() + .Chain(Tween.Delay(target, duration: duration)) + .ChainCallback(() => { + }) + .Chain(Tween.Delay(target, duration: duration)) + .ChainCallback(() => { + createSeq2(); + }); + createSeq2(); + } + + void createSeq2() { + // print("createSeq2"); + seq2.Stop(); + seq2 = Sequence.Create() + .Chain(Tween.Delay(target, duration: duration)) + .ChainCallback(() => { + }) + .Chain(Tween.Delay(target, duration: duration)) + .ChainCallback(() => { + seq1.Complete(); + }); + } + + while (seq1.isAlive || seq2.isAlive) { + yield return null; + } + yield return null; + } + + [UnityTest] + public IEnumerator StopSequenceFromCallback2() { + Sequence s = default; + int numCyclesDone = 0; + var duration = getDt() * 2f; + s = Sequence.Create(2) + .ChainDelay(duration) + .ChainDelay(duration) + .ChainCallback(() => { + numCyclesDone++; + // print($"numCyclesDone: {numCyclesDone}"); + if (numCyclesDone == 2) { + s.timeScale = 0f; + s.SetRemainingCycles(3); + Tween.StopAll(); + } + }); + yield return s.ToYieldInstruction(); + yield return null; + } + + [UnityTest] + public IEnumerator StopSequenceFromCallback3() { + var dt = getDt(); + var s2 = Sequence.Create().ChainDelay(dt * 10f); + var s1 = Sequence.Create() + .ChainDelay(dt) + .ChainCallback(() => { + Assert.IsTrue(s2.isAlive); + s2.Stop(); + Assert.IsFalse(s2.isAlive); + }); + yield return s1.ToYieldInstruction(); + yield return null; + } + + [UnityTest] + public IEnumerator StopSequenceFromCallback4() { + Sequence s = default; + s = Sequence.Create(2) + .ChainDelay(getDt()) + .ChainCallback(() => { + s.Stop(); + }); + yield return s.ToYieldInstruction(); + yield return null; + } + + [UnityTest] + public IEnumerator SequenceOnCompleteIsCalledAfterAllChildren() { + bool delayCompleted = false; + bool sequenceCompleted = false; + var delay = Tween.Delay(getDt(), () => { + Assert.IsTrue(!delayCompleted && !sequenceCompleted); + delayCompleted = true; + }); + yield return Sequence.Create(delay).OnComplete(() => { + Assert.IsTrue(delayCompleted); + Assert.IsFalse(sequenceCompleted); + sequenceCompleted = true; + }); + Assert.IsTrue(delayCompleted && sequenceCompleted); + } + + [UnityTest] + public IEnumerator SequenceIsNotAliveInOnComplete() { + Sequence s = default; + int onCompleted = 0; + s = Sequence.Create() + .OnComplete(() => { + Assert.IsFalse(s.isAlive); + onCompleted++; + }); + yield return null; + Assert.AreEqual(1, onCompleted); + Assert.IsFalse(s.isAlive); + } + + [UnityTest] + public IEnumerator CompleteSequenceInOnComplete() { + Sequence s = default; + s = Sequence.Create() + .OnComplete(() => { + Assert.IsFalse(s.isAlive); + s.Complete(); + }); + yield return s.ToYieldInstruction(); + } + + [UnityTest] + public IEnumerator SequenceSetProgressRecursively() { + int i = 0; + Sequence s = default; + s = Sequence.Create() + .Chain(Tween.Custom(0f, 1f, getDt() * 2f, _ => { + i++; + Assert.IsTrue(i < 100); + expectRecursiveCallError(); + s.progress += 0.01f; + expectRecursiveCallError(); + s.progressTotal += 0.01f; + expectRecursiveCallError(); + s.elapsedTime += 0.01f; + expectRecursiveCallError(); + s.elapsedTimeTotal += 0.01f; + })); + yield return s.ToYieldInstruction(); + } + + static void expectRecursiveCallError() => LogAssert.Expect(LogType.Error, Constants.recursiveCallError); + + [UnityTest] + public IEnumerator SetSequenceProgressTo_1_AtCycleEnd() { + Sequence s = default; + s = Sequence.Create(2) + .ChainDelay(0.01f) + .Chain(Tween.Custom(0f, 1f, 0.01f, val => { + if (val == 1f) { + // print("custom val == 1f"); + expectRecursiveCallError(); + s.progress = 1f; + } + })); + yield return s.ToYieldInstruction(); + } + [UnityTest] + public IEnumerator SetSequenceProgressTo_0_AtCycleEnd() { + Sequence s = default; + s = Sequence.Create(2) + .Chain(Tween.Custom(0f, 1f, 0.01f, val => { + if (val == 1f) { + // print("custom val == 1f"); + expectRecursiveCallError(); + s.progress = 0f; + } + })); + yield return s.ToYieldInstruction(); + } + + [UnityTest] + public IEnumerator SequenceStopOrCompleteFromCustomCallback() { + yield return test(s => { + // callback can be called twice when Time.delta time is less than TweenSetting.minDuration + s.Complete(); + }); + yield return test(s => s.Stop()); + IEnumerator test(Action action) { + Sequence s = default; + s = Sequence.Create(2) + .ChainDelay(minDuration) + .Chain(Tween.Custom(0f, 1f, minDuration, _ => { + Assert.IsTrue(s.isAlive); + action(s); + Assert.IsFalse(s.isAlive); + })); + yield return s.ToYieldInstruction(); + } + } + + [UnityTest] + public IEnumerator StopSequenceFromSequenceOnComplete() { + Sequence sequence = default; + sequence = Sequence.Create() + .OnComplete(() => { + Assert.IsFalse(sequence.isAlive); + sequence.Stop(); + }); + yield return sequence.ToYieldInstruction(); + } + + [UnityTest] + public IEnumerator SettingSequenceRemainingCyclesInOnComplete() { + Sequence s = default; + s = Sequence.Create() + .OnComplete(() => { + Assert.IsFalse(s.isAlive); + expectIsDeadError(); + s.SetRemainingCycles(2); + }); + yield return s.ToYieldInstruction(); + } + + [UnityTest] + public IEnumerator AddingStartedTweenToSequenceIsOk() { + var tween = Tween.PositionY(transform, getDt() * 3, 1f); + yield return null; + Assert.IsTrue(tween.isAlive); + Sequence.Create(tween).Stop(); + Assert.IsFalse(tween.isAlive); + } + + #if PRIME_TWEEN_DOTWEEN_ADAPTER + [Test] + public void SequenceDurationAfterChainLast() { + var seq = Tween.Delay(1f) + .Group(Tween.Delay(0.5f)) + .ChainLast(Tween.Delay(0.1f)); + Assert.AreEqual(1f, seq.duration); + + seq.ChainLast(Tween.Delay(1f)); + Assert.AreEqual(1.6f, seq.duration); + } + + [UnityTest] + public IEnumerator PrependInterval() { + { + var duration = getDt(); + yield return Sequence.Create(Tween.Delay(duration)).PrependInterval(duration).ToYieldInstruction(); + } + { + var s = Sequence.Create() + .ChainCallback(() => Assert.Fail()) + .PrependInterval(100f); + yield return null; + s.Stop(); + } + } + + [Test] + public void DontLogCantManipulateErrorInAdapter() { + var target = new GameObject().transform; + { + var t = Tween.Delay(target, 1f); + Sequence.Create(t); + Assert.AreEqual(0, target.DOKill()); + Assert.AreEqual(0, target.DOKill(true)); + LogAssert.NoUnexpectedReceived(); + } + Object.DestroyImmediate(target.gameObject); + } + #endif + + [UnityTest] + public IEnumerator Insert1() { + var seq = Sequence.Create(); + int numCallbacks = 0; + seq.InsertCallback(0f, () => numCallbacks++); + Assert.AreEqual(0f, seq.duration); + yield return seq.ToYieldInstruction(); + Assert.AreEqual(1, numCallbacks); + LogAssert.NoUnexpectedReceived(); + } + + [UnityTest] + public IEnumerator Insert2() { + var seq = Sequence.Create(); + int i = 0; + seq.InsertCallback(0f, transform, delegate { + Assert.AreEqual(0, i); + i++; + }); + Assert.AreEqual(0f, seq.duration); + + float dt = getDt(); + float longestTime = dt * 10; + seq.InsertCallback(longestTime, () => { + Assert.AreEqual(2, i); + i++; + }); + Assert.AreEqual(longestTime, seq.duration); + + seq.InsertCallback(dt, () => { + Assert.AreEqual(1, i); + i++; + }); + Assert.AreEqual(longestTime, seq.duration); + + yield return seq.ToYieldInstruction(); + } + + [UnityTest] + public IEnumerator Insert3() { + var seq = Sequence.Create(); + + seq.Insert(0f, Tween.Delay(1f)); + Assert.AreEqual(1f, seq.duration); + + seq.Insert(0.5f, Tween.Delay(1f)); + Assert.AreEqual(1.5f, seq.duration); + + seq.Insert(0.5f, Tween.Delay(1f)); + Assert.AreEqual(1.5f, seq.duration); + + seq.Insert(2f, Tween.Delay(1f)); + Assert.AreEqual(3f, seq.duration); + + seq.Chain(Tween.Delay(1f)); + Assert.AreEqual(4f, seq.duration); + + seq.Insert(5f, Tween.Delay(1f)); + Assert.AreEqual(6f, seq.duration); + + seq.Group(Tween.Delay(1f)); + Assert.AreEqual(6f, seq.duration); + + seq.Group(Tween.Delay(1.5f)); + Assert.AreEqual(6.5f, seq.duration); + + seq.Stop(); + yield break; + } + + [Test] + public void NestSequenceTwice() { + var main = Sequence.Create(); + var nested = Sequence.Create(); + main.Group(nested); + LogAssert.Expect(LogType.Error, Constants.nestSequenceTwiceError); + main.Group(nested); + } + + [UnityTest] + public IEnumerator SequenceCompleteRemainingCycles() { + var yoyoOrRewind = Random.value < 0.5f ? CycleMode.Yoyo : CycleMode.Rewind; + { + float val = -1f; + int numCompleted = 0; + Sequence.Create(9, yoyoOrRewind) + .Chain(Tween.Custom(0f, 1f, 1f, x => val = x)) + .ChainCallback(() => numCompleted++) + .Complete(); + Assert.AreEqual(1, numCompleted); + Assert.AreEqual(1f, val); + } + { + float val = -1f; + int numCompleted = 0; + Sequence.Create(10, yoyoOrRewind) + .Chain(Tween.Custom(0f, 1f, 1f, x => val = x)) + .ChainCallback(() => numCompleted++) + .Complete(); + Assert.AreEqual(1, numCompleted); + Assert.AreEqual(0f, val); + } + + { + float val = -1f; + int numCompleted = 0; + var seq = Sequence.Create(9, yoyoOrRewind) + .Chain(Tween.Custom(0f, 1f, 100f, x => val = x)) + .ChainCallback(() => numCompleted++); + seq.progress = 1f; + yield return null; + Assert.AreEqual(1, seq.cyclesDone); + Assert.AreEqual(1, numCompleted); + seq.Complete(); + Assert.AreEqual(2, numCompleted); + Assert.AreEqual(1f, val); + } + { + float val = -1f; + int numCompleted = 0; + var seq = Sequence.Create(10, yoyoOrRewind) + .Chain(Tween.Custom(0f, 1f, 100f, x => val = x)) + .ChainCallback(() => numCompleted++); + seq.progress = 1f; + yield return null; + Assert.AreEqual(1, seq.cyclesDone); + Assert.AreEqual(1, numCompleted); + seq.Complete(); + Assert.AreEqual(1, numCompleted); + Assert.AreEqual(0f, val); + } + + { + float val = -1f; + int numCompleted = 0; + Sequence.Create(Random.Range(1, 100), CycleMode.Restart) + .Chain(Tween.Custom(0f, 1f, 1f, x => val = x)) + .ChainCallback(() => numCompleted++) + .Complete(); + Assert.AreEqual(1, numCompleted); + Assert.AreEqual(1f, val); + } + } + + [Test] + public void GetTweensCountOnSequence() { + Tween.StopAll(); + Assert.AreEqual(0, Tween.GetTweensCount()); + var seq = Tween.Position(transform, Vector3.one, 1f) + .Chain(Tween.Position(transform, Vector3.zero, 1f)); + Assert.AreEqual(3, Tween.GetTweensCount()); // two tweens + sequence + Assert.AreEqual(2, Tween.GetTweensCount(transform)); // two tween on transform + seq.Stop(); + } + + /// report: https://forum.unity.com/threads/primetween-high-performance-animations-and-sequences.1479609/page-6#post-9802575 + [UnityTest] + public IEnumerator SequenceUpdatesChildrenOnlyIfUpdatedSelf() { + var seq = Sequence.Create() + .ChainDelay(1) + .Chain(Sequence.Create() + .Chain(Tween.Custom(0f, 1f, 1f, _ => Assert.Fail()))); + yield return null; + seq.Stop(); + } + + /// https://github.com/KyryloKuzyk/PrimeTween/discussions/112 + [Test] + public void SequenceChainOrInsertCallbackBug1() { + var seq = Sequence.Create() + .ChainDelay(1f) + .ChainCallback(() => { }) + .Group(Tween.Delay(1f)); + Assert.AreEqual(2f, seq.duration); + } + [Test] + public void SequenceChainOrInsertCallbackBug2() { + var seq = Sequence.Create() + .ChainDelay(1f) + .ChainCallback(this, _ => { }) + .Group(Tween.Delay(1f)); + Assert.AreEqual(2f, seq.duration); + } + [Test] + public void SequenceChainOrInsertCallbackBug3() { + var seq = Sequence.Create() + .ChainDelay(1f) + .InsertCallback(0.5f, () => { }) + .Group(Tween.Delay(1f)); + Assert.AreEqual(1.5f, seq.duration); + } + [Test] + public void SequenceChainOrInsertCallbackBug4() { + var seq = Sequence.Create() + .ChainDelay(1f) + .InsertCallback(0.5f, this, _ => { }) + .Group(Tween.Delay(1f)); + Assert.AreEqual(1.5f, seq.duration); + } +} +#endif diff --git a/FactoryNumeric/Packages/PrimeTween/Tests/Sequence.cs.meta b/FactoryNumeric/Packages/PrimeTween/Tests/Sequence.cs.meta new file mode 100644 index 00000000..c24b02f8 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Tests/Sequence.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 0ec991aedbad4a02b584512ce5eb13b8 +timeCreated: 1676975243 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Tests/TestComponent.cs b/FactoryNumeric/Packages/PrimeTween/Tests/TestComponent.cs new file mode 100644 index 00000000..5c2ff10a --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Tests/TestComponent.cs @@ -0,0 +1,11 @@ +#if TEST_FRAMEWORK_INSTALLED +using System.Collections; +using UnityEngine; + +public class TestComponent : MonoBehaviour { + IEnumerator Start() { + var test = new Tests(); + yield return test.SequenceNestingInfinite(); + } +} +#endif \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Tests/TestComponent.cs.meta b/FactoryNumeric/Packages/PrimeTween/Tests/TestComponent.cs.meta new file mode 100644 index 00000000..a29f1b5c --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Tests/TestComponent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 68618093b33214f66a3d7be8a2c7b12b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/PrimeTween/Tests/Tweens.cs b/FactoryNumeric/Packages/PrimeTween/Tests/Tweens.cs new file mode 100644 index 00000000..44550103 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Tests/Tweens.cs @@ -0,0 +1,2799 @@ +#if TEST_FRAMEWORK_INSTALLED +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using JetBrains.Annotations; +using NUnit.Framework; +using PrimeTween; +using UnityEngine; +using UnityEngine.SceneManagement; +using UnityEngine.TestTools; +using Assert = NUnit.Framework.Assert; +using AssertionException = UnityEngine.Assertions.AssertionException; +using Object = UnityEngine.Object; +using Random = UnityEngine.Random; +using SuppressMessage = System.Diagnostics.CodeAnalysis.SuppressMessageAttribute; + +public partial class Tests { + [Test] + public void TweenTimeScaleWhileInSequence() { + var t = Tween.Delay(0.01f); + Sequence.Create(t); + expectCantManipulateTweenInsideSequence(); + t.timeScale = 2f; + LogAssert.NoUnexpectedReceived(); + Tween.StopAll(); + } + + [Test] + public async Task TweenTimeScaleOutlive() { + { + var tween = Tween.Delay(getDt() / 2); + var timeScaleTween = Tween.TweenTimeScale(tween, Random.value + 0.01f, float.MaxValue); + await tween; + Assert.IsFalse(timeScaleTween.isAlive); + } + { + var seq = Sequence.Create(Tween.Delay(getDt() / 2)); + var timeScaleTween = Tween.TweenTimeScale(seq, Random.value + 0.01f, float.MaxValue); + await seq; + Assert.IsFalse(timeScaleTween.isAlive); + } + } + + [Test] + public async Task TweenTimeScale() { + var t = Tween.PositionZ(transform, 10, 1); + const float iniTimeScale = 0.9f; + t.timeScale = iniTimeScale; + Assert.AreEqual(iniTimeScale, t.timeScale); + const float targetTimeScale = 0.5f; + await Tween.TweenTimeScale(t, targetTimeScale, 0.001f); + Assert.AreEqual(targetTimeScale, t.timeScale); + t.Complete(); + } + + [UnityTest] + public IEnumerator QuaternionDefaultValue() { + { + var q = Quaternion.Euler(0, 0, 45); + var def = new Quaternion(); + Assert.AreEqual(Quaternion.identity.normalized, def.normalized); + Assert.AreNotEqual(Quaternion.Angle(Quaternion.identity, q), Quaternion.Angle(def, q)); + Assert.AreEqual(Quaternion.Angle(Quaternion.identity, q), Quaternion.Angle(def.normalized, q)); + } + { + Tween t = default; + var def = new Quaternion(); + int numCallback = 0; + t = Tween.Custom(def, def, 0.01f, delegate { + numCallback++; + var startVal = t.tween.startValue.QuaternionVal; + var endVal = t.tween.endValue.QuaternionVal; + // Debug.Log($"{startVal}, {endVal}"); + Assert.AreNotEqual(def, startVal); + Assert.AreNotEqual(def, endVal); + t.Stop(); + }); + yield return t.ToYieldInstruction(); + Assert.AreEqual(1, numCallback); + } + } + + /// This test can fail if Game window is set to 'Play Unfocused' + [UnityTest] + public IEnumerator StartValueIsAppliedOnFirstFrame() { + const int iniVal = -1; + float val = iniVal; + const int startValue = 0; + Tween.Custom(startValue, 1, 0.01f, newVal => val = newVal); + Assert.AreEqual(iniVal, val); + yield return new WaitForEndOfFrame(); + Assert.AreEqual(startValue, val); + yield return new WaitForEndOfFrame(); + Assert.AreNotEqual(startValue, val); + } + + [Test] + public void SafetyChecksEnabled() { + #if !PRIME_TWEEN_SAFETY_CHECKS + Assert.Inconclusive(); + #endif + } + + [UnityTest] + public IEnumerator TweenIsDeadInOnComplete() { + Tween t = default; + t = Tween.Delay(0.01f, () => { + Assert.IsFalse(t.isAlive); + for (int i = 0; i < 6; i++) { + expectIsDeadError(); + } + Assert.AreEqual(0, t.elapsedTime); + Assert.AreEqual(0, t.elapsedTimeTotal); + Assert.AreEqual(0, t.progress); + Assert.AreEqual(0, t.progressTotal); + Assert.AreEqual(0, t.duration); + Assert.AreEqual(0, t.durationTotal); + }); + yield return t.ToYieldInstruction(); + } + + static void expectIsDeadError(bool isCreated = true) => LogAssert.Expect(LogType.Error, new Regex(isCreated ? Constants.isDeadMessage : "Tween or Sequence is not created properly.")); + + [Test] + public void ShakeDuplication1() { + var s1 = Tween.ShakeLocalPosition(transform, Vector3.one, 0.1f, startDelay: 0.1f); + var s2 = Tween.ShakeLocalPosition(transform, Vector3.one, 0.1f); + Assert.IsTrue(s1.isAlive); + Assert.IsTrue(s2.isAlive); + } + + [UnityTest] + public IEnumerator ShakeDuplication2() { + var s1 = Tween.ShakeLocalPosition(transform, Vector3.one, 0.1f); + Assert.IsTrue(s1.isAlive); + var s2 = Tween.ShakeLocalPosition(transform, Vector3.one, 0.1f); + Assert.IsTrue(s1.isAlive); + yield return null; + // because two shakes are started the same frame, the first one completes the second one + Assert.IsTrue(s1.isAlive); + Assert.IsTrue(s2.isAlive); + } + + [UnityTest] + public IEnumerator ShakeDuplication3() { + var s1 = Tween.ShakeLocalPosition(transform, Vector3.one, 0.1f); + yield return null; + var s2 = Tween.ShakeLocalPosition(transform, Vector3.one, 0.1f); + yield return null; + Assert.IsTrue(s1.isAlive); + Assert.IsTrue(s2.isAlive); + } + + [UnityTest] + public IEnumerator ShakeDuplication4() { + const float startDelay = 0.05f; + var s1 = Tween.ShakeLocalPosition(transform, Vector3.one, 0.1f, startDelay: startDelay); + var s2 = Tween.ShakeLocalPosition(transform, Vector3.one, 0.1f, startDelay: 0.1f); + yield return Tween.Delay(startDelay + Time.deltaTime).ToYieldInstruction(); + Assert.IsTrue(s1.isAlive); + Assert.IsTrue(s2.isAlive); + } + + [UnityTest] + public IEnumerator ShakeDuplication5() { + var target = new GameObject(nameof(ShakeDuplication5)).transform; + target.localPosition = new Vector3(Random.value, Random.value, Random.value); + var iniPos = target.localPosition; + var s1 = Tween.ShakeLocalPosition(target, Vector3.one, 0.1f); + var seq = Sequence.Create(s1); + Assert.IsTrue(s1.isAlive); + var s2 = Tween.ShakeLocalPosition(target, Vector3.one, 0.1f); + Assert.IsTrue(s1.isAlive); + Assert.IsTrue(seq.isAlive); + Assert.IsTrue(s2.isAlive); + + Assert.IsTrue(s1.tween.startFromCurrent); + Assert.IsTrue(s2.tween.startFromCurrent); + yield return null; + Assert.IsTrue(s1.isAlive); + Assert.IsTrue(seq.isAlive); + Assert.IsTrue(s2.isAlive); + + Assert.IsFalse(s1.tween.startFromCurrent); + Assert.IsFalse(s2.tween.startFromCurrent); + Assert.AreEqual(iniPos, s1.tween.startValue.Vector3Val); + Assert.AreEqual(iniPos, s2.tween.startValue.Vector3Val); + } + + [Test] + public void ShakeDuplicationDestroyedTarget() { + var target = new GameObject(nameof(ShakeDuplicationDestroyedTarget)).transform; + Tween.ShakeLocalPosition(target, Vector3.one, 0.1f); + Object.DestroyImmediate(target.gameObject); + Tween.ShakeLocalPosition(target, Vector3.one, 0.1f); + expectTargetIsNull(); + } + + static void expectTargetIsNull() => LogAssert.Expect(LogType.Error, new Regex("Tween's target is null")); + + [UnityTest] + public IEnumerator FramePacing() { + Tween.StopAll(); + const int fps = 120; + Application.targetFrameRate = fps; + QualitySettings.vSyncCount = 0; + Assert.AreEqual(fps, Application.targetFrameRate); + yield return null; + { + var go = new GameObject(); + go.AddComponent(); + while (go != null) { + yield return null; + } + } + Application.targetFrameRate = targetFrameRate; + yield return null; + } + + #if UNITY_EDITOR + [Test] + public void GenerateCode() { + const string path = "Packages/com.kyrylokuzyk.primetween/Editor/CodeGenerator.asset"; + var cg = UnityEditor.AssetDatabase.LoadAssetAtPath(path); + cg.generateAllMethods(); + } + #endif + + [Test] + public void TweenCompleteInvokeOnCompleteParameter() { + { + int numCompleted = 0; + var t = Tween.Scale(transform, 1.5f, 0.01f).OnComplete(() => numCompleted++); + t.Complete(); + Assert.AreEqual(1, numCompleted); + t.Complete(); + Assert.AreEqual(1, numCompleted); + } + /*{ + int numCompleted = 0; + var t = Tween.Scale(transform, 1.5f, 0.01f).OnComplete(() => numCompleted++); + t.Complete(false); + Assert.AreEqual(0, numCompleted); + t.Complete(false); + Assert.AreEqual(0, numCompleted); + t.Complete(); + Assert.AreEqual(0, numCompleted); + }*/ + } + + [Test] + public void IgnoreFromInScale() { + var t = Tween.Scale(transform, 1.5f, 0.01f); + Assert.IsTrue(t.tween.startFromCurrent); + } + + [UnityTest] + public IEnumerator FromToValues() { + { + var duration = getDt() * Random.Range(0.5f, 1.5f); + var t = Tween.Custom(0, 0, duration, ease: Ease.Linear, onValueChange: delegate { }); + while (t.isAlive) { + Assert.AreEqual(t.elapsedTime, t.progress * duration, 0.001f); + Assert.AreEqual(t.interpolationFactor, t.progress); + Assert.AreEqual(t.interpolationFactor, t.progressTotal); + yield return null; + } + } + var from = Random.value; + var to = Random.value; + var data = new TweenSettings(from, to, 0.01f); + { + var t = Tween.LocalPositionX(transform, data); + Assert.AreEqual(from, t.tween.startValue.FloatVal); + Assert.AreEqual(to, t.tween.endValue.FloatVal); + } + { + var t = Tween.Custom(this, data, delegate { }); + Assert.AreEqual(from, t.tween.startValue.FloatVal); + Assert.AreEqual(to, t.tween.endValue.FloatVal); + } + } + + [UnityTest] + public IEnumerator TweenCompleteWhenInterpolationCompleted() { + float curVal = 0f; + var t = Tween.Custom(this, 0f, 1f, 0.05f, (_, val) => curVal = val, cycles: 2, endDelay: 1f, cycleMode: CycleMode.Yoyo); + while (t.interpolationFactor < 1f) { + yield return null; + } + Assert.AreEqual(0, t.cyclesDone); + Assert.AreEqual(1f, curVal); + t.Complete(); + Assert.AreEqual(0f, curVal); + } + + [Test] + public async Task CycleModeIncremental() { + { + float curVal = 0f; + await Tween.Custom(this, 0f, 1f, 0.01f, (_, val) => curVal = val, cycles: 2, cycleMode: CycleMode.Incremental); + Assert.AreEqual(2f, curVal); + } + { + float curVal = 0f; + await Tween.Custom(this, 0f, 1f, 0.01f, (_, val) => curVal = val, cycles: 4, cycleMode: CycleMode.Incremental); + Assert.AreEqual(4f, curVal); + } + { + float curVal = 0f; + Tween.Custom(this, 0f, 1f, 0.01f, (_, val) => curVal = val, cycles: 2, cycleMode: CycleMode.Incremental) + .Complete(); + Assert.AreEqual(2f, curVal); + } + { + float curVal = 0f; + Tween.Custom(this, 0f, 1f, 0.01f, (_, val) => curVal = val, cycles: 4, cycleMode: CycleMode.Incremental) + .Complete(); + Assert.AreEqual(4f, curVal); + } + } + + [Test] + public void TweenCompleteWithEvenCycles() { + { + float curVal = 0f; + Tween.Custom(this, 0f, 1f, 0.05f, (_, val) => curVal = val, cycles: 2, cycleMode: CycleMode.Restart) + .Complete(); + Assert.AreEqual(1f, curVal); + } + { + float curVal = 0f; + Tween.Custom(this, 0f, 1f, 0.05f, (_, val) => curVal = val, cycles: 4, cycleMode: CycleMode.Restart) + .Complete(); + Assert.AreEqual(1f, curVal); + } + + { + float curVal = 0f; + Tween.Custom(this, 0f, 1f, 0.05f, (_, val) => curVal = val, cycles: 2, cycleMode: CycleMode.Yoyo) + .Complete(); + Assert.AreEqual(0f, curVal); + } + { + float curVal = 0f; + Tween.Custom(this, 0f, 1f, 0.05f, (_, val) => curVal = val, cycles: 4, cycleMode: CycleMode.Yoyo) + .Complete(); + Assert.AreEqual(0f, curVal); + } + { + float curVal = 0f; + Tween.Custom(this, 0f, 1f, 0.05f, (_, val) => curVal = val, cycles: 2, cycleMode: CycleMode.Rewind) + .Complete(); + Assert.AreEqual(0f, curVal); + } + { + float curVal = 0f; + Tween.Custom(this, 0f, 1f, 0.05f, (_, val) => curVal = val, cycles: 4, cycleMode: CycleMode.Rewind) + .Complete(); + Assert.AreEqual(0f, curVal); + } + } + + [Test] + public void TweenCompleteWithOddCycles() { + { + float curVal = 0f; + Tween.Custom(this, 0f, 1f, 0.05f, (_, val) => curVal = val, cycles: 1, cycleMode: CycleMode.Yoyo) + .Complete(); + Assert.AreEqual(1f, curVal); + } + { + float curVal = 0f; + Tween.Custom(this, 0f, 1f, 0.05f, (_, val) => curVal = val, cycles: 3, cycleMode: CycleMode.Yoyo) + .Complete(); + Assert.AreEqual(1f, curVal); + } + } + + [UnityTest] + public IEnumerator TweenOnCompleteIsCalledOnceForTweenInSequence() { + for (int i = 0; i < 1; i++) { + loopBegin: + float curVal = 0f; + int numCompleted = 0; + float duration = Mathf.Max(minDuration, getDt()) * 10f; + var t = Tween.Custom(this, 0f, 1f, duration, (_, val) => curVal = val, cycles: 1, cycleMode: CycleMode.Yoyo) + .OnComplete(() => numCompleted++); + var s = t.Chain(Tween.Delay(duration)); + while (true) { + if (!t.isAlive) { + goto loopBegin; + } + if (t.cyclesDone == 1) { + break; + } + yield return null; + } + Assert.IsTrue(t.isAlive); + Assert.AreEqual(1, t.tween.getCyclesDone()); + Assert.IsTrue(t.tween.sequence.IsCreated); + Assert.AreEqual(1, numCompleted); + + Assert.IsTrue(s.isAlive); + Assert.AreEqual(1f, curVal); + s.Complete(); + Assert.AreEqual(1f, curVal); + Assert.AreEqual(1, numCompleted); + } + } + + [Test] + public void TweenCompleteInSequence() { + float curVal = 0f; + var t = Tween.Custom(this, 0f, 1f, 0.05f, (_, val) => curVal = val, cycles: 1, cycleMode: CycleMode.Yoyo); + var s = t.Chain(Tween.Delay(0.05f)); + Assert.IsTrue(t.isAlive); + Assert.AreEqual(0, t.tween.getCyclesDone()); + Assert.IsTrue(t.tween.sequence.IsCreated); + Assert.IsTrue(s.isAlive); + Assert.AreNotEqual(1f, curVal); + s.Complete(); + Assert.AreEqual(1f, curVal); + } + + [Test] + public async Task AwaitExceptions() { + expectTweenWasStoppedBecauseException(); + await Tween.Custom(this, 0f, 1f, 1f, delegate { + throw new Exception(); + }); + } + + [UnityTest] + public IEnumerator CoroutineEnumeratorNotEnumeratedToTheEnd() { + Tween.StopAll(); + Assert.AreEqual(0, tweensCount); + var t = Tween.Delay(TweenSettings.minDuration * 100); + var e = t.ToYieldInstruction(); + Assert.IsTrue(e.MoveNext()); + yield return e.Current; + Assert.IsTrue(t.isAlive); + while (t.isAlive) { + yield return null; + } + yield return null; + Assert.AreEqual(0, tweensCount); + testCompletedCorEnumerator(e); + } + + [UnityTest] + public IEnumerator CoroutineEnumeratorInfiniteTween() { + { + var t = Tween.Position(transform, Vector3.one, getDt(), cycles: -1); + Tween.Delay(getDt() * 5f).OnComplete(() => t.Stop()); + yield return t.ToYieldInstruction(); + } + { + var t = Tween.Position(transform, Vector3.one, getDt(), cycles: -1); + Tween.Delay(getDt() * 5f).OnComplete(() => t.Complete()); + yield return t.ToYieldInstruction(); + } + } + + [UnityTest] + public IEnumerator CoroutineEnumeratorMultipleToYieldInstruction() { + var t = Tween.Delay(0.01f); + var e = t.ToYieldInstruction(); + Assert.Throws(() => t.ToYieldInstruction()); + t.Complete(); + yield return e; + Assert.IsFalse(t.isAlive); + testCompletedCorEnumerator(e); + } + + [UnityTest] + public IEnumerator CoroutineEnumeratorUsingDead() { + var t = Tween.Delay(0.01f); + var e = t.ToYieldInstruction(); + yield return e; + Assert.IsFalse(t.isAlive); + testCompletedCorEnumerator(e); + } + + static void testCompletedCorEnumerator(IEnumerator e) { + Assert.IsFalse(e.MoveNext()); + Assert.Throws(() => { + _ = e.Current; + }); + Assert.Throws(() => e.Reset()); + } + + [UnityTest] + public IEnumerator YieldInstructionsClash2() { + var test = new GameObject().AddComponent(); + // ReSharper disable once LoopVariableIsNeverChangedInsideLoop + while (test != null) { + yield return null; + } + } + + [UnityTest] + public IEnumerator YieldInstructionsClash() { + Application.targetFrameRate = 100; + yield return null; + Assert.AreEqual(0, tweensCount); + for (int i = 0; i < 1; i++) { + { + var t1 = Tween.Delay(minDuration); + int frameStart = Time.frameCount; + yield return t1.ToYieldInstruction(); + Assert.AreEqual(1, Time.frameCount - frameStart); + Assert.IsFalse(t1.isAlive); + var t2 = Tween.Delay(minDuration); + t2.ToYieldInstruction(); + t2.Complete(); + } + { + var t1 = Tween.Delay(minDuration); + t1.ToYieldInstruction(); + yield return null; + yield return null; + Assert.IsFalse(t1.isAlive); + var t2 = Tween.Delay(minDuration); + t2.ToYieldInstruction(); + t2.Complete(); + } + } + Application.targetFrameRate = targetFrameRate; + } + + [Test] + public void TweenDuplicateInSequence() { + var t1 = Tween.Delay(0.1f); + var t2 = Tween.Delay(0.1f); + var s = t1.Chain(t2); + expectNestTweenTwiceError(); + s.Chain(t1); + } + + /*[UnityTest] + public IEnumerator WaitStopFromValueChange2() { + Tween t = default; + t = Tween.WaitWhile(this, _ => { + Assert.IsTrue(t.isAlive); + t.Stop(); + return true; + }); + yield return t.ToYieldInstruction(); + } + + [UnityTest] + public IEnumerator WaitCompleteFromValueChange2() { + Tween t = default; + int numValueChanged = 0; + t = Tween.WaitWhile(this, _ => { + numValueChanged++; + switch (numValueChanged) { + case 1: + Assert.IsTrue(t.isAlive); + t.Complete(); + break; + case 2: + Assert.IsFalse(t.isAlive); + break; + default: throw new Exception(); + } + return true; + }); + yield return t.ToYieldInstruction(); + } + + [UnityTest] + public IEnumerator WaitCompleteFromValueChange() { + var target = new GameObject(); + int numValueChanged = 0; + yield return Tween.WaitWhile(target, _ => { + numValueChanged++; + switch (numValueChanged) { + case 1: + Assert.AreEqual(1, Tween.CompleteAll(target, 1, 1)); + break; + case 2: + Assert.AreEqual(0, Tween.CompleteAll(target, 0, 0)); + break; + default: throw new Exception(); + } + return true; + }).ToYieldInstruction(); + } + + [UnityTest] + public IEnumerator WaitStopFromValueChange() { + var target = new GameObject(); + yield return Tween.WaitWhile(target, _ => { + Assert.AreEqual(1, Tween.StopAll(target, 1, 1)); + return true; + }).ToYieldInstruction(); + } + + [UnityTest] + public IEnumerator TweenWait() { + var timeStart = Time.time; + int numOnCompleteDone = 0; + const float duration = 0.3f; + var t = Tween.WaitWhile(this, _ => Time.time - timeStart < duration) + .OnComplete(() => numOnCompleteDone++); + yield return null; + Assert.IsTrue(t.isAlive); + yield return new WaitForSeconds(duration + 0.01f); + Assert.IsFalse(t.isAlive); + Assert.AreEqual(1, numOnCompleteDone); + LogAssert.NoUnexpectedReceived(); + } + + [Test] + public void TweenWaitInstantComplete() { + int numOnCompleteDone = 0; + var t = Tween.WaitWhile(this, _ => true).OnComplete(() => numOnCompleteDone++); + Assert.IsTrue(t.isAlive); + t.Complete(); + Assert.IsFalse(t.isAlive); + Assert.AreEqual(1, numOnCompleteDone); + } + + [Test] + public void TweenWaitInstantStop() { + int numOnCompleteDone = 0; + var t = Tween.WaitWhile(this, _ => true).OnComplete(() => numOnCompleteDone++); + Assert.IsTrue(t.isAlive); + t.Stop(); + Assert.IsFalse(t.isAlive); + Assert.AreEqual(0, numOnCompleteDone); + } + + [Test] + public void TweenWaitException() { + var t = Tween.WaitWhile(this, _ => throw new Exception()).OnComplete(Assert.Fail); + Assert.IsTrue(t.isAlive); + LogAssert.Expect(LogType.Error, new Regex("Tween was stopped because of exception")); + LogAssert.Expect(LogType.Error, new Regex(Constants.onCompleteCallbackIgnored)); + t.Complete(); + Assert.IsFalse(t.isAlive); + } + + [UnityTest] + public IEnumerator TweenWaitDuration() { + // Application.targetFrameRate = 60; + var t = Tween.WaitWhile(this, _ => true); + validate(); + Assert.AreEqual(0, t.elapsedTime); + Assert.AreEqual(0, t.elapsedTimeTotal); + yield return null; + Assert.AreNotEqual(0, t.elapsedTime); + Assert.AreNotEqual(0, t.elapsedTimeTotal); + // for (int i = 0; i < 60; i++) { + // yield return null; + // Debug.Log($"{t.elapsedTime}, {t.elapsedTimeTotal}"); + // } + validate(); + t.Complete(); + void validate() { + Assert.AreEqual(-1, t.cyclesTotal); + Assert.AreEqual(0, t.cyclesDone); + Assert.IsTrue(float.IsPositiveInfinity(t.duration)); + Assert.IsTrue(float.IsPositiveInfinity(t.durationTotal)); + Assert.AreEqual(0, t.progress); + Assert.AreEqual(0, t.progressTotal); + Assert.AreEqual(0, t.interpolationFactor); + } + }*/ + + [Test] + public void ZeroDurationWarning() { + var oldSetting = PrimeTweenConfig.warnZeroDuration; + try { + PrimeTweenConfig.warnZeroDuration = true; + LogAssert.Expect(LogType.Warning, new Regex(nameof(PrimeTweenManager.warnZeroDuration))); + Tween.Custom(this, 0, 1, 0, delegate{}); + PrimeTweenConfig.warnZeroDuration = false; + Tween.Custom(this, 0, 1, 0, delegate{}); + LogAssert.NoUnexpectedReceived(); + } finally { + PrimeTweenConfig.warnZeroDuration = oldSetting; + } + } + + [Test] + public void CompleteTweenTwice() { + int numCompleted = 0; + var t = createCustomTween(1) + .OnComplete(() => numCompleted++); + t.Complete(); + Assert.AreEqual(1, numCompleted); + t.Complete(); + Assert.AreEqual(1, numCompleted); + } + + [UnityTest] + public IEnumerator FromValueShouldNotChangeBetweenCycles() { + var cube = GameObject.CreatePrimitive(PrimitiveType.Cube); + var origPos = new Vector3(10, 10, 10); + cube.transform.position = origPos; + var tween = Tween.Position(cube.transform, new Vector3(20, 10, 10), 0.01f, cycles: 5); + Assert.IsTrue(tween.isAlive); + Assert.IsNotNull(tween.tween.getter); + while (tween.isAlive) { + yield return null; + Assert.AreEqual(origPos, tween.tween.startValue.Vector3Val, "'From' should not change after a cycle. This can happen if tween resets startFromCurrent after a cycle."); + } + Object.Destroy(cube); + } + + [Test] + public void SettingIsPausedOnTweenInSequenceDisplayError() { + var target = new object(); + var t = Tween.Delay(target, 0.01f); + Sequence.Create(t); + expectError(); + t.isPaused = true; + + expectError(); + Tween.SetPausedAll(true, target); + + expectError(); + Tween.SetPausedAll(false, target); + + void expectError() { + expectCantManipulateTweenInsideSequence(); + } + } + + [Test] + public void SettingCyclesOnDeadTweenDisplaysError() { + var t = createTween(); + Assert.IsTrue(t.isAlive); + t.Complete(); + Assert.IsFalse(t.isAlive); + expectIsDeadError(); + t.SetRemainingCycles(5); + } + + [Test] + public void TestDeadTween() { + var t = createDeadTween(); + + expectError(); + t.isPaused = true; + + t.Stop(); + t.Complete(); + // t.Revert(); + + expectError(); + t.SetRemainingCycles(10); + + expectError(); + t.OnComplete(delegate{}); + + expectError(); + t.OnComplete(this, delegate { }); + + expectError(); + t.timeScale = 0; + + void expectError() { + expectIsDeadError(); + } + } + + static Tween createDeadTween() { + var t = createCustomTween(0.1f); + t.Complete(); + Assert.IsFalse(t.isAlive); + return t; + } + + [UnityTest] + public IEnumerator TweenIsPaused() { + var val = 0f; + var t = Tween.Custom(this, 0, 1, 1, (_, newVal) => { + val = newVal; + }); + t.isPaused = true; + yield return null; + Assert.AreEqual(0, val); + yield return null; + Assert.AreEqual(0, val); + yield return null; + Assert.AreEqual(0, val); + t.isPaused = false; + yield return null; + Assert.AreNotEqual(0, val); + } + + [UnityTest] + public IEnumerator SequenceIsPaused() { + var val = 0f; + var t = Tween.Custom(this, 0, 1, 1, (_, newVal) => { + val = newVal; + }); + var s = Sequence.Create(t); + s.isPaused = true; + yield return null; + Assert.AreEqual(0, val); + yield return null; + Assert.AreEqual(0, val); + yield return null; + Assert.AreEqual(0, val); + s.isPaused = false; + yield return null; + Assert.AreNotEqual(0, val); + } + + const int capacityForTest = 800; + + [UnityTest] + public IEnumerator TweensCapacity() { + Tween.StopAll(); + Assert.AreEqual(0, tweensCount); + PrimeTweenConfig.SetTweensCapacity(capacityForTest); + Assert.AreEqual(capacityForTest, tweensCapacity); + PrimeTweenConfig.SetTweensCapacity(0); + Assert.AreEqual(0, tweensCapacity); + LogAssert.Expect(LogType.Warning, new Regex("Please increase the capacity")); + Tween.Delay(0.0001f); + Tween.Delay(0.0001f); // created before set capacity + PrimeTweenConfig.SetTweensCapacity(capacityForTest); + Assert.AreEqual(capacityForTest, tweensCapacity); + var delay = Tween.Delay(0.0001f); + yield return delay.ToYieldInstruction(); // should not display warning + Assert.IsFalse(delay.isAlive); + yield return null; // the yielded tween is not yet released when the coroutine completes. The release will happen only in a frame + Assert.AreEqual(0, tweensCount); + LogAssert.NoUnexpectedReceived(); + } + + static int tweensCapacity => PrimeTweenManager.Instance.currentPoolCapacity; + + [Test] + public void ListResize() { + Tween.StopAll(); + Assert.AreEqual(0, tweensCount); + var list = new List(); + test(2, 2); + Assert.AreNotEqual(list[0], list[1]); + test(0, 2); + test(10, 10); + test(2, 5); + test(10, 20); + test(5, 30); + test(6, 29); + test(4, 31); + test(5, 32); + test(5, 31); + test(4, 31); + test(3, 31); + test(0, 31); + test(31, 31); + Assert.Throws(() => test(32, 31)); + test(0, 0); + test(10, 10); + void test(int newCount, int newCapacity) { + PrimeTweenManager.resizeAndSetCapacity(list, newCount, newCapacity); + Assert.AreEqual(newCount, list.Count); + Assert.AreEqual(newCapacity, list.Capacity); + + PrimeTweenConfig.SetTweensCapacity(newCapacity); + Assert.AreEqual(newCapacity, tweensCapacity); + } + PrimeTweenConfig.SetTweensCapacity(capacityForTest); + } + + static ShakeSettings shakeSettings { + get { + if (Random.value < 0.5f) { + return new ShakeSettings(Vector3.one, 1f, 10f, false); + } + return new ShakeSettings(Vector3.one, 1f, 10f, false, Ease.Linear); + } + } + + [UnityTest] + public IEnumerator ShakeCompleteWhenStartDelayIsNotElapsed() { + var target = new GameObject(nameof(ShakeCompleteWhenStartDelayIsNotElapsed)).transform; + var iniPos = Random.value * Vector3.one; + target.localPosition = iniPos; + var t = Tween.ShakeLocalPosition(target, Vector3.one, 0.1f, startDelay: 0.1f); + yield return null; + Assert.AreEqual(0f, t.interpolationFactor); + Assert.AreEqual(iniPos, target.localPosition); + t.Complete(); + Assert.AreEqual(iniPos, target.localPosition); + } + + [UnityTest] + public IEnumerator ShakeScale() { + var shakeTransform = new GameObject("shake target").transform; + shakeTransform.position = Vector3.one; + Assert.AreEqual(shakeTransform.localScale, Vector3.one); + var t = Tween.ShakeScale(shakeTransform, shakeSettings); + yield return null; + Assert.AreNotEqual(shakeTransform.localScale, Vector3.one); + t.Complete(); + Assert.IsTrue(shakeTransform.localScale == Vector3.one); + Object.DestroyImmediate(shakeTransform.gameObject); + } + + [UnityTest] + public IEnumerator ShakeLocalRotation() { + var shakeTransform = new GameObject("shake target").transform; + shakeTransform.position = Vector3.one; + Assert.AreEqual(shakeTransform.localRotation, Quaternion.identity); + var t = Tween.ShakeLocalRotation(shakeTransform, shakeSettings); + yield return null; + Assert.AreNotEqual(shakeTransform.localRotation, Quaternion.identity); + t.Complete(); + Assert.IsTrue(shakeTransform.localRotation == Quaternion.identity); + Object.DestroyImmediate(shakeTransform.gameObject); + } + + [UnityTest] + public IEnumerator ShakeLocalPosition() { + var shakeTransform = new GameObject("shake target").transform; + shakeTransform.position = Vector3.one; + Assert.AreEqual(shakeTransform.position, Vector3.one); + var t = Tween.ShakeLocalPosition(shakeTransform, shakeSettings); + yield return null; + Assert.AreNotEqual(shakeTransform.position, Vector3.one); + t.Complete(); + Assert.IsTrue(shakeTransform.position == Vector3.one, shakeTransform.position.ToString()); + Object.DestroyImmediate(shakeTransform.gameObject); + } + + [UnityTest] + public IEnumerator ShakeCustom() { + var shakeTransform = new GameObject("shake target").transform; + var iniPos = Vector3.one; + shakeTransform.position = iniPos; + Assert.AreEqual(iniPos, shakeTransform.position); + var t = Tween.ShakeCustom(shakeTransform, iniPos, shakeSettings, (target, val) => target.localPosition = val); + yield return null; + Assert.AreNotEqual(iniPos, shakeTransform.position); + t.Complete(); + Assert.IsTrue(iniPos == shakeTransform.position, iniPos.ToString()); + } + + [UnityTest] + public IEnumerator CreateShakeWhenTweenListHasNull() { + Tween.StopAll(); + Assert.AreEqual(0, tweensCount); + Tween.Delay(0.0001f); + LogAssert.Expect(LogType.Error, "Shake's strength is (0, 0, 0)."); + LogAssert.Expect(LogType.Error, new Regex("Shake's frequency should be > 0f")); + Tween.Delay(0.0001f) + .OnComplete(() => { + Assert.AreEqual(1, getNullTweensCount()); + Tween.ShakeLocalPosition(transform, default).Complete(); + }); + yield return null; + yield return null; + yield return null; + Assert.AreEqual(0, tweensCount); + } + + static int getNullTweensCount() => PrimeTweenManager.Instance.tweensCount - Tween.GetTweensCount(); + + [UnityTest] + public IEnumerator DelayNoTarget() { + int numCallbackCalled = 0; + var t = Tween.Delay(getDt() * 2f, () => numCallbackCalled++); + Assert.AreEqual(0, numCallbackCalled); + while (t.isAlive) { + yield return null; + } + Assert.AreEqual(1, numCallbackCalled); + } + + [UnityTest] + public IEnumerator DelayFirstOverload() { + int numCallbackCalled = 0; + var t = Tween.Delay(this, getDt() * 3, () => numCallbackCalled++); + Assert.AreEqual(0, numCallbackCalled); + while (t.isAlive) { + yield return null; + } + Assert.AreEqual(1, numCallbackCalled); + } + + [UnityTest] + public IEnumerator DelaySecondOverload() { + int numCallbackCalled = 0; + var t = Tween.Delay(this, getDt() * 3, _ => numCallbackCalled++); + Assert.AreEqual(0, numCallbackCalled); + while (t.isAlive) { + yield return null; + } + Assert.AreEqual(1, numCallbackCalled); + } + + [UnityTest] + [SuppressMessage("ReSharper", "PossibleNullReferenceException")] + public IEnumerator NewTweenCreatedFromManualOnComplete() { + Tween.StopAll(); + Assert.AreEqual(0, tweensCount); + var t1 = createTween().OnComplete(() => createTween()); + createTween(); + t1.Complete(); + Assert.AreEqual(3, tweensCount); + checkTweensAreOrdered(); + yield return null; + Assert.AreEqual(2, tweensCount); + checkTweensAreOrdered(); + Tween.StopAll(); + } + + static void checkTweensAreOrdered() { + checkOrder(PrimeTweenManager.Instance.tweens); + checkOrder(PrimeTweenManager.Instance.lateUpdateTweens); + checkOrder(PrimeTweenManager.Instance.fixedUpdateTweens); + void checkOrder(List tweens) { + Assert.IsTrue(tweens.OrderBy(_ => _.id).SequenceEqual(tweens)); + } + } + + [UnityTest] + [SuppressMessage("ReSharper", "PossibleNullReferenceException")] + public IEnumerator NewTweenCreatedFromNormalOnComplete() { + Tween.StopAll(); + Assert.AreEqual(0, tweensCount); + int numOnCompleteCalled = 0; + var t1 = createCustomTween(0.01f).OnComplete(() => { + numOnCompleteCalled++; + createCustomTween(0.01f); + createCustomTween(0.01f); + createCustomTween(0.01f); + }); + Assert.AreEqual(1, tweensCount); + checkTweensAreOrdered(); + while (t1.isAlive) { + yield return null; + } + Assert.AreEqual(1, numOnCompleteCalled); + Assert.AreEqual(3, tweensCount); + checkTweensAreOrdered(); + } + + [UnityTest] + public IEnumerator SetAllPaused() { + if (tweensCount != 0) { + var aliveCount = Tween.GetTweensCount(); + Assert.AreEqual(Tween.StopAll(null), aliveCount); + } + Assert.AreEqual(0, tweensCount); + const int count = 10; + var tweens = new List(); + for (int i = 0; i < count; i++) { + tweens.Add(createCustomTween(1)); + } + Assert.IsTrue(tweens.All(_ => !_.isPaused)); + Assert.AreEqual(Tween.SetPausedAll(true, null), count); + Assert.IsTrue(tweens.All(_ => _.isPaused)); + Assert.AreEqual(Tween.SetPausedAll(false, null), count); + Assert.IsTrue(tweens.All(_ => !_.isPaused)); + Assert.IsTrue(tweens.All(_ => _.isAlive)); + yield return null; + Assert.IsTrue(tweens.All(_ => _.isAlive)); + foreach (var _ in tweens) { + _.Complete(); + } + Assert.IsFalse(tweens.All(_ => _.isAlive)); + } + + [UnityTest] + public IEnumerator StopAllCalledFromOnValueChange() { + Tween.StopAll(); + Assert.AreEqual(0, tweensCount); + int numOnValueChangeCalled = 0; + var t = Tween.Custom(this, 0, 1, 1f, delegate { + Assert.AreEqual(0, numOnValueChangeCalled); + numOnValueChangeCalled++; + var numStopped = Tween.StopAll(this); + Assert.AreEqual(1, numStopped); + }); + Assert.IsTrue(t.isAlive); + yield return null; + yield return null; + Assert.IsFalse(t.isAlive); + LogAssert.NoUnexpectedReceived(); + } + + [UnityTest] + public IEnumerator RecursiveCompleteCallFromOnValueChange() { + int numOnValueChangeCalled = 0; + int numOnCompleteCalled = 0; + Tween t = default; + t = Tween.Custom(this, 0, 1, 1f, delegate { + // Debug.Log(val); + numOnValueChangeCalled++; + Assert.IsTrue(numOnValueChangeCalled <= 2); + t.Complete(); + }).OnComplete(() => numOnCompleteCalled++); + Assert.IsTrue(t.isAlive); + while (t.isAlive) { + yield return null; + } + Assert.IsFalse(t.isAlive); + Assert.AreEqual(1, numOnCompleteCalled); + LogAssert.NoUnexpectedReceived(); + } + + [UnityTest] + public IEnumerator RecursiveCompleteAllCallFromOnValueChange() { + Tween.StopAll(); + Assert.AreEqual(0, tweensCount); + int numOnValueChangeCalled = 0; + int numOnCompleteCalled = 0; + var t = Tween.Custom(this, 0, 1, 1f, delegate { + // Debug.Log(val); + numOnValueChangeCalled++; + switch (numOnValueChangeCalled) { + case 1: { + var numCompleted = Tween.CompleteAll(this); + Assert.AreEqual(1, numCompleted); + break; + } + case 2: { + var numCompleted = Tween.CompleteAll(this); + Assert.AreEqual(0, numCompleted); + break; + } + default: + throw new Exception(); + } + }).OnComplete(() => numOnCompleteCalled++); + Assert.IsTrue(t.isAlive); + while (t.isAlive) { + yield return null; + } + Assert.IsFalse(t.isAlive); + Assert.AreEqual(1, numOnCompleteCalled); + yield return null; + Assert.AreEqual(0, tweensCount); + Assert.AreEqual(2, numOnValueChangeCalled); + LogAssert.NoUnexpectedReceived(); + } + + [UnityTest] + public IEnumerator RecursiveCompleteCallFromOnComplete() { + Tween.StopAll(); + Assert.AreEqual(0, tweensCount); + int numOnCompleteCalled = 0; + Tween t = default; + t = Tween.Custom(this, 0, 1, minDuration, delegate { + }).OnComplete(() => { + numOnCompleteCalled++; + t.Complete(); + }); + Assert.IsTrue(t.isAlive); + while (t.isAlive) { + yield return null; + } + Assert.IsFalse(t.isAlive); + Assert.AreEqual(1, numOnCompleteCalled); + yield return null; + Assert.AreEqual(0, tweensCount); + } + + [UnityTest] + public IEnumerator RecursiveCompleteAllCallFromOnComplete() { + Tween.StopAll(); + Assert.AreEqual(0, tweensCount); + int numOnCompleteCalled = 0; + var t = Tween.Custom(this, 0, 1, minDuration, delegate { + }).OnComplete(() => { + numOnCompleteCalled++; + var numCompleted = Tween.CompleteAll(this); + Assert.AreEqual(0, numCompleted); + }); + Assert.IsTrue(t.isAlive); + while (t.isAlive) { + yield return null; + } + Assert.IsFalse(t.isAlive); + Assert.AreEqual(1, numOnCompleteCalled); + yield return null; + Assert.AreEqual(0, tweensCount); + } + + [UnityTest] + public IEnumerator StopAllCalledFromOnValueChange2() { + int numOnValChangedCalled = 0; + var t = Tween.Custom(this, 0, 1, 0.0001f, (_, val) => { + // Debug.Log(val); + Assert.AreEqual(0, val); + Assert.AreEqual(0, numOnValChangedCalled); + numOnValChangedCalled++; + var numStopped = Tween.StopAll(this); + Assert.AreEqual(1, numStopped); + }); + Assert.IsTrue(t.isAlive); + yield return null; + Assert.IsFalse(t.isAlive); + Assert.AreEqual(1, numOnValChangedCalled); + } + + [UnityTest] + public IEnumerator TweenCanBeNullInProcessAllMethod() { + Assert.AreEqual(0, tweensCount); + Tween.Custom(this, 0, 1, 0.0001f, delegate { + // Debug.Log($"t1 val {val}"); + }); + Tween.Custom(this, 0, 1, 0.0001f, delegate { + // Debug.Log($"t2 val {val}"); + Assert.AreEqual(0, getNullTweensCount()); + Assert.AreEqual(Tween.StopAll(this), 2); + }); + yield return null; + LogAssert.NoUnexpectedReceived(); + } + + [UnityTest] + public IEnumerator TweenCanBeNullInOnComplete() { + Tween.StopAll(); + Assert.AreEqual(0, tweensCount); + int numOnCompleteCalled = 0; + Tween.Custom(this, 0, 1, 0.0001f, delegate{}); + Tween.Custom(this, 0, 1, 0.0001f, delegate { + }).OnComplete(() => { + numOnCompleteCalled++; + Assert.AreEqual(1, getNullTweensCount()); + var numStopped = Tween.StopAll(this); + Assert.AreEqual(0, numStopped); + }); + yield return null; + Assert.AreEqual(1, numOnCompleteCalled); + LogAssert.NoUnexpectedReceived(); + } + + [UnityTest] + public IEnumerator TweenShouldBeDeadInOnValueChangeAfterCallingComplete() { + // Debug.Log(nameof(TweenShouldBeDeadInOnValueChangeAfterCallingComplete)); + var target = new GameObject(nameof(TweenShouldBeDeadInOnValueChangeAfterCallingComplete)); + int numOnValueChangeCalled = 0; + Tween t = default; + t = Tween.Custom(target, 0, 1, minDuration, (_, val) => { + // Debug.Log(val); + Assert.IsTrue(val == 0 || val == 1); + numOnValueChangeCalled++; + switch (numOnValueChangeCalled) { + case 1: + Assert.IsTrue(t.isAlive); + if (Random.value < 0.5f) { + t.Complete(); + } else { + Assert.AreEqual(Tween.CompleteAll(target), 1); + } + break; + case 2: + // when Complete() is called, it's expected that onValueChange will be reported once again + break; + default: throw new Exception(); + } + }); + Assert.AreEqual(1, Tween.SetPausedAll(true, target)); + Assert.AreEqual(1, Tween.SetPausedAll(false, target)); + yield return null; + Assert.IsFalse(t.isAlive); + Assert.AreEqual(2, numOnValueChangeCalled); + } + + [Test] + public void NumProcessed() { + Tween.StopAll(); + Assert.AreEqual(0, tweensCount); + var target1 = new object(); + var target2 = new object(); + + createWithTarget1(); // 1 + createWithTarget1(); // 2 + createWithTarget1(); // 3 + createWithTarget2(); // 1 + createWithTarget2(); // 2 + createWithTarget1(); // 4 + createWithTarget2(); // 3 + + Assert.AreEqual(4, Tween.SetPausedAll(true, target1)); + Assert.AreEqual(4, Tween.SetPausedAll(false, target1)); + Assert.AreEqual(4, Tween.StopAll(target1)); + Assert.AreEqual(0, Tween.StopAll(target1)); + Assert.AreEqual(0, Tween.CompleteAll(target1)); + Assert.AreEqual(0, Tween.SetPausedAll(true, target1)); + + Assert.AreEqual(3, Tween.SetPausedAll(true, target2)); + Assert.AreEqual(3, Tween.SetPausedAll(false, target2)); + Assert.AreEqual(3, Tween.CompleteAll(target2)); + Assert.AreEqual(0, Tween.CompleteAll(target2)); + Assert.AreEqual(0, Tween.StopAll(target2)); + + void createWithTarget1() => Tween.Custom(target1, 0, 1, 0.0001f, delegate { }); + void createWithTarget2() => Tween.Custom(target2, 0, 1, 0.0001f, delegate { }); + } + + [UnityTest] + public IEnumerator TweenIsAliveForWholeDuration() { + int numOnValueChangedCalled = 0; + int numOnValueChangedCalledAfterComplete = 0; + Tween t = default; + var target = new object(); + bool isCompleteCalled = false; + const float duration = 0.3f; + t = Tween.Custom(target, 0, 1, duration, (_, val) => { + // Debug.Log(val); + numOnValueChangedCalled++; + if (isCompleteCalled) { + numOnValueChangedCalledAfterComplete++; + } + Assert.AreEqual(!isCompleteCalled, t.isAlive); + if (val > duration / 2) { + isCompleteCalled = true; + t.Complete(); + } + }).OnComplete(() => { + Assert.IsTrue(t.IsCreated); + Assert.IsFalse(t.isAlive); + Assert.AreEqual(0, Tween.StopAll(target)); + }); + while (t.isAlive) { + yield return null; + } + Assert.IsTrue(numOnValueChangedCalled > 1); + Assert.AreEqual(1, numOnValueChangedCalledAfterComplete); + } + + [Test] + public void SetPauseAll() { + var target = new object(); + var t = Tween.Custom(target, 0, 1, 1, delegate{}); + Assert.AreEqual(0, Tween.SetPausedAll(false, target)); + Assert.AreEqual(1, Tween.SetPausedAll(true, target)); + Assert.AreEqual(0, Tween.SetPausedAll(true, target)); + Assert.AreEqual(1, Tween.SetPausedAll(false, target)); + Assert.AreEqual(0, Tween.SetPausedAll(false, target)); + t.Stop(); + Assert.AreEqual(0, Tween.SetPausedAll(true, target)); + } + + [UnityTest] + public IEnumerator StopByTargetFromOnValueChange() { + var target = new GameObject(); + int numOnValueChangeCalled = 0; + var t = Tween.Custom(target, 0, 1, 1, delegate { + numOnValueChangeCalled++; + var numStopped = Tween.StopAll(target); + Assert.AreEqual(1, numStopped); + }); + Assert.AreEqual(0, numOnValueChangeCalled); + Assert.IsTrue(t.isAlive); + yield return null; + Assert.IsFalse(t.isAlive); + Assert.AreEqual(1, numOnValueChangeCalled); + } + + [UnityTest] + public IEnumerator TweenPropertiesDefault() { + if (tweensCount != 0) { + Tween.StopAll(); + Assert.AreEqual(0, tweensCount); + } + { + yield return Tween.Delay(0.001f).ToYieldInstruction(); + Assert.AreEqual(1, tweensCount); + yield return null; + Assert.AreEqual(0, tweensCount); + } + { + var t = Tween.Delay(0f); + Assert.IsTrue(t.isAlive); + validate(t, true); + } + { + var t = new Tween(); + Assert.IsFalse(t.isAlive); + expectError(false); + Assert.AreEqual(0, t.cyclesTotal); + validate(t, false, false); + } + { + var t = Tween.Delay(1); + t.Complete(); + Assert.IsFalse(t.isAlive); + expectError(); + Assert.AreEqual(0, t.cyclesTotal); + validate(t, false); + } + { + var t = Tween.Delay(1); + t.Stop(); + Assert.IsFalse(t.isAlive); + expectError(); + Assert.AreEqual(0, t.cyclesTotal); + validate(t, false); + } + void validate(Tween t, bool isAlive, bool isCreated = true) { + if (!isAlive) { + for (int i = 0; i < 8; i++) { + expectError(isCreated); + } + } + Assert.AreEqual(0, t.elapsedTime); + Assert.AreEqual(0, t.elapsedTimeTotal); + Assert.AreEqual(0, t.cyclesDone); + Assert.AreEqual(0, t.duration); + Assert.AreEqual(0, t.durationTotal); + Assert.AreEqual(0, t.progress); + Assert.AreEqual(0, t.progressTotal); + Assert.AreEqual(0, t.interpolationFactor); + if (!isAlive) { + expectError(isCreated); + } + Assert.AreEqual(1, t.timeScale); + } + { + const float duration = 0.123f; + var t = Tween.PositionY(transform, 0, duration, Ease.Linear, -1); + Assert.AreEqual(duration, t.duration); + Assert.IsTrue(float.IsPositiveInfinity(t.durationTotal)); + Assert.AreEqual(0, t.progress); + Assert.AreEqual(0, t.progressTotal); + t.Stop(); + validate(t, false); + } + + void expectError(bool isCreated = true) { + expectIsDeadError(isCreated); + } + } + + [UnityTest] + public IEnumerator TweenProperties() { + float duration = Mathf.Max(minDuration, getDt() * Random.Range(0.5f, 5f)); + int numCyclesExpected = Random.Range(1, 3); + Tween t = default; + float startDelay = getDt() * Random.Range(0.1f, 1.2f); + float endDelay = getDt() * Random.Range(0.1f, 1.2f); + float durationExpected = startDelay + duration + endDelay; + float totalDurationExpected = durationExpected * numCyclesExpected; + float timeStart = Time.time; + t = Tween.Custom(this, 1f, 2f, duration, ease: Ease.Linear, cycles: numCyclesExpected, startDelay: startDelay, endDelay: endDelay, onValueChange: (_, val) => { + val -= 1f; + var elapsedTimeTotalExpected = Time.time - timeStart; + var elapsedTimeExpected = elapsedTimeTotalExpected - durationExpected * t.cyclesDone; + // Debug.Log($"val: {val}, progress: {t.progress}, elapsedTimeExpected: {elapsedTimeExpected}, elapsedTimeTotalExpected: {elapsedTimeTotalExpected}"); + const float tolerance = 0.001f; + if (val < 1) { + Assert.AreEqual(elapsedTimeExpected, t.elapsedTime, tolerance); + Assert.AreEqual(elapsedTimeTotalExpected, t.elapsedTimeTotal, tolerance, $"val: {val},duration: {duration}, numCyclesExpected: {numCyclesExpected}"); + Assert.AreEqual(Mathf.Min(elapsedTimeTotalExpected / totalDurationExpected, 1f), t.progressTotal, tolerance); + Assert.AreEqual(elapsedTimeExpected / durationExpected, t.progress, tolerance); + } + Assert.AreEqual(numCyclesExpected, t.cyclesTotal); + Assert.AreEqual(durationExpected, t.duration); + Assert.AreEqual(totalDurationExpected, t.durationTotal); + Assert.AreEqual(t.interpolationFactor, val, tolerance); + }); + yield return t.ToYieldInstruction(); + Assert.IsFalse(t.isAlive); + for (int i = 0; i < 2; i++) { + expectIsDeadError(); + } + Assert.AreEqual(0, t.progress); + Assert.AreEqual(0, t.progressTotal); + + var infT = Tween.Position(transform, Vector3.one, minDuration, cycles: -1); + Assert.IsTrue(infT.isAlive); + Assert.AreEqual(-1, infT.cyclesTotal); + infT.Complete(); + } + + [UnityTest] + public IEnumerator ZeroDurationOnTweenShouldReportValueAtLeastOnce() { + Tween.StopAll(); + Assert.AreEqual(0, tweensCount); + Assert.AreEqual(capacityForTest, tweensCapacity); + + const float p1 = 0.345f; + Tween.PositionZ(transform, 0, p1, 0f).Complete(); + UnityEngine.Assertions.Assert.AreApproximatelyEqual(p1, transform.position.z); + + const float p2 = 0.123f; + Tween.PositionZ(transform, p2, 0).Complete(); + UnityEngine.Assertions.Assert.AreApproximatelyEqual(p2, transform.position.z); + + const float p3 = 0.456f; + Tween.PositionZ(transform, p3, 0); + yield return null; + UnityEngine.Assertions.Assert.AreApproximatelyEqual(p3, transform.position.z); + + yield return Tween.PositionZ(transform, p1, 0).OnComplete(() => { }).ToYieldInstruction(); + UnityEngine.Assertions.Assert.AreApproximatelyEqual(p1, transform.position.z); + } + + [UnityTest] + public IEnumerator OneShouldBeReportedExactlyOnce() { + int numOneReported = 0; + const int cycles = 1; + for (int i = 0; i < 1; i++) { + numOneReported = 0; + yield return Tween.Custom(this, 0, 1, getDt() * Random.Range(0.5f, 1.5f), startDelay: getDt() * Random.Range(0.1f, 1.1f), endDelay: getDt() * Random.Range(0.5f, 3f), cycles: cycles, onValueChange: (_, val) => { + // print($"val: {val}"); + if (val == 1f) { + numOneReported++; + } + }).ToYieldInstruction(); + Assert.AreEqual(cycles, numOneReported); + } + + numOneReported = 0; + yield return Tween.Custom(this, 0, 1, 0f, startDelay: getDt() * Random.Range(0.1f, 1.1f), endDelay: getDt() * Random.Range(0.1f, 1.1f), cycles: cycles, onValueChange: (_, val) => { + if (val == 1) { + numOneReported++; + } + }).ToYieldInstruction(); + Assert.AreEqual(cycles, numOneReported); + + numOneReported = 0; + yield return Tween.Custom(this, 0, 1, 0f, cycles: cycles, onValueChange: (_, val) => { + if (val == 1) { + numOneReported++; + } + }).ToYieldInstruction(); + Assert.AreEqual(cycles, numOneReported); + + numOneReported = 0; + yield return Tween.Custom(this, 0, 1, 0f, (_, val) => { + if (val == 1) { + numOneReported++; + } + }).ToYieldInstruction(); + Assert.AreEqual(1, numOneReported); + + yield return Tween.PositionY(transform, 3.14f, Mathf.Max(minDuration, getDt() * Random.Range(0.1f, 1.1f))).ToYieldInstruction(); + yield return Tween.PositionY(transform, 3.14f, 0f).ToYieldInstruction(); + yield return Tween.PositionY(transform, 0, 3.14f, 0f).ToYieldInstruction(); + } + + [UnityTest] + public IEnumerator SingleFrameTween() { + Application.targetFrameRate = 200; + for (int i = 0; i < 1; i++) { + int numOnValueChangeCalled = 0; + yield return Tween.Custom(this, 0, 1, 0.0001f, (_, val) => { + numOnValueChangeCalled++; + Assert.IsTrue(val == 0 || val == 1); + }).ToYieldInstruction(); + Assert.AreEqual(2, numOnValueChangeCalled); + } + Application.targetFrameRate = targetFrameRate; + } + + [UnityTest] + public IEnumerator TweensWithDurationOfDeltaTime() { + for (int i = 0; i < 1; i++) { + var go = new GameObject(); + go.AddComponent(); + // ReSharper disable once LoopVariableIsNeverChangedInsideLoop + while (go != null) { + yield return null; + } + } + } + + [UnityTest] + public IEnumerator TweenWithExactDurationOfDeltaTime1() { + yield return Tween.Delay(this, Time.deltaTime).ToYieldInstruction(); + } + + [UnityTest] + public IEnumerator TweenWithExactDurationOfDeltaTime2() { + int numOnCompleteCalled = 0; + yield return Tween.Delay(this, Time.deltaTime, () => numOnCompleteCalled++).ToYieldInstruction(); + Assert.AreEqual(1, numOnCompleteCalled); + } + + [Test] + public void TotalDurationWithCycles() { + var duration = Random.value; + var startDelay = Random.value; + var endDelay = Random.value; + var cycles = Random.Range(1, 10); + var t = Tween.LocalPositionY(transform, new TweenSettings(0, 1, duration, cycles: cycles, startDelay: startDelay, endDelay: endDelay)); + var durationTotalExpected = duration + startDelay + endDelay; + const float tolerance = 0.0001f; + Assert.AreEqual(durationTotalExpected, t.duration, tolerance); + Assert.AreEqual(durationTotalExpected * cycles, t.durationTotal, tolerance); + Assert.AreEqual(durationTotalExpected * cycles, t.durationTotal, tolerance); + t.Complete(); + } + + [Test] + public void DurationWithWaitDependencies() { + var t1Dur = Random.value; + var t1Cycles = Random.Range(1, 20); + var t2Dur = Random.value; + var t2Cycles = Random.Range(1, 20); + // const int t1Dur = 1; + // const int t1Cycles = 2; + // const int t2Dur = 2; + // const int t2Cycles = 2; + var t1 = Tween.LocalPositionX(transform, 1, t1Dur, cycles: t1Cycles); + var t2 = Tween.LocalPositionX(transform, 1, t2Dur, cycles: t2Cycles); + var s = t1.Chain(t2); + Assert.IsTrue(t1.isAlive); + Assert.IsTrue(t2.isAlive); + Assert.AreEqual(t1Dur * t1Cycles, t1.durationTotal); + Assert.AreEqual(t2Dur * t2Cycles, t2.durationTotal); + Assert.AreEqual(t1Dur * t1Cycles, t1.durationWithWaitDelay); + Assert.AreEqual(t1Dur * t1Cycles + t2Dur * t2Cycles, t2.durationWithWaitDelay, 0.001f); + s.Complete(); + } + + + [Test] + public void AwaitingDeadCompletesImmediately() { + bool isCompleted = false; + AwaitingDeadCompletesImmediatelyAsync(() => isCompleted = true); + Assert.IsTrue(isCompleted); + } + + static async void AwaitingDeadCompletesImmediatelyAsync([NotNull] Action callback) { + var frame = Time.frameCount; + await new Tween(); + await new Sequence(); + Assert.AreEqual(frame, Time.frameCount); + callback(); + } + + [UnityTest] + public IEnumerator TestAwaitByCallback() { + bool isCompleted = false; + var t = Tween.Delay(getDt() * 5f); + waitForTweenAsync(t, () => isCompleted = true); + Assert.IsFalse(isCompleted); + yield return null; + Assert.IsFalse(isCompleted); + yield return t.ToYieldInstruction(); + Assert.IsTrue(isCompleted); + } + + static async void waitForTweenAsync(Tween tween, [NotNull] Action callback) { + await tween; + callback(); + } + + [Test] + public async Task AwaitTweenWithCallback() { + bool isCompleted = false; + var t = Tween.Delay(getDt() * 2f,() => isCompleted = true); + Assert.IsTrue(t.isAlive); + Assert.IsTrue(t.tween.HasOnComplete); + await t; + Assert.IsFalse(t.isAlive); + Assert.IsTrue(isCompleted); + } + + const float minDuration = TweenSettings.minDuration; + + [Test] + public async Task AwaitTweenWithCallbackDoesntPostpone() { + bool isCompleted = false; + var t = Tween.Delay(minDuration,() => isCompleted = true); + Assert.IsTrue(t.isAlive); + Assert.IsTrue(t.tween.HasOnComplete); + var frameStart = Time.frameCount; + await t; + Assert.AreEqual(1, Time.frameCount - frameStart); + Assert.IsFalse(t.isAlive); + Assert.IsTrue(isCompleted); + } + + [Test] + public async Task AwaitSequence() { + bool isCompleted1 = false; + bool isCompleted2 = false; + await Sequence.Create(Tween.Delay(0.01f, () => isCompleted1 = true)) + .Chain(Tween.Delay(0.02f, () => isCompleted2 = true)); + Assert.IsTrue(isCompleted1); + Assert.IsTrue(isCompleted2); + } + + [Test] + public async Task AwaitSequence2() { + var t1 = Tween.Delay(getDt()); + var t2 = Tween.Delay(getDt()); + await t1.Chain(t2); + Assert.IsFalse(t1.isAlive); + Assert.IsFalse(t2.isAlive); + } + + [UnityTest] + public IEnumerator ToYieldInstruction() { + var t = Tween.Delay(0.1f); + var e = t.ToYieldInstruction(); + var frameStart = Time.frameCount; + while (e.MoveNext()) { + yield return e.Current; + t.Complete(); + } + Assert.AreEqual(1, Time.frameCount - frameStart); + Assert.IsFalse(t.isAlive); + yield return t.ToYieldInstruction(); + + Tween defaultTween = default; + defaultTween.ToYieldInstruction(); + + Sequence defaultSequence = default; + defaultSequence.ToYieldInstruction(); + + t.Complete(); + } + + [UnityTest] + public IEnumerator ImplicitConversionToIterator() { + PrimeTweenConfig.warnStructBoxingAllocationInCoroutine = true; + { + var t2 = Tween.Delay(0.0001f); + var frameStart = Time.frameCount; + expectCoroutineBoxingWarning(); + yield return t2; + Assert.AreEqual(1, Time.frameCount - frameStart); + Assert.IsFalse(t2.isAlive); + } + { + var s = Sequence.Create(Tween.Delay(0.0001f)); + var frameStart = Time.frameCount; + // iterator boxing warning is shown only once + yield return s; + Assert.AreEqual(1, Time.frameCount - frameStart); + Assert.IsFalse(s.isAlive); + } + LogAssert.NoUnexpectedReceived(); + } + + [Test] + public async Task AwaitInfiniteTweenComplete() { + Tween t = default; + int numCompleted = 0; + t = Tween.Custom(this, 0, 1, 1, cycles: -1, onValueChange: delegate { t.Complete(); }) + .OnComplete(() => numCompleted++); + await t; + Assert.AreEqual(1, numCompleted); + } + + [Test] + public async Task AwaitInfiniteTweenStop() { + Tween t = default; + int numOnValueChanged = 0; + t = Tween.Custom(this, 0, 1, 1f, cycles: -1, onValueChange: delegate { + // Debug.Log(numOnValueChanged); + numOnValueChanged++; + Assert.AreEqual(1, numOnValueChanged); + Assert.IsTrue(t.isAlive); + t.Stop(); + }); + Assert.IsTrue(t.isAlive); + await t; + Assert.IsFalse(t.isAlive); + Assert.AreEqual(1, numOnValueChanged); + } + + [Test] + public async Task TweenStoppedTweenWhileAwaiting() { + var t = Tween.Delay(0.05f); + #pragma warning disable CS4014 + Tween.Delay(0.01f).OnComplete(() => t.Stop()); + #pragma warning restore CS4014 + Assert.IsTrue(t.isAlive); + await t; + Assert.IsFalse(t.isAlive); + } + + [Test] + public void InvalidDurations() { + Assert.Throws(() => Tween.Delay(float.NaN), Constants.durationInvalidError); + Assert.Throws(() => Tween.Delay(float.PositiveInfinity), Constants.durationInvalidError); + Assert.Throws(() => Tween.Delay(float.NegativeInfinity), Constants.durationInvalidError); + Assert.Throws(() => Tween.PositionZ(transform, new TweenSettings(0, 1, new TweenSettings(1, startDelay: float.NaN))), Constants.durationInvalidError); + Assert.Throws(() => Tween.PositionZ(transform, new TweenSettings(0, 1, new TweenSettings(1, startDelay: float.PositiveInfinity))), Constants.durationInvalidError); + Assert.Throws(() => Tween.PositionZ(transform, new TweenSettings(0, 1, new TweenSettings(1, startDelay: float.NegativeInfinity))), Constants.durationInvalidError); + Assert.Throws(() => Tween.PositionZ(transform, new TweenSettings(0, 1, new TweenSettings(1, endDelay: float.NaN))), Constants.durationInvalidError); + Assert.Throws(() => Tween.PositionZ(transform, new TweenSettings(0, 1, new TweenSettings(1, endDelay: float.PositiveInfinity))), Constants.durationInvalidError); + Assert.Throws(() => Tween.PositionZ(transform, new TweenSettings(0, 1, new TweenSettings(1, endDelay: float.NegativeInfinity))), Constants.durationInvalidError); + } + + [Test] + public void MaterialTweens() { + { + var s = Shader.Find("Standard"); + if (s == null) { + Assert.Ignore(); + return; + } + var m = new Material(s); + + { + const string propName = "_EmissionColor"; + #if UNITY_2021_1_OR_NEWER + Assert.IsTrue(m.HasColor(propName)); + #endif + var to = Color.red; + Tween.MaterialColor(m, Shader.PropertyToID(propName), to, 1f).Complete(); + Assert.AreEqual(to, m.GetColor(propName)); + } + { + const string propName = "_EmissionColor"; + #if UNITY_2021_1_OR_NEWER + Assert.IsTrue(m.HasColor(propName)); + #endif + var iniColor = new Color(Random.value, Random.value, Random.value, Random.value); + m.SetColor(propName, iniColor); + var toAlpha = Random.value; + Tween.MaterialAlpha(m, Shader.PropertyToID(propName), toAlpha, 1f).Complete(); + var col = m.GetColor(propName); + UnityEngine.Assertions.Assert.AreApproximatelyEqual(col.r, iniColor.r); + UnityEngine.Assertions.Assert.AreApproximatelyEqual(col.g, iniColor.g); + UnityEngine.Assertions.Assert.AreApproximatelyEqual(col.b, iniColor.b); + UnityEngine.Assertions.Assert.AreApproximatelyEqual(col.a, toAlpha); + } + { + const string propName = "_Cutoff"; + #if UNITY_2021_1_OR_NEWER + Assert.IsTrue(m.HasFloat(propName)); + #endif + var to = Random.value; + Tween.MaterialProperty(m, Shader.PropertyToID(propName), to, 1f).Complete(); + UnityEngine.Assertions.Assert.AreApproximatelyEqual(to, m.GetFloat(propName)); + } + { + const string propName = "_MainTex"; + #if UNITY_2021_1_OR_NEWER + Assert.IsTrue(m.HasTexture(propName)); + #endif + var to = Random.value * Vector2.one; + Tween.MaterialTextureOffset(m, Shader.PropertyToID(propName), to, 1f).Complete(); + Assert.AreEqual(to, m.GetTextureOffset(propName)); + } + { + const string propName = "_MainTex"; + #if UNITY_2021_1_OR_NEWER + Assert.IsTrue(m.HasTexture(propName)); + #endif + var to = Random.value * Vector2.one; + Tween.MaterialTextureScale(m, Shader.PropertyToID(propName), to, 1f).Complete(); + Assert.IsTrue(to == m.GetTextureScale(propName)); + } + } + + { + var m = Resources.Load("Custom_TestShader"); + Assert.IsNotNull(m); + const string propName = "_TestVectorProp"; + var to = Random.value * Vector4.one; + Tween.MaterialProperty(m, Shader.PropertyToID(propName), to, 1f).Complete(); + Assert.IsTrue(to == m.GetVector(propName)); + } + } + + /// passing the serialized UnityEngine.Object reference that is not populated behaves like passing destroyed object + [Test] + public void PassingDestroyedUnityTarget() { + LogAssert.NoUnexpectedReceived(); + + var target = new GameObject().transform; + Object.DestroyImmediate(target.gameObject); + + var s = Sequence.Create(); + expectError(); + s.ChainCallback(target, delegate { }); + + expectError(); + Assert.IsFalse(Tween.Delay(target, 0.1f, delegate { }).IsCreated); + expectError(); + Assert.IsFalse(Tween.Delay(target, 0.1f).IsCreated); + expectError(); + Assert.IsFalse(Tween.Delay(target, 0.1f, () => {}).IsCreated); + + expectError(); + Assert.IsFalse(Tween.Position(target, new TweenSettings(default, default, 0.1f)).IsCreated); + + expectError(); + var deadTween = Tween.Custom(target, 0f, 0, 0.1f, delegate { }); + Assert.IsFalse(deadTween.isAlive); + expectAddDeadToSequenceError(); + Sequence.Create(deadTween); + + LogAssert.Expect(LogType.Error, "Shake's strength is (0, 0, 0)."); + LogAssert.Expect(LogType.Error, new Regex("Shake's frequency should be > 0f")); + expectError(); + Tween.ShakeLocalPosition(target, default); + + void expectError() { + expectTargetIsNull(); + } + } + + [Test] + public void ShakeSettings() { + { + var s = new ShakeSettings(Vector3.one, 1f, 1); + Assert.IsTrue(s.enableFalloff); + } + { + var s = new ShakeSettings(Vector3.one, 1f, 1, true, Ease.InBack); + Assert.IsTrue(s.enableFalloff); + } + { + var s = new ShakeSettings(Vector3.one, 1f, 1, AnimationCurve.Linear(0,0,1,1)); + Assert.IsTrue(s.enableFalloff); + } + } + + [UnityTest] + public IEnumerator ForceCompleteWhenWaitingForEndDelay() { + var t = Tween.ShakeLocalPosition(transform, new ShakeSettings(Vector3.one, getDt() * 2f, endDelay: 100f)); + while (t.interpolationFactor < 1f) { + yield return null; + } + Assert.IsTrue(t.isAlive); + t.Complete(); + Assert.IsFalse(t.isAlive); + } + + static void print(object o) => Debug.Log($"[{Time.frameCount}] {o}"); + + [UnityTest] + public IEnumerator StopAtEvenOrOddCycle() { + for (int i = 0; i < 5; i++) { + var t = Tween.Rotation(transform, Vector3.one, getDt() * 5f, cycles: 10, cycleMode: CycleMode.Yoyo); + while (t.cyclesDone < Random.Range(2, 4)) { + yield return null; + } + t.SetRemainingCycles(true); + Assert.AreEqual(t.cyclesDone % 2 + 1, t.cyclesTotal - t.cyclesDone); + t.SetRemainingCycles(false); + Assert.AreEqual(t.cyclesDone % 2, (t.cyclesTotal - t.cyclesDone) % 2); + } + } + + [UnityTest] + public IEnumerator SetCycles() { + var t = Tween.Rotation(transform, Vector3.one, Mathf.Max(minDuration, getDt()) * 10, cycles: 10); + while (t.cyclesDone != 2) { + yield return null; + } + t.SetRemainingCycles(3); + Assert.AreEqual(2, t.cyclesDone); + Assert.AreEqual(5, t.cyclesTotal); + t.Complete(); + } + + [Test] + public void DOTweenAdapterEnabled() { + #if !PRIME_TWEEN_DOTWEEN_ADAPTER + Assert.Inconclusive(); + #endif + } + + [Test] + public void ExperimentalDefineSet() { + #if PRIME_TWEEN_EXPERIMENTAL + Assert.Ignore("Please remove the PRIME_TWEEN_EXPERIMENTAL define and run all tests again."); + #endif + } + + [UnityTest] + public IEnumerator RecursiveKillAllCall() { + // Calling Tween.StopAll/Complete() from onValueChange previously threw the 'Please don't call Tween.StopAll/CompleteAll() from the OnComplete() callback' exception before. + // But this no longer the case - current impl checks if Update/FixedUpdate() is safe to call + yield return Tween.Custom(0, 1, 1f, val => { + if (val != 0) { + Tween.StopAll(); + } + }).ToYieldInstruction(); + + yield return Tween.Custom(0, 1, 0.01f, _ => { + Tween.CompleteAll(); + }).ToYieldInstruction(); + LogAssert.NoUnexpectedReceived(); + } + + [UnityTest] + public IEnumerator KillAllIsImmediate() { + Tween.Delay(0.01f); + Tween.StopAll(null); + Assert.AreEqual(0, tweensCount); + Tween.Delay(0.01f); + Assert.AreEqual(1, tweensCount); + Assert.AreEqual(Tween.CompleteAll(null), 1); + Assert.AreEqual(0, tweensCount); + yield return null; + LogAssert.NoUnexpectedReceived(); + } + + [Test] + public void SetCapacityImmediatelyAfterStopAll() { + Tween.StopAll(); + Assert.AreEqual(0, tweensCount); + PrimeTweenConfig.SetTweensCapacity(2); + Tween.Delay(0.01f); + Tween.Delay(0.01f); + Assert.AreEqual(2, tweensCount); + Tween.StopAll(); + Assert.AreEqual(0, tweensCount); + PrimeTweenConfig.SetTweensCapacity(1); + PrimeTweenConfig.SetTweensCapacity(capacityForTest); + LogAssert.NoUnexpectedReceived(); + } + + [UnityTest] + public IEnumerator RotationShakeEndVal() { + var target = new GameObject(nameof(RotationShakeEndVal)).transform; + var iniRot = Random.rotation.normalized; + var strength = Random.insideUnitSphere; + var freq = Random.value * 10; + target.rotation = iniRot; + var handle = Tween.ShakeLocalRotation(target, strength, 1f, freq); + // skip frame so cacheDiff() is called + yield return null; + Assert.IsTrue(handle.isAlive); + var t = handle.tween; + Assert.IsTrue(iniRot == t.startValue.QuaternionVal); + Assert.IsTrue(Quaternion.identity == t.endValue.QuaternionVal); + Assert.AreEqual(strength, t.shakeData.strengthPerAxis); + Assert.AreEqual(freq, t.shakeData.frequency); + Object.Destroy(target.gameObject); + handle.Stop(); + } + + [UnityTest] + public IEnumerator AtSpeed() { + var target = new GameObject(nameof(AtSpeed)).transform; + var speed = (Random.value + 0.1f) * 10f; + const double tolerance = 0.001; + var endValue = new Vector3(1, 0,0); + { + Assert.AreEqual(Vector3.zero, target.position); + var t = Tween.PositionAtSpeed(target, endValue, speed); + Assert.AreEqual(speed, 1 / t.duration, tolerance); + yield return null; + Assert.AreEqual(speed, 1 / t.duration, tolerance); + t.Stop(); + } + { + target.position = Vector3.zero; + Tween.PositionAtSpeed(target, endValue, speed).Complete(); + Assert.AreEqual(endValue, target.position); + } + { + target.position = Vector3.zero; + float startDelay = getDt(); + var t = Tween.PositionAtSpeed(target, endValue, speed, startDelay: startDelay); + var expectedDuration = 1 / speed + startDelay; + while (t.interpolationFactor == 0) { + Assert.AreEqual(expectedDuration, t.duration, tolerance); + yield return null; + } + Assert.AreEqual(expectedDuration, t.duration, tolerance); + yield return null; + Assert.AreEqual(expectedDuration, t.duration, tolerance); + t.Stop(); + } + } + + [UnityTest] + public IEnumerator DelayInterpolationFactor() { + for (int i = 0; i < 1; i++) { + float duration = Random.Range(0.001f, 0.1f); + var d = Tween.Delay(duration); + float timeStart = Time.time; + while (d.isAlive) { + Assert.AreEqual(Mathf.Min(1f, (Time.time - timeStart) / duration), d.interpolationFactor, 0.001f); + yield return null; + } + } + } + + [Test] + public void TweensCount() { + Tween.StopAll(); + int count = Random.Range(1, 10); + for (int i = 0; i < count; i++) { + Tween.PositionX(transform, 10, 0.01f); + } + Assert.AreEqual(count, Tween.GetTweensCount()); + Assert.AreEqual(count, Tween.GetTweensCount(transform)); + Tween.StopAll(); + Assert.AreEqual(0, Tween.GetTweensCount()); + } + + [UnityTest] + public IEnumerator StopCalledOnLastTweenFrame() { + float dt = getDt(); + Tween tween = default; + tween = Tween.Custom(0, 1, dt * 3, val => { + if (val == 1f) { + tween.Stop(); + Assert.IsFalse(tween.isAlive); + } + }).OnComplete(() => Assert.Fail()); + yield return tween.ToYieldInstruction(); + } + + [UnityTest] + public IEnumerator StopCalledOnLastTweenFrameFromOnUpdate() { + Tween tween = default; + float duration = getDt() * 3f; + tween = Tween.Custom(0, 1, duration, delegate { }) + .OnUpdate(this, delegate { + if (tween.interpolationFactor == 1f) { + tween.Stop(); + Assert.IsFalse(tween.isAlive); + } + }) + .OnComplete(() => Assert.Fail()); + yield return tween.ToYieldInstruction(); + } + + [UnityTest] + public IEnumerator OnUpdateDestroyedTarget() { + var onUpdateTarget = new GameObject(nameof(OnUpdateDestroyedTarget)); + int numUpdated = 0; + expectOnUpdateRemoved(); + yield return Tween.Delay(getDt() * 5) + .OnUpdate(onUpdateTarget, (target, _) => { + Assert.AreEqual(0, numUpdated); + numUpdated++; + Object.Destroy(target); + }) + .ToYieldInstruction(); + Assert.AreEqual(1, numUpdated); + LogAssert.NoUnexpectedReceived(); + } + + [UnityTest] + public IEnumerator OnUpdateException() { + var onUpdateTarget = new GameObject(nameof(OnUpdateDestroyedTarget)); + expectOnUpdateRemoved(); + int numCompleted = 0; + yield return Tween.PositionZ(transform, Random.value, 0.001f) + .OnUpdate(onUpdateTarget, delegate { throw new Exception(); }) + .OnComplete(() => numCompleted++) + .ToYieldInstruction(); + Assert.AreEqual(1, numCompleted); + LogAssert.NoUnexpectedReceived(); + } + + [Test] + public void OnUpdateInvalidUsage() { + var t = Tween.Delay(0.001f); + t.OnUpdate(null, delegate { }); // ok + expectException(() => { + t.OnUpdate(null, delegate { }); // duplicate is not allowed + }, "Only one OnUpdate() is allowed for one tween."); + Assert.Throws(() => { + t.OnUpdate(this, null); // null onUpdate is not allowed + }); + } + + [UnityTest] + public IEnumerator OnUpdate() { + { + // with delay + int numCalled = 0; + yield return Tween.Delay(minDuration, () => numCalled++).ToYieldInstruction(); + Assert.AreEqual(1, numCalled); + } + { + var t = Tween.Position(transform, Vector3.one, getDt(), endDelay: getDt() * 5); + int numInterpolationCompleted = 0; + yield return t.OnUpdate(null, delegate { + if (t.interpolationFactor == 1f) { + numInterpolationCompleted++; + } + }).ToYieldInstruction(); + Assert.AreEqual(1, numInterpolationCompleted); + } + } + + static void expectOnUpdateRemoved() => LogAssert.Expect(LogType.Error, new Regex("will not be called again because")); + + [UnityTest] + public IEnumerator TimescaleTweenOutliveTheTarget() { + var shortTween = Tween.Delay(0.001f); + var timeScaleTween = Tween.TweenTimeScale(shortTween, 0.5f, 1) + .OnComplete(Assert.Fail); + expectOnCompleteIgnored(); + yield return shortTween.ToYieldInstruction(); + Assert.IsFalse(timeScaleTween.isAlive); + LogAssert.NoUnexpectedReceived(); + } + + [UnityTest] + public IEnumerator ConversionToEasing() { + var curve = AnimationCurve.Linear(0, 0, 1, 1); + new TweenSettings(1, curve); + new TweenSettings(0, 1, curve); + new TweenSettings(0, 1, 1, curve); + Tween.Position(transform, Vector3.one, 1, curve); + Tween.Position(transform, Vector3.one, 1, (Easing)Ease.InBack); + Tween.Position(transform, Vector3.zero, Vector3.one, 1, curve); + #if PRIME_TWEEN_EXPERIMENTAL + Tween.PositionAdditive(transform, Vector3.one, 1, curve); + #endif + Tween.PositionAtSpeed(transform, Vector3.one, 10, curve); + Tween.PositionAtSpeed(transform, Vector3.zero, Vector3.one, 10, curve); + yield return null; + Tween.StopAll(); + } + + [UnityTest] + public IEnumerator Elastic() { + for (int i = 0; i < 5; i++) { + Assert.AreEqual(0, Easing.Evaluate(0, parametricSettings(ParametricEase.Elastic, 1, 0.3f))); + Assert.AreEqual(1, Easing.Evaluate(1, parametricSettings(ParametricEase.Elastic, 1, 0.3f))); + var strength = 1 + Random.value; + var period = 0.1f + Random.value; + var t = Tween.Position(transform, Vector3.one, 1, Easing.Elastic(strength, period)); + yield return null; + Assert.IsTrue(t.isAlive); + Assert.AreEqual(strength, t.tween.settings.parametricEaseStrength); + Assert.AreEqual(period, t.tween.settings.parametricEasePeriod); + Assert.AreEqual(Ease.Custom, t.tween.settings.ease); + Assert.AreEqual(ParametricEase.Elastic, t.tween.settings.parametricEase); + t.Stop(); + } + } + + [NotNull] + static ReusableTween parametricSettings(ParametricEase ease, float strength, float period) { + return new ReusableTween { + settings = new TweenSettings { + ease = Ease.Custom, + duration = 1, + parametricEase = ease, + parametricEaseStrength = strength, + parametricEasePeriod = period + } + }; + } + + [UnityTest] + public IEnumerator Overshoot() { + Assert.AreEqual(0, Easing.Evaluate(0, parametricSettings(ParametricEase.Overshoot, 1, float.NaN))); + Assert.AreEqual(1, Easing.Evaluate(1, parametricSettings(ParametricEase.Overshoot, 1, float.NaN))); + var strength = Random.value; + var t = Tween.Position(transform, Vector3.one, 1, Easing.Overshoot(strength)); + yield return null; + Assert.IsTrue(t.isAlive); + Assert.AreEqual(strength * StandardEasing.backEaseConst, t.tween.settings.parametricEaseStrength); + Assert.AreEqual(ParametricEase.Overshoot, t.tween.settings.parametricEase); + Assert.AreEqual(Ease.Custom, t.tween.settings.ease); + t.Stop(); + } + + [UnityTest] + [SuppressMessage("ReSharper", "AssignNullToNotNullAttribute")] + public IEnumerator NullTarget() { + const float duration = 0.05f; + Transform t = null; + + expectTargetIsNull(); + Tween.Position(t, Vector3.one, duration).ToYieldInstruction(); + + expectTargetIsNull(); + Tween.Delay(null, duration); + + expectTargetIsNull(); + Tween.Delay(t, duration, delegate { }); + + expectTargetIsNull(); + Sequence.Create().ChainCallback(t, delegate { }); + + Tween.Custom(0, 1, duration, delegate { }); + Tween.Delay(duration); + Time.timeScale = 0.99f; + Tween.GlobalTimeScale(1, 0.05f); + Sequence.Create().ChainCallback(delegate { }); + #if PRIME_TWEEN_DOTWEEN_ADAPTER + DOTween.Sequence().SetLoops(2).AppendCallback(delegate {}); + DOTween.Sequence().PrependInterval(0.01f); + #endif + yield return null; + yield return null; + Tween.StopAll(); + LogAssert.NoUnexpectedReceived(); + } + + [UnityTest] + public IEnumerator MoreThanOneCyclePerFrame() { + yield return null; + { + var zeroDurTween = Tween.ScaleY(transform, 2f, 0, cycles: int.MaxValue - 1); + yield return null; + Assert.IsFalse(zeroDurTween.isAlive, "0f duration completes all cycles immediately"); + } + { + var infiniteZeroDurTween = Tween.ScaleY(transform, 2f, 0, cycles: -1); + yield return null; + Assert.AreEqual(1, infiniteZeroDurTween.cyclesDone); + Assert.IsTrue(infiniteZeroDurTween.isAlive); + } + { + float duration = 0.001f + getDt() / 10f; + Assert.IsTrue(duration >= 0.001f); + var t = Tween.ScaleY(transform, 2f, duration, cycles: int.MaxValue - 1); + yield return null; + Assert.AreEqual(Mathf.FloorToInt(Time.deltaTime / duration), t.cyclesDone); + t.Complete(); + } + } + + [UnityTest] + public IEnumerator ExecutionOrder() { + yield return null; + int i = 0; + void validate(int order) { + // Debug.Log($"-------------- validate {order}"); + Assert.AreEqual(i, order); + i++; + } + { + for (int k = 0; k < 1; k++) { + yield return Sequence.Create(2) + .Chain(Tween.Custom(0, 1, getDur(), delegate { }, startDelay: getDur(), endDelay: getDur()).OnComplete(() => validate(0))) + .ChainCallback(() => validate(1)) + .Chain(Tween.Delay(getDur(), () => validate(2))) + .Chain(Tween.Custom(0, 1, getDur(), delegate { }, startDelay: getDur(), endDelay: getDur()).OnComplete(() => validate(3))) + .ChainCallback(() => validate(4)) + .ChainCallback(() => validate(5)) + .ChainCallback(() => { + validate(6); + i = 0; + }) + .ToYieldInstruction(); + } + } + { + for (int k = 0; k < 1; k++) { + i = 0; + var seq = Sequence.Create(); + const int iterations = 5; + for (int j = 0; j < iterations; j++) { + var expected = j; + if (Random.value > 0.5f) { + seq.Chain(Tween.Delay(getDur(), () => validate(expected))); + } else { + seq.ChainCallback(() => validate(expected)); + } + } + seq.ChainCallback(() => { + validate(iterations); + i = 0; + }); + seq.SetRemainingCycles(2); + yield return seq.ToYieldInstruction(); + } + } + + float getDur() => Mathf.Max(minDuration, getDt() * Mathf.Lerp(0.1f, 2f, Random.value)); + } + + static float getDt() => Application.targetFrameRate != -1 ? 1f / Application.targetFrameRate : Time.deltaTime; + + [Test] + public void ShakeIsDeadOnNewReusableTween() { + var t = new ReusableTween(); + Assert.IsFalse(t.shakeData.isAlive); + } + + [UnityTest] + public IEnumerator SmallDurationWithInfiniteCycles() { + int numChanged = 0; + int numUpdated = 0; + const float duration = 0.001f; + var t = Tween.Custom(0f, 1f, duration, cycles: -1, onValueChange: delegate { + numChanged++; + // print("onValueChange"); + }) + .OnUpdate(this, delegate { + numUpdated++; + Assert.AreEqual(numChanged, numUpdated); + // print("OnUpdate()"); + }); + float timeStart = Time.time; + yield return null; + yield return null; + yield return null; + Assert.AreEqual(4, numChanged); + Assert.AreEqual(4, numUpdated); + var cyclesDoneExpected = Mathf.FloorToInt((Time.time - timeStart) / duration); + Assert.AreEqual(cyclesDoneExpected, t.cyclesDone); + t.Complete(); + } + + [UnityTest] + public IEnumerator InvalidOperationExceptionInsideCompleteAllBug() { + for (int i = 0; i < 1; i++) { + const float upper = 1.5f; + Tween.Delay(getDt() * Random.Range(0.5f, upper), () => Tween.Delay(getDt() * Random.Range(0.5f, 1.5f))); + Tween.Delay(getDt() * Random.Range(0.5f, upper), () => Tween.Delay(getDt() * Random.Range(0.5f, 1.5f))); + Tween.Delay(getDt() * Random.Range(0.5f, upper), () => Tween.Delay(getDt() * Random.Range(0.5f, 1.5f))); + Tween.Delay(getDt() * Random.Range(0.5f, upper), () => Tween.Delay(getDt() * Random.Range(0.5f, 1.5f))); + Tween.Delay(getDt() * Random.Range(0.5f, upper), () => Tween.Delay(getDt() * Random.Range(0.5f, 1.5f))); + int delayFramesBeforeCompleteAll = Random.Range(0, 0); + for (int j = 0; j < delayFramesBeforeCompleteAll; j++) { + yield return null; + } + if (Random.value >= 0.0f) { + Tween.CompleteAll(); + } + } + yield return null; + } + + [UnityTest] + public IEnumerator TweenElapsedTimeTotal() { + var duration = getDt() * 2f; + var t = Tween.Custom(0f, 1f, duration, delegate { }); + var s = Sequence.Create(2) + .ChainDelay(duration) + .Chain(t) + .ChainDelay(duration); + while (s.isAlive) { + Assert.IsTrue(t.elapsedTimeTotal >= 0f); + Assert.IsTrue(t.elapsedTimeTotal <= t.durationTotal); + yield return null; + } + } + + [Test] + public void SetCyclesWithDelay() { + LogAssert.Expect(LogType.Error, new Regex("Applying cycles to Delay will not repeat")); + var delay = Tween.Delay(this, duration: .5f, delegate {}); + delay.SetRemainingCycles(10); + delay.Stop(); + } + + [Test] + public void ElapsedTimeTotalIsClamped() { + for (int i = 0; i < 1; i++) { + float duration = Random.value + 0.001f; + int cycles = Random.Range(3, 20); + var t = Tween.Delay(duration); + t.SetRemainingCycles(cycles); + t.isPaused = true; + + t.elapsedTime = float.MaxValue; + Assert.AreEqual(1, t.cyclesDone); + Assert.AreEqual(duration, t.tween.elapsedTimeTotal); + Assert.AreEqual(0f, t.elapsedTime); // new cycles has started, so should be 0f + Assert.AreEqual(duration, t.elapsedTimeTotal); + + t.elapsedTimeTotal = 0f; + Assert.AreEqual(0, t.cyclesDone); + Assert.AreEqual(0f, t.tween.elapsedTimeTotal); + Assert.AreEqual(0f, t.elapsedTime); + Assert.AreEqual(0f, t.elapsedTimeTotal); + + t.elapsedTimeTotal = float.MaxValue; + Assert.AreEqual(cycles, t.cyclesDone); + Assert.AreEqual(t.durationTotal, t.tween.elapsedTimeTotal); + Assert.AreEqual(t.duration, t.elapsedTime); + Assert.AreEqual(t.durationTotal, t.elapsedTimeTotal); + + Assert.IsTrue(t.isAlive); + t.Stop(); + } + } + + [UnityTest] + public IEnumerator WarnEndValueEqualsCurrent() { + Assert.AreEqual(0, tweensCount); + var iniPos = Vector3.one * Random.value; + + { + transform.position = iniPos; + var t = Tween.Position(transform, iniPos, 1f); + yield return null; + LogAssert.Expect(LogType.Warning, new Regex("Tween's 'endValue' equals to the current animated value")); + t.Stop(); + } + + { + PrimeTweenConfig.warnEndValueEqualsCurrent = false; + transform.position = iniPos; + var t = Tween.Position(transform, iniPos, 1f); + yield return null; + t.Stop(); + PrimeTweenConfig.warnEndValueEqualsCurrent = true; + } + + LogAssert.NoUnexpectedReceived(); + } + + [Test] + public void SetInfiniteTweenElapsedTime() { + var t = Tween.Custom(0f, 1f, 0.01f, delegate { }, cycles: -1); + for (int i = 0; i < 8; i++) { + LogAssert.Expect(LogType.Error, new Regex("Invalid elapsedTime")); + } + t.elapsedTime = float.MaxValue; // ok + t.elapsedTime = float.PositiveInfinity; // ok + t.elapsedTime = -1f; + t.elapsedTime = float.NegativeInfinity; + t.elapsedTime = float.NaN; + + t.elapsedTimeTotal = 0f; // ok + t.elapsedTimeTotal = 10f; // ok + t.elapsedTimeTotal = -1f; + t.elapsedTimeTotal = float.MaxValue; + t.elapsedTimeTotal = float.PositiveInfinity; + t.elapsedTimeTotal = float.NegativeInfinity; + t.elapsedTimeTotal = float.NaN; + t.Stop(); + } + + [Test] + public void SetInfiniteTweenProgress() { + var t = Tween.Custom(0f, 1f, 0.01f, delegate { }, cycles: -1); + Assert.IsTrue(float.IsPositiveInfinity(t.durationTotal)); + + // ok + t.progress = 0f; + t.progress = 0.5f; + t.progress = 1f; + + for (int i = 0; i < 3; i++) { + LogAssert.Expect(LogType.Error, new Regex("It's not allowed to set progressTotal on infinite tween")); + } + t.progressTotal = 0f; + t.progressTotal = 0.5f; + t.progressTotal = 1f; + Assert.IsTrue(float.IsPositiveInfinity(t.durationTotal)); + t.Stop(); + } + + [UnityTest] + public IEnumerator ZZ_SceneLoadSetsUnityObjectBug1() { + var t = Tween.Delay(1f); + LoadTestScene(); + yield return null; + Assert.IsTrue(t.isAlive); + t.Stop(); + } + + [UnityTest] + public IEnumerator ZZ_SceneLoadSetsUnityObjectBug2() { + var seq = Sequence.Create().ChainDelay(1f); + LoadTestScene(); + yield return null; + Assert.IsTrue(seq.isAlive); + seq.Stop(); + } + + static void LoadTestScene() { + const string testScenePath = "Packages/com.kyrylokuzyk.primetween/Tests/SceneLoadSetsUnityObjectBug.unity"; + #if UNITY_EDITOR + if (Application.isEditor) { + UnityEditor.SceneManagement.EditorSceneManager.LoadSceneInPlayMode(testScenePath, new LoadSceneParameters(LoadSceneMode.Single)); + return; + } + #endif + SceneManager.LoadScene(testScenePath, LoadSceneMode.Single); + } + + [UnityTest] + public IEnumerator SetElapsedTimeRecursively() { + Tween t = default; + int i = 0; + t = Tween.Custom(0f, 1f, getDt() / 5f, delegate { + // print("custom"); + onUpdate(); + }) + .OnUpdate(this, delegate { + // print("OnUpdate"); + onUpdate(); + }); + yield return t.ToYieldInstruction(); + + void onUpdate() { + i++; + Assert.IsTrue(i < 100); + expectRecursiveCallError(); + t.progress += 0.01f; + expectRecursiveCallError(); + t.progressTotal += 0.01f; + expectRecursiveCallError(); + t.elapsedTime += 0.01f; + expectRecursiveCallError(); + t.elapsedTimeTotal += 0.01f; + } + } + + [UnityTest] + public IEnumerator CompleteInfiniteTween() { + int numCallbacks = 0; + var duration = Mathf.Max(minDuration, Random.Range(0f, getDt())); + Assert.IsTrue(duration >= minDuration); + var t = Tween.Position(transform, Vector3.one, duration, cycles: -1) + .OnComplete(() => numCallbacks++); + float timeStart = Time.time; + yield return null; + yield return null; + var cyclesDoneExpected = Mathf.FloorToInt((Time.time - timeStart) / duration); + Assert.AreEqual(cyclesDoneExpected, t.cyclesDone); + t.Complete(); + Assert.AreEqual(1, numCallbacks); + } + + [Test] + public void CompleteInfiniteTween2() { + var target = new GameObject().transform; + var iniValue = Vector3.one * 0.5f; + target.localScale = iniValue; + var endValue = Vector3.one * 2f; + Tween.Scale(target, endValue, 0.5f, cycles: -1, cycleMode: CycleMode.Yoyo).Complete(); + Assert.AreEqual(endValue, target.localScale); + { + var t = Tween.Scale(target, iniValue, 0.5f, cycles: -1, cycleMode: CycleMode.Yoyo); + t.SetRemainingCycles(true); + t.Complete(); + Assert.AreEqual(iniValue, target.localScale); + } + { + var t = Tween.Scale(target, endValue, 0.5f, cycles: -1, cycleMode: CycleMode.Yoyo); + t.SetRemainingCycles(false); + t.Complete(); + Assert.AreEqual(iniValue, target.localScale); + } + Object.DestroyImmediate(target.gameObject); + LogAssert.NoUnexpectedReceived(); + } + + [UnityTest] + public IEnumerator WarnEndValueEqualsCurrent2() { + Tween.StopAll(); + yield return null; + { + transform.position = Vector3.one; + expectWarning(); + var t = Tween.Position(transform, Vector3.one, 0.01f); + yield return null; + t.Stop(); + } + { + transform.position = Vector3.one; + PrimeTweenConfig.warnEndValueEqualsCurrent = false; + var t = Tween.Position(transform, Vector3.one, 0.01f); + PrimeTweenConfig.warnEndValueEqualsCurrent = true; + yield return null; + t.Stop(); + } + + LogAssert.NoUnexpectedReceived(); + static void expectWarning() => LogAssert.Expect(LogType.Warning, new Regex("Tween's 'endValue' equals to the current animated value")); + } + + [UnityTest] + public IEnumerator SetPropertiesOfInfiniteTween() { + var t = Tween.Custom(0, 1, 1, _ => { + // print(_); + }, cycles: -1, cycleMode: CycleMode.Yoyo, ease: Ease.Linear); + t.elapsedTime = 0.5f; + yield return null; + t.progress = 0.75f; + yield return null; + t.elapsedTimeTotal = 2.1f; + yield return null; + t.elapsedTime = 0.5f; + yield return null; + t.Stop(); + } + + [Test] + public void NegativeIniCyclesBugReport() { + // https://github.com/KyryloKuzyk/PrimeTween/issues/63 + Tween.StopAll(); + var startValue = Vector3.one * 10; + var endValue = Vector3.one * 20; + transform.position = startValue; + var posTween = Tween.Position(transform, startValue, endValue, new TweenSettings(1f, cycles: 2, cycleMode: CycleMode.Rewind)); + var seq = Sequence.Create() + .ChainDelay(1f) + .Chain(posTween); + seq.elapsedTime = 1.1f; + Assert.AreNotEqual(0f, posTween.interpolationFactor); + Assert.AreNotEqual(startValue, transform.position); + // Assert.AreEqual(-1, posTween.tween.cyclesDone); + seq.elapsedTime = 0.5f; + Assert.AreEqual(0f, posTween.interpolationFactor); + Assert.AreEqual(startValue, transform.position); + seq.Stop(); + } + + [Test] + public void UpdateTypes() { + var iniUpdateType = PrimeTweenConfig.defaultUpdateType; + { + Tween.StopAll(); + var t = Tween.Position(transform, default, new TweenSettings(1f, updateType: default)).tween; + Assert.AreEqual(_UpdateType.Update, t.settings._updateType); + Assert.AreEqual(t, PrimeTweenManager.Instance.tweens.Single()); + } + { + Tween.StopAll(); + var t = Tween.Position(transform, default, new TweenSettings(1f, updateType: UpdateType.Update)).tween; + Assert.AreEqual(_UpdateType.Update, t.settings._updateType); + Assert.AreEqual(t, PrimeTweenManager.Instance.tweens.Single()); + } + { + Tween.StopAll(); + var t = Tween.Position(transform, default, new TweenSettings(1f, updateType: UpdateType.LateUpdate)).tween; + Assert.AreEqual(_UpdateType.LateUpdate, t.settings._updateType); + Assert.AreEqual(t, PrimeTweenManager.Instance.lateUpdateTweens.Single()); + } + { + Tween.StopAll(); + var t = Tween.Position(transform, default, new TweenSettings(1f, updateType: UpdateType.FixedUpdate)).tween; + Assert.AreEqual(_UpdateType.FixedUpdate, t.settings._updateType); + Assert.AreEqual(t, PrimeTweenManager.Instance.fixedUpdateTweens.Single()); + } + { + Tween.StopAll(); + UpdateType updateType = default; + updateType.enumValue = (_UpdateType)100; + Tween.Position(transform, default, new TweenSettings(1f, updateType: updateType)); + LogAssert.Expect(LogType.Error, "Invalid update type: 100"); + } + { + Tween.StopAll(); + var t = Tween.ShakeLocalPosition(transform, new ShakeSettings(Vector3.one, updateType: default)).tween; + Assert.AreEqual(_UpdateType.Update, t.settings._updateType); + Assert.AreEqual(t, PrimeTweenManager.Instance.tweens.Single()); + } + { + Tween.StopAll(); + var t = Tween.ShakeLocalPosition(transform, new ShakeSettings(Vector3.one, updateType: UpdateType.Update)).tween; + Assert.AreEqual(_UpdateType.Update, t.settings._updateType); + Assert.AreEqual(t, PrimeTweenManager.Instance.tweens.Single()); + } + { + Tween.StopAll(); + var t = Tween.ShakeLocalPosition(transform, new ShakeSettings(Vector3.one, updateType: UpdateType.LateUpdate)).tween; + Assert.AreEqual(_UpdateType.LateUpdate, t.settings._updateType); + Assert.AreEqual(t, PrimeTweenManager.Instance.lateUpdateTweens.Single()); + } + { + Tween.StopAll(); + var t = Tween.ShakeLocalPosition(transform, new ShakeSettings(Vector3.one, updateType: UpdateType.FixedUpdate)).tween; + Assert.AreEqual(_UpdateType.FixedUpdate, t.settings._updateType); + Assert.AreEqual(t, PrimeTweenManager.Instance.fixedUpdateTweens.Single()); + } + + { + Tween.StopAll(); + PrimeTweenConfig.defaultUpdateType = UpdateType.FixedUpdate; + var t = Tween.Position(transform, default, new TweenSettings(1f, updateType: default)).tween; + Assert.AreEqual(_UpdateType.FixedUpdate, t.settings._updateType); + Assert.AreEqual(t, PrimeTweenManager.Instance.fixedUpdateTweens.Single()); + } + { + Tween.StopAll(); + PrimeTweenConfig.defaultUpdateType = UpdateType.LateUpdate; + var t = Tween.Position(transform, default, new TweenSettings(1f, updateType: default)).tween; + Assert.AreEqual(_UpdateType.LateUpdate, t.settings._updateType); + Assert.AreEqual(t, PrimeTweenManager.Instance.lateUpdateTweens.Single()); + } + Tween.StopAll(); + + #pragma warning disable CS0618 // Type or member is obsolete + Assert.AreEqual(false, new TweenSettings(1f, updateType: default).useFixedUpdate); + Assert.AreEqual(false, new TweenSettings(1f, updateType: UpdateType.Update).useFixedUpdate); + Assert.AreEqual(false, new TweenSettings(1f, updateType: UpdateType.LateUpdate).useFixedUpdate); + Assert.AreEqual(true, new TweenSettings(1f, updateType: UpdateType.FixedUpdate).useFixedUpdate); + #pragma warning restore CS0618 // Type or member is obsolete + + Assert.AreEqual(UpdateType.Default, new TweenSettings(1f, updateType: default).updateType); + PrimeTweenConfig.defaultUpdateType = UpdateType.Update; + Assert.AreEqual(UpdateType.Default, new TweenSettings(1f, updateType: default).updateType); + PrimeTweenConfig.defaultUpdateType = UpdateType.LateUpdate; + Assert.AreEqual(UpdateType.Update, new TweenSettings(1f, updateType: UpdateType.Update).updateType); + Assert.AreEqual(UpdateType.FixedUpdate, new TweenSettings(1f, updateType: UpdateType.FixedUpdate).updateType); + PrimeTweenConfig.defaultUpdateType = iniUpdateType; + } +} +#endif diff --git a/FactoryNumeric/Packages/PrimeTween/Tests/Tweens.cs.meta b/FactoryNumeric/Packages/PrimeTween/Tests/Tweens.cs.meta new file mode 100644 index 00000000..11cb6dfc --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Tests/Tweens.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: cae3f42cabd64722acb964bd4f835d07 +timeCreated: 1676992173 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Tests/TweensWithDurationOfDeltaTime.cs b/FactoryNumeric/Packages/PrimeTween/Tests/TweensWithDurationOfDeltaTime.cs new file mode 100644 index 00000000..ab212080 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Tests/TweensWithDurationOfDeltaTime.cs @@ -0,0 +1,53 @@ +#if TEST_FRAMEWORK_INSTALLED +using System.Collections; +using NUnit.Framework; +using PrimeTween; +using UnityEngine; +using Assert = NUnit.Framework.Assert; + +internal class TweensWithDurationOfDeltaTime : MonoBehaviour { + int frame; + + void Update() { + switch (frame) { + case 0: + // print($"{Time.frameCount} start test"); + StartCoroutine(TweenWithExactDurationOfDeltaTime3()); + StartCoroutine(TweenWithExactDurationOfDeltaTime4()); + break; + case 3: // was 1, but currently impl doesn't account for halfDt + Assert.AreEqual(0, Tween.StopAll(this)); + Destroy(gameObject); + break; + } + frame++; + } + + IEnumerator TweenWithExactDurationOfDeltaTime3() { + // int numValueChanged = 0; + int numCompleted = 0; + var duration = Time.deltaTime; + // Debug.Log($"{Time.frameCount}, duration: {duration}"); + var t = Tween.Custom(this, 0, 1, duration, (_, _) => { + // Assert.IsTrue(val == 0 || val == 1, $"elapsedTime: {t.elapsedTime}, progress: {t.progress}, interpolationFactor: {t.interpolationFactor}, dt: {Time.deltaTime}, duration: {duration}, val: {val}"); + // numValueChanged++; + }).OnComplete(() => numCompleted++); + yield return t.ToYieldInstruction(); + // Assert.AreEqual(2, numValueChanged); + Assert.AreEqual(1, numCompleted); + } + + IEnumerator TweenWithExactDurationOfDeltaTime4() { + // int numValueChanged = 0; + int numCompleted = 0; + var duration = Time.deltaTime; + var t = Tween.Custom(this, 0, 1, duration, (_, _) => { + // Assert.IsTrue(val == 0 || val == 1, $"elapsedTime: {t.elapsedTime}, progress: {t.progress}, interpolationFactor: {t.interpolationFactor}, dt: {Time.deltaTime}, duration: {duration}"); + // numValueChanged++; + }).OnComplete(this, _ => numCompleted++); + yield return t.ToYieldInstruction(); + // Assert.AreEqual(2, numValueChanged); + Assert.AreEqual(1, numCompleted); + } +} +#endif diff --git a/FactoryNumeric/Packages/PrimeTween/Tests/TweensWithDurationOfDeltaTime.cs.meta b/FactoryNumeric/Packages/PrimeTween/Tests/TweensWithDurationOfDeltaTime.cs.meta new file mode 100644 index 00000000..b51ef7bd --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Tests/TweensWithDurationOfDeltaTime.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 19f52d8316124020833a26a46a7a2466 +timeCreated: 1684942004 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/Tests/UnityTargetDestruction.cs b/FactoryNumeric/Packages/PrimeTween/Tests/UnityTargetDestruction.cs new file mode 100644 index 00000000..61f0e945 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Tests/UnityTargetDestruction.cs @@ -0,0 +1,261 @@ +#if TEST_FRAMEWORK_INSTALLED +using System.Collections; +using System.Linq; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using NUnit.Framework; +using PrimeTween; +using UnityEngine; +using UnityEngine.TestTools; +using Assert = NUnit.Framework.Assert; +using Object = UnityEngine.Object; + +public partial class Tests { + Transform transform; + static TweenSettings settingsVector3 => new TweenSettings(Vector3.zero, Vector3.one, getDt() * 2f); + static bool setTweenCapacityBeforeSplashScreenLoggedError; + + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSplashScreen)] + static void beforeSplashScreen() { + Application.logMessageReceived += OnLogMessageReceived; + PrimeTweenConfig.SetTweensCapacity(capacityForTest); + Application.logMessageReceived -= OnLogMessageReceived; + static void OnLogMessageReceived(string condition, string stacktrace, LogType type) => setTweenCapacityBeforeSplashScreenLoggedError = true; + } + + [OneTimeSetUp] + public void oneTimeSetup() { + Assert.IsFalse(setTweenCapacityBeforeSplashScreenLoggedError, "setTweenCapacityBeforeSplashScreenLoggedError"); + transform = new GameObject().transform; + PrimeTweenConfig.SetTweensCapacity(capacityForTest); + } + + const int targetFrameRate = -1; + + [SetUp] + public void setUp() => Application.targetFrameRate = targetFrameRate; + + static int tweensCount => PrimeTweenManager.Instance.tweensCount; + + [Test] + public void CreatingTweenWithDestroyedTargetReturnsTweenToPool() { + if (tweensCount != 0) { + Tween.StopAll(); + } + Assert.AreEqual(0, tweensCount); + var target = new GameObject(); + var targetTr = target.transform; + Object.DestroyImmediate(target); + + var pool = PrimeTweenManager.Instance.pool; + var poolCount = pool.Count; + { + expectTargetIsNull(); + var t = Tween.Delay(target, 0.0001f); + Assert.IsFalse(t.isAlive); + Assert.AreEqual(poolCount, pool.Count); + } + { + expectTargetIsNull(); + var t = Tween.Custom(target, 0, 0, 1, delegate { }); + Assert.IsFalse(t.isAlive); + Assert.AreEqual(poolCount, pool.Count); + } + { + expectTargetIsNull(); + Assert.IsTrue(targetTr == null); + var t = Tween.Position(targetTr, default, 1); + Assert.IsFalse(t.isAlive); + Assert.AreEqual(poolCount, pool.Count); + } + Assert.AreEqual(0, tweensCount); + } + + [UnityTest] + public IEnumerator TweenTargetDestroyedInSequenceWithCallbacks() { + expectOnCompleteIgnored(); + var target = new GameObject("t1"); + var duration = getDt(); + yield return Sequence.Create() + .Group(Tween.Custom(target, 0, 1, duration, delegate { })) + .Chain(Tween.Custom(target, 0, 1, duration, (_target, _) => Object.DestroyImmediate(_target)).OnComplete(() => {})) + .Chain(Tween.Delay(target, duration)) + .ToYieldInstruction(); + yield return null; + Assert.AreEqual(0, tweensCount, "TweenCoroutineEnumerator should not check the target's destruction."); + LogAssert.NoUnexpectedReceived(); + } + + [UnityTest] + public IEnumerator TweenTargetDestroyedInSequence() { + var target = new GameObject("t1"); + const float duration = 0.03f; + yield return Sequence.Create() + .Group(Tween.Custom(target, 0, 1, duration, delegate { })) + .Chain(Tween.Custom(target, 0, 1, duration, (_target, _) => Object.DestroyImmediate(_target))) + .Chain(Tween.Delay(target, duration)) + .ToYieldInstruction(); + LogAssert.NoUnexpectedReceived(); + } + + [Test] + public void SequenceTargetDestroyedBeforeCallingStop() { + var tweener = createTweenAndDestroyTargetImmediately(false); + Sequence.Create(tweener).Stop(); + } + + [Test] + public void SequenceTargetDestroyedBeforeCallingComplete() { + var tweener = createTweenAndDestroyTargetImmediately().OnComplete(Assert.Fail); + Sequence.Create(tweener).Complete(); + } + + [UnityTest] + public IEnumerator TargetDestroyedBeforeCallingCompleteAll() { + createTweenAndDestroyTargetImmediately().OnComplete(Assert.Fail); + Tween.CompleteAll(); + Tween.SetPausedAll(true); + Tween.SetPausedAll(false); + Assert.AreEqual(0, getCurrentTweensCount()); + yield break; + } + + static int getCurrentTweensCount() => tweensCount; + + [UnityTest] + public IEnumerator TargetDestroyedBeforeCallingCompleteByTarget() { + var tweener = createTweenAndDestroyTargetImmediately().OnComplete(Assert.Fail); + Assert.AreEqual(Tween.CompleteAll(tweener.tween.target), 1); + Tween.SetPausedAll(true); + Tween.SetPausedAll(false); + Assert.AreEqual(1, getCurrentTweensCount()); + yield return tweener; + Assert.AreEqual(0, tweensCount); + } + + [Test] + public void TargetDestroyedBeforeCallingComplete() { + createTweenAndDestroyTargetImmediately().OnComplete(Assert.Fail).Complete(); + } + + [UnityTest] + public IEnumerator TargetDestroyedBeforeAddingOnComplete1() { + yield return createTweenAndDestroyTargetImmediately() + .OnComplete(delegate { }) + .ToYieldInstruction(); + } + + [UnityTest] + public IEnumerator TargetDestroyedBeforeAddingOnComplete2() { + yield return createTweenAndDestroyTargetImmediately() + .OnComplete(this, delegate { }) + .ToYieldInstruction(); + } + + [UnityTest] + public IEnumerator TargetDestroyedSetIsPaused() { + var t = createTweenAndDestroyTargetImmediately().OnComplete(Assert.Fail); + t.isPaused = true; // changing isPaused is ok + t.isPaused = false; + yield return t.ToYieldInstruction(); + } + + static Tween createTweenAndDestroyTargetImmediately(bool expectOnCompleteIgnoredWarning = true) { + if (expectOnCompleteIgnoredWarning) { + expectOnCompleteIgnored(); + } + var tempTransform = new GameObject().transform; + var tweener = Tween.LocalPosition(tempTransform, settingsVector3); + Object.DestroyImmediate(tempTransform.gameObject); + Assert.IsTrue(tweener.isAlive); + return tweener; + } + + [UnityTest] + public IEnumerator OnCompleteIsNotCalledIfTargetDestroyed() { + expectOnCompleteIgnored(); + var tempTransform = new GameObject().transform; + var tweener = Tween.LocalPosition(tempTransform, settingsVector3).OnComplete(Assert.Fail); + Object.DestroyImmediate(tempTransform.gameObject); + while (tweener.isAlive) { + yield return null; + } + } + + [UnityTest] + public IEnumerator SettingCyclesOnDestroyedTween() { + var t = createTweenAndDestroyTargetImmediately().OnComplete(Assert.Fail); + t.SetRemainingCycles(2); + yield return t; + } + + [Test] + public void IgnoreIfOnCompleteTargetDestroyed() { + { + var target = new GameObject(nameof(IgnoreIfOnCompleteTargetDestroyed)); + var t = Tween.Delay(1f).OnComplete(target, _ => Assert.Fail()); + Object.DestroyImmediate(target); + expectOnCompleteIgnored(); + t.Complete(); + } + { + var target = new GameObject(nameof(IgnoreIfOnCompleteTargetDestroyed)); + var t = Tween.Delay(1f).OnComplete(target, _ => Assert.Fail(), false); + Object.DestroyImmediate(target); + t.Complete(); + } + LogAssert.NoUnexpectedReceived(); + } + + [Test] + public async Task TargetDestructionAsync() { + { + expectOnCompleteIgnored(); + var target = new GameObject(nameof(TargetDestructionAsync)); + await Tween.Custom(target, 0, 1, 1, delegate { Object.DestroyImmediate(target); }) + .OnComplete(Assert.Fail); + } + { + var target = new GameObject(nameof(TargetDestructionAsync)); + await Tween.Custom(target, 0, 1, 1, delegate { Object.DestroyImmediate(target); }) + .OnComplete(Assert.Fail, false); + } + LogAssert.NoUnexpectedReceived(); + } + + [UnityTest] + public IEnumerator TargetDestructionInCoroutine() { + if (tweensCount > 0) { + Tween.StopAll(); + } + Assert.AreEqual(0, tweensCount); + { + PrimeTweenConfig.warnStructBoxingAllocationInCoroutine = true; + expectCoroutineBoxingWarning(); + expectOnCompleteIgnored(); + var target = new GameObject(nameof(TargetDestructionInCoroutine)); + yield return Tween.Custom(target, 0, 1, 1, delegate { + Object.DestroyImmediate(target); + }).OnComplete(Assert.Fail); + } + { + var target = new GameObject(nameof(TargetDestructionInCoroutine)); + yield return Tween.Custom(target, 0, 1, 1, delegate { + Object.DestroyImmediate(target); + }).OnComplete(Assert.Fail, false) + .ToYieldInstruction(); + } + LogAssert.NoUnexpectedReceived(); + } + + [UnityTest] + public IEnumerator TargetDestructionWhilePaused() { + var target = new GameObject(nameof(TargetDestructionWhilePaused)); + var tween = Tween.Delay(target, 0.05f); + tween.isPaused = true; + Object.DestroyImmediate(target); + yield return null; + Assert.IsFalse(tween.isAlive); + } +} +#endif diff --git a/FactoryNumeric/Packages/PrimeTween/Tests/UnityTargetDestruction.cs.meta b/FactoryNumeric/Packages/PrimeTween/Tests/UnityTargetDestruction.cs.meta new file mode 100644 index 00000000..8dd91e20 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Tests/UnityTargetDestruction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4b5fe864d964e4dc181888cf771eeb54 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/PrimeTween/Tests/YieldInstructionsClash_.cs b/FactoryNumeric/Packages/PrimeTween/Tests/YieldInstructionsClash_.cs new file mode 100644 index 00000000..a6d05c3f --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Tests/YieldInstructionsClash_.cs @@ -0,0 +1,45 @@ +using System.Collections; +using System.Diagnostics; +using PrimeTween; +using UnityEngine; +using UnityEngine.Assertions; +using Assert = UnityEngine.Assertions.Assert; +using Debug = UnityEngine.Debug; + +internal class YieldInstructionsClash : MonoBehaviour { + int frame; + + void Update() { + log($"{Time.frameCount} Update()"); + switch (frame) { + case 0: + StartCoroutine(cor()); + break; + case 1: + Tween.Delay(TweenSettings.minDuration).ToYieldInstruction(); + break; + } + frame++; + } + + IEnumerator cor() { + log($"{Time.frameCount} cor start"); + int frameStart = Time.frameCount; + var t = Tween.Delay(TweenSettings.minDuration); + var enumerator = t.ToYieldInstruction(); + while (enumerator.MoveNext()) { + var coroutineEnumerator = enumerator as TweenCoroutineEnumerator; + Assert.AreEqual(t.id, coroutineEnumerator.tween.id); + yield return enumerator.Current; + } + Destroy(gameObject); + var diff = Time.frameCount - frameStart; + Assert.AreEqual(1, diff); + log($"{Time.frameCount} cor DONE"); + } + + [Conditional("_")] + static void log(string msg) { + Debug.Log(msg); + } +} diff --git a/FactoryNumeric/Packages/PrimeTween/Tests/YieldInstructionsClash_.cs.meta b/FactoryNumeric/Packages/PrimeTween/Tests/YieldInstructionsClash_.cs.meta new file mode 100644 index 00000000..3aad5550 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/Tests/YieldInstructionsClash_.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 14945cccdf73497d832eed7a07ea5f78 +timeCreated: 1680184433 \ No newline at end of file diff --git a/FactoryNumeric/Packages/PrimeTween/changelog.md b/FactoryNumeric/Packages/PrimeTween/changelog.md new file mode 100644 index 00000000..19deb4b0 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/changelog.md @@ -0,0 +1,307 @@ +## [1.3.0] - 2025-04-04 +### Added +- Add support for updating animations in LateUpdate with the help of the new 'UpdateType updateType' parameter. The available options are Update, LateUpdate, and FixedUpdate. https://github.com/KyryloKuzyk/PrimeTween/issues/138 +- Add 'Vector3' overloads to RotationAtSpeed() and LocalRotationAtSpeed() methods. +- Add 'TextFontSize()' to animate 'TextMeshPro.fontSize' property. https://github.com/KyryloKuzyk/PrimeTween/discussions/129 +- Add a message to the exception thrown when an invalid ease is provided to `StandardEasing.Evaluate()`. https://github.com/KyryloKuzyk/PrimeTween/issues/151 +### Changed +- Change 'bool useFixedUpdate' to 'UpdateType updateType'. The new version comes with an automatic script updater. Please back up your project before updating. +- Make the exception stack trace clickable when custom tween throws an exception. https://github.com/KyryloKuzyk/PrimeTween/issues/119 +- Prevent allocations in development builds when PRIME_TWEEN_SAFETY_CHECKS is enabled. + +## [1.2.2] - 2024-12-05 +### Fixed +- Fixed: TextMeshPro animations are not available in Unity 2023. Bug report: https://discussions.unity.com/t/primetween-high-performance-animations-and-sequences/926420/365 +- Fixed: Demo project produces compilation errors if Ugui package is not installed. + +## [1.2.1] - 2024-11-28 +### Fixed +- Fixed: when a new tween is created at the last frame of `ToYieldInstruction()`, coroutine will wait for the wrong tween. Bug report: https://github.com/KyryloKuzyk/PrimeTween/issues/126 + +## [1.2.0] - 2024-10-03 +### Fixed +- Fixed: sequence.Group() doesn't work correctly after ChainCallback() and InsertCallback(). More info: https://github.com/KyryloKuzyk/PrimeTween/discussions/112 + +## [1.1.22] - 2024-09-14 +### Added +- Add `Easing.Evaluate(float interpolationFactor, Ease ease)` method that gives the ability to evaluate standard eases manually. Previously this method was experimental. +### Fixed +- Fixed: destroying target of a paused tween doesn't release the tween. Bug report: https://github.com/KyryloKuzyk/PrimeTween/discussions/4#discussioncomment-10555636 +- Fixed: UPM examples are not compatible with Input System (New). + +## [1.1.21] - 2024-08-31 +### Added +- Implement GetHashCode() and IEquatable for Tween and Sequence. + +## [1.1.20] - 2024-08-12 +### Changed +- Change internal tween from 'int' to 'long', which reduces the likelihood of id collisions in apps that run for months or years. Feature request: https://discussions.unity.com/t/926420/291 +### Added +- Add 'setImmediately' and 'isRelative' parameters to From() method in [Adapter](https://github.com/KyryloKuzyk/PrimeTween#dotween-adapter). Feature request: https://discussions.unity.com/t/926420/299 +### Fixed +- Fixed: Demo scene doesn't work with Input System (New). Bug report: https://github.com/KyryloKuzyk/PrimeTween/issues/85 +- Fixed (minor): calling Sequence.Complete() when the sequence is in Stater.After doesn't complete the sequence immediately. + +## [1.1.19] - 2024-05-29 +### Fixed +- Fixed: Tween.TextMaxVisibleCharacters() is not available in Unity 6 because Text Mesh Pro was merged with UGUI. + +## [1.1.18] - 2024-05-11 +### Fixed +- Fixed: nested sequence updates its children even when it doesn't update self. This resulted in multiple chained jumps to override the first jump. Bug report: https://forum.unity.com/threads/primetween-high-performance-animations-and-sequences.1479609/page-6#post-9802575 + +## [1.1.17] - 2024-04-17 +### Fixed +- Fixed: Tween.TextMaxVisibleCharacters() throws assertion exception. + +## [1.1.16] - 2024-04-16 +### Fixed +- Fixed: interpolation factor can be calculated incorrectly when cyclic tween is not started yet. Bug report: https://github.com/KyryloKuzyk/PrimeTween/issues/63 +- Fixed: don't log an error when the child animation setting is the same as the parent Sequence's setting. Bug report: https://github.com/KyryloKuzyk/PrimeTween/issues/66 +- Fixed: enabling PRIME_TWEEN_SAFETY_CHECKS in IL2CPP builds throws exception. Bug report: https://github.com/KyryloKuzyk/PrimeTween/issues/65 +- Fixed: adding experimental define produces compilation error. + +## [1.1.15] - 2024-04-07 +### Fixed +- Fixed: Tween.GetTweenCount(target) doesn't work for tweens inside sequences. Bug report: https://github.com/KyryloKuzyk/PrimeTween/issues/60 +- Fixed: ShakeSettings.strength property incorrectly displayed in narrow Inspector. +- Fixed: sometimes automatic installation fails and users have to press the 'PrimeTweenInstaller/Install' button to fix it. +- Fixed: review request should appear only after the user presses the Update button in Package Manager. Bug report: https://github.com/KyryloKuzyk/PrimeTween/issues/58 + +## [1.1.14] - 2024-03-16 +### Added +- Add Tween.VisualElementColor/VisualElementBackgroundColor() to animate colors of UIToolkit components. +- Experimental: add 'double' numeric type support for Tween.Custom(). This feature requires the PRIME_TWEEN_EXPERIMENTAL define in 'Scripting Define Symbols'. +### Changed +- Improve documentation. + +## [1.1.13] - 2024-02-23 +### Added +- Add sequence.Pause/Play() to adapter. +### Changed +- If sequence child pauses the parent sequence, stop updating Sequence immediately. Other tweens after the current one will not receive an update. + +## [1.1.12] - 2024-02-14 +### Added +- Add experimental Easing.Evaluate(float, Ease). +- Add DOVirtual.EasedValue() to adapter. +- Add custom Ease.OutBounce strength support to adapter. +### Changed +- The 'warnEndValueEqualsCurrent' setting is now applied on a per-tween basis. Feature request: https://github.com/KyryloKuzyk/PrimeTween/discussions/48 + +## [1.1.11] - 2024-01-18 +### Fixed +- Fixed: calling PrimeTweenConfig.SetTweensCapacity() before PrimeTweenManager is created throws an exception in Editor. +### Changed +- Optimize duplicated shakes on the same target. + +## [1.1.10] - 2024-01-15 +### Added +- Add sequence.Insert() and sequence.InsertCallback() APIs. Feature request: https://github.com/KyryloKuzyk/PrimeTween/discussions/33 +- Add Asset Store review request when updating PrimeTween to a new version. +### Fixed +- Fixed: completing an infinite tween (cycles == -1) evaluates the interpolation factor to -1 and produces wrong animated value. Bug report: https://github.com/KyryloKuzyk/PrimeTween/issues/38 +### Changed +- sequence.Complete() now respects the 'cycles' and 'cycleMode' and works similarly to tween.Complete(). Previuosly, sequence.Complete() completed only the current cycle. +### Removed +- Remove Tween.PositionOutBounce() experimental API. Use Easing.BounceExact(float amplitude) instead. + +## [1.1.9] - 2024-01-09 +### Added +- [Adapter](https://github.com/KyryloKuzyk/PrimeTween#dotween-adapter): add 'loopType' parameter to sequence.SetLoops(); add sequence.SetEase(); add SetLink(). +### Fixed +- Fixed: sequence.Group() after seqence.Chain() produces a wrong sequence duration (too short) if a grouped tween is longer than the previously chained tween. +- Fixed: sequence.Group(sequence) groups with the first tween in sequence, but should group with the previous tween (or sequence) instead. Now it works the same way as sequence.Group(tween). +- Fixed: sequence.OnComplete() should be called when all sequence children are completed. Previously it was called before the last children update. +- Fixed: setting 'elapsedTime' or 'progress' recursively from Tween.Custom() or tween.OnUpdate() leads to a crash because of stack overflow. +### Changed +- Remove the 'useUnscaledTime' parameter from sequence.ChainDelay(). The parent Sequence controls the 'useUnscaledTime' of all children tweens and sequences, so this parameter is not needed. + +## [1.1.8] - 2024-01-05 +### Added: +- Add more detailed warnings and errors. +### Fixed +- Fixed: Demo.cs causes compilation error, preventing PrimeTween to install correctly. + +## [1.1.7] - 2024-01-02 +### Fixed +- Fixed: ReusableTween.updateSequence() throws AssertionException when a sequence is running during scene change in the Editor. Bug report: https://github.com/KyryloKuzyk/PrimeTween/issues/32 + +## [1.1.6] - 2023-12-29 +### Added: +- PrimeTween can now print tween's creation stack trace when an error occurs to make the debugging process a lot easier. This feature requires the 'PRIME_TWEEN_SAFETY_CHECKS' define. +- Add TypewriterAnimatorExample.TypewriterAnimationByWords() to the Demo scene to show an example of how to animate text word-by-word. +### Fixed +- Fixed: shake doesn't restore the position to the initial value if shake's period is less than duration. + +## [1.1.5] - 2023-12-14 +### Added: +- Add Tween.TextMaxVisibleCharacters(TMP_Text target, ...) method to support simple typewriter animation. Please see the 'Demo.TypewriterAnimatorExample.cs' for a more complex example of text animation that makes pauses after punctuations. +### Fixed +- Fixed: don't allow to set invalid elapsedTimeTotal and progressTotal values to infinite tweens. + +## [1.1.4] - 2023-12-10 +### Added: +- Tween/Sequence.timeScale can now be negative to support backward movement (rewind). +- Add 'useFixedUpdate' parameter to update a tween or sequence in the FixedUpdate(). +- Release Parametric Easing to production (previously this feature was experimental): https://github.com/KyryloKuzyk/PrimeTween#parametric-easing +### Changed +- The default 'easeBetweenShakes' is now Ease.OutQuad instead of Ease.OutSine. +- The 'useUnscaledTime' parameter now doesn't prevent the abrupt delta time changes when unpausing the Editor to be consistent with the official Unity's behavior. +### Fixed +- Fixed: shakes log the 'warnEndValueEqualsCurrent' warning if object's local position/rotation is Vector3.zero/Quaternion.identity. + +## [1.1.3] - 2023-12-06 +### Added: +- Add Sequence.OnComplete() API. +### Fixed +- Fixed: nesting multiple empty Sequences may lead to a StackOverflow exception in some cases. +- Fixed: enabling/disabling UI.Slider in Demo scene constantly allocates GC. + +## [1.1.2] - 2023-12-03 +### Added: +- Add 'PrimeTweenConfig.warnEndValueEqualsCurrent' setting to warn if the 'endValue' equals to the current animated value. +### Fixed +- Fixed: PrimeTween may log warnings in Editor when exiting Play Mode. + +## [1.1.1] - 2023-11-30 +### Added: +- Sequences now support CycleMode.Yoyo and CycleMode.Rewind with the help of Sequence.Create(numCycles, CycleMode **cycleMode**). +- Sequences now support easing that can be applied to the whole Sequence with the help of Sequence.Create(..., Ease **sequenceEase**). +- 'elapsedTime', 'elapsedTimeTotal', 'progress', and 'progressTotal' properties now have setters, so it's possible to manually set the elapsed time of tweens and sequences. Please see the Demo scene for usage example. +- Parent Sequence now controls the isPaused, timeScale, and useUnscaledTime of all its children tweens and sequences. +- Add a warning when tween.SetRemainingCycles() is called on Tween.Delay(). More info: https://discussions.unity.com/t/926420/101. +### Changed +- It's no longer allowed to Stop()/Complete() a tween inside a Sequence. Please Stop()/Complete() the parent Sequence instead. +- It's no longer allowed to await or use the '.ToYieldInstruction()' on tween inside a Sequence. Please use the parent Sequence instead. +- It's no longer allowed to add tweens to a started Sequence. +- It's now allowed to call Tween.StopAll(), Tween.CompleteAll() and Tween.SetPausedAll() from onValueChange, OnUpdate() and OnComplete(). +- SetCycles() was renamed to SetRemainingCycles(). To set Sequence cycles, use Sequence.Create(cycles: numCycles). +- Remove 'minExpected' and 'numMaxExpected' parameters from Tween.StopAll/CompleteAll/SetPausedAll() methods. +### Fixed +- Fixed: Tween.GetTweensCount() may return the incorrect result if called from the OnComplete() callback. +- Fixed: MeasureMemoryAllocations.cs example script doesn't ignore its own allocations. + +## [1.0.17] - 2023-11-12 +### Fixed +- Fixed: the Demo scene doesn't compile if PrimeTween is not installed. + +## [1.0.16] - 2023-11-04 +### Fixed +- Fixed: Quaternion tweens don't work correctly with CycleMode.Incremental. Bug report: https://github.com/KyryloKuzyk/PrimeTween/issues/19 + +## [1.0.15] - 2023-10-14 +### Fixed +- Fixed: the first time Sequence is created, it may play incorrectly in some cases. + +## [1.0.14] - 2023-10-02 +### Added +- Add methods to animate RectTransform.offsetMin/offsetMax. +- Add sequence.timeScale to set the timeScale for all tweens in a Sequence. +- Add Tween.TweenTimeScale(Sequence) method to animate sequence.timeScale over time. +### Fixed +- Fixed: Unity's Time.unscaledDeltaTime reports the wrong value after unpausing a scene in the Editor. + +## [1.0.13] - 2023-09-24 +### Fixed +- Fixed: passing a null UnityEngine.Object to 'Tween.' methods causes null ref exception in PrimeTweenManager.Update(). Bug report: https://github.com/KyryloKuzyk/PrimeTween/issues/13 + +## [1.0.12] - 2023-09-22 +### Added +- Experimental: add parametric Easing.Bounce(float strength) and Easing.BounceExact(float magnitude). BounceExact allows to specify the exact bounce amplitude in meters/degrees regardless of the total tween distance. This feature requires the PRIME_TWEEN_EXPERIMENTAL define. +- Add From(fromValue) method to adapter. +- Support parametric OutBack and OutElastic eases in the adapter. +### Changed +- Easing.Elastic: normalize the oscillation period by duration; this ensures the tween has the same period regardless of duration. + +## [1.0.11] - 2023-09-21 +### Added +- Tween.GlobalTimeScale(), Tween.TweenTimeScale(), and tween.timeScale are no longer experimental. +- Add tween.OnUpdate() to execute a custom callback when the animated value is updated. +- Experimental: add Easing.Overshoot(float strength) and Easing.Elastic(float strength, float normalizedPeriod) methods to customize Ease.OutBounce and Ease.OutElastic. +### Changed +- Tween methods now accept Easing struct instead of AnimationCurve. You can continue using AnimationCurve as before because it is implicitly converted to the Easing struct. +- Ease.OutElastic now works the same as the most popular js and C# tween libraries. +### Fixed +- Add PrimeTween.Demo namespace to Demo scripts. + +## [1.0.10] - 2023-09-13 +### Added +- Add Tween.XxxAtSpeed() methods to create animations based on speed instead of duration. +- Add Tween.GetTweensCount() method. +### Changed +- Improve performance. + +## [1.0.9] - 2023-09-08 +### Changed +- Tween.StopAll(null) and Tween.CompleteAll(null) now immediately clean the internal tweens list, so PrimeTweenConfig.SetTweensCapacity() can be called immediately after that. +### Fixed +- Fixed: Tween.ShakeLocalRotation() doesn't work correctly. + +## [1.0.8] - 2023-09-07 +### Added +- Tween.Delay(), tween.OnComplete(), and sequence.ChainDelay() methods now accept the 'warnIfTargetDestroyed' parameter to control whether PrimeTween should log the error about tween's target destruction. More info: https://github.com/KyryloKuzyk/PrimeTween/discussions/4 +### Fixed +- Fix compilation error with PRIME_TWEEN_DOTWEEN_ADAPTER. + +## [1.0.7] - 2023-09-01 +### Added +- Add 'UI Toolkit' support (com.unity.modules.uielements). All animations from the [ITransitionAnimations](https://docs.unity3d.com/2023.2/Documentation/ScriptReference/UIElements.Experimental.ITransitionAnimations.html) interface are supported. +- Experimental: add Tween.PositionOutBounce/LocalPositionOutBounce() methods. These methods add the ability to fine-tune the Ease.OutBounce by specifying the exact bounce amplitude, number of bounces, and bounce stiffness. +- Log error when properties of dead tweens and sequences are used. +### Changed +- Rename 'Tween.LocalScale()' methods to 'Tween.Scale()'. +- Rename 'IsAlive' to 'isAlive'. +- Rename 'IsPaused' to 'isPaused'. + +## [1.0.5] - 2023-08-29 +### Added +- Experimental: add tween.timeScale; Tween.TweenTimeScale(); Tween.GlobalTimeScale(). +### Fixed +- Fixed: onComplete callback should not be called if Tween.OnComplete(_target_, ...) has been destroyed. +- Fixed: 'additive' tweens don't work correctly. + +## [1.0.4] - 2023-08-22 +### Added +- Warn if PrimeTween's API is used in Edit mode (when the scene is not running). +- Experimental: additive tweens. +### Changed +- Move Tween.Custom() 'AnimationCurve' parameter after 'onValueChange' parameter to be consistent with other overloads. +- Move Tween.ShakeCustom/PunchCustom() 'startValue' parameter before 'ShakeSettings' parameter to be consistent with Tween.Custom() methods. +### Fixed +- Normalize Quaternion passed to animation methods. + +## [1.0.3] - 2023-08-15 +### Added +- Sequence nesting: sequences can be grouped/chained to other sequences. +- Add startValue/endValue overload to all animation methods. +- Add Tween.ShakeCamera(). +- Measure memory allocations in the Demo scene. + +## [1.0.2] - 2023-05-29 +### Added +- All tweens can now be viewed in PrimeTweenManager's inspector. +### Changed +- Tweens are now frame perfect. That is, on a stable framerate, tweens take a deterministic number of frames. + +## [1.0.1] - 2023-04-28 +### Added +- Add a version of Tween.Custom() that doesn't require passing a tween's target. Please note that this version will most probably generate garbage because of closure allocation. +- Add Tween.EulerAngles/LocalEulerAngles methods to animate rotation beyond 180 degrees. +- Add Demo scene. +### Changed +- Remove Tween.RotationXYZ/LocalRotationXYZ methods because manipulating Euler angles may lead to unexpected results. More info: https://docs.unity3d.com/ScriptReference/Transform-eulerAngles.html +- Tween.Rotation/LocalRotation methods now convert the Vector3 parameter to Quaternion instead of treating it as Euler angles. +### Fixed +- Property drawers don't work correctly with copy-pasting and prefabs. +- Fixed: samples asmdef has dependency duplication that leads to compilation error. +- Fixed: custom curve should not be clamped at the start or the end of the animation. + +## [1.0.0] - 2023-04-20 +### Added +- Animate anything (UI, Transform, Material, etc.) with zero allocations. +- Group animations in Sequences with zero allocations. +- Shake anything. +- Everything is tweakable from the Inspector. +- Async/await support. +- Coroutines support. diff --git a/FactoryNumeric/Packages/PrimeTween/changelog.md.meta b/FactoryNumeric/Packages/PrimeTween/changelog.md.meta new file mode 100644 index 00000000..d91c6254 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/changelog.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d8cd7a46f75814a39a0493beef45259e +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/PrimeTween/license.md b/FactoryNumeric/Packages/PrimeTween/license.md new file mode 100644 index 00000000..53e19ef8 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/license.md @@ -0,0 +1,10 @@ +PrimeTween is licensed under the Asset Store EULA: +https://unity3d.com/legal/as_terms + +In short, it's allowed to use and modify PrimeTween in products distributed in binary format (apps and games). +But it's not allowed to redistribute it or create derivative libraries based on PrimeTween. + +To create other libraries that depend on PrimeTween, please refer to this forum post: +https://forum.unity.com/threads/1479609/page-4#post-9587461 + +Copyright: Kyrylo Kuzyk 2023 diff --git a/FactoryNumeric/Packages/PrimeTween/license.md.meta b/FactoryNumeric/Packages/PrimeTween/license.md.meta new file mode 100644 index 00000000..a8cdc0a9 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/license.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0525e33a4bd6548cd92d528f6959997b +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/PrimeTween/package.json b/FactoryNumeric/Packages/PrimeTween/package.json new file mode 100644 index 00000000..c36d6597 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/package.json @@ -0,0 +1,40 @@ +{ + "name": "com.kyrylokuzyk.primetween", + "displayName": "PrimeTween", + "version": "1.3.0", + "unity": "2018.4", + "author": { + "name": "Kyrylo Kuzyk" + }, + "samples": [ + { + "displayName": "Examples", + "path": "Samples~/Examples" + } + ], + "hideInEditor": false, + "description": "PrimeTween is a high-performance, allocation-free animation library for Unity.\n\nAnimate anything with just one line of code, tweak all animation properties directly from the Inspector, and create complex animation sequences. No runtime memory allocations, ever.\n\nEnjoying PrimeTween? Consider leaving an honest review on Asset Store.", + "keywords": [ + "Tween", + "Easing", + "Delay", + "Sequence", + "Shake", + "Screen Shake", + "Camera Shake", + "Game Feel", + "Feel", + "Interpolation", + "Performance", + "Zero-allocation", + "Ease", + "Tweening", + "Animate" + ], + "documentationUrl": "https://github.com/KyryloKuzyk/PrimeTween", + "repository": { + "url": "git@bitbucket.org:stampedegames/primetween.git", + "type": "git", + "revision": "35bc62132b4f2ee6a369863fd55f2e59a038f028" + } +} diff --git a/FactoryNumeric/Packages/PrimeTween/package.json.meta b/FactoryNumeric/Packages/PrimeTween/package.json.meta new file mode 100644 index 00000000..c03fcb57 --- /dev/null +++ b/FactoryNumeric/Packages/PrimeTween/package.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 46acf034b9e1a49bda98477ffb2c87be +PackageManifestImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/com.unity.hlod/.gitignore b/FactoryNumeric/Packages/com.unity.hlod/.gitignore new file mode 100644 index 00000000..1592c6c9 --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/.gitignore @@ -0,0 +1,37 @@ +[Ll]ibrary/ +[Tt]emp/ +[Oo]bj/ +[Bb]uild/ +[Bb]uilds/ +[Pp]ackage/ +Assets/AssetStoreTools* + +# Visual Studio cache directory +.vs/ + +# Autogenerated VS/MD/Consulo solution and project files +ExportedObj/ +.consulo/ +*.csproj +*.unityproj +*.sln +*.suo +*.tmp +*.user +*.userprefs +*.pidb +*.booproj +*.svd +*.pdb +*.opendb + +# Unity3D generated meta files +*.pidb.meta +*.pdb.meta + +# Unity3D Generated File On Crash Reports +sysinfo.txt + +# Builds +*.apk +*.unitypackage diff --git a/FactoryNumeric/Packages/com.unity.hlod/.gitmodules b/FactoryNumeric/Packages/com.unity.hlod/.gitmodules new file mode 100644 index 00000000..b68ebb32 --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/.gitmodules @@ -0,0 +1,3 @@ +[submodule "Package/UnityMeshSimplifier"] + path = Package/UnityMeshSimplifier + url = https://github.com/Unity-Technologies/UnityMeshSimplifier.git \ No newline at end of file diff --git a/FactoryNumeric/Packages/com.unity.hlod/CHANGELOG.md b/FactoryNumeric/Packages/com.unity.hlod/CHANGELOG.md new file mode 100644 index 00000000..d159e3ae --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/CHANGELOG.md @@ -0,0 +1,12 @@ +# Changelog +All notable changes to this package will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +[0.0.1] - 2020-02-19 + +### Fixed +- Removed Test Cased from com.unity.hlod and added them to Samples~ Project diff --git a/FactoryNumeric/Packages/com.unity.hlod/CHANGELOG.md.meta b/FactoryNumeric/Packages/com.unity.hlod/CHANGELOG.md.meta new file mode 100644 index 00000000..3668e34a --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/CHANGELOG.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 81e1adf93d365c54f85bf9745a174b42 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/com.unity.hlod/Documentation~/Batcher.md b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/Batcher.md new file mode 100644 index 00000000..e88284de --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/Batcher.md @@ -0,0 +1,46 @@ +# Batcher + +This setting determines how the meshes are combined. We provide two options here: + +## MaterialPreservingBatcher + +![](.//media/image21.png) + +HLOD meshes are created by grouping meshes with the same material. We use the existing material as it is. + +## SimpleBatcher + +![](.//media/image8.png) + +Even if the material of adjacent meshes is different, we always merge +the meshes and create a new material for the merged mesh. To do this +properly, we need to combine the textures referenced by different +materials into textures referenced by the new material, and +accordingly perform UV-remapping when building the merged mesh. We +have a number of settings that specifies how this process should be +performed: + +**Pack texture size**: Sets the size of the generated texture atlas. + +**Limit texture size**: Sets the maximum area each source texture +occupies. If (because of this setting) there is unused space after all +source textures are copied to the generated texture atlas, HLOD system +will try to reduce the size of the generated texture atlas. + +**Material**: Sets the material for the merged mesh. If not set, we'll +use *Standard Shader*. + +**Textures:** An entry X-Y here means we find all textures referenced +as property X from materials used by meshes in the HLOD hierarchy, +merge them together into a combined texture atlas and set this texture +atlas as parameter Y in the new generated material. + +Note that this means HLOD system would only work properly if all the +materials used by the meshes in the HLOD hierarchy have a similar +texture input naming convention. + +**Update texture properties:** The **Textures** setting tries to +collect appropriate material properties for the GUI drop-down, but +sometimes this does not work properly. Press this button if some +material property you want to use for the **Textures** setting is +missing. \ No newline at end of file diff --git a/FactoryNumeric/Packages/com.unity.hlod/Documentation~/GettingStarted.md b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/GettingStarted.md new file mode 100644 index 00000000..e0d134a3 --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/GettingStarted.md @@ -0,0 +1,88 @@ +# Getting started + +## Prerequisites +- Git Client +- Unity 2019.3+ (2019.2 works too, but 2019.3+ is recommended) +- Unity Technologies GitHub Account + +## Getting HLOD System +HLOD System is provided as an individual package. Currently it is available only on GitHub. In later stages of development, it will be available through Unity Package Manager. + +HLOD System GitHub Repo URL is [https://github.com/Unity-Technologies/HLODSystem](https://github.com/Unity-Technologies/HLODSystem) + +Follow through to get the package to your local PC and work with it. + +### CLI + +**Step 1.** Run one of the following commands to clone the repo: + +`git clone https://github.com/Unity-Technologies/HLODSystem.git` + +or + +`git clone git@github.com:Unity-Technologies/HLODSystem.git` + + + +``` +user@DESKTOP /Dev$ git clone https://github.com/Unity-Technologies/HLODSystem.git +Cloning into 'HLODSystem'... +remote: Enumerating objects: 150, done. +remote: Counting objects: 100% (150/150), done. +remote: Compressing objects: 100% (110/110), done. +remote: Total 4179 (delta 76), reused 80 (delta 39), pack-reused 4029 +Receiving objects: 100% (4179/4179), 139.22 MiB | 16.71 MiB/s, done. +Resolving deltas: 100% (2684/2684), done. +user@DESKTOP /MobileOpenWorldSample +``` + +**Step 2.** Next, change directory to the root directory of HLOD, and pull the dependencies, which are included into project as Git Submodules. They are [ConditionalCompilationUtility](https://github.com/Unity-Technologies/ConditionalCompilationUtility) and [UnityMeshSimplifier](https://github.com/Unity-Technologies/UnityMeshSimplifier): + +`cd HLODSystem` + +`git submodule update --init --recursive` + +``` +user@DESKTOP Dev$ cd HLODSystem +user@DESKTOP Dev/HLODSystem$ git submodule update --init --recursive +Submodule 'com.unity.hlod/Package/ConditionalCompilationUtility' +(https://github.com/Unity-Technologies/ConditionalCompilationUtility.git) registered for path | +'com.unity.hlod/Package/ConditionalCompilationUtility' +... +user@DESKTOP /MobileOpenWorldSample +``` + +### Sourcetree + +For this particular example, we used [Sourcetree](https://www.sourcetreeapp.com/), but the steps should be fairly similar for the GUI Client of your choice. + +**Step 1.** Open Sourcetree, and click Clone Button: + +![](./media/image4.png) + +**Step 2.** Input the clone URL, select the destination where the repo is cloned, and wait for a couple of seconds until Sourcetree gets the repo details: + +`https://github.com/Unity-Technologies/HLODSystem.git` + +or + +`git@github.com:Unity-Technologies/HLODSystem.git` + +**Step 3.** Make sure to check Recurse submodules checkbox and click Clone: + +![](./media/image15.png) + +## Importing package to a Unity Project + +**Step 1.** Open the Unity Project which you want to add HLOD to, and open the Package Manager Window. + +**Step 2.** Click the + button on the top-left corner, and select Add package from disk... menu: + +![](./media/image16.png) + +**Step 3.** Browse to the location where you cloned HLODSystem repo, open com.unity.hlod folder and select package.json file. Click Open. + +![](./media/image10.png) + +The Editor will import and add HLOD System to the project. Now the project is ready to use it. + diff --git a/FactoryNumeric/Packages/com.unity.hlod/Documentation~/HLOD.md b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/HLOD.md new file mode 100644 index 00000000..f7846d28 --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/HLOD.md @@ -0,0 +1,51 @@ +# HLOD + +This component is used to generate HLOD data-structure for static objects. + +## Common + +Typical setting related to HLOD. + +![](./media/image2.png) + +**Chunk Size**: For our hierarchy with HLOD component, we define a +number of detail levels where each level represents one way to group +the meshes into a number of merged meshes. On the top level, all +meshes are merged together. On the next level, we partition the meshes +into 4 merged mesh (we do not partition along height axis, but only +across the horizontal plane). In this way, the HLOD system builds a +quadtree data structure. + +The "Chunk Size" setting sets the size of the "terminal node" of the +HLOD quadtree. Nodes are split into quadtrees until they are smaller +than this value at full size. + +**High/Low/Cull**: This setting defines a function that categorize a +mesh into 3 categories: *High*, *Low*, and *Cull*. Looking at the +above setting as an example, if a mesh has AABB projected onto the +screen occupying less than 1% of the screen, it is categorized as +"Cull". If a mesh has AABB projected onto the screen occupying more +than 80% of the screen, it is categorized as "High". + +When rendering HLOD mesh hierarchy, we traverse the HLOD quadtree. If +the root HLOD mesh is "Low", we render just the combined HLOD mesh. If +the root HLOD mesh is "Cull", we render nothing. If the root HLOD mesh +is "High", we look at the children of the HLOD root node and decide +how to render each children recursively in the same fashion. + +**Min Object Size**: Specifies the minimal size for a mesh to be +included in the HLOD data-structure. If the size of a mesh is greater +than the set value, it is included in the HLOD system. If a mesh is +too small, it is excluded from the HLOD mesh. + +## Simplifier + +See section [Simplifier](Simplifier.md). + +## Batcher + +See section [Batcher](Batcher.md). + +## Streaming + +See section [Streaming](Streaming.md). \ No newline at end of file diff --git a/FactoryNumeric/Packages/com.unity.hlod/Documentation~/Simplifier.md b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/Simplifier.md new file mode 100644 index 00000000..b99552a2 --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/Simplifier.md @@ -0,0 +1,21 @@ +# Simplifier + +Specifies how to simplify when creating HLODMesh. + +Currently, there are two methods available: None and UnityMeshSimplifier. + +## None + +![](.//media/image11.png) + +We do not simplify when creating HLODMesh. + +## UnityMeshSimplifier + +![](.//media/image18.png) + +We simplify using [UnityMeshSimplifier](https://github.com/Unity-Technologies/UnityMeshSimplifier). + +**Polygon Ratio**: Sets the rate at which the polygon is reduced. + +**Triangle Range**: Sets the maximum/minimum number of polygons after simplification. \ No newline at end of file diff --git a/FactoryNumeric/Packages/com.unity.hlod/Documentation~/Streaming.md b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/Streaming.md new file mode 100644 index 00000000..acf347e3 --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/Streaming.md @@ -0,0 +1,23 @@ +# Streaming + +This part is regarding how the HLOD mesh is loaded into the scene. The +HLOD streaming system creates a controller component on top of the +gameObject with the HLOD component. This controller is responsible for +the actual HLOD mesh loading behavior. There is a modes available: + +- Unsupported + +# Unsupported + +![](.//media/image17.png) + +Under this mode, we do not support streaming. We add HLOD meshes at +every detail level into the scene, and during gameplay we +enable/disable meshes the HLOD system wants to show/hide. + +**OutputDirectory**: Specify where the resource file will be created. +The location must be under an Assets folder. + +**Compress Format**: Specifies texture compression format by the +platform. Texture compression happens when resources are imported or +when the platform changes. \ No newline at end of file diff --git a/FactoryNumeric/Packages/com.unity.hlod/Documentation~/TerrainHLOD.md b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/TerrainHLOD.md new file mode 100644 index 00000000..2b912659 --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/TerrainHLOD.md @@ -0,0 +1,49 @@ +# TerrainHLOD + +TerrainHLOD takes a Terrain as input and converts it to a HLOD Mesh. + +## Common + +![](.//media/image7.png) + +**Source**: Set the source TerrainData to generate the HLOD. + +**Destroy terrain**: The original terrain will be deleted on build when you check this. +It is deleted only the Terrain when using same TerrainData on same scene. + +**Chunk Size**: Sets the size of the terminal node in HLOD. Nodes are +split into quadtrees until they are smaller than this value at full +size. + +**Border Vertex Count**: For each side of a terminal node terrain +patch, we allocate this number of regularly spaced vertices. As we +combine terrain patch for lower LOD levels, although we can simplify +and reduce vertex count for inner vertices, we must preserve vertices +at the edge to avoid seams. So for example if we have 3 LOD levels and +Border Vertex Count is 256, terminal node have 256 + +## Simplifier + +See section [Simplifier](Simplifier.md). + +## Material + +Set up the material to be used for the baked TerrainHLODMesh. Note +that we bake the Splat System into single textures for our +TerrainHLODMesh material. + +![](.//media/image19.png) + +**Material:** Specifies the Material to be used for the +TerrainHLODMesh. + +**Size:** Specifies the size at which the texture will be baked. + +**Texture properties:** We'll bake 3 textures for the material: +Albedo, Normal, and Mask. Mask texture's R and G channel contains +roughness and specular parameter. This property decides which material +property these textures are set to. + +## Streaming + +See section [Streaming](Streaming.md). \ No newline at end of file diff --git a/FactoryNumeric/Packages/com.unity.hlod/Documentation~/UsingHLOD.md b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/UsingHLOD.md new file mode 100644 index 00000000..dc1822b1 --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/UsingHLOD.md @@ -0,0 +1,48 @@ +# Using HLOD in the Project + +## Creating the Test Scene + +You can follow through the steps and create the test scene with necessary object to use with HLOD, or you can download the Test Scene created in advance and just apply HLOD. + +**Step 1.** Create a new scene and place objects in it. Let's say, 5 of them. The objects must be: +- Static +- With albedo material +- Add some more features + +HLOD does not work with objects that are not static, have animated mesh, or are destroyed during game-play. + +![](./media/image14.png) + +This is how Hierarchy Window looks like after we added our Game Objects: + +![](./media/image6.png) + +## Applying HLOD to Objects + +**Step 1.** Create an empty Game Object and name it HLOD or anything else you would like it to be: + +![](./media/image3.png) + +**Step 2.** Select your game objects and make them the children of HLOD Game Object: + +![](./media/image9.png) + +**Step 3.** Select HLOD Game Object and add HLOD Component to it in Inspector, then click Generate: + +![](./media/image1.png) + +For a detailed explanation of the settings of HLOD Component, see [HLOD](HLOD.md). + +A Default HLOD Controller Component will be added automatically: + +![](./media/image20.png) + +The HLOD Data Structure will be created in the path which OutputDirectory parameter of HLOD Component points to: + +![](./media/image12.png) + +If you expand HLOD Data Structure and click the mesh component of it, you can see how Game Object Meshes are combined into a single mesh: + +![](./media/image13.png) + +**Step 4.** Click Destroy button if you want to destroy and/or re-generate HLOD for a given Game Object. diff --git a/FactoryNumeric/Packages/com.unity.hlod/Documentation~/index.md b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/index.md new file mode 100644 index 00000000..6dca0279 --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/index.md @@ -0,0 +1,29 @@ +# HLOD + +![](media/compare.gif) + +It can replace multiple Static Mesh Actors with single, combined Static Mesh Actor at long view distances. This helps reduce the number of Actors that need to be rendered for the scene, increasing performance by lowering the number of draw calls per frame. + +| Render image | Show draw calls | Show draw calls of HLOD | +| ------------------------- | ------------------------- | ------------------------- | +| ![](media/overview_1.png) | ![](media/overview_2.png) | ![](media/overview_3.png) | + + + +## Getting started with HLODSystem + +For information on starting with HLOD package, see section [Getting started](GettingStarted.md). + +## Using HLOD in the Project + +For information on simple HLODSystem usage, see section [Using HLOD](UsingHLOD.md). + +## Component + +HLODSystem provides 2 components used to build 2 types of HLOD data-structure: + +### HLOD +See section [HLOD](HLOD.md). + +### TerrainHLOD +See section [TerrainHLOD](TerrainHLOD.md). diff --git a/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/compare.gif b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/compare.gif new file mode 100644 index 00000000..a5df28ad Binary files /dev/null and b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/compare.gif differ diff --git a/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image1.png b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image1.png new file mode 100644 index 00000000..095908a8 Binary files /dev/null and b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image1.png differ diff --git a/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image10.png b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image10.png new file mode 100644 index 00000000..be5bd95f Binary files /dev/null and b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image10.png differ diff --git a/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image11.png b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image11.png new file mode 100644 index 00000000..f6f93ba2 Binary files /dev/null and b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image11.png differ diff --git a/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image12.png b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image12.png new file mode 100644 index 00000000..6abca662 Binary files /dev/null and b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image12.png differ diff --git a/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image13.png b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image13.png new file mode 100644 index 00000000..4093b3bc Binary files /dev/null and b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image13.png differ diff --git a/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image14.png b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image14.png new file mode 100644 index 00000000..ff289ba2 Binary files /dev/null and b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image14.png differ diff --git a/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image15.png b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image15.png new file mode 100644 index 00000000..654e14d0 Binary files /dev/null and b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image15.png differ diff --git a/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image16.png b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image16.png new file mode 100644 index 00000000..ba2e533e Binary files /dev/null and b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image16.png differ diff --git a/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image17.png b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image17.png new file mode 100644 index 00000000..27d068fa Binary files /dev/null and b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image17.png differ diff --git a/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image18.png b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image18.png new file mode 100644 index 00000000..55f18069 Binary files /dev/null and b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image18.png differ diff --git a/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image19.png b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image19.png new file mode 100644 index 00000000..ae9d6656 Binary files /dev/null and b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image19.png differ diff --git a/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image2.png b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image2.png new file mode 100644 index 00000000..4fafbafc Binary files /dev/null and b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image2.png differ diff --git a/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image20.png b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image20.png new file mode 100644 index 00000000..4eef7055 Binary files /dev/null and b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image20.png differ diff --git a/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image21.png b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image21.png new file mode 100644 index 00000000..c50ef78c Binary files /dev/null and b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image21.png differ diff --git a/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image3.png b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image3.png new file mode 100644 index 00000000..d6818acf Binary files /dev/null and b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image3.png differ diff --git a/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image4.png b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image4.png new file mode 100644 index 00000000..b2469abb Binary files /dev/null and b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image4.png differ diff --git a/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image6.png b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image6.png new file mode 100644 index 00000000..7f06e8d3 Binary files /dev/null and b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image6.png differ diff --git a/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image7.png b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image7.png new file mode 100644 index 00000000..95671998 Binary files /dev/null and b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image7.png differ diff --git a/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image8.png b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image8.png new file mode 100644 index 00000000..de6a6733 Binary files /dev/null and b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image8.png differ diff --git a/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image9.png b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image9.png new file mode 100644 index 00000000..8025fa7d Binary files /dev/null and b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/image9.png differ diff --git a/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/overview_1.png b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/overview_1.png new file mode 100644 index 00000000..8fda7eee Binary files /dev/null and b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/overview_1.png differ diff --git a/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/overview_2.png b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/overview_2.png new file mode 100644 index 00000000..58fa190d Binary files /dev/null and b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/overview_2.png differ diff --git a/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/overview_3.png b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/overview_3.png new file mode 100644 index 00000000..169c2adf Binary files /dev/null and b/FactoryNumeric/Packages/com.unity.hlod/Documentation~/media/overview_3.png differ diff --git a/FactoryNumeric/Packages/com.unity.hlod/Editor.meta b/FactoryNumeric/Packages/com.unity.hlod/Editor.meta new file mode 100644 index 00000000..b4d55f78 --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d1a38e5bcdb1e6a459ea5d5830843151 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/com.unity.hlod/Editor/Batcher.meta b/FactoryNumeric/Packages/com.unity.hlod/Editor/Batcher.meta new file mode 100644 index 00000000..b01ddc52 --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/Editor/Batcher.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1bcdd40ff948dfa4b8f9c1a9d8598574 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/com.unity.hlod/Editor/Batcher/BatcherTypes.cs b/FactoryNumeric/Packages/com.unity.hlod/Editor/Batcher/BatcherTypes.cs new file mode 100644 index 00000000..7d3a7fc0 --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/Editor/Batcher/BatcherTypes.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; + + +namespace Unity.HLODSystem +{ + public static class BatcherTypes + { + private static List s_Types = new List(); + + public static void RegisterBatcherType(Type type) + { + s_Types.Add(type); + } + + public static void UnregisterBatcherType(Type type) + { + s_Types.Remove(type); + } + + public static Type[] GetTypes() + { + return s_Types.ToArray(); + } + } + + + +} \ No newline at end of file diff --git a/FactoryNumeric/Packages/com.unity.hlod/Editor/Batcher/BatcherTypes.cs.meta b/FactoryNumeric/Packages/com.unity.hlod/Editor/Batcher/BatcherTypes.cs.meta new file mode 100644 index 00000000..b62974e6 --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/Editor/Batcher/BatcherTypes.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e205ac840c9c6df4ab5a21ca2760f100 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/com.unity.hlod/Editor/Batcher/IBatcher.cs b/FactoryNumeric/Packages/com.unity.hlod/Editor/Batcher/IBatcher.cs new file mode 100644 index 00000000..5c22ab58 --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/Editor/Batcher/IBatcher.cs @@ -0,0 +1,13 @@ +using System; +using Unity.HLODSystem.Utils; +using UnityEngine; + +namespace Unity.HLODSystem +{ + public interface IBatcher : IDisposable + { + + void Batch(Transform rootTransform, DisposableList targets, Action onProgress); + + } +} \ No newline at end of file diff --git a/FactoryNumeric/Packages/com.unity.hlod/Editor/Batcher/IBatcher.cs.meta b/FactoryNumeric/Packages/com.unity.hlod/Editor/Batcher/IBatcher.cs.meta new file mode 100644 index 00000000..89367190 --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/Editor/Batcher/IBatcher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 13a5e2b1cfab1844c8f5bdec78407d6c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/com.unity.hlod/Editor/Batcher/MaterialPreservingBatcher.cs b/FactoryNumeric/Packages/com.unity.hlod/Editor/Batcher/MaterialPreservingBatcher.cs new file mode 100644 index 00000000..41efd905 --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/Editor/Batcher/MaterialPreservingBatcher.cs @@ -0,0 +1,106 @@ +using System; +using System.Collections.Generic; +using Unity.Collections; +using Unity.HLODSystem.Utils; +using UnityEditor; +using UnityEngine; + +namespace Unity.HLODSystem +{ + /// + /// A batcher that preserves materials when combining meshes (does not reduce draw calls) + /// + class MaterialPreservingBatcher : IBatcher + { + [InitializeOnLoadMethod] + static void RegisterType() + { + BatcherTypes.RegisterBatcherType(typeof(MaterialPreservingBatcher)); + } + + + public MaterialPreservingBatcher(SerializableDynamicObject batcherOptions) + { + } + + public void Dispose() + { + } + + public void Batch(Transform rootTransform, DisposableList targets, Action onProgress) + { + for (int i = 0; i < targets.Count; ++i) + { + Combine(rootTransform, targets[i]); + + if (onProgress != null) + onProgress((float) i / (float)targets.Count); + } + + } + + private void Combine(Transform rootTransform, HLODBuildInfo info) + { + var materialTable = new Dictionary(); + var combineInfos = new Dictionary>(); + + var hlodWorldToLocal = rootTransform.worldToLocalMatrix; + + + for (int i = 0; i < info.WorkingObjects.Count; ++i) + { + var materials = info.WorkingObjects[i].Materials; + for (int m = 0; m < materials.Count; ++m) + { + //var mat = materials[m]; + MeshCombiner.CombineInfo combineInfo = new MeshCombiner.CombineInfo(); + + var colliderLocalToWorld = info.WorkingObjects[i].LocalToWorld; + var matrix = hlodWorldToLocal * colliderLocalToWorld; + + combineInfo.Transform = matrix; + combineInfo.Mesh = info.WorkingObjects[i].Mesh; + combineInfo.MeshIndex = m; + + if (combineInfo.Mesh == null) + continue; + + if (combineInfos.ContainsKey(materials[m].Identifier) == false) + { + combineInfos.Add(materials[m].Identifier, new List()); + materialTable.Add(materials[m].Identifier, materials[m]); + } + + combineInfos[materials[m].Identifier].Add(combineInfo); + } + } + + using (var originWorkingObject = info.WorkingObjects) + { + DisposableList combinedObjects = new DisposableList(); + info.WorkingObjects = combinedObjects; + + MeshCombiner combiner = new MeshCombiner(); + foreach (var pair in combineInfos) + { + WorkingMesh combinedMesh = combiner.CombineMesh(Allocator.Persistent, pair.Value); + WorkingObject combinedObject = new WorkingObject(Allocator.Persistent); + WorkingMaterial material = materialTable[pair.Key].Clone(); + + combinedMesh.name = info.Name + "_Mesh" + pair.Key; + combinedObject.Name = info.Name; + combinedObject.SetMesh(combinedMesh); + combinedObject.Materials.Add(material); + + combinedObjects.Add(combinedObject); + } + } + } + + static void OnGUI(HLOD hlod, bool isFirst) + { + + } + + } +} diff --git a/FactoryNumeric/Packages/com.unity.hlod/Editor/Batcher/MaterialPreservingBatcher.cs.meta b/FactoryNumeric/Packages/com.unity.hlod/Editor/Batcher/MaterialPreservingBatcher.cs.meta new file mode 100644 index 00000000..0f506de7 --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/Editor/Batcher/MaterialPreservingBatcher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a288cdecc6af3cd498ca6bee205fd564 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/com.unity.hlod/Editor/Batcher/SimpleBatcher.cs b/FactoryNumeric/Packages/com.unity.hlod/Editor/Batcher/SimpleBatcher.cs new file mode 100644 index 00000000..1ab7b4fc --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/Editor/Batcher/SimpleBatcher.cs @@ -0,0 +1,615 @@ +using System; +using UnityEditor; +using UnityEngine; +using System.Collections.Generic; +using System.Linq; +using Unity.Collections; +using Unity.HLODSystem.Utils; + +namespace Unity.HLODSystem +{ + public class SimpleBatcher : IBatcher + { + public enum PackingType + { + White, + Black, + Normal, + } + + [InitializeOnLoadMethod] + static void RegisterType() + { + BatcherTypes.RegisterBatcherType(typeof(SimpleBatcher)); + } + + private DisposableDictionary m_createdMaterials = new DisposableDictionary(); + private SerializableDynamicObject m_batcherOptions; + + + + [Serializable] + public class TextureInfo + { + public string InputName = "_InputProperty"; + public string OutputName = "_OutputProperty"; + public PackingType Type = PackingType.White; + } + + public SimpleBatcher(SerializableDynamicObject batcherOptions) + { + m_batcherOptions = batcherOptions; + } + + public void Dispose() + { + m_createdMaterials.Dispose(); + } + + public void Batch(Transform rootTransform, DisposableList targets, Action onProgress) + { + dynamic options = m_batcherOptions; + if (onProgress != null) + onProgress(0.0f); + + using (TexturePacker packer = new TexturePacker()) + { + PackingTexture(packer, targets, options, onProgress); + + for (int i = 0; i < targets.Count; ++i) + { + Combine(rootTransform, packer, targets[i], options); + if (onProgress != null) + onProgress(0.5f + ((float)i / (float)targets.Count) * 0.5f); + } + } + + } + + + class MaterialTextureCache : IDisposable + { + private NativeArray m_detector = new NativeArray(1, Allocator.Persistent); + + private List m_textureInfoList; + private DisposableDictionary m_textureCache; + private DisposableDictionary m_defaultTextures; + + private bool m_enableTintColor; + private string m_tintColorName; + + public MaterialTextureCache(dynamic options) + { + m_defaultTextures = CreateDefaultTextures(); + m_enableTintColor = options.EnableTintColor; + m_tintColorName = options.TintColorName; + m_textureInfoList = options.TextureInfoList; + m_textureCache = new DisposableDictionary(); + } + public TexturePacker.MaterialTexture GetMaterialTextures(WorkingMaterial material) + { + if (m_textureCache.ContainsKey(material.Guid) == false) + { + AddToCache(material); + } + + var textures = m_textureCache[material.Guid]; + if (textures != null) + { + string inputName = m_textureInfoList[0].InputName; + material.SetTexture(inputName, textures[0].Clone()); + } + + return textures; + } + + public void Dispose() + { + m_textureCache.Dispose(); + m_defaultTextures.Dispose(); + m_detector.Dispose(); + + } + + private void AddToCache(WorkingMaterial material) + { + string inputName = m_textureInfoList[0].InputName; + WorkingTexture texture = material.GetTexture(inputName); + + if (texture == null) + { + texture = m_defaultTextures[m_textureInfoList[0].Type]; + } + + TexturePacker.MaterialTexture materialTexture = new TexturePacker.MaterialTexture(); + + if (m_enableTintColor) + { + Color tintColor = material.GetColor(m_tintColorName); + + texture = texture.Clone(); + ApplyTintColor(texture, tintColor); + materialTexture.Add(texture); + texture.Dispose(); + } + else + { + materialTexture.Add(texture); + } + + + for (int ti = 1; ti < m_textureInfoList.Count; ++ti) + { + string input = m_textureInfoList[ti].InputName; + WorkingTexture tex = material.GetTexture(input); + + if (tex == null) + { + tex = m_defaultTextures[m_textureInfoList[ti].Type]; + } + + materialTexture.Add(tex); + } + + m_textureCache.Add(material.Guid, materialTexture); + } + private void ApplyTintColor(WorkingTexture texture, Color tintColor) + { + for (int ty = 0; ty < texture.Height; ++ty) + { + for (int tx = 0; tx < texture.Width; ++tx) + { + Color c = texture.GetPixel(tx, ty); + + c.r = c.r * tintColor.r; + c.g = c.g * tintColor.g; + c.b = c.b * tintColor.b; + c.a = c.a * tintColor.a; + + texture.SetPixel(tx, ty, c); + } + } + } + + private static DisposableDictionary CreateDefaultTextures() + { + DisposableDictionary textures = new DisposableDictionary(); + + textures.Add(PackingType.White, CreateEmptyTexture(4, 4, Color.white, false)); + textures.Add(PackingType.Black, CreateEmptyTexture(4, 4, Color.black, false)); + textures.Add(PackingType.Normal, CreateEmptyTexture(4, 4, new Color(0.5f, 0.5f, 1.0f), true)); + + return textures; + } + + } + + private void PackingTexture(TexturePacker packer, DisposableList targets, dynamic options, Action onProgress) + { + List textureInfoList = options.TextureInfoList; + using (MaterialTextureCache cache = new MaterialTextureCache(options)) + { + for (int i = 0; i < targets.Count; ++i) + { + var workingObjects = targets[i].WorkingObjects; + Dictionary textures = + new Dictionary(); + + for (int oi = 0; oi < workingObjects.Count; ++oi) + { + var materials = workingObjects[oi].Materials; + + for (int m = 0; m < materials.Count; ++m) + { + var materialTextures = cache.GetMaterialTextures(materials[m]); + if (materialTextures == null) + continue; + + if (textures.ContainsKey(materialTextures[0].GetGUID()) == true) + continue; + + textures.Add(materialTextures[0].GetGUID(), materialTextures); + } + } + + + packer.AddTextureGroup(targets[i], textures.Values.ToList()); + + + if (onProgress != null) + onProgress(((float) i / targets.Count) * 0.1f); + } + } + + packer.Pack(TextureFormat.RGBA32, options.PackTextureSize, options.LimitTextureSize, false); + if ( onProgress != null) onProgress(0.3f); + + int index = 1; + var atlases = packer.GetAllAtlases(); + foreach (var atlas in atlases) + { + Dictionary textures = new Dictionary(); + for (int i = 0; i < atlas.Textures.Count; ++i) + { + WorkingTexture wt = atlas.Textures[i]; + wt.Name = "CombinedTexture " + index + "_" + i; + if (textureInfoList[i].Type == PackingType.Normal) + { + wt.Linear = true; + } + + textures.Add(textureInfoList[i].OutputName, wt); + } + + WorkingMaterial mat = CreateMaterial(options.MaterialGUID, textures); + mat.Name = "CombinedMaterial " + index; + m_createdMaterials.Add(atlas, mat); + index += 1; + } + } + + static WorkingMaterial CreateMaterial(string guidstr, Dictionary textures) + { + WorkingMaterial material = null; + string path = AssetDatabase.GUIDToAssetPath(guidstr); + if (string.IsNullOrEmpty(path) == false) + { + Material mat = AssetDatabase.LoadAssetAtPath(path); + if (mat != null) + { + material = new WorkingMaterial(Allocator.Invalid, mat.GetInstanceID(), mat.name); + } + } + + if (material == null) + { + material = new WorkingMaterial(Allocator.Persistent, new Material(Shader.Find("Standard"))); + } + + foreach (var texture in textures) + { + material.AddTexture(texture.Key, texture.Value.Clone()); + } + + return material; + } + + private void Combine(Transform rootTransform, TexturePacker packer, HLODBuildInfo info, dynamic options) + { + var atlas = packer.GetAtlas(info); + if (atlas == null) + return; + + List textureInfoList = options.TextureInfoList; + List combineInfos = new List(); + var hlodWorldToLocal = rootTransform.worldToLocalMatrix; + + for (int i = 0; i < info.WorkingObjects.Count; ++i) + { + var obj = info.WorkingObjects[i]; + ConvertMesh(obj.Mesh, obj.Materials, atlas, textureInfoList[0].InputName); + + for (int si = 0; si < obj.Mesh.subMeshCount; ++si) + { + var ci = new MeshCombiner.CombineInfo(); + var colliderLocalToWorld = obj.LocalToWorld; + var matrix = hlodWorldToLocal * colliderLocalToWorld; + + ci.Mesh = obj.Mesh; + ci.MeshIndex = si; + + ci.Transform = matrix; + + if (ci.Mesh == null) + continue; + + combineInfos.Add(ci); + } + } + + MeshCombiner combiner = new MeshCombiner(); + WorkingMesh combinedMesh = combiner.CombineMesh(Allocator.Persistent, combineInfos); + + WorkingObject newObj = new WorkingObject(Allocator.Persistent); + WorkingMaterial newMat = m_createdMaterials[atlas].Clone(); + + combinedMesh.name = info.Name + "_Mesh"; + newObj.Name = info.Name; + newObj.SetMesh(combinedMesh); + newObj.Materials.Add(newMat); + + info.WorkingObjects.Dispose(); + info.WorkingObjects = new DisposableList(); + info.WorkingObjects.Add(newObj); + } + + + private void ConvertMesh(WorkingMesh mesh, DisposableList materials, TexturePacker.TextureAtlas atlas, string mainTextureName) + { + var uv = mesh.uv; + var updated = new bool[uv.Length]; + // Some meshes have submeshes that either aren't expected to render or are missing a material, so go ahead and skip + int subMeshCount = Mathf.Min(mesh.subMeshCount, materials.Count); + for (int mi = 0; mi < subMeshCount; ++mi) + { + int[] indices = mesh.GetTriangles(mi); + foreach (var i in indices) + { + if ( updated[i] == false ) + { + var uvCoord = uv[i]; + var texture = materials[mi].GetTexture(mainTextureName); + + if (texture == null || texture.GetGUID() == Guid.Empty) + { + // Sample at center of white texture to avoid sampling edge colors incorrectly + uvCoord.x = 0.5f; + uvCoord.y = 0.5f; + } + else + { + var uvOffset = atlas.GetUV(texture.GetGUID()); + + uvCoord.x = Mathf.Lerp(uvOffset.xMin, uvOffset.xMax, uvCoord.x); + uvCoord.y = Mathf.Lerp(uvOffset.yMin, uvOffset.yMax, uvCoord.y); + } + + uv[i] = uvCoord; + updated[i] = true; + } + } + + } + + mesh.uv = uv; + } + + + + static private WorkingTexture CreateEmptyTexture(int width, int height, Color color, bool linear) + { + WorkingTexture texture = new WorkingTexture(Allocator.Persistent, TextureFormat.RGB24, width, height, linear); + + for (int y = 0; y < height; ++y) + { + for (int x = 0; x < width; ++x) + { + texture.SetPixel(x, y, color); + } + } + + return texture; + } + + static class Styles + { + public static int[] PackTextureSizes = new int[] + { + 256, 512, 1024, 2048, 4096 + }; + public static string[] PackTextureSizeNames; + + public static int[] LimitTextureSizes = new int[] + { + 32, 64, 128, 256, 512, 1024 + }; + public static string[] LimitTextureSizeNames; + + + static Styles() + { + PackTextureSizeNames = new string[PackTextureSizes.Length]; + for (int i = 0; i < PackTextureSizes.Length; ++i) + { + PackTextureSizeNames[i] = PackTextureSizes[i].ToString(); + } + + LimitTextureSizeNames = new string[LimitTextureSizes.Length]; + for (int i = 0; i < LimitTextureSizes.Length; ++i) + { + LimitTextureSizeNames[i] = LimitTextureSizes[i].ToString(); + } + } + } + + private static string[] inputTexturePropertyNames = null; + private static string[] outputTexturePropertyNames = null; + private static TextureInfo addingTextureInfo = new TextureInfo(); + public static void OnGUI(HLOD hlod, bool isFirst) + { + if (isFirst ) + { + inputTexturePropertyNames = null; + outputTexturePropertyNames = null; + } + + EditorGUI.indentLevel += 1; + dynamic batcherOptions = hlod.BatcherOptions; + + if (batcherOptions.PackTextureSize == null) + batcherOptions.PackTextureSize = 1024; + if (batcherOptions.LimitTextureSize == null) + batcherOptions.LimitTextureSize = 128; + if (batcherOptions.MaterialGUID == null) + batcherOptions.MaterialGUID = ""; + if (batcherOptions.TextureInfoList == null) + { + batcherOptions.TextureInfoList = new List(); + batcherOptions.TextureInfoList.Add(new TextureInfo() + { + InputName = "_MainTex", + OutputName = "_MainTex", + Type = PackingType.White + }); + } + + if (batcherOptions.EnableTintColor == null) + batcherOptions.EnableTintColor = false; + if (batcherOptions.TintColorName == null) + batcherOptions.TintColorName = ""; + + batcherOptions.PackTextureSize = EditorGUILayout.IntPopup("Pack texture size", batcherOptions.PackTextureSize, Styles.PackTextureSizeNames, Styles.PackTextureSizes); + batcherOptions.LimitTextureSize = EditorGUILayout.IntPopup("Limit texture size", batcherOptions.LimitTextureSize, Styles.LimitTextureSizeNames, Styles.LimitTextureSizes); + + Material mat = null; + + string matGUID = batcherOptions.MaterialGUID; + string path = ""; + if (string.IsNullOrEmpty(matGUID) == false) + { + path = AssetDatabase.GUIDToAssetPath(matGUID); + mat = AssetDatabase.LoadAssetAtPath(path); + } + mat = EditorGUILayout.ObjectField("Material", mat, typeof(Material), false) as Material; + if( mat == null) + mat = new Material(Shader.Find("Standard")); + + path = AssetDatabase.GetAssetPath(mat); + matGUID = AssetDatabase.AssetPathToGUID(path); + + + if (matGUID != batcherOptions.MaterialGUID) + { + batcherOptions.MaterialGUID = matGUID; + outputTexturePropertyNames = mat.GetTexturePropertyNames(); + } + if (inputTexturePropertyNames == null) + { + inputTexturePropertyNames = GetAllMaterialTextureProperties(hlod.gameObject); + } + if (outputTexturePropertyNames == null) + { + outputTexturePropertyNames = mat.GetTexturePropertyNames(); + } + + //apply tint color + batcherOptions.EnableTintColor = + EditorGUILayout.Toggle("Enable tint color", batcherOptions.EnableTintColor); + if (batcherOptions.EnableTintColor == true) + { + EditorGUI.indentLevel += 1; + + var shader = mat.shader; + List colorPropertyNames = new List(); + int propertyCount = ShaderUtil.GetPropertyCount(shader); + for (int i = 0; i < propertyCount; ++i) + { + string name = ShaderUtil.GetPropertyName(shader, i); + if (ShaderUtil.GetPropertyType(shader, i) == ShaderUtil.ShaderPropertyType.Color) + { + colorPropertyNames.Add(name); + } + } + + int index = colorPropertyNames.IndexOf(batcherOptions.TintColorName); + index = EditorGUILayout.Popup("Tint color property", index, colorPropertyNames.ToArray()); + if (index >= 0) + { + batcherOptions.TintColorName = colorPropertyNames[index]; + } + else + { + batcherOptions.TintColorName = ""; + } + + EditorGUI.indentLevel -= 1; + } + + //ext textures + EditorGUILayout.Space(); + EditorGUILayout.LabelField("Textures"); + EditorGUI.indentLevel += 1; + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.PrefixLabel(" "); + //EditorGUILayout.LabelField(); + EditorGUILayout.SelectableLabel("Input"); + EditorGUILayout.SelectableLabel("Output"); + EditorGUILayout.SelectableLabel("Type"); + EditorGUILayout.EndHorizontal(); + + for (int i = 0; i < batcherOptions.TextureInfoList.Count; ++i) + { + TextureInfo info = batcherOptions.TextureInfoList[i]; + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.PrefixLabel(" "); + + info.InputName = StringPopup(info.InputName, inputTexturePropertyNames); + info.OutputName = StringPopup(info.OutputName, outputTexturePropertyNames); + info.Type = (PackingType)EditorGUILayout.EnumPopup(info.Type); + + if (i == 0) + GUI.enabled = false; + if (GUILayout.Button("x") == true) + { + batcherOptions.TextureInfoList.RemoveAt(i); + i -= 1; + } + if (i == 0) + GUI.enabled = true; + EditorGUILayout.EndHorizontal(); + } + + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.PrefixLabel(" "); + if (GUILayout.Button("Add new texture property") == true) + { + batcherOptions.TextureInfoList.Add(new TextureInfo()); + } + + EditorGUILayout.EndHorizontal(); + + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.PrefixLabel(" "); + if (GUILayout.Button("Update texture properties")) + { + //TODO: Need update automatically + inputTexturePropertyNames = null; + outputTexturePropertyNames = null; + } + EditorGUILayout.EndHorizontal(); + + EditorGUI.indentLevel -= 1; + EditorGUI.indentLevel -= 1; + } + + static string StringPopup(string select, string[] options) + { + if (options == null || options.Length == 0) + { + EditorGUILayout.Popup(0, new string[] {select}); + return select; + } + + int index = Array.IndexOf(options, select); + if (index < 0) + index = 0; + + int selected = EditorGUILayout.Popup(index, options); + return options[selected]; + } + + static string[] GetAllMaterialTextureProperties(GameObject root) + { + var meshRenderers = root.GetComponentsInChildren(); + HashSet texturePropertyNames = new HashSet(); + for (int m = 0; m < meshRenderers.Length; ++m) + { + var mesh = meshRenderers[m]; + foreach (Material material in mesh.sharedMaterials) + { + var names = material.GetTexturePropertyNames(); + for (int n = 0; n < names.Length; ++n) + { + texturePropertyNames.Add(names[n]); + } + } + + } + + return texturePropertyNames.ToArray(); + } + + + } + +} diff --git a/FactoryNumeric/Packages/com.unity.hlod/Editor/Batcher/SimpleBatcher.cs.meta b/FactoryNumeric/Packages/com.unity.hlod/Editor/Batcher/SimpleBatcher.cs.meta new file mode 100644 index 00000000..44d62b8a --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/Editor/Batcher/SimpleBatcher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0bad0c6038747d5448d4bf1a2be79c8b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/com.unity.hlod/Editor/BuildProcess.cs b/FactoryNumeric/Packages/com.unity.hlod/Editor/BuildProcess.cs new file mode 100644 index 00000000..346572ab --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/Editor/BuildProcess.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using Unity.HLODSystem.Streaming; +using UnityEditor; +using UnityEngine; +using UnityEditor.Build; +using UnityEditor.Build.Reporting; +using UnityEngine.SceneManagement; +using Object = UnityEngine.Object; + +namespace Unity.HLODSystem +{ + class BuildProcess : IProcessSceneWithReport + { + List instantiatePrefabs = new List(); + + public int callbackOrder => 0; + + public void OnProcessScene(Scene scene, BuildReport report) + { + var roots = scene.GetRootGameObjects(); + + //first, if we use HLODPrefab, we have to create prefab instance while build. + for (int i = 0; i < roots.Length; ++i) + { + var prefabs = roots[i].GetComponentsInChildren(); + for (int pi = 0; pi < prefabs.Length; ++pi) + { + prefabs[pi].IsEdit = false; + GameObject obj = Object.Instantiate(prefabs[pi].Prefab) as GameObject; + obj.transform.SetParent(prefabs[pi].transform, false); + instantiatePrefabs.Add(obj); + + Object.DestroyImmediate(prefabs[pi]); + } + } + + List controllers = new List(); + for (int i = 0; i < roots.Length; ++i) + { + controllers.AddRange(roots[i].GetComponentsInChildren()); + } + + for (int i = 0; i < controllers.Count; ++i) + { + var controller = controllers[i]; + + if (controller != null && controller.enabled == true) + { + controller.Install(); + } + } + + } + } +} diff --git a/FactoryNumeric/Packages/com.unity.hlod/Editor/BuildProcess.cs.meta b/FactoryNumeric/Packages/com.unity.hlod/Editor/BuildProcess.cs.meta new file mode 100644 index 00000000..4ce06a07 --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/Editor/BuildProcess.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1f0f890fb7c2b0d4fbf6f0106e842380 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/com.unity.hlod/Editor/Cache.meta b/FactoryNumeric/Packages/com.unity.hlod/Editor/Cache.meta new file mode 100644 index 00000000..73da1c47 --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/Editor/Cache.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0171b8829b148cb4aa431494352b068e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/com.unity.hlod/Editor/Cache/SimplifiedCache.cs b/FactoryNumeric/Packages/com.unity.hlod/Editor/Cache/SimplifiedCache.cs new file mode 100644 index 00000000..bd30611e --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/Editor/Cache/SimplifiedCache.cs @@ -0,0 +1,211 @@ +using System; +using System.IO; +using System.Collections.Generic; +using UnityEditor; +using UnityEngine; + +namespace Unity.HLODSystem.Cache +{ + class SimplifiedCache + { + private const string k_CachePath = "Assets/HLODSystem/Cache/"; + + struct GeneratingInfo + { + public Type Type; + public Mesh Mesh; + public float Quality; + }; + + List m_GeneratingInfos = new List(); + + #region Interface + public static void Clear() + { + Instance.ClearImpl(); + } + + public static void MarkGenerating(Type type, Mesh mesh, float quality) + { + Instance.m_GeneratingInfos.Add(new GeneratingInfo() + { + Type = type, + Mesh = mesh, + Quality = quality, + }); + } + + public static bool IsGenerating(Type type, Mesh mesh, float quality) + { + for (int i = 0; i < Instance.m_GeneratingInfos.Count; ++i) + { + if (Instance.m_GeneratingInfos[i].Type == type && + Instance.m_GeneratingInfos[i].Mesh == mesh && + Mathf.Abs(Instance.m_GeneratingInfos[i].Quality - quality) < 0.0001f ) + return true; + } + + return false; + } + + public static void Update(Type simplifierType, Mesh originalMesh, Mesh simplifiedMesh, float qualtiy) + { + Instance.UpdateImpl(simplifierType, originalMesh, simplifiedMesh, qualtiy); + } + public static Mesh Get(Type simplifierType, Mesh mesh, float quality) + { + return Instance.GetImpl(simplifierType, mesh, quality); + } + #endregion + + #region Singleton + private static SimplifiedCache s_Instance; + + private static SimplifiedCache Instance + { + get + { + if (s_Instance == null) + s_Instance = new SimplifiedCache(); + return s_Instance; + } + } + #endregion + + private void ClearImpl() + { + DeleteDirectory(k_CachePath); + } + private void UpdateImpl(Type simplifiedType, Mesh originalMesh, Mesh simplifiedMesh, float quality) + { + string path = AssetDatabase.GetAssetPath(originalMesh); + string guid = AssetDatabase.AssetPathToGUID(path); + + if (string.IsNullOrEmpty(guid) == true) + return; + + DateTime time = System.IO.File.GetLastWriteTime(path); + SimplifiedMeshList meshList = GetMeshList(guid, time.ToFileTimeUtc()); + var mesh = meshList.GetMesh(quality, simplifiedType); + if (mesh != null) + { + mesh.Mesh = simplifiedMesh; + } + else + { + meshList.AddMesh(quality, simplifiedType, simplifiedMesh); + } + + AssetDatabase.AddObjectToAsset(simplifiedMesh, meshList); + EditorUtility.SetDirty(meshList); + + for (int i = 0; i < m_GeneratingInfos.Count; ++i) + { + if (m_GeneratingInfos[i].Type == simplifiedType && + m_GeneratingInfos[i].Mesh == originalMesh && + Mathf.Abs(Instance.m_GeneratingInfos[i].Quality - quality) < 0.0001f) + { + m_GeneratingInfos.RemoveAt(i); + return; + } + } + } + private Mesh GetImpl(Type simplifierType, Mesh mesh, float quality) + { + string path = AssetDatabase.GetAssetPath(mesh); + string guid = AssetDatabase.AssetPathToGUID(path); + + if (string.IsNullOrEmpty(guid) == true) + return null; + + DateTime time = System.IO.File.GetLastWriteTime(path); + + return GetMesh(simplifierType, mesh, quality, guid, time.ToFileTimeUtc()); + } + + private Mesh GetMesh(Type simplifiedType, Mesh source, float quality, string guid, long time) + { + SimplifiedMeshList meshList = GetMeshList(guid, time); + + var mesh = meshList.GetMesh(quality, simplifiedType); + if (mesh != null) + { + return mesh.Mesh; + } + else + { + return null; + } + } + + private SimplifiedMeshList GetMeshList(string guid, long time) + { + var meshList = LoadMeshList(guid); + if (meshList == null || meshList.Timestamp != time) + { + RemoveMeshList(guid); + meshList = NewMeshList(guid, time); + } + + return meshList; + } + + private SimplifiedMeshList NewMeshList(string guid, long time) + { + SimplifiedMeshList meshList = SimplifiedMeshList.CreateInstance(); + meshList.Timestamp = time; + meshList.name = guid; + + string path = GetAssetPath(guid); + string dir = Path.GetDirectoryName(path); + if (Directory.Exists(dir) == false) + { + Directory.CreateDirectory(dir); + } + + AssetDatabase.CreateAsset(meshList, path); + return meshList; + } + private SimplifiedMeshList LoadMeshList(string guid) + { + string path = GetAssetPath(guid); + if (System.IO.File.Exists(path) == false) + return null; + + return AssetDatabase.LoadAssetAtPath(path); + } + + private void RemoveMeshList(string guid) + { + string path = GetAssetPath(guid); + AssetDatabase.DeleteAsset(path); + } + + + private string GetAssetPath(string guid) + { + return k_CachePath + guid + ".asset"; + } + + public static void DeleteDirectory(string path) + { + if (Directory.Exists(path) == false) + return; + + DirectoryInfo di = new DirectoryInfo(path); + + foreach (FileInfo file in di.GetFiles()) + { + file.Delete(); + } + + foreach (DirectoryInfo dir in di.GetDirectories()) + { + DeleteDirectory(dir.FullName); + } + + di.Delete(); + + } + } +} diff --git a/FactoryNumeric/Packages/com.unity.hlod/Editor/Cache/SimplifiedCache.cs.meta b/FactoryNumeric/Packages/com.unity.hlod/Editor/Cache/SimplifiedCache.cs.meta new file mode 100644 index 00000000..206c1f42 --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/Editor/Cache/SimplifiedCache.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8734536ac6ce8bf4ba5e1bcc183b0555 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/com.unity.hlod/Editor/Cache/SimplifiedMeshList.cs b/FactoryNumeric/Packages/com.unity.hlod/Editor/Cache/SimplifiedMeshList.cs new file mode 100644 index 00000000..c8cc7172 --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/Editor/Cache/SimplifiedMeshList.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace Unity.HLODSystem.Cache +{ + [Serializable] + class SimplifiedMesh + { + public float Quality; + public string SimplifierType; + public Mesh Mesh; + } + + class SimplifiedMeshList : ScriptableObject + { + public long Timestamp; + [SerializeField] + private List m_MeshList = new List(); + + public void AddMesh(float quality, Type simplifierType, Mesh mesh) + { + m_MeshList.Add(new SimplifiedMesh() + { + Quality = quality, + SimplifierType = simplifierType.AssemblyQualifiedName, + Mesh = mesh, + }); + } + + public SimplifiedMesh GetMesh(float quality, Type simplifierType) + { + //Compare three decimal places + int compareQuality = (int)(quality * 1000.0f + 0.5f); + + for (int i = 0; i < m_MeshList.Count; ++i) + { + var mesh = m_MeshList[i]; + int meshQuality = (int) (mesh.Quality * 1000.0f + 0.5f); + if (meshQuality == compareQuality && simplifierType.AssemblyQualifiedName == mesh.SimplifierType) + return mesh; + } + + return null; + } + } + +} diff --git a/FactoryNumeric/Packages/com.unity.hlod/Editor/Cache/SimplifiedMeshList.cs.meta b/FactoryNumeric/Packages/com.unity.hlod/Editor/Cache/SimplifiedMeshList.cs.meta new file mode 100644 index 00000000..67ab596f --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/Editor/Cache/SimplifiedMeshList.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0038a9ce1b6fe274ab2d5635a62a3bd0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/com.unity.hlod/Editor/CreateUtils.meta b/FactoryNumeric/Packages/com.unity.hlod/Editor/CreateUtils.meta new file mode 100644 index 00000000..ea330642 --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/Editor/CreateUtils.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 21d13720474403b4b888402926a6dd14 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/com.unity.hlod/Editor/CreateUtils/GetMeshRenderer.cs b/FactoryNumeric/Packages/com.unity.hlod/Editor/CreateUtils/GetMeshRenderer.cs new file mode 100644 index 00000000..5e18e4e7 --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/Editor/CreateUtils/GetMeshRenderer.cs @@ -0,0 +1,196 @@ +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; +using Unity.HLODSystem.Utils; + +namespace Unity.HLODSystem +{ + public static partial class CreateUtils + { + private class MeshRendererCalculator + { + private bool m_isCalculated = false; + private List m_meshSetters = new List(); + private List m_meshRenderers = new List(); + private List m_lodGroups = new List(); + + private List m_resultMeshRenderers = new List(); + + public List ResultMeshRenderers + { + get { return m_resultMeshRenderers; } + } + + public MeshRendererCalculator(List targetGameObjects) + { + for (int oi = 0; oi < targetGameObjects.Count; ++oi) + { + var target = targetGameObjects[oi]; + + m_meshSetters.AddRange(target.GetComponentsInChildren()); + m_meshRenderers.AddRange(target.GetComponentsInChildren()); + m_lodGroups.AddRange(target.GetComponentsInChildren()); + } + + RemoveDisabled(m_meshSetters); + RemoveDisabled(m_lodGroups); + RemoveDisabled(m_meshRenderers); + } + + public void Calculate(float minObjectSize, int level) + { + if (m_isCalculated == true) + return; + + for (int si = 0; si < m_meshSetters.Count; ++si) + { + AddResultFromMeshSetters(m_meshSetters[si], minObjectSize, level); + } + + for (int gi = 0; gi < m_lodGroups.Count; ++gi) + { + LODGroup lodGroup = m_lodGroups[gi]; + LOD[] lods = lodGroup.GetLODs(); + for (int li = 0; li < lods.Length; ++li) + { + Renderer[] lodRenderers = lods[li].renderers; + + //Remove every mesh renderer which is registered to the LODGroup. + for (int ri = 0; ri < lodRenderers.Length; ++ri) + { + MeshRenderer mr = lodRenderers[ri] as MeshRenderer; + if (mr == null) + continue; + + m_meshRenderers.Remove(mr); + } + } + + AddReusltFromLODGroup(lodGroup, minObjectSize); + } + + for (int mi = 0; mi < m_meshRenderers.Count; ++mi) + { + MeshRenderer mr = m_meshRenderers[mi]; + + float max = Mathf.Max(mr.bounds.size.x, mr.bounds.size.y, mr.bounds.size.z); + if (max < minObjectSize) + continue; + + m_resultMeshRenderers.Add(mr); + } + + m_isCalculated = true; + } + + + private void AddResultFromMeshSetters(HLODMeshSetter setter, float minObjectSize, int level) + { + var group = setter.FindGroup(level); + + //If group is null, there is no MeshSetting for current level. + if (group == null) + return; + + m_resultMeshRenderers.AddRange(group.MeshRenderers); + RemoveUnderMeshSetters(setter); + } + + private void AddReusltFromLODGroup(LODGroup lodGroup, float minObjectSize) + { + LOD[] lods = lodGroup.GetLODs(); + Renderer[] renderers = lods.Last().renderers; + for (int ri = 0; ri < renderers.Length; ++ri) + { + MeshRenderer mr = renderers[ri] as MeshRenderer; + + if (mr == null) + continue; + + if (mr.gameObject.activeInHierarchy == false || mr.enabled == false) + continue; + + float max = Mathf.Max(mr.bounds.size.x, mr.bounds.size.y, mr.bounds.size.z); + if (max < minObjectSize) + continue; + + m_resultMeshRenderers.Add(mr); + } + } + + private void RemoveUnderMeshSetters(HLODMeshSetter setter) + { + m_lodGroups.RemoveAll(setter.GetComponentsInChildren()); + m_meshRenderers.RemoveAll(setter.GetComponentsInChildren()); + } + + + //enabled is not Component variable. + //So we can not make this to Generic function. + private void RemoveDisabled(List componentList) + { + for (int i = 0; i < componentList.Count; ++i) + { + if (componentList[i].enabled == true && componentList[i].gameObject.activeInHierarchy == true) + { + continue; + } + + int backIndex = componentList.Count - 1; + componentList[i] = componentList[backIndex]; + componentList.RemoveAt(backIndex); + i -= 1; + } + } + private void RemoveDisabled(List componentList) + { + for (int i = 0; i < componentList.Count; ++i) + { + if (componentList[i].enabled == true && componentList[i].gameObject.activeInHierarchy == true) + { + continue; + } + + int backIndex = componentList.Count - 1; + componentList[i] = componentList[backIndex]; + componentList.RemoveAt(backIndex); + i -= 1; + } + } + private void RemoveDisabled(List componentList) + { + for (int i = 0; i < componentList.Count; ++i) + { + if (componentList[i].enabled == true && componentList[i].gameObject.activeInHierarchy == true) + { + continue; + } + + int backIndex = componentList.Count - 1; + componentList[i] = componentList[backIndex]; + componentList.RemoveAt(backIndex); + i -= 1; + } + } + } + public static List GetMeshRenderers(List gameObjects, float minObjectSize, int level) + { + MeshRendererCalculator calculator = new MeshRendererCalculator(gameObjects); + calculator.Calculate(minObjectSize, level); + return calculator.ResultMeshRenderers; + } + + public static List GetMeshRenderers(GameObject gameObject, float minObjectSize, int level) + { + List tmpList = new List(); + tmpList.Add(gameObject); + + MeshRendererCalculator calculator = new MeshRendererCalculator(tmpList); + calculator.Calculate(minObjectSize, level); + return calculator.ResultMeshRenderers; + } + + } + +} \ No newline at end of file diff --git a/FactoryNumeric/Packages/com.unity.hlod/Editor/CreateUtils/GetMeshRenderer.cs.meta b/FactoryNumeric/Packages/com.unity.hlod/Editor/CreateUtils/GetMeshRenderer.cs.meta new file mode 100644 index 00000000..6eb06a13 --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/Editor/CreateUtils/GetMeshRenderer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3b4240e093925af41b05d967e9270553 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/com.unity.hlod/Editor/DebugWindow.meta b/FactoryNumeric/Packages/com.unity.hlod/Editor/DebugWindow.meta new file mode 100644 index 00000000..2b928c81 --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/Editor/DebugWindow.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 094d6c79b828d824abed32b69713e2bb +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/com.unity.hlod/Editor/DebugWindow/DrawMode.cs b/FactoryNumeric/Packages/com.unity.hlod/Editor/DebugWindow/DrawMode.cs new file mode 100644 index 00000000..3d01054d --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/Editor/DebugWindow/DrawMode.cs @@ -0,0 +1,13 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace Unity.HLODSystem.DebugWindow +{ + public enum DrawMode + { + None, + RenderOnly, + All, + } +} \ No newline at end of file diff --git a/FactoryNumeric/Packages/com.unity.hlod/Editor/DebugWindow/DrawMode.cs.meta b/FactoryNumeric/Packages/com.unity.hlod/Editor/DebugWindow/DrawMode.cs.meta new file mode 100644 index 00000000..d1014edc --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/Editor/DebugWindow/DrawMode.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7ca9a658ddc1ee640b34f943624d8717 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/com.unity.hlod/Editor/DebugWindow/HLODDebugWindow.cs b/FactoryNumeric/Packages/com.unity.hlod/Editor/DebugWindow/HLODDebugWindow.cs new file mode 100644 index 00000000..a2f7b946 --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/Editor/DebugWindow/HLODDebugWindow.cs @@ -0,0 +1,168 @@ +using System; +using System.Collections.Generic; +using System.IO; +using UnityEditor; +using UnityEditor.UIElements; +using UnityEngine; +using UnityEngine.UIElements; +using Toggle = UnityEngine.UIElements.Toggle; + +namespace Unity.HLODSystem.DebugWindow +{ + public class HLODDebugWindow : EditorWindow + { + + #region menu item + [MenuItem("Window/HLOD/DebugWindow", false, 100000)] + static void ShowWindow() + { + var window = GetWindow("HLOD Debug window"); + window.Show(); + } + #endregion + + private ListView m_hlodItemList; + private List m_hlodItems = new List(); + private List m_hlodItemDatas = new List(); + private HierarchyItem m_selectedItem; + + private RadioButtonGroup m_drawModeUI; + + [SerializeField] + private bool m_drawSelected = true; + [SerializeField] + private bool m_highlightRendered = true; + + [SerializeField] + private DrawMode m_drawMode = DrawMode.RenderOnly; + + public bool HighlightRendered => m_highlightRendered; + + private void OnEnable() + { + // Each editor window contains a root VisualElement object + VisualElement root = rootVisualElement; + + MonoScript ms = MonoScript.FromScriptableObject(this); + string scriptPath = AssetDatabase.GetAssetPath(ms); + string scriptDirectory = Path.GetDirectoryName(scriptPath); + + // Import UXML + var visualTree = + AssetDatabase.LoadAssetAtPath(scriptDirectory + "/HLODDebugWindow.uxml"); + + visualTree.CloneTree(root); + + //Initialize variables + m_hlodItemList = root.Q("HLODItemList"); + + UpdateDataList(); + + + var serializedObject = new SerializedObject(this); + var drawSelectedUI = root.Q("DrawSelected"); + drawSelectedUI.Bind(serializedObject); + + var highlightRenderedUI = root.Q("HighlightRendered"); + highlightRenderedUI.Bind(serializedObject); + + m_drawModeUI = root.Q("DrawMode"); + m_drawModeUI.choices = new[] + { + DrawMode.None.ToString(), + DrawMode.RenderOnly.ToString(), + DrawMode.All.ToString(), + }; + m_drawModeUI.Bind(serializedObject); + + EditorApplication.playModeStateChanged += OnPlayModeStateChanged; + SceneView.duringSceneGui += SceneViewOnDuringSceneGui; + } + private void OnDisable() + { + EditorApplication.playModeStateChanged -= OnPlayModeStateChanged; + SceneView.duringSceneGui -= SceneViewOnDuringSceneGui; + } + + + + private void Update() + { + if (HLODManager.Instance.ActiveControllers.Count != m_hlodItemDatas.Count) + { + UpdateDataList(); + } + } + + private void UpdateDataList() + { + foreach (var hlodItem in m_hlodItems) + { + hlodItem.Dispose(); + } + + m_hlodItemDatas.Clear(); + m_hlodItemList.Clear(); + m_hlodItems.Clear(); + + foreach (var controller in HLODManager.Instance.ActiveControllers) + { + var data = new HLODItemData(); + data.Initialize(controller); + m_hlodItemDatas.Add(data); + } + + var view = m_hlodItemList.hierarchy[0] as ScrollView; + view.Clear(); + foreach (var data in m_hlodItemDatas) + { + var item = new HLODItem(this); + item.BindData(data); + view.Add(item); + + m_hlodItems.Add(item); + + } + } + + + private void OnPlayModeStateChanged(PlayModeStateChange state) + { + UpdateDataList(); + m_selectedItem = null; + } + + #region Debug rendering + private void SceneViewOnDuringSceneGui(SceneView obj) + { + if (m_drawMode != DrawMode.None) + { + foreach (var itemData in m_hlodItemDatas) + { + itemData.Render(m_drawMode); + } + } + if (m_drawSelected) + { + if ( m_selectedItem != null) + { + HLODTreeNodeRenderer.Instance.Render(m_selectedItem.Data.TreeNode, Color.red, 2.0f); + } + } + } + + public void SetSelectItem(HierarchyItem item) + { + if ( m_selectedItem != null) + m_selectedItem.UnselectItem(); + + m_selectedItem = item; + if ( m_selectedItem != null) + m_selectedItem.SelectItem(); + } + + + #endregion + } + +} \ No newline at end of file diff --git a/FactoryNumeric/Packages/com.unity.hlod/Editor/DebugWindow/HLODDebugWindow.cs.meta b/FactoryNumeric/Packages/com.unity.hlod/Editor/DebugWindow/HLODDebugWindow.cs.meta new file mode 100644 index 00000000..3af0b61a --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/Editor/DebugWindow/HLODDebugWindow.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d83321e45ced11d4ba33fde563ecf1e1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FactoryNumeric/Packages/com.unity.hlod/Editor/DebugWindow/HLODDebugWindow.uss b/FactoryNumeric/Packages/com.unity.hlod/Editor/DebugWindow/HLODDebugWindow.uss new file mode 100644 index 00000000..f2c5aed0 --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/Editor/DebugWindow/HLODDebugWindow.uss @@ -0,0 +1,21 @@ +.hlod-debugwindow-header{ + padding: 0px 0px 0px 0px; + margin: 0px 0px 0px 0px; +} + +#Header{ + flex-direction: row; + flex-shrink: 0; +} +#LabelHeader{ + flex-grow: 1; +} +#EnableDebugHeader{ + width: 70px; +} + +#HLODItemList{ + height: 100%; + padding-left: 5px; + padding-bottom: 5px; +} \ No newline at end of file diff --git a/FactoryNumeric/Packages/com.unity.hlod/Editor/DebugWindow/HLODDebugWindow.uss.meta b/FactoryNumeric/Packages/com.unity.hlod/Editor/DebugWindow/HLODDebugWindow.uss.meta new file mode 100644 index 00000000..e3a8ce0f --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/Editor/DebugWindow/HLODDebugWindow.uss.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f8155404e467c0b4caeb33538ea107cf +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0} + disableValidation: 0 diff --git a/FactoryNumeric/Packages/com.unity.hlod/Editor/DebugWindow/HLODDebugWindow.uxml b/FactoryNumeric/Packages/com.unity.hlod/Editor/DebugWindow/HLODDebugWindow.uxml new file mode 100644 index 00000000..8e40808a --- /dev/null +++ b/FactoryNumeric/Packages/com.unity.hlod/Editor/DebugWindow/HLODDebugWindow.uxml @@ -0,0 +1,16 @@ + +