diff --git a/Examples/Assets/2-Chess/Chess.unity b/Examples/Assets/2-Chess/Chess.unity index 9d60a1f..7f9f8e6 100644 --- a/Examples/Assets/2-Chess/Chess.unity +++ b/Examples/Assets/2-Chess/Chess.unity @@ -132,6 +132,7 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 18479229} + - component: {fileID: 18479230} m_Layer: 0 m_Name: PieceSpawner m_TagString: Untagged @@ -153,6 +154,33 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &18479230 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 18479228} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5eef96e5ff14464db4ce41c12e55a69a, type: 3} + m_Name: + m_EditorClassIdentifier: + baseMaterial: {fileID: 2100000, guid: e62e815d106881342ad0363de99e4032, type: 2} + whiteColor: {r: 0.745283, g: 0.745283, b: 0.745283, a: 0} + blackColor: {r: 0.3301887, g: 0.3301887, b: 0.3301887, a: 0} + pawnPrefab: {fileID: 1583218075738367649, guid: 32b62efada760e849bd87da4273b3b53, + type: 3} + bishopPrefab: {fileID: 4176364942238273365, guid: 6e884ce33c0cb614183072a3b6d3428c, + type: 3} + knightPrefab: {fileID: 5946930590886837822, guid: fe6946c1e57f1e04da70f359e47f0b74, + type: 3} + rookPrefab: {fileID: 2026019943357961452, guid: 0b18bbbd40b5c414c8dae0da35082cc2, + type: 3} + queenPrefab: {fileID: 1567788881234649031, guid: 5fe76d0647bbcf84aa5989b1d4582db1, + type: 3} + kingPrefab: {fileID: 5957118620367066376, guid: 8064d5600829eac4193f1d236ee464e1, + type: 3} --- !u!1 &835953010 GameObject: m_ObjectHideFlags: 0 @@ -164,6 +192,8 @@ GameObject: - component: {fileID: 835953013} - component: {fileID: 835953012} - component: {fileID: 835953011} + - component: {fileID: 835953014} + - component: {fileID: 835953015} m_Layer: 0 m_Name: Main Camera m_TagString: MainCamera @@ -236,6 +266,51 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!114 &835953014 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 835953010} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RenderShadows: 1 + m_RequiresDepthTextureOption: 2 + m_RequiresOpaqueTextureOption: 2 + m_CameraType: 0 + m_Cameras: [] + m_RendererIndex: -1 + m_VolumeLayerMask: + serializedVersion: 2 + m_Bits: 1 + m_VolumeTrigger: {fileID: 0} + m_RenderPostProcessing: 0 + m_Antialiasing: 0 + m_AntialiasingQuality: 2 + m_StopNaN: 0 + m_Dithering: 0 + m_ClearDepth: 1 + m_AllowXRRendering: 1 + m_RequiresDepthTexture: 0 + m_RequiresColorTexture: 0 + m_Version: 2 +--- !u!114 &835953015 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 835953010} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 93b4c6956f914255af4b113d48ac3282, type: 3} + m_Name: + m_EditorClassIdentifier: + store: {fileID: 1074850383} --- !u!1001 &990988795 PrefabInstance: m_ObjectHideFlags: 0 @@ -253,6 +328,11 @@ PrefabInstance: propertyPath: m_RootOrder value: 1 objectReference: {fileID: 0} + - target: {fileID: 7621059963395653558, guid: dd7ea297c8547c24d9b69c1d063cd660, + type: 3} + propertyPath: m_LocalScale.z + value: -1 + objectReference: {fileID: 0} - target: {fileID: 7621059963395653558, guid: dd7ea297c8547c24d9b69c1d063cd660, type: 3} propertyPath: m_LocalPosition.x @@ -348,6 +428,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 2b9385cb5c9a3bf4aa966592c7c92f76, type: 3} m_Name: m_EditorClassIdentifier: + spawner: {fileID: 18479230} --- !u!1 &1943387544 GameObject: m_ObjectHideFlags: 0 @@ -389,7 +470,7 @@ Light: m_Strength: 1 m_Bias: 0.05 m_NormalBias: 0.4 - m_NearPlane: 0.2 + m_NearPlane: 0.1 m_CullingMatrixOverride: e00: 1 e01: 0 diff --git a/Examples/Assets/2-Chess/Materials/ChessPiece.mat b/Examples/Assets/2-Chess/Materials/ChessPiece.mat new file mode 100644 index 0000000..4797680 --- /dev/null +++ b/Examples/Assets/2-Chess/Materials/ChessPiece.mat @@ -0,0 +1,129 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-3749607757857133310 +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: 4 +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: ChessPiece + m_Shader: {fileID: 4800000, guid: 8d2bb70cbf9db8d4da26e15b26e74248, type: 3} + m_ShaderKeywords: _SPECULAR_COLOR + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 2000 + stringTagMap: + RenderType: Opaque + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseMap: + m_Texture: {fileID: 0} + 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: 0} + 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 + - _Blend: 0 + - _BumpScale: 1 + - _ClearCoatMask: 0 + - _ClearCoatSmoothness: 0 + - _Cull: 2 + - _Cutoff: 0.5 + - _DetailAlbedoMapScale: 1 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _EnvironmentReflections: 1 + - _GlossMapScale: 0 + - _Glossiness: 0 + - _GlossinessSource: 0 + - _GlossyReflections: 0 + - _Metallic: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.005 + - _QueueOffset: 0 + - _ReceiveShadows: 1 + - _Shininess: 0 + - _Smoothness: 0.5 + - _SmoothnessSource: 0 + - _SmoothnessTextureChannel: 0 + - _SpecSource: 0 + - _SpecularHighlights: 0 + - _SrcBlend: 1 + - _Surface: 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.19999927, g: 0.19999927, b: 0.19999927, a: 0.5} + m_BuildTextureStacks: [] diff --git a/Examples/Assets/2-Chess/Materials/ChessPiece.mat.meta b/Examples/Assets/2-Chess/Materials/ChessPiece.mat.meta new file mode 100644 index 0000000..7240d37 --- /dev/null +++ b/Examples/Assets/2-Chess/Materials/ChessPiece.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e62e815d106881342ad0363de99e4032 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Examples/Assets/2-Chess/Prefabs/ChessPiece.prefab b/Examples/Assets/2-Chess/Prefabs/ChessPiece.prefab new file mode 100644 index 0000000..e554390 --- /dev/null +++ b/Examples/Assets/2-Chess/Prefabs/ChessPiece.prefab @@ -0,0 +1,143 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1812032989495986861 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1812032989496153741} + - component: {fileID: 1812032989492762285} + - component: {fileID: 1812032989493728365} + m_Layer: 0 + m_Name: Model + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1812032989496153741 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1812032989495986861} + m_LocalRotation: {x: 0.0000000218557, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0, y: 0, z: 0} + m_LocalScale: {x: 0.6666667, y: 0.6666667, z: 0.6666667} + m_Children: [] + m_Father: {fileID: 4954453973512217138} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &1812032989492762285 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1812032989495986861} + m_Mesh: {fileID: 0} +--- !u!23 &1812032989493728365 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1812032989495986861} + 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: e62e815d106881342ad0363de99e4032, 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 &2230369837149406147 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4954453973512217138} + - component: {fileID: 2863982070394274075} + - component: {fileID: -5701791958302882844} + m_Layer: 0 + m_Name: ChessPiece + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4954453973512217138 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2230369837149406147} + 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: 1812032989496153741} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2863982070394274075 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2230369837149406147} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9b48b005af2d31e44a524862a63bf877, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &-5701791958302882844 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2230369837149406147} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dea8c34343a646e78bcf4f8a8b49fec0, type: 3} + m_Name: + m_EditorClassIdentifier: + AnimationSpeed: 2 + Ease: 1 diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTween.Modules.asmdef.meta b/Examples/Assets/2-Chess/Prefabs/ChessPiece.prefab.meta similarity index 59% rename from Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTween.Modules.asmdef.meta rename to Examples/Assets/2-Chess/Prefabs/ChessPiece.prefab.meta index 0409246..f615ef2 100644 --- a/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTween.Modules.asmdef.meta +++ b/Examples/Assets/2-Chess/Prefabs/ChessPiece.prefab.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 742cc6f6bfd2cf542b571648c351ceea -AssemblyDefinitionImporter: +guid: 2171c4445fb8a384c964f7a4cfe4bd75 +PrefabImporter: externalObjects: {} userData: assetBundleName: diff --git a/Examples/Assets/2-Chess/Prefabs/ChessPieceBishop.prefab b/Examples/Assets/2-Chess/Prefabs/ChessPieceBishop.prefab new file mode 100644 index 0000000..1a1beff --- /dev/null +++ b/Examples/Assets/2-Chess/Prefabs/ChessPieceBishop.prefab @@ -0,0 +1,101 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &2812128829475687574 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 1812032989492762285, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_Mesh + value: + objectReference: {fileID: 4300000, guid: 66ad00b166b914e47acce78daea25aa6, type: 3} + - target: {fileID: 1812032989496153741, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.7071068 + objectReference: {fileID: 0} + - target: {fileID: 1812032989496153741, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1812032989496153741, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalRotation.y + value: -0.7071068 + objectReference: {fileID: 0} + - target: {fileID: 1812032989496153741, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1812032989496153741, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -90 + objectReference: {fileID: 0} + - target: {fileID: 2230369837149406147, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_Name + value: ChessPieceBishop + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 2171c4445fb8a384c964f7a4cfe4bd75, type: 3} diff --git a/Examples/Assets/Plugins.meta b/Examples/Assets/2-Chess/Prefabs/ChessPieceBishop.prefab.meta similarity index 57% rename from Examples/Assets/Plugins.meta rename to Examples/Assets/2-Chess/Prefabs/ChessPieceBishop.prefab.meta index 2ef9153..3d75397 100644 --- a/Examples/Assets/Plugins.meta +++ b/Examples/Assets/2-Chess/Prefabs/ChessPieceBishop.prefab.meta @@ -1,7 +1,6 @@ fileFormatVersion: 2 -guid: 23b6aca329d14a44caeaf7b4718be22a -folderAsset: yes -DefaultImporter: +guid: 6e884ce33c0cb614183072a3b6d3428c +PrefabImporter: externalObjects: {} userData: assetBundleName: diff --git a/Examples/Assets/2-Chess/Prefabs/ChessPieceKing.prefab b/Examples/Assets/2-Chess/Prefabs/ChessPieceKing.prefab new file mode 100644 index 0000000..dd7acad --- /dev/null +++ b/Examples/Assets/2-Chess/Prefabs/ChessPieceKing.prefab @@ -0,0 +1,76 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &5501202326134806219 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 1812032989492762285, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_Mesh + value: + objectReference: {fileID: 4300002, guid: a1edea9a41e71514f94a737abaf1410c, type: 3} + - target: {fileID: 2230369837149406147, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_Name + value: ChessPieceKing + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 2171c4445fb8a384c964f7a4cfe4bd75, type: 3} diff --git a/Examples/Assets/Plugins/Demigiant.meta b/Examples/Assets/2-Chess/Prefabs/ChessPieceKing.prefab.meta similarity index 57% rename from Examples/Assets/Plugins/Demigiant.meta rename to Examples/Assets/2-Chess/Prefabs/ChessPieceKing.prefab.meta index 7ff3c27..4195051 100644 --- a/Examples/Assets/Plugins/Demigiant.meta +++ b/Examples/Assets/2-Chess/Prefabs/ChessPieceKing.prefab.meta @@ -1,7 +1,6 @@ fileFormatVersion: 2 -guid: 8e5bda14619f4de4695b2fc1295622d9 -folderAsset: yes -DefaultImporter: +guid: 8064d5600829eac4193f1d236ee464e1 +PrefabImporter: externalObjects: {} userData: assetBundleName: diff --git a/Examples/Assets/2-Chess/Prefabs/ChessPieceKnight.prefab b/Examples/Assets/2-Chess/Prefabs/ChessPieceKnight.prefab new file mode 100644 index 0000000..7c40b47 --- /dev/null +++ b/Examples/Assets/2-Chess/Prefabs/ChessPieceKnight.prefab @@ -0,0 +1,76 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &5509134149362908669 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 1812032989492762285, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_Mesh + value: + objectReference: {fileID: 4300000, guid: 639050e749c3ce444a196d84e803b067, type: 3} + - target: {fileID: 2230369837149406147, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_Name + value: ChessPieceKnight + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 2171c4445fb8a384c964f7a4cfe4bd75, type: 3} diff --git a/Examples/Assets/Plugins/Demigiant/DOTween.meta b/Examples/Assets/2-Chess/Prefabs/ChessPieceKnight.prefab.meta similarity index 57% rename from Examples/Assets/Plugins/Demigiant/DOTween.meta rename to Examples/Assets/2-Chess/Prefabs/ChessPieceKnight.prefab.meta index ef6995a..00272a3 100644 --- a/Examples/Assets/Plugins/Demigiant/DOTween.meta +++ b/Examples/Assets/2-Chess/Prefabs/ChessPieceKnight.prefab.meta @@ -1,7 +1,6 @@ fileFormatVersion: 2 -guid: 7338446198fab1946800bfea0c898650 -folderAsset: yes -DefaultImporter: +guid: fe6946c1e57f1e04da70f359e47f0b74 +PrefabImporter: externalObjects: {} userData: assetBundleName: diff --git a/Examples/Assets/2-Chess/Prefabs/ChessPiecePawn.prefab b/Examples/Assets/2-Chess/Prefabs/ChessPiecePawn.prefab new file mode 100644 index 0000000..7442a25 --- /dev/null +++ b/Examples/Assets/2-Chess/Prefabs/ChessPiecePawn.prefab @@ -0,0 +1,76 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &795841906584429922 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 1812032989492762285, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_Mesh + value: + objectReference: {fileID: 4300000, guid: 8fbcce33444d4ce4db5b61f8d0eeb7aa, type: 3} + - target: {fileID: 2230369837149406147, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_Name + value: PawnChessPiece + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 2171c4445fb8a384c964f7a4cfe4bd75, type: 3} diff --git a/Examples/Assets/2-Chess/Prefabs/ChessPiecePawn.prefab.meta b/Examples/Assets/2-Chess/Prefabs/ChessPiecePawn.prefab.meta new file mode 100644 index 0000000..2589023 --- /dev/null +++ b/Examples/Assets/2-Chess/Prefabs/ChessPiecePawn.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 32b62efada760e849bd87da4273b3b53 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Examples/Assets/2-Chess/Prefabs/ChessPieceQueen.prefab b/Examples/Assets/2-Chess/Prefabs/ChessPieceQueen.prefab new file mode 100644 index 0000000..030a52d --- /dev/null +++ b/Examples/Assets/2-Chess/Prefabs/ChessPieceQueen.prefab @@ -0,0 +1,76 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &806771203401653252 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 1812032989492762285, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_Mesh + value: + objectReference: {fileID: 4300000, guid: 5d7a66b35fd81564380721b6bfcaaa47, type: 3} + - target: {fileID: 2230369837149406147, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_Name + value: ChessPieceQueen + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 2171c4445fb8a384c964f7a4cfe4bd75, type: 3} diff --git a/Examples/Assets/2-Chess/Prefabs/ChessPieceQueen.prefab.meta b/Examples/Assets/2-Chess/Prefabs/ChessPieceQueen.prefab.meta new file mode 100644 index 0000000..64dd581 --- /dev/null +++ b/Examples/Assets/2-Chess/Prefabs/ChessPieceQueen.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5fe76d0647bbcf84aa5989b1d4582db1 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Examples/Assets/2-Chess/Prefabs/ChessPieceRook.prefab b/Examples/Assets/2-Chess/Prefabs/ChessPieceRook.prefab new file mode 100644 index 0000000..d9376c5 --- /dev/null +++ b/Examples/Assets/2-Chess/Prefabs/ChessPieceRook.prefab @@ -0,0 +1,76 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &211110543383861039 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 1812032989492762285, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_Mesh + value: + objectReference: {fileID: 4300000, guid: c61872173bf5220469786c549644854f, type: 3} + - target: {fileID: 2230369837149406147, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_Name + value: ChessPieceRook + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4954453973512217138, guid: 2171c4445fb8a384c964f7a4cfe4bd75, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 2171c4445fb8a384c964f7a4cfe4bd75, type: 3} diff --git a/Examples/Assets/2-Chess/Prefabs/ChessPieceRook.prefab.meta b/Examples/Assets/2-Chess/Prefabs/ChessPieceRook.prefab.meta new file mode 100644 index 0000000..e1314bf --- /dev/null +++ b/Examples/Assets/2-Chess/Prefabs/ChessPieceRook.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0b18bbbd40b5c414c8dae0da35082cc2 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Examples/Assets/2-Chess/Scripts/Chess.asmdef b/Examples/Assets/2-Chess/Scripts/Chess.asmdef index 0a7db36..806fb9d 100644 --- a/Examples/Assets/2-Chess/Scripts/Chess.asmdef +++ b/Examples/Assets/2-Chess/Scripts/Chess.asmdef @@ -2,7 +2,10 @@ "name": "Chess", "rootNamespace": "PlayduxExamples.Chess", "references": [ - "GUID:1b0ba1c813752254a9500a93c914f473" + "GUID:1b0ba1c813752254a9500a93c914f473", + "GUID:560b04d1a97f54a4e82edc0cbbb69285", + "GUID:f51ebe6a0ceec4240a699833d6309b23", + "GUID:029c1c1b674aaae47a6841a0b89ad80e" ], "includePlatforms": [], "excludePlatforms": [], diff --git a/Examples/Assets/2-Chess/Scripts/ChessPieceInstance.meta b/Examples/Assets/2-Chess/Scripts/ChessPieceInstance.meta new file mode 100644 index 0000000..4bc5b0f --- /dev/null +++ b/Examples/Assets/2-Chess/Scripts/ChessPieceInstance.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 1d15bb6abe88494aa6e790d79b46b949 +timeCreated: 1619029615 \ No newline at end of file diff --git a/Examples/Assets/2-Chess/Scripts/ChessPieceInstance/ChessPieceAnimator.cs b/Examples/Assets/2-Chess/Scripts/ChessPieceInstance/ChessPieceAnimator.cs new file mode 100644 index 0000000..c7d2827 --- /dev/null +++ b/Examples/Assets/2-Chess/Scripts/ChessPieceInstance/ChessPieceAnimator.cs @@ -0,0 +1,72 @@ +#nullable enable +using System; +using System.Threading; +using Cysharp.Threading.Tasks; +using DG.Tweening; +using Playdux.src.Store; +using PlayduxExamples.Chess.Scripts.Common; +using PlayduxExamples.Chess.Scripts.State; +using PlayduxExamples.Chess.Scripts.State.Actions; +using UnityEngine; + +namespace PlayduxExamples.Chess.Scripts.ChessPieceInstance +{ + public class ChessPieceAnimator : MonoBehaviour, ISideEffector + { + [SerializeField] private float AnimationSpeed = 1; + [SerializeField] private Ease Ease; + + private int? index; + + private Transform? cachedTransform; + private CancellationToken ct; + + private void Awake() + { + cachedTransform = transform; + ct = this.GetCancellationTokenOnDestroy(); + } + + public void Initialize(int pieceIndex) { index = pieceIndex; } + + // ISideEffector implementation + public int Priority => 0; + + public bool PreEffect(DispatchedAction dispatchedAction, IStore store) + { + if ( + dispatchedAction.IsCanceled + || dispatchedAction.Action is not MovePieceAction action + || action.Index != index + || !action.Animate + ) { return true; } + + UniTask.Run(() => AnimateTo(action, store), cancellationToken: ct); + + return false; + } + + private async void AnimateTo(MovePieceAction action, IActionDispatcher dispatcher) + { + if (cachedTransform is null) throw new InvalidOperationException($"Unable to animate when {cachedTransform} is null"); + + await UniTask.SwitchToMainThread(); + + var src = cachedTransform.position; + var dest = action.NewLocation.ToVector3(); + var deltaX = dest.x - src.x; + var deltaZ = dest.z - src.z; + var totalDist = deltaX + deltaZ; + + await cachedTransform.DOPath(new[] + { + new Vector3(src.x + deltaX, 0, src.z), + new Vector3(src.x + deltaX, 0, src.z + deltaZ) + }, AnimationSpeed).SetEase(Ease); + + dispatcher.Dispatch(action with { Animate = false }); + } + + public void PostEffect(DispatchedAction dispatchedAction, IStore store) { } + } +} \ No newline at end of file diff --git a/Examples/Assets/2-Chess/Scripts/ChessPieceInstance/ChessPieceAnimator.cs.meta b/Examples/Assets/2-Chess/Scripts/ChessPieceInstance/ChessPieceAnimator.cs.meta new file mode 100644 index 0000000..68ed1c0 --- /dev/null +++ b/Examples/Assets/2-Chess/Scripts/ChessPieceInstance/ChessPieceAnimator.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: dea8c34343a646e78bcf4f8a8b49fec0 +timeCreated: 1619030023 \ No newline at end of file diff --git a/Examples/Assets/2-Chess/Scripts/ChessPieceInstance/ChessPieceInstanceCollection.cs b/Examples/Assets/2-Chess/Scripts/ChessPieceInstance/ChessPieceInstanceCollection.cs new file mode 100644 index 0000000..2fcafff --- /dev/null +++ b/Examples/Assets/2-Chess/Scripts/ChessPieceInstance/ChessPieceInstanceCollection.cs @@ -0,0 +1,122 @@ +#nullable enable +using System; +using System.Collections.Generic; +using Cysharp.Threading.Tasks; +using Playdux.src.Store; +using PlayduxExamples.Chess.Scripts.Common; +using PlayduxExamples.Chess.Scripts.State; +using PlayduxExamples.Chess.Scripts.State.Selectors; +using UnityEngine; + +namespace PlayduxExamples.Chess.Scripts.ChessPieceInstance +{ + public class ChessPieceInstanceCollection : MonoBehaviour, ISideEffector + { + [Header("Material Config")] + [SerializeField] private Material? baseMaterial; + [SerializeField] private Color whiteColor; + [SerializeField] private Color blackColor; + + [Header("Piece Prefabs")] + [SerializeField] private GameObject? pawnPrefab; + [SerializeField] private GameObject? bishopPrefab; + [SerializeField] private GameObject? knightPrefab; + [SerializeField] private GameObject? rookPrefab; + [SerializeField] private GameObject? queenPrefab; + [SerializeField] private GameObject? kingPrefab; + + public int Priority => 0; + + private Material? whiteMaterial; + private Material? blackMaterial; + + private readonly List existingInstanceObjects = new(); + + private void Awake() + { + whiteMaterial = new Material(baseMaterial!) { color = whiteColor }; + blackMaterial = new Material(baseMaterial!) { color = blackColor }; + } + + public bool PreEffect(DispatchedAction dispatchedAction, IStore store) => true; + + public void PostEffect(DispatchedAction dispatchedAction, IStore store) + { + if (dispatchedAction.Action is not InitializeAction) return; + + UniTask.Run(() => SpawnPieces(store)); + } + + private async UniTask SpawnPieces(IStore store) + { + // Ensure Awake has been called prior to spawning pieces + if (whiteMaterial is null || blackMaterial is null) await UniTask.WaitUntil(() => whiteMaterial is not null && blackMaterial is not null); + + ClearExistingObjects(); + + var pieces = store.Select(state => state.Pieces); + + for (var i = 0; i < pieces.Length; i++) + { + var ((team, piece), loc, _) = pieces[i]; + + // Spawn piece instance + var prefab = PrefabFromPiece(piece); + var instanceObject = Instantiate(prefab, loc.ToVector3(), Quaternion.identity); + if (instanceObject is null) throw new InvalidOperationException("Instance of piece not properly created"); + + // Set piece orientation (black faces "down", white faces "up") + if (team is ChessTeam.White) instanceObject.transform.Rotate(Vector3.up, 180f); + + // Apply material + instanceObject.GetComponentInChildren().material = team switch + { + ChessTeam.Black => blackMaterial!, + ChessTeam.White => whiteMaterial!, + _ => throw new ArgumentOutOfRangeException(nameof(team), team, null) + }; + + // Initialize instance state listener + var stateListener = instanceObject.GetComponent(); + if (stateListener is null) throw new InvalidOperationException($"Created instance did not have a component of type {nameof(ChessPieceStateListener)}"); + + stateListener.Initialize(store.ObservableFor(SelectorGenerator.ForPiece(i))); + + // Initialize instance animator + var animator = instanceObject.GetComponent(); + if (animator is null) throw new InvalidOperationException($"Created instance did not have a component of type {nameof(ChessPieceAnimator)}"); + + animator.Initialize(i); + + store.RegisterSideEffector(animator); + + // Store piece instance + existingInstanceObjects.Add(instanceObject); + } + } + + private void ClearExistingObjects() + { + foreach (var existing in existingInstanceObjects) { Destroy(existing); } + + existingInstanceObjects.Clear(); + } + + private void OnDestroy() + { + Destroy(whiteMaterial); + Destroy(blackMaterial); + } + + private GameObject PrefabFromPiece(ChessPiece piece) => piece switch + { + ChessPiece.Pawn => pawnPrefab!, + ChessPiece.Bishop => bishopPrefab!, + ChessPiece.Knight => knightPrefab!, + ChessPiece.Rook => rookPrefab!, + ChessPiece.Queen => queenPrefab!, + ChessPiece.King => kingPrefab!, + _ => throw new ArgumentOutOfRangeException(nameof(piece), piece, null) + }; + } +} \ No newline at end of file diff --git a/Examples/Assets/2-Chess/Scripts/ChessPieceInstance/ChessPieceInstanceCollection.cs.meta b/Examples/Assets/2-Chess/Scripts/ChessPieceInstance/ChessPieceInstanceCollection.cs.meta new file mode 100644 index 0000000..90d976f --- /dev/null +++ b/Examples/Assets/2-Chess/Scripts/ChessPieceInstance/ChessPieceInstanceCollection.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 5eef96e5ff14464db4ce41c12e55a69a +timeCreated: 1619012496 \ No newline at end of file diff --git a/Examples/Assets/2-Chess/Scripts/ChessPieceInstance/ChessPieceStateListener.cs b/Examples/Assets/2-Chess/Scripts/ChessPieceInstance/ChessPieceStateListener.cs new file mode 100644 index 0000000..f4323b2 --- /dev/null +++ b/Examples/Assets/2-Chess/Scripts/ChessPieceInstance/ChessPieceStateListener.cs @@ -0,0 +1,18 @@ +#nullable enable +using System; +using PlayduxExamples.Chess.Scripts.Common; +using UniRx; +using UnityEngine; + +namespace PlayduxExamples.Chess.Scripts.ChessPieceInstance +{ + /// Listens to a stream of a chess piece's state and updates the owning game object's position to match. + public class ChessPieceStateListener : MonoBehaviour + { + public void Initialize(IObservable stateStream) => + stateStream.Subscribe( + onNext: state => transform.position = state.Location.ToVector3(), + Debug.LogException + ); + } +} diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleAudio.cs.meta b/Examples/Assets/2-Chess/Scripts/ChessPieceInstance/ChessPieceStateListener.cs.meta similarity index 57% rename from Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleAudio.cs.meta rename to Examples/Assets/2-Chess/Scripts/ChessPieceInstance/ChessPieceStateListener.cs.meta index 50aa010..356fb4e 100644 --- a/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleAudio.cs.meta +++ b/Examples/Assets/2-Chess/Scripts/ChessPieceInstance/ChessPieceStateListener.cs.meta @@ -1,8 +1,11 @@ fileFormatVersion: 2 -guid: b766d08851589514b97afb23c6f30a70 +guid: 9b48b005af2d31e44a524862a63bf877 MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: + assetBundleName: + assetBundleVariant: diff --git a/Examples/Assets/2-Chess/Scripts/Common/ChessLocation.cs b/Examples/Assets/2-Chess/Scripts/Common/ChessLocation.cs index 214d687..7e90cc0 100644 --- a/Examples/Assets/2-Chess/Scripts/Common/ChessLocation.cs +++ b/Examples/Assets/2-Chess/Scripts/Common/ChessLocation.cs @@ -1,5 +1,6 @@ #nullable enable using System; +using UnityEngine; namespace PlayduxExamples.Chess.Scripts.Common { @@ -11,4 +12,14 @@ public record ChessLocation(Rank Rank, File File) public enum Rank { One, Two, Three, Four, Five, Six, Seven, Eight } public enum File { A, B, C, D, E, F, G, H } + + public static class RankAndFileExtensions + { + public static int ToXPos(this File file) => (int)file; + public static int ToZPos(this Rank rank) => (int)rank; + + public static Vector3 ToVector3(this ChessLocation loc) => new(loc.File.ToXPos(), 0, loc.Rank.ToZPos()); + + public static ChessLocation ChessLocationFromXZ(this ValueTuple loc) => new((Rank)loc.Item1, (File)loc.Item2); + } } \ No newline at end of file diff --git a/Examples/Assets/2-Chess/Scripts/RandomPieceMover.cs b/Examples/Assets/2-Chess/Scripts/RandomPieceMover.cs new file mode 100644 index 0000000..b293c1a --- /dev/null +++ b/Examples/Assets/2-Chess/Scripts/RandomPieceMover.cs @@ -0,0 +1,26 @@ +#nullable enable +using System; +using PlayduxExamples.Chess.Scripts.Common; +using PlayduxExamples.Chess.Scripts.State; +using PlayduxExamples.Chess.Scripts.State.Actions; +using UnityEngine; +using Random = UnityEngine.Random; + +namespace PlayduxExamples.Chess.Scripts +{ + public class RandomPieceMover : MonoBehaviour + { + [SerializeField] private ChessStore? store; + + private void Update() + { + if (!Input.GetKeyDown(KeyCode.Space)) return; + + var pieceIndex = Random.Range(0, store!.State.Pieces.Length - 1); + var newX = Random.Range(0, Enum.GetValues(typeof(File)).Length - 1); + var newZ = Random.Range(0, Enum.GetValues(typeof(Rank)).Length - 1); + + store.Dispatch(new MovePieceAction(pieceIndex, (newX, newZ).ChessLocationFromXZ())); + } + } +} \ No newline at end of file diff --git a/Examples/Assets/2-Chess/Scripts/RandomPieceMover.cs.meta b/Examples/Assets/2-Chess/Scripts/RandomPieceMover.cs.meta new file mode 100644 index 0000000..c6bed32 --- /dev/null +++ b/Examples/Assets/2-Chess/Scripts/RandomPieceMover.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 93b4c6956f914255af4b113d48ac3282 +timeCreated: 1619023636 \ No newline at end of file diff --git a/Examples/Assets/2-Chess/Scripts/State/Actions.meta b/Examples/Assets/2-Chess/Scripts/State/Actions.meta new file mode 100644 index 0000000..4856f76 --- /dev/null +++ b/Examples/Assets/2-Chess/Scripts/State/Actions.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 137358630b2545e59aa52f3a25bdc70d +timeCreated: 1619023092 \ No newline at end of file diff --git a/Examples/Assets/2-Chess/Scripts/State/Actions/Actions.cs b/Examples/Assets/2-Chess/Scripts/State/Actions/Actions.cs new file mode 100644 index 0000000..c8be995 --- /dev/null +++ b/Examples/Assets/2-Chess/Scripts/State/Actions/Actions.cs @@ -0,0 +1,8 @@ +#nullable enable +using Playdux.src.Store; +using PlayduxExamples.Chess.Scripts.Common; + +namespace PlayduxExamples.Chess.Scripts.State.Actions +{ + public record MovePieceAction(int Index, ChessLocation NewLocation, bool Animate = true) : IAction; +} \ No newline at end of file diff --git a/Examples/Assets/2-Chess/Scripts/State/Actions/Actions.cs.meta b/Examples/Assets/2-Chess/Scripts/State/Actions/Actions.cs.meta new file mode 100644 index 0000000..e0ea2b5 --- /dev/null +++ b/Examples/Assets/2-Chess/Scripts/State/Actions/Actions.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: d6cc3dccb9c34f7190a03fb41104d43e +timeCreated: 1619023097 \ No newline at end of file diff --git a/Examples/Assets/2-Chess/Scripts/State/ChessStore.cs b/Examples/Assets/2-Chess/Scripts/State/ChessStore.cs index d5a2290..c0e7a49 100644 --- a/Examples/Assets/2-Chess/Scripts/State/ChessStore.cs +++ b/Examples/Assets/2-Chess/Scripts/State/ChessStore.cs @@ -1,21 +1,24 @@ #nullable enable using Playdux.src.Store; +using PlayduxExamples.Chess.Scripts.ChessPieceInstance; +using PlayduxExamples.Chess.Scripts.State.Actions; +using PlayduxExamples.Chess.Scripts.State.Reducers; using UnityEngine; namespace PlayduxExamples.Chess.Scripts.State { public class ChessStore : StoreBehaviour { - protected override Store InitializeStore() - { - return new(ChessState.InitialState, RootReducer); - } + [SerializeField] private ChessPieceInstanceCollection? spawner; + + protected override Store InitializeStore() => new(ChessState.InitialState, RootReducer, new[] { spawner! }); private static ChessState RootReducer(ChessState state, IAction action) { Debug.Log($"Action dispatched:\n\t{action}"); return action switch { + MovePieceAction a => state with { Pieces = MovePieceReducer.Reduce(state.Pieces, a) }, _ => state }; } diff --git a/Examples/Assets/2-Chess/Scripts/State/Reducers.meta b/Examples/Assets/2-Chess/Scripts/State/Reducers.meta new file mode 100644 index 0000000..3c263d9 --- /dev/null +++ b/Examples/Assets/2-Chess/Scripts/State/Reducers.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 0cd7c00858db49b8921c2da41680b6f5 +timeCreated: 1619023191 \ No newline at end of file diff --git a/Examples/Assets/2-Chess/Scripts/State/Reducers/MovePieceReducer.cs b/Examples/Assets/2-Chess/Scripts/State/Reducers/MovePieceReducer.cs new file mode 100644 index 0000000..09d1f31 --- /dev/null +++ b/Examples/Assets/2-Chess/Scripts/State/Reducers/MovePieceReducer.cs @@ -0,0 +1,11 @@ +using PlayduxExamples.Chess.Scripts.Common; +using PlayduxExamples.Chess.Scripts.State.Actions; + +namespace PlayduxExamples.Chess.Scripts.State.Reducers +{ + public static class MovePieceReducer + { + public static ChessPieceState[] Reduce(ChessPieceState[] pieces, MovePieceAction action) => + PiecesReducerUtils.SetChessPieceState(pieces, action.Index, pieces[action.Index] with { Location = action.NewLocation }); + } +} \ No newline at end of file diff --git a/Examples/Assets/2-Chess/Scripts/State/Reducers/MovePieceReducer.cs.meta b/Examples/Assets/2-Chess/Scripts/State/Reducers/MovePieceReducer.cs.meta new file mode 100644 index 0000000..0a99c29 --- /dev/null +++ b/Examples/Assets/2-Chess/Scripts/State/Reducers/MovePieceReducer.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: d32696da3777466bb51141007362431e +timeCreated: 1619023201 \ No newline at end of file diff --git a/Examples/Assets/2-Chess/Scripts/State/Reducers/PiecesReducerUtils.cs b/Examples/Assets/2-Chess/Scripts/State/Reducers/PiecesReducerUtils.cs new file mode 100644 index 0000000..85e3695 --- /dev/null +++ b/Examples/Assets/2-Chess/Scripts/State/Reducers/PiecesReducerUtils.cs @@ -0,0 +1,19 @@ +using System; +using PlayduxExamples.Chess.Scripts.Common; + +namespace PlayduxExamples.Chess.Scripts.State.Reducers +{ + public static class PiecesReducerUtils + { + public static ChessPieceState[] SetChessPieceState(ChessPieceState[] pieces, int index, ChessPieceState newState) + { + var newPieces = new ChessPieceState[pieces.Length]; + + Array.Copy(pieces, 0, newPieces, 0, index); + newPieces[index] = newState; + Array.Copy(pieces, index + 1, newPieces, index + 1, pieces.Length - (index + 1)); + + return newPieces; + } + } +} \ No newline at end of file diff --git a/Examples/Assets/2-Chess/Scripts/State/Reducers/PiecesReducerUtils.cs.meta b/Examples/Assets/2-Chess/Scripts/State/Reducers/PiecesReducerUtils.cs.meta new file mode 100644 index 0000000..7d67c27 --- /dev/null +++ b/Examples/Assets/2-Chess/Scripts/State/Reducers/PiecesReducerUtils.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 7e0af35e702e4643accba45f31ef6872 +timeCreated: 1619023294 \ No newline at end of file diff --git a/Examples/Assets/2-Chess/Scripts/State/Selectors.meta b/Examples/Assets/2-Chess/Scripts/State/Selectors.meta new file mode 100644 index 0000000..89fa66b --- /dev/null +++ b/Examples/Assets/2-Chess/Scripts/State/Selectors.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: ff9ecc4ee9604473950b577a73be44a5 +timeCreated: 1619019675 \ No newline at end of file diff --git a/Examples/Assets/2-Chess/Scripts/State/Selectors/Selectors.cs b/Examples/Assets/2-Chess/Scripts/State/Selectors/Selectors.cs new file mode 100644 index 0000000..7e99114 --- /dev/null +++ b/Examples/Assets/2-Chess/Scripts/State/Selectors/Selectors.cs @@ -0,0 +1,14 @@ +#nullable enable +using System; +using PlayduxExamples.Chess.Scripts.Common; + +namespace PlayduxExamples.Chess.Scripts.State.Selectors +{ + public static class Selector { } + + public static class SelectorGenerator + { + public static Func ForPiece(int index) => + state => state.Pieces[index]; + } +} \ No newline at end of file diff --git a/Examples/Assets/2-Chess/Scripts/State/Selectors/Selectors.cs.meta b/Examples/Assets/2-Chess/Scripts/State/Selectors/Selectors.cs.meta new file mode 100644 index 0000000..df465f7 --- /dev/null +++ b/Examples/Assets/2-Chess/Scripts/State/Selectors/Selectors.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 9e5a5fa641624ee29c4fa2d7d85b2b23 +timeCreated: 1619019681 \ No newline at end of file diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/DOTween.XML b/Examples/Assets/Plugins/Demigiant/DOTween/DOTween.XML deleted file mode 100644 index 11e9215..0000000 --- a/Examples/Assets/Plugins/Demigiant/DOTween/DOTween.XML +++ /dev/null @@ -1,2769 +0,0 @@ - - - - DOTween - - - - - Types of autoPlay behaviours - - - - No tween is automatically played - - - Only Sequences are automatically played - - - Only Tweeners are automatically played - - - All tweens are automatically played - - - - What axis to constrain in case of Vector tweens - - - - Called the first time the tween is set in a playing state, after any eventual delay - - - - Used in place of System.Func, which is not available in mscorlib. - - - - - Used in place of System.Action. - - - - - Public so it can be used by lose scripts related to DOTween (like DOTweenAnimation) - - - - - Used to separate DOTween class from the MonoBehaviour instance (in order to use static constructors on DOTween). - Contains all instance-based methods - - - - Used internally inside Unity Editor, as a trick to update DOTween's inspector at every frame - - - - Directly sets the current max capacity of Tweeners and Sequences - (meaning how many Tweeners and Sequences can be running at the same time), - so that DOTween doesn't need to automatically increase them in case the max is reached - (which might lead to hiccups when that happens). - Sequences capacity must be less or equal to Tweeners capacity - (if you pass a low Tweener capacity it will be automatically increased to match the Sequence's). - Beware: use this method only when there are no tweens running. - - Max Tweeners capacity. - Default: 200 - Max Sequences capacity. - Default: 50 - - - - This class contains a C# port of the easing equations created by Robert Penner (http://robertpenner.com/easing). - - - - - Easing equation function for a bounce (exponentially decaying parabolic bounce) easing in: accelerating from zero velocity. - - - Current time (in frames or seconds). - - - Expected easing duration (in frames or seconds). - - Unused: here to keep same delegate for all ease types. - Unused: here to keep same delegate for all ease types. - - The eased value. - - - - - Easing equation function for a bounce (exponentially decaying parabolic bounce) easing out: decelerating from zero velocity. - - - Current time (in frames or seconds). - - - Expected easing duration (in frames or seconds). - - Unused: here to keep same delegate for all ease types. - Unused: here to keep same delegate for all ease types. - - The eased value. - - - - - Easing equation function for a bounce (exponentially decaying parabolic bounce) easing in/out: acceleration until halfway, then deceleration. - - - Current time (in frames or seconds). - - - Expected easing duration (in frames or seconds). - - Unused: here to keep same delegate for all ease types. - Unused: here to keep same delegate for all ease types. - - The eased value. - - - - - Returns a value between 0 and 1 (inclusive) based on the elapsed time and ease selected - - - - - Returns a value between 0 and 1 (inclusive) based on the elapsed time and ease selected - - - - - Used to interpret AnimationCurves as eases. - Public so it can be used by external ease factories - - - - - Behaviour in case a tween nested inside a Sequence fails - - - - If the Sequence contains other elements, kill the failed tween but preserve the rest - - - Kill the whole Sequence - - - - Additional notices passed to plugins when updating. - Public so it can be used by custom plugins. Internally, only PathPlugin uses it - - - - - None - - - - - Lets the plugin know that we restarted or rewinded - - - - - OnRewind callback behaviour (can only be set via DOTween's Utility Panel) - - - - - When calling Rewind or PlayBackwards/SmoothRewind, OnRewind callbacks will be fired only if the tween isn't already rewinded - - - - - When calling Rewind, OnRewind callbacks will always be fired, even if the tween is already rewinded. - When calling PlayBackwards/SmoothRewind instead, OnRewind callbacks will be fired only if the tween isn't already rewinded - - - - - When calling Rewind or PlayBackwards/SmoothRewind, OnRewind callbacks will always be fired, even if the tween is already rewinded - - - - - Public only so custom shortcuts can access some of these methods - - - - - INTERNAL: used by DO shortcuts and Modules to set special startup mode - - - - - INTERNAL: used by DO shortcuts and Modules to set the tween as blendable - - - - - INTERNAL: used by DO shortcuts and Modules to prevent a tween from using a From setup even if passed - - - - - Used to dispatch commands that need to be captured externally, usually by Modules - - - - - Returns a Vector3 with z = 0 - - - - - Returns the 2D angle between two vectors - - - - - Uses approximate equality on each axis instead of Unity's Vector3 equality, - because the latter fails (in some cases) when assigning a Vector3 to a transform.position and then checking it. - - - - - Looks for the type within all possible project assembly names - - - - NO-GC METHOD: changes the start value of a tween and rewinds it (without pausing it). - Has no effect with tweens that are inside Sequences - The new start value - If bigger than 0 applies it as the new tween duration - - - NO-GC METHOD: changes the end value of a tween and rewinds it (without pausing it). - Has no effect with tweens that are inside Sequences - The new end value - If TRUE the start value will become the current target's value, otherwise it will stay the same - - - NO-GC METHOD: changes the end value of a tween and rewinds it (without pausing it). - Has no effect with tweens that are inside Sequences - The new end value - If bigger than 0 applies it as the new tween duration - If TRUE the start value will become the current target's value, otherwise it will stay the same - - - NO-GC METHOD: changes the start and end value of a tween and rewinds it (without pausing it). - Has no effect with tweens that are inside Sequences - The new start value - The new end value - If bigger than 0 applies it as the new tween duration - - - - Struct that stores two colors (used for LineRenderer tweens) - - - - - Used for tween callbacks - - - - - Used for tween callbacks - - - - - Used for custom and animationCurve-based ease functions. Must return a value between 0 and 1. - - - - - Straight Quaternion plugin. Instead of using Vector3 values accepts Quaternion values directly. - Beware: doesn't work with LoopType.Incremental (neither directly nor if inside a LoopType.Incremental Sequence). - To use it, call DOTween.To with the plugin parameter overload, passing it PureQuaternionPlugin.Plug() as first parameter - (do not use any of the other public PureQuaternionPlugin methods): - DOTween.To(PureQuaternionPlugin.Plug(), ()=> myQuaternionProperty, x=> myQuaternionProperty = x, myQuaternionEndValue, duration); - - - - - Plug this plugin inside a DOTween.To call. - Example: - DOTween.To(PureQuaternionPlugin.Plug(), ()=> myQuaternionProperty, x=> myQuaternionProperty = x, myQuaternionEndValue, duration); - - - - INTERNAL: do not use - - - INTERNAL: do not use - - - INTERNAL: do not use - - - INTERNAL: do not use - - - INTERNAL: do not use - - - INTERNAL: do not use - - - INTERNAL: do not use - - - INTERNAL: do not use - - - - Main DOTween class. Contains static methods to create and control tweens in a generic way - - - - DOTween's version - - - If TRUE (default) makes tweens slightly slower but safer, automatically taking care of a series of things - (like targets becoming null while a tween is playing). - Default: TRUE - - - Behaviour in case a tween nested inside a Sequence fails (caught by safe mode). - Default: NestedTweenFailureBehaviour.TryToPreserveSequence - - - If TRUE you will get a DOTween report when exiting play mode (only in the Editor). - Useful to know how many max Tweeners and Sequences you reached and optimize your final project accordingly. - Beware, this will slightly slow down your tweens while inside Unity Editor. - Default: FALSE - - - Global DOTween timeScale. - Default: 1 - - - If TRUE, DOTween will use Time.smoothDeltaTime instead of Time.deltaTime for UpdateType.Normal and UpdateType.Late tweens - (unless they're set as timeScaleIndependent, in which case a value between the last timestep - and will be used instead). - Setting this to TRUE will lead to smoother animations. - Default: FALSE - - - If is TRUE, this indicates the max timeStep that an independent update call can last. - Setting this to TRUE will lead to smoother animations. - Default: FALSE - - - DOTween's log behaviour. - Default: LogBehaviour.ErrorsOnly - - - Used to intercept DOTween's logs. If this method isn't NULL, DOTween will call it before writing a log via Unity's own Debug log methods. - Return TRUE if you want DOTween to proceed with the log, FALSE otherwise. - This method must return a bool and accept two parameters: - - LogType: the type of Unity log that DOTween is trying to log - - object: the log message that DOTween wants to log - - - If TRUE draws path gizmos in Unity Editor (if the gizmos button is active). - Deactivate this if you want to avoid gizmos overhead while in Unity Editor - - - If TRUE activates various debug options - - - Stores the target id so it can be used to give more info in case of safeMode error capturing. - Only active if both debugMode and useSafeMode are TRUE - - - Default updateType for new tweens. - Default: UpdateType.Normal - - - Sets whether Unity's timeScale should be taken into account by default or not. - Default: false - - - Default autoPlay behaviour for new tweens. - Default: AutoPlay.All - - - Default autoKillOnComplete behaviour for new tweens. - Default: TRUE - - - Default loopType applied to all new tweens. - Default: LoopType.Restart - - - If TRUE all newly created tweens are set as recyclable, otherwise not. - Default: FALSE - - - Default ease applied to all new Tweeners (not to Sequences which always have Ease.Linear as default). - Default: Ease.InOutQuad - - - Default overshoot/amplitude used for eases - Default: 1.70158f - - - Default period used for eases - Default: 0 - - - Used internally. Assigned/removed by DOTweenComponent.Create/DestroyInstance - - - - Must be called once, before the first ever DOTween call/reference, - otherwise it will be called automatically and will use default options. - Calling it a second time won't have any effect. - You can chain SetCapacity to this method, to directly set the max starting size of Tweeners and Sequences: - DOTween.Init(false, false, LogBehaviour.Default).SetCapacity(100, 20); - - If TRUE all new tweens will be set for recycling, meaning that when killed, - instead of being destroyed, they will be put in a pool and reused instead of creating new tweens. This option allows you to avoid - GC allocations by reusing tweens, but you will have to take care of tween references, since they might result active - even if they were killed (since they might have been respawned and are now being used for other tweens). - If you want to automatically set your tween references to NULL when a tween is killed - you can use the OnKill callback like this: - .OnKill(()=> myTweenReference = null) - You can change this setting at any time by changing the static property, - or you can set the recycling behaviour for each tween separately, using: - SetRecyclable(bool recyclable) - Default: FALSE - If TRUE makes tweens slightly slower but safer, automatically taking care of a series of things - (like targets becoming null while a tween is playing). - You can change this setting at any time by changing the static property. - Default: FALSE - Type of logging to use. - You can change this setting at any time by changing the static property. - Default: ErrorsOnly - - - - Directly sets the current max capacity of Tweeners and Sequences - (meaning how many Tweeners and Sequences can be running at the same time), - so that DOTween doesn't need to automatically increase them in case the max is reached - (which might lead to hiccups when that happens). - Sequences capacity must be less or equal to Tweeners capacity - (if you pass a low Tweener capacity it will be automatically increased to match the Sequence's). - Beware: use this method only when there are no tweens running. - - Max Tweeners capacity. - Default: 200 - Max Sequences capacity. - Default: 50 - - - - Kills all tweens, clears all cached tween pools and plugins and resets the max Tweeners/Sequences capacities to the default values. - - If TRUE also destroys DOTween's gameObject and resets its initializiation, default settings and everything else - (so that next time you use it it will need to be re-initialized) - - - - Clears all cached tween pools. - - - - - Checks all active tweens to find and remove eventually invalid ones (usually because their targets became NULL) - and returns the total number of invalid tweens found and removed. - IMPORTANT: this will cause an error on UWP platform, so don't use it there - BEWARE: this is a slightly expensive operation so use it with care - - - - - Updates all tweens that are set to . - - Manual deltaTime - Unscaled delta time (used with tweens set as timeScaleIndependent) - - - Tweens a property or field to the given value using default plugins - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The end value to reachThe tween's duration - - - Tweens a property or field to the given value using default plugins - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The end value to reachThe tween's duration - - - Tweens a property or field to the given value using default plugins - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The end value to reachThe tween's duration - - - Tweens a property or field to the given value using default plugins - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The end value to reachThe tween's duration - - - Tweens a property or field to the given value using default plugins - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The end value to reachThe tween's duration - - - Tweens a property or field to the given value using default plugins - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The end value to reachThe tween's duration - - - Tweens a property or field to the given value using default plugins - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The end value to reachThe tween's duration - - - Tweens a property or field to the given value using default plugins - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The end value to reachThe tween's duration - - - Tweens a property or field to the given value using default plugins - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The end value to reachThe tween's duration - - - Tweens a property or field to the given value using default plugins - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The end value to reachThe tween's duration - - - Tweens a property or field to the given value using default plugins - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The end value to reachThe tween's duration - - - Tweens a property or field to the given value using default plugins - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The end value to reachThe tween's duration - - - Tweens a property or field to the given value using default plugins - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The end value to reachThe tween's duration - - - Tweens a property or field to the given value using default plugins - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The end value to reachThe tween's duration - - - Tweens a property or field to the given value using a custom plugin - The plugin to use. Each custom plugin implements a static Get() method - you'll need to call to assign the correct plugin in the correct way, like this: - CustomPlugin.Get() - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The end value to reachThe tween's duration - - - Tweens only one axis of a Vector3 to the given value using default plugins. - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The end value to reachThe tween's duration - The axis to tween - - - Tweens only the alpha of a Color to the given value using default plugins - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The end value to reachThe tween's duration - - - Tweens a virtual property from the given start to the given end value - and implements a setter that allows to use that value with an external method or a lambda - Example: - To(MyMethod, 0, 12, 0.5f); - Where MyMethod is a function that accepts a float parameter (which will be the result of the virtual tween) - The action to perform with the tweened value - The value to start from - The end value to reach - The duration of the virtual tween - - - - Punches a Vector3 towards the given direction and then back to the starting one - as if it was connected to the starting position via an elastic. - This tween type generates some GC allocations at startup - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The direction and strength of the punch - The duration of the tween - Indicates how much will the punch vibrate - Represents how much (0 to 1) the vector will go beyond the starting position when bouncing backwards. - 1 creates a full oscillation between the direction and the opposite decaying direction, - while 0 oscillates only between the starting position and the decaying direction - - - Shakes a Vector3 with the given values. - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The duration of the tween - The shake strength - Indicates how much will the shake vibrate - Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). - Setting it to 0 will shake along a single direction and behave like a random punch. - If TRUE only shakes on the X Y axis (looks better with things like cameras). - If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not - - - Shakes a Vector3 with the given values. - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The duration of the tween - The shake strength on each axis - Indicates how much will the shake vibrate - Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). - Setting it to 0 will shake along a single direction and behave like a random punch. - If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not - - - Tweens a property or field to the given values using default plugins. - Ease is applied between each segment and not as a whole. - This tween type generates some GC allocations at startup - A getter for the field or property to tween. - Example usage with lambda:()=> myProperty - A setter for the field or property to tween - Example usage with lambda:x=> myProperty = x - The end values to reach for each segment. This array must have the same length as durations - The duration of each segment. This array must have the same length as endValues - - - - Returns a new to be used for tween groups - - - - Completes all tweens and returns the number of actual tweens completed - (meaning tweens that don't have infinite loops and were not already complete) - For Sequences only: if TRUE also internal Sequence callbacks will be fired, - otherwise they will be ignored - - - Completes all tweens with the given ID or target and returns the number of actual tweens completed - (meaning the tweens that don't have infinite loops and were not already complete) - For Sequences only: if TRUE internal Sequence callbacks will be fired, - otherwise they will be ignored - - - Flips all tweens (changing their direction to forward if it was backwards and viceversa), - then returns the number of actual tweens flipped - - - Flips the tweens with the given ID or target (changing their direction to forward if it was backwards and viceversa), - then returns the number of actual tweens flipped - - - Sends all tweens to the given position (calculating also eventual loop cycles) and returns the actual tweens involved - - - Sends all tweens with the given ID or target to the given position (calculating also eventual loop cycles) - and returns the actual tweens involved - - - Kills all tweens and returns the number of actual tweens killed - If TRUE completes the tweens before killing them - - - Kills all tweens and returns the number of actual tweens killed - If TRUE completes the tweens before killing them - Eventual IDs or targets to exclude from the killing - - - Kills all tweens with the given ID or target and returns the number of actual tweens killed - If TRUE completes the tweens before killing them - - - Pauses all tweens and returns the number of actual tweens paused - - - Pauses all tweens with the given ID or target and returns the number of actual tweens paused - (meaning the tweens that were actually playing and have been paused) - - - Plays all tweens and returns the number of actual tweens played - (meaning tweens that were not already playing or complete) - - - Plays all tweens with the given ID or target and returns the number of actual tweens played - (meaning the tweens that were not already playing or complete) - - - Plays all tweens with the given target and the given ID, and returns the number of actual tweens played - (meaning the tweens that were not already playing or complete) - - - Plays backwards all tweens and returns the number of actual tweens played - (meaning tweens that were not already started, playing backwards or rewinded) - - - Plays backwards all tweens with the given ID or target and returns the number of actual tweens played - (meaning the tweens that were not already started, playing backwards or rewinded) - - - Plays backwards all tweens with the given target and ID and returns the number of actual tweens played - (meaning the tweens that were not already started, playing backwards or rewinded) - - - Plays forward all tweens and returns the number of actual tweens played - (meaning tweens that were not already playing forward or complete) - - - Plays forward all tweens with the given ID or target and returns the number of actual tweens played - (meaning the tweens that were not already playing forward or complete) - - - Plays forward all tweens with the given target and ID and returns the number of actual tweens played - (meaning the tweens that were not already started, playing backwards or rewinded) - - - Restarts all tweens, then returns the number of actual tweens restarted - - - Restarts all tweens with the given ID or target, then returns the number of actual tweens restarted - If TRUE includes the eventual tweens delays, otherwise skips them - If >= 0 changes the startup delay of all involved tweens to this value, otherwise doesn't touch it - - - Restarts all tweens with the given target and the given ID, and returns the number of actual tweens played - (meaning the tweens that were not already playing or complete) - If TRUE includes the eventual tweens delays, otherwise skips them - If >= 0 changes the startup delay of all involved tweens to this value, otherwise doesn't touch it - - - Rewinds and pauses all tweens, then returns the number of actual tweens rewinded - (meaning tweens that were not already rewinded) - - - Rewinds and pauses all tweens with the given ID or target, then returns the number of actual tweens rewinded - (meaning the tweens that were not already rewinded) - - - Smoothly rewinds all tweens (delays excluded), then returns the number of actual tweens rewinding/rewinded - (meaning tweens that were not already rewinded). - A "smooth rewind" animates the tween to its start position, - skipping all elapsed loops (except in case of LoopType.Incremental) while keeping the animation fluent. - Note that a tween that was smoothly rewinded will have its play direction flipped - - - Smoothly rewinds all tweens (delays excluded) with the given ID or target, then returns the number of actual tweens rewinding/rewinded - (meaning the tweens that were not already rewinded). - A "smooth rewind" animates the tween to its start position, - skipping all elapsed loops (except in case of LoopType.Incremental) while keeping the animation fluent. - Note that a tween that was smoothly rewinded will have its play direction flipped - - - Toggles the play state of all tweens and returns the number of actual tweens toggled - (meaning tweens that could be played or paused, depending on the toggle state) - - - Toggles the play state of all tweens with the given ID or target and returns the number of actual tweens toggled - (meaning the tweens that could be played or paused, depending on the toggle state) - - - - Returns TRUE if a tween with the given ID or target is active. - You can also use this to know if a shortcut tween is active for a given target. - Example: - transform.DOMoveX(45, 1); // transform is automatically added as the tween target - DOTween.IsTweening(transform); // Returns true - - The target or ID to look for - If FALSE (default) returns TRUE as long as a tween for the given target/ID is active, - otherwise also requires it to be playing - - - - Returns the total number of active and playing tweens. - A tween is considered as playing even if its delay is actually playing - - - - - Returns a list of all active tweens in a playing state. - Returns NULL if there are no active playing tweens. - Beware: each time you call this method a new list is generated, so use it for debug only - - If NULL creates a new list, otherwise clears and fills this one (and thus saves allocations) - - - - Returns a list of all active tweens in a paused state. - Returns NULL if there are no active paused tweens. - Beware: each time you call this method a new list is generated, so use it for debug only - - If NULL creates a new list, otherwise clears and fills this one (and thus saves allocations) - - - - Returns a list of all active tweens with the given id. - Returns NULL if there are no active tweens with the given id. - Beware: each time you call this method a new list is generated - - If TRUE returns only the tweens with the given ID that are currently playing - If NULL creates a new list, otherwise clears and fills this one (and thus saves allocations) - - - - Returns a list of all active tweens with the given target. - Returns NULL if there are no active tweens with the given target. - Beware: each time you call this method a new list is generated - If TRUE returns only the tweens with the given target that are currently playing - If NULL creates a new list, otherwise clears and fills this one (and thus saves allocations) - - - - - Creates virtual tweens that can be used to change other elements via their OnUpdate calls - - - - - Tweens a virtual float. - You can add regular settings to the generated tween, - but do not use SetUpdate or you will overwrite the onVirtualUpdate parameter - - The value to start from - The value to tween to - The duration of the tween - A callback which must accept a parameter of type float, called at each update - - - - Returns a value based on the given ease and lifetime percentage (0 to 1) - The value to start from when lifetimePercentage is 0 - The value to reach when lifetimePercentage is 1 - The time percentage (0 to 1) at which the value should be taken - The type of ease - - - Returns a value based on the given ease and lifetime percentage (0 to 1) - The value to start from when lifetimePercentage is 0 - The value to reach when lifetimePercentage is 1 - The time percentage (0 to 1) at which the value should be taken - The type of ease - Eventual overshoot to use with Back ease - - - Returns a value based on the given ease and lifetime percentage (0 to 1) - The value to start from when lifetimePercentage is 0 - The value to reach when lifetimePercentage is 1 - The time percentage (0 to 1) at which the value should be taken - The type of ease - Eventual amplitude to use with Elastic easeType - Eventual period to use with Elastic easeType - - - Returns a value based on the given ease and lifetime percentage (0 to 1) - The value to start from when lifetimePercentage is 0 - The value to reach when lifetimePercentage is 1 - The time percentage (0 to 1) at which the value should be taken - The AnimationCurve to use for ease - - - Fires the given callback after the given time. - Callback delay - Callback to fire when the delay has expired - If TRUE (default) ignores Unity's timeScale - - - - Don't assign this! It's assigned automatically when creating 0 duration tweens - - - - - Don't assign this! It's assigned automatically when setting the ease to an AnimationCurve or to a custom ease function - - - - - Allows to wrap ease method in special ways, adding extra features - - - - - Converts the given ease so that it also creates a stop-motion effect, by playing the tween at the given FPS - - FPS at which the tween should be played - Ease type - - - - Converts the given ease so that it also creates a stop-motion effect, by playing the tween at the given FPS - - FPS at which the tween should be played - AnimationCurve to use for the ease - - - - Converts the given ease so that it also creates a stop-motion effect, by playing the tween at the given FPS - - FPS at which the tween should be played - Custom ease function to use - - - - Used to allow method chaining with DOTween.Init - - - - - Directly sets the current max capacity of Tweeners and Sequences - (meaning how many Tweeners and Sequences can be running at the same time), - so that DOTween doesn't need to automatically increase them in case the max is reached - (which might lead to hiccups when that happens). - Sequences capacity must be less or equal to Tweeners capacity - (if you pass a low Tweener capacity it will be automatically increased to match the Sequence's). - Beware: use this method only when there are no tweens running. - - Max Tweeners capacity. - Default: 200 - Max Sequences capacity. - Default: 50 - - - - Behaviour that can be assigned when chaining a SetLink to a tween - - - - Pauses the tween when the link target is disabled - - - Pauses the tween when the link target is disabled, plays it when it's enabled - - - Pauses the tween when the link target is disabled, restarts it when it's enabled - - - Plays the tween when the link target is enabled - - - Restarts the tween when the link target is enabled - - - Kills the tween when the link target is disabled - - - Kills the tween when the link target is destroyed (becomes NULL). This is always active even if another behaviour is chosen - - - Completes the tween when the link target is disabled - - - Completes and kills the tween when the link target is disabled - - - Rewinds the tween (delay excluded) when the link target is disabled - - - Rewinds and kills the tween when the link target is disabled - - - - Path mode (used to determine correct LookAt orientation) - - - - Ignores the path mode (and thus LookAt behaviour) - - - Regular 3D path - - - 2D top-down path - - - 2D side-scroller path - - - - Type of path to use with DOPath tweens - - - - Linear, composed of straight segments between each waypoint - - - Curved path (which uses Catmull-Rom curves) - - - EXPERIMENTAL: Curved path (which uses Cubic Bezier curves, where each point requires two extra control points) - - - - Path control point - - - - - Path waypoints (modified by PathPlugin when setting relative end/change value or by CubicBezierDecoder) and by DOTweenPathInspector - - - - - Gets the point on the path at the given percentage (0 to 1) - - The percentage (0 to 1) at which to get the point - If TRUE constant speed is taken into account, otherwise not - - - - Base interface for all tween plugins options - - - - Resets the plugin - - - - This plugin generates some GC allocations at startup - - - - - Path plugin works exclusively with Transforms - - - - - Rotation mode used with DORotate methods - - - - - Fastest way that never rotates beyond 360° - - - - - Fastest way that rotates beyond 360° - - - - - Adds the given rotation to the transform using world axis and an advanced precision mode - (like when using transform.Rotate(Space.World)). - In this mode the end value is is always considered relative - - - - - Adds the given rotation to the transform's local axis - (like when rotating an object with the "local" switch enabled in Unity's editor or using transform.Rotate(Space.Self)). - In this mode the end value is is always considered relative - - - - - Type of scramble to apply to string tweens - - - - - No scrambling of characters - - - - - A-Z + a-z + 0-9 characters - - - - - A-Z characters - - - - - a-z characters - - - - - 0-9 characters - - - - - Custom characters - - - - - Methods that extend Tween objects and allow to control or get data from them - - - - Completes the tween - - - Completes the tween - For Sequences only: if TRUE also internal Sequence callbacks will be fired, - otherwise they will be ignored - - - Flips the direction of this tween (backwards if it was going forward or viceversa) - - - Forces the tween to initialize its settings immediately - - - Send the tween to the given position in time - Time position to reach - (if higher than the whole tween duration the tween will simply reach its end) - If TRUE will play the tween after reaching the given position, otherwise it will pause it - - - Kills the tween - If TRUE completes the tween before killing it - - - Pauses the tween - - - Plays the tween - - - Sets the tween in a backwards direction and plays it - - - Sets the tween in a forward direction and plays it - - - Restarts the tween from the beginning - Ignored in case of Sequences. If TRUE includes the eventual tween delay, otherwise skips it - Ignored in case of Sequences. If >= 0 changes the startup delay to this value, otherwise doesn't touch it - - - Rewinds and pauses the tween - Ignored in case of Sequences. If TRUE includes the eventual tween delay, otherwise skips it - - - Smoothly rewinds the tween (delays excluded). - A "smooth rewind" animates the tween to its start position, - skipping all elapsed loops (except in case of LoopType.Incremental) while keeping the animation fluent. - If called on a tween who is still waiting for its delay to happen, it will simply set the delay to 0 and pause the tween. - Note that a tween that was smoothly rewinded will have its play direction flipped - - - Plays the tween if it was paused, pauses it if it was playing - - - Send a path tween to the given waypoint. - Has no effect if this is not a path tween. - BEWARE, this is a special utility method: - it works only with Linear eases. Also, the lookAt direction might be wrong after calling this and might need to be set manually - (because it relies on a smooth path movement and doesn't work well with jumps that encompass dramatic direction changes) - Waypoint index to reach - (if higher than the max waypoint index the tween will simply go to the last one) - If TRUE will play the tween after reaching the given waypoint, otherwise it will pause it - - - - Creates a yield instruction that waits until the tween is killed or complete. - It can be used inside a coroutine as a yield. - Example usage:yield return myTween.WaitForCompletion(); - - - - - Creates a yield instruction that waits until the tween is killed or rewinded. - It can be used inside a coroutine as a yield. - Example usage:yield return myTween.WaitForRewind(); - - - - - Creates a yield instruction that waits until the tween is killed. - It can be used inside a coroutine as a yield. - Example usage:yield return myTween.WaitForKill(); - - - - - Creates a yield instruction that waits until the tween is killed or has gone through the given amount of loops. - It can be used inside a coroutine as a yield. - Example usage:yield return myTween.WaitForElapsedLoops(2); - - Elapsed loops to wait for - - - - Creates a yield instruction that waits until the tween is killed or has reached the given position (loops included, delays excluded). - It can be used inside a coroutine as a yield. - Example usage:yield return myTween.WaitForPosition(2.5f); - - Position (loops included, delays excluded) to wait for - - - - Creates a yield instruction that waits until the tween is killed or started - (meaning when the tween is set in a playing state the first time, after any eventual delay). - It can be used inside a coroutine as a yield. - Example usage:yield return myTween.WaitForStart(); - - - - Returns the total number of loops completed by this tween - - - Returns the eventual delay set for this tween - - - Returns the eventual elapsed delay set for this tween - - - Returns the duration of this tween (delays excluded). - NOTE: when using settings like SpeedBased, the duration will be recalculated when the tween starts - If TRUE returns the full duration loops included, - otherwise the duration of a single loop cycle - - - Returns the elapsed time for this tween (delays exluded) - If TRUE returns the elapsed time since startup loops included, - otherwise the elapsed time within the current loop cycle - - - Returns the elapsed percentage (0 to 1) of this tween (delays exluded) - If TRUE returns the elapsed percentage since startup loops included, - otherwise the elapsed percentage within the current loop cycle - - - Returns the elapsed percentage (0 to 1) of this tween (delays exluded), - based on a single loop, and calculating eventual backwards Yoyo loops as 1 to 0 instead of 0 to 1 - - - Returns FALSE if this tween has been killed or is NULL, TRUE otherwise. - BEWARE: if this tween is recyclable it might have been spawned again for another use and thus return TRUE anyway. - When working with recyclable tweens you should take care to know when a tween has been killed and manually set your references to NULL. - If you want to be sure your references are set to NULL when a tween is killed you can use the OnKill callback like this: - .OnKill(()=> myTweenReference = null) - - - Returns TRUE if this tween was reversed and is set to go backwards - - - Returns TRUE if the tween is complete - (silently fails and returns FALSE if the tween has been killed) - - - Returns TRUE if this tween has been initialized - - - Returns TRUE if this tween is playing - - - Returns the total number of loops set for this tween - (returns -1 if the loops are infinite) - - - - Returns a point on a path based on the given path percentage. - Returns Vector3.zero if this is not a path tween, if the tween is invalid, or if the path is not yet initialized. - A path is initialized after its tween starts, or immediately if the tween was created with the Path Editor (DOTween Pro feature). - You can force a path to be initialized by calling myTween.ForceInit(). - - Percentage of the path (0 to 1) on which to get the point - - - - Returns an array of points that can be used to draw the path. - Note that this method generates allocations, because it creates a new array. - Returns NULL if this is not a path tween, if the tween is invalid, or if the path is not yet initialized. - A path is initialized after its tween starts, or immediately if the tween was created with the Path Editor (DOTween Pro feature). - You can force a path to be initialized by calling myTween.ForceInit(). - - How many points to create for each path segment (waypoint to waypoint). - Only used in case of non-Linear paths - - - - Returns the length of a path. - Returns -1 if this is not a path tween, if the tween is invalid, or if the path is not yet initialized. - A path is initialized after its tween starts, or immediately if the tween was created with the Path Editor (DOTween Pro feature). - You can force a path to be initialized by calling myTween.ForceInit(). - - - - - Types of loop - - - - Each loop cycle restarts from the beginning - - - The tween moves forward and backwards at alternate cycles - - - Continuously increments the tween at the end of each loop cycle (A to B, B to B+(A-B), and so on), thus always moving "onward". - In case of String tweens works only if the tween is set as relative - - - - Controls other tweens as a group - - - - - Methods that extend known Unity objects and allow to directly create and control tweens from their instances - - - - Tweens a Camera's aspect to the given value. - Also stores the camera as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Camera's backgroundColor to the given value. - Also stores the camera as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Camera's farClipPlane to the given value. - Also stores the camera as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Camera's fieldOfView to the given value. - Also stores the camera as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Camera's nearClipPlane to the given value. - Also stores the camera as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Camera's orthographicSize to the given value. - Also stores the camera as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Camera's pixelRect to the given value. - Also stores the camera as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Camera's rect to the given value. - Also stores the camera as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Shakes a Camera's localPosition along its relative X Y axes with the given values. - Also stores the camera as the tween's target so it can be used for filtered operations - The duration of the tween - The shake strength - Indicates how much will the shake vibrate - Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). - Setting it to 0 will shake along a single direction. - If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not - - - Shakes a Camera's localPosition along its relative X Y axes with the given values. - Also stores the camera as the tween's target so it can be used for filtered operations - The duration of the tween - The shake strength on each axis - Indicates how much will the shake vibrate - Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). - Setting it to 0 will shake along a single direction. - If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not - - - Shakes a Camera's localRotation. - Also stores the camera as the tween's target so it can be used for filtered operations - The duration of the tween - The shake strength - Indicates how much will the shake vibrate - Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). - Setting it to 0 will shake along a single direction. - If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not - - - Shakes a Camera's localRotation. - Also stores the camera as the tween's target so it can be used for filtered operations - The duration of the tween - The shake strength on each axis - Indicates how much will the shake vibrate - Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). - Setting it to 0 will shake along a single direction. - If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not - - - Tweens a Light's color to the given value. - Also stores the light as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Light's intensity to the given value. - Also stores the light as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Light's shadowStrength to the given value. - Also stores the light as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a LineRenderer's color to the given value. - Also stores the LineRenderer as the tween's target so it can be used for filtered operations. - Note that this method requires to also insert the start colors for the tween, - since LineRenderers have no way to get them. - The start value to tween from - The end value to reachThe duration of the tween - - - Tweens a Material's color to the given value. - Also stores the material as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Material's named color property to the given value. - Also stores the material as the tween's target so it can be used for filtered operations - The end value to reach - The name of the material property to tween (like _Tint or _SpecColor) - The duration of the tween - - - Tweens a Material's named color property with the given ID to the given value. - Also stores the material as the tween's target so it can be used for filtered operations - The end value to reach - The ID of the material property to tween (also called nameID in Unity's manual) - The duration of the tween - - - Tweens a Material's alpha color to the given value - (will have no effect unless your material supports transparency). - Also stores the material as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Material's alpha color to the given value - (will have no effect unless your material supports transparency). - Also stores the material as the tween's target so it can be used for filtered operations - The end value to reach - The name of the material property to tween (like _Tint or _SpecColor) - The duration of the tween - - - Tweens a Material's alpha color with the given ID to the given value - (will have no effect unless your material supports transparency). - Also stores the material as the tween's target so it can be used for filtered operations - The end value to reach - The ID of the material property to tween (also called nameID in Unity's manual) - The duration of the tween - - - Tweens a Material's named float property to the given value. - Also stores the material as the tween's target so it can be used for filtered operations - The end value to reach - The name of the material property to tween - The duration of the tween - - - Tweens a Material's named float property with the given ID to the given value. - Also stores the material as the tween's target so it can be used for filtered operations - The end value to reach - The ID of the material property to tween (also called nameID in Unity's manual) - The duration of the tween - - - Tweens a Material's texture offset to the given value. - Also stores the material as the tween's target so it can be used for filtered operations - The end value to reach - The duration of the tween - - - Tweens a Material's named texture offset property to the given value. - Also stores the material as the tween's target so it can be used for filtered operations - The end value to reach - The name of the material property to tween - The duration of the tween - - - Tweens a Material's texture scale to the given value. - Also stores the material as the tween's target so it can be used for filtered operations - The end value to reach - The duration of the tween - - - Tweens a Material's named texture scale property to the given value. - Also stores the material as the tween's target so it can be used for filtered operations - The end value to reach - The name of the material property to tween - The duration of the tween - - - Tweens a Material's named Vector property to the given value. - Also stores the material as the tween's target so it can be used for filtered operations - The end value to reach - The name of the material property to tween - The duration of the tween - - - Tweens a Material's named Vector property with the given ID to the given value. - Also stores the material as the tween's target so it can be used for filtered operations - The end value to reach - The ID of the material property to tween (also called nameID in Unity's manual) - The duration of the tween - - - Tweens a TrailRenderer's startWidth/endWidth to the given value. - Also stores the TrailRenderer as the tween's target so it can be used for filtered operations - The end startWidth to reachThe end endWidth to reach - The duration of the tween - - - Tweens a TrailRenderer's time to the given value. - Also stores the TrailRenderer as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Transform's position to the given value. - Also stores the transform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Transform's X position to the given value. - Also stores the transform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Transform's Y position to the given value. - Also stores the transform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Transform's Z position to the given value. - Also stores the transform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Transform's localPosition to the given value. - Also stores the transform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Transform's X localPosition to the given value. - Also stores the transform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Transform's Y localPosition to the given value. - Also stores the transform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Transform's Z localPosition to the given value. - Also stores the transform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Transform's rotation to the given value. - Also stores the transform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - Rotation mode - - - Tweens a Transform's rotation to the given value using pure quaternion values. - Also stores the transform as the tween's target so it can be used for filtered operations. - PLEASE NOTE: DORotate, which takes Vector3 values, is the preferred rotation method. - This method was implemented for very special cases, and doesn't support LoopType.Incremental loops - (neither for itself nor if placed inside a LoopType.Incremental Sequence) - - The end value to reachThe duration of the tween - - - Tweens a Transform's localRotation to the given value. - Also stores the transform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - Rotation mode - - - Tweens a Transform's rotation to the given value using pure quaternion values. - Also stores the transform as the tween's target so it can be used for filtered operations. - PLEASE NOTE: DOLocalRotate, which takes Vector3 values, is the preferred rotation method. - This method was implemented for very special cases, and doesn't support LoopType.Incremental loops - (neither for itself nor if placed inside a LoopType.Incremental Sequence) - - The end value to reachThe duration of the tween - - - Tweens a Transform's localScale to the given value. - Also stores the transform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Transform's localScale uniformly to the given value. - Also stores the transform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Transform's X localScale to the given value. - Also stores the transform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Transform's Y localScale to the given value. - Also stores the transform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Transform's Z localScale to the given value. - Also stores the transform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Transform's rotation so that it will look towards the given position. - Also stores the transform as the tween's target so it can be used for filtered operations - The position to look atThe duration of the tween - Eventual axis constraint for the rotation - The vector that defines in which direction up is (default: Vector3.up) - - - Punches a Transform's localPosition towards the given direction and then back to the starting one - as if it was connected to the starting position via an elastic. - The direction and strength of the punch (added to the Transform's current position) - The duration of the tween - Indicates how much will the punch vibrate - Represents how much (0 to 1) the vector will go beyond the starting position when bouncing backwards. - 1 creates a full oscillation between the punch direction and the opposite direction, - while 0 oscillates only between the punch and the start position - If TRUE the tween will smoothly snap all values to integers - - - Punches a Transform's localScale towards the given size and then back to the starting one - as if it was connected to the starting scale via an elastic. - The punch strength (added to the Transform's current scale) - The duration of the tween - Indicates how much will the punch vibrate - Represents how much (0 to 1) the vector will go beyond the starting size when bouncing backwards. - 1 creates a full oscillation between the punch scale and the opposite scale, - while 0 oscillates only between the punch scale and the start scale - - - Punches a Transform's localRotation towards the given size and then back to the starting one - as if it was connected to the starting rotation via an elastic. - The punch strength (added to the Transform's current rotation) - The duration of the tween - Indicates how much will the punch vibrate - Represents how much (0 to 1) the vector will go beyond the starting rotation when bouncing backwards. - 1 creates a full oscillation between the punch rotation and the opposite rotation, - while 0 oscillates only between the punch and the start rotation - - - Shakes a Transform's localPosition with the given values. - The duration of the tween - The shake strength - Indicates how much will the shake vibrate - Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). - Setting it to 0 will shake along a single direction. - If TRUE the tween will smoothly snap all values to integers - If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not - - - Shakes a Transform's localPosition with the given values. - The duration of the tween - The shake strength on each axis - Indicates how much will the shake vibrate - Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). - Setting it to 0 will shake along a single direction. - If TRUE the tween will smoothly snap all values to integers - If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not - - - Shakes a Transform's localRotation. - The duration of the tween - The shake strength - Indicates how much will the shake vibrate - Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). - Setting it to 0 will shake along a single direction. - If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not - - - Shakes a Transform's localRotation. - The duration of the tween - The shake strength on each axis - Indicates how much will the shake vibrate - Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). - Setting it to 0 will shake along a single direction. - If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not - - - Shakes a Transform's localScale. - The duration of the tween - The shake strength - Indicates how much will the shake vibrate - Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). - Setting it to 0 will shake along a single direction. - If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not - - - Shakes a Transform's localScale. - The duration of the tween - The shake strength on each axis - Indicates how much will the shake vibrate - Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). - Setting it to 0 will shake along a single direction. - If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not - - - Tweens a Transform's position to the given value, while also applying a jump effect along the Y axis. - Returns a Sequence instead of a Tweener. - Also stores the transform as the tween's target so it can be used for filtered operations - The end value to reach - Power of the jump (the max height of the jump is represented by this plus the final Y offset) - Total number of jumps - The duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Transform's localPosition to the given value, while also applying a jump effect along the Y axis. - Returns a Sequence instead of a Tweener. - Also stores the transform as the tween's target so it can be used for filtered operations - The end value to reach - Power of the jump (the max height of the jump is represented by this plus the final Y offset) - Total number of jumps - The duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Transform's position through the given path waypoints, using the chosen path algorithm. - Also stores the transform as the tween's target so it can be used for filtered operations - The waypoints to go through - The duration of the tween - The type of path: Linear (straight path), CatmullRom (curved CatmullRom path) or CubicBezier (curved with control points) - The path mode: 3D, side-scroller 2D, top-down 2D - The resolution of the path (useless in case of Linear paths): higher resolutions make for more detailed curved paths but are more expensive. - Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints - The color of the path (shown when gizmos are active in the Play panel and the tween is running) - - - Tweens a Transform's localPosition through the given path waypoints, using the chosen path algorithm. - Also stores the transform as the tween's target so it can be used for filtered operations - The waypoint to go through - The duration of the tween - The type of path: Linear (straight path), CatmullRom (curved CatmullRom path) or CubicBezier (curved with control points) - The path mode: 3D, side-scroller 2D, top-down 2D - The resolution of the path: higher resolutions make for more detailed curved paths but are more expensive. - Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints - The color of the path (shown when gizmos are active in the Play panel and the tween is running) - - - IMPORTANT: Unless you really know what you're doing, you should use the overload that accepts a Vector3 array instead. - Tweens a Transform's position via the given path. - Also stores the transform as the tween's target so it can be used for filtered operations - The path to use - The duration of the tween - The path mode: 3D, side-scroller 2D, top-down 2D - - - IMPORTANT: Unless you really know what you're doing, you should use the overload that accepts a Vector3 array instead. - Tweens a Transform's localPosition via the given path. - Also stores the transform as the tween's target so it can be used for filtered operations - The path to use - The duration of the tween - The path mode: 3D, side-scroller 2D, top-down 2D - - - Tweens a Tween's timeScale to the given value. - Also stores the Tween as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Light's color to the given value, - in a way that allows other DOBlendableColor tweens to work together on the same target, - instead than fight each other as multiple DOColor would do. - Also stores the Light as the tween's target so it can be used for filtered operations - The value to tween toThe duration of the tween - - - Tweens a Material's color to the given value, - in a way that allows other DOBlendableColor tweens to work together on the same target, - instead than fight each other as multiple DOColor would do. - Also stores the Material as the tween's target so it can be used for filtered operations - The value to tween toThe duration of the tween - - - Tweens a Material's named color property to the given value, - in a way that allows other DOBlendableColor tweens to work together on the same target, - instead than fight each other as multiple DOColor would do. - Also stores the Material as the tween's target so it can be used for filtered operations - The value to tween to - The name of the material property to tween (like _Tint or _SpecColor) - The duration of the tween - - - Tweens a Material's named color property with the given ID to the given value, - in a way that allows other DOBlendableColor tweens to work together on the same target, - instead than fight each other as multiple DOColor would do. - Also stores the Material as the tween's target so it can be used for filtered operations - The value to tween to - The ID of the material property to tween (also called nameID in Unity's manual) - The duration of the tween - - - Tweens a Transform's position BY the given value (as if you chained a SetRelative), - in a way that allows other DOBlendableMove tweens to work together on the same target, - instead than fight each other as multiple DOMove would do. - Also stores the transform as the tween's target so it can be used for filtered operations - The value to tween byThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Transform's localPosition BY the given value (as if you chained a SetRelative), - in a way that allows other DOBlendableMove tweens to work together on the same target, - instead than fight each other as multiple DOMove would do. - Also stores the transform as the tween's target so it can be used for filtered operations - The value to tween byThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - EXPERIMENTAL METHOD - Tweens a Transform's rotation BY the given value (as if you chained a SetRelative), - in a way that allows other DOBlendableRotate tweens to work together on the same target, - instead than fight each other as multiple DORotate would do. - Also stores the transform as the tween's target so it can be used for filtered operations - The value to tween byThe duration of the tween - Rotation mode - - - EXPERIMENTAL METHOD - Tweens a Transform's lcoalRotation BY the given value (as if you chained a SetRelative), - in a way that allows other DOBlendableRotate tweens to work together on the same target, - instead than fight each other as multiple DORotate would do. - Also stores the transform as the tween's target so it can be used for filtered operations - The value to tween byThe duration of the tween - Rotation mode - - - Punches a Transform's localRotation BY the given value and then back to the starting one - as if it was connected to the starting rotation via an elastic. Does it in a way that allows other - DOBlendableRotate tweens to work together on the same target - The punch strength (added to the Transform's current rotation) - The duration of the tween - Indicates how much will the punch vibrate - Represents how much (0 to 1) the vector will go beyond the starting rotation when bouncing backwards. - 1 creates a full oscillation between the punch rotation and the opposite rotation, - while 0 oscillates only between the punch and the start rotation - - - Tweens a Transform's localScale BY the given value (as if you chained a SetRelative), - in a way that allows other DOBlendableScale tweens to work together on the same target, - instead than fight each other as multiple DOScale would do. - Also stores the transform as the tween's target so it can be used for filtered operations - The value to tween byThe duration of the tween - - - - Completes all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens completed - (meaning the tweens that don't have infinite loops and were not already complete) - - For Sequences only: if TRUE also internal Sequence callbacks will be fired, - otherwise they will be ignored - - - - Completes all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens completed - (meaning the tweens that don't have infinite loops and were not already complete) - - For Sequences only: if TRUE also internal Sequence callbacks will be fired, - otherwise they will be ignored - - - - Kills all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens killed. - - If TRUE completes the tween before killing it - - - - Kills all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens killed. - - If TRUE completes the tween before killing it - - - - Flips the direction (backwards if it was going forward or viceversa) of all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens flipped. - - - - - Flips the direction (backwards if it was going forward or viceversa) of all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens flipped. - - - - - Sends to the given position all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens involved. - - Time position to reach - (if higher than the whole tween duration the tween will simply reach its end) - If TRUE will play the tween after reaching the given position, otherwise it will pause it - - - - Sends to the given position all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens involved. - - Time position to reach - (if higher than the whole tween duration the tween will simply reach its end) - If TRUE will play the tween after reaching the given position, otherwise it will pause it - - - - Pauses all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens paused. - - - - - Pauses all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens paused. - - - - - Plays all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens played. - - - - - Plays all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens played. - - - - - Plays backwards all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens played. - - - - - Plays backwards all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens played. - - - - - Plays forward all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens played. - - - - - Plays forward all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens played. - - - - - Restarts all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens restarted. - - - - - Restarts all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens restarted. - - - - - Rewinds all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens rewinded. - - - - - Rewinds all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens rewinded. - - - - - Smoothly rewinds all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens rewinded. - - - - - Smoothly rewinds all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens rewinded. - - - - - Toggles the paused state (plays if it was paused, pauses if it was playing) of all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens involved. - - - - - Toggles the paused state (plays if it was paused, pauses if it was playing) of all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens involved. - - - - - This class serves only as a utility class to store tween settings to apply on multiple tweens. - It is in no way needed otherwise, since you can directly apply tween settings to a tween via chaining - - - - A variable you can eventually Clear and reuse when needed, - to avoid instantiating TweenParams objects - - - Creates a new TweenParams object, which you can use to store tween settings - to pass to multiple tweens via myTween.SetAs(myTweenParms) - - - Clears and resets this TweenParams instance using default values, - so it can be reused without instantiating another one - - - Sets the autoKill behaviour of the tween. - Has no effect if the tween has already started - If TRUE the tween will be automatically killed when complete - - - Sets an ID for the tween, which can then be used as a filter with DOTween's static methods. - The ID to assign to this tween. Can be an int, a string, an object or anything else. - - - Sets the target for the tween, which can then be used as a filter with DOTween's static methods. - IMPORTANT: use it with caution. If you just want to set an ID for the tween use SetId instead. - When using shorcuts the shortcut target is already assigned as the tween's target, - so using this method will overwrite it and prevent shortcut-operations like myTarget.DOPause from working correctly. - The target to assign to this tween. Can be an int, a string, an object or anything else. - - - Sets the looping options for the tween. - Has no effect if the tween has already started - Number of cycles to play (-1 for infinite - will be converted to 1 in case the tween is nested in a Sequence) - Loop behaviour type (default: LoopType.Restart) - - - Sets the ease of the tween. - If applied to Sequences eases the whole sequence animation - Eventual overshoot or amplitude to use with Back or Elastic easeType (default is 1.70158) - Eventual period to use with Elastic easeType (default is 0) - - - Sets the ease of the tween using an AnimationCurve. - If applied to Sequences eases the whole sequence animation - - - Sets the ease of the tween using a custom ease function. - If applied to Sequences eases the whole sequence animation - - - Sets the recycling behaviour for the tween. - If TRUE the tween will be recycled after being killed, otherwise it will be destroyed. - - - Sets the update type to the one defined in DOTween.defaultUpdateType (UpdateType.Normal unless changed) - and lets you choose if it should be independent from Unity's Time.timeScale - If TRUE the tween will ignore Unity's Time.timeScale - - - Sets the type of update (default or independent) for the tween - The type of update (default: UpdateType.Normal) - If TRUE the tween will ignore Unity's Time.timeScale - - - Sets the onStart callback for the tween. - Called the first time the tween is set in a playing state, after any eventual delay - - - Sets the onPlay callback for the tween. - Called when the tween is set in a playing state, after any eventual delay. - Also called each time the tween resumes playing from a paused state - - - Sets the onRewind callback for the tween. - Called when the tween is rewinded, - either by calling Rewind or by reaching the start position while playing backwards. - Rewinding a tween that is already rewinded will not fire this callback - - - Sets the onUpdate callback for the tween. - Called each time the tween updates - - - Sets the onStepComplete callback for the tween. - Called the moment the tween completes one loop cycle, even when going backwards - - - Sets the onComplete callback for the tween. - Called the moment the tween reaches its final forward position, loops included - - - Sets the onKill callback for the tween. - Called the moment the tween is killed - - - Sets the onWaypointChange callback for the tween. - Called when a path tween reaches a new waypoint - - - Sets a delayed startup for the tween. - Has no effect on Sequences or if the tween has already started - - - If isRelative is TRUE sets the tween as relative - (the endValue will be calculated as startValue + endValue instead than being used directly). - Has no effect on Sequences or if the tween has already started - - - If isSpeedBased is TRUE sets the tween as speed based - (the duration will represent the number of units the tween moves x second). - Has no effect on Sequences, nested tweens, or if the tween has already started - - - - Methods that extend Tween objects and allow to set their parameters - - - - Sets the autoKill behaviour of the tween to TRUE. - Has no effect if the tween has already started or if it's added to a Sequence - - - Sets the autoKill behaviour of the tween. - Has no effect if the tween has already started or if it's added to a Sequence - If TRUE the tween will be automatically killed when complete - - - Sets an ID for the tween (), which can then be used as a filter with DOTween's static methods. - The ID to assign to this tween. Can be an int, a string, an object or anything else. - - - Sets a string ID for the tween (), which can then be used as a filter with DOTween's static methods. - Filtering via string is 2X faster than using an object as an ID (using the alternate obejct overload) - The string ID to assign to this tween. - - - Sets an int ID for the tween (), which can then be used as a filter with DOTween's static methods. - Filtering via int is 4X faster than via object, 2X faster than via string (using the alternate object/string overloads) - The int ID to assign to this tween. - - - Allows to link this tween to a GameObject - so that it will be automatically killed when the GameObject is destroyed. - Has no effect if the tween is added to a Sequence - The link target (unrelated to the target set via SetTarget) - - - Allows to link this tween to a GameObject and assign a behaviour depending on it. - This will also automatically kill the tween when the GameObject is destroyed. - Has no effect if the tween is added to a Sequence - The link target (unrelated to the target set via SetTarget) - The behaviour to use ( is always evaluated even if you choose another one) - - - Sets the target for the tween, which can then be used as a filter with DOTween's static methods. - IMPORTANT: use it with caution. If you just want to set an ID for the tween use SetId instead. - When using shorcuts the shortcut target is already assigned as the tween's target, - so using this method will overwrite it and prevent shortcut-operations like myTarget.DOPause from working correctly. - The target to assign to this tween. Can be an int, a string, an object or anything else. - - - Sets the looping options for the tween. - Has no effect if the tween has already started - Number of cycles to play (-1 for infinite - will be converted to 1 in case the tween is nested in a Sequence) - - - Sets the looping options for the tween. - Has no effect if the tween has already started - Number of cycles to play (-1 for infinite - will be converted to 1 in case the tween is nested in a Sequence) - Loop behaviour type (default: LoopType.Restart) - - - Sets the ease of the tween. - If applied to Sequences eases the whole sequence animation - - - Sets the ease of the tween. - If applied to Sequences eases the whole sequence animation - - Eventual overshoot to use with Back or Flash ease (default is 1.70158 - 1 for Flash). - In case of Flash ease it must be an intenger and sets the total number of flashes that will happen. - Using an even number will complete the tween on the starting value, while an odd one will complete it on the end value. - - - - Sets the ease of the tween. - If applied to Sequences eases the whole sequence animation - Eventual amplitude to use with Elastic easeType or overshoot to use with Flash easeType (default is 1.70158 - 1 for Flash). - In case of Flash ease it must be an integer and sets the total number of flashes that will happen. - Using an even number will complete the tween on the starting value, while an odd one will complete it on the end value. - - Eventual period to use with Elastic or Flash easeType (default is 0). - In case of Flash ease it indicates the power in time of the ease, and must be between -1 and 1. - 0 is balanced, 1 weakens the ease with time, -1 starts the ease weakened and gives it power towards the end. - - - - Sets the ease of the tween using an AnimationCurve. - If applied to Sequences eases the whole sequence animation - - - Sets the ease of the tween using a custom ease function (which must return a value between 0 and 1). - If applied to Sequences eases the whole sequence animation - - - Allows the tween to be recycled after being killed. - - - Sets the recycling behaviour for the tween. - If TRUE the tween will be recycled after being killed, otherwise it will be destroyed. - - - Sets the update type to UpdateType.Normal and lets you choose if it should be independent from Unity's Time.timeScale - If TRUE the tween will ignore Unity's Time.timeScale - - - Sets the type of update for the tween - The type of update (defalt: UpdateType.Normal) - - - Sets the type of update for the tween and lets you choose if it should be independent from Unity's Time.timeScale - The type of update - If TRUE the tween will ignore Unity's Time.timeScale - - - Sets the onStart callback for the tween, clearing any previous onStart callback that was set. - Called the first time the tween is set in a playing state, after any eventual delay - - - Sets the onPlay callback for the tween, clearing any previous onPlay callback that was set. - Called when the tween is set in a playing state, after any eventual delay. - Also called each time the tween resumes playing from a paused state - - - Sets the onPause callback for the tween, clearing any previous onPause callback that was set. - Called when the tween state changes from playing to paused. - If the tween has autoKill set to FALSE, this is called also when the tween reaches completion. - - - Sets the onRewind callback for the tween, clearing any previous onRewind callback that was set. - Called when the tween is rewinded, - either by calling Rewind or by reaching the start position while playing backwards. - Rewinding a tween that is already rewinded will not fire this callback - - - Sets the onUpdate callback for the tween, clearing any previous onUpdate callback that was set. - Called each time the tween updates - - - Sets the onStepComplete callback for the tween, clearing any previous onStepComplete callback that was set. - Called the moment the tween completes one loop cycle, even when going backwards - - - Sets the onComplete callback for the tween, clearing any previous onComplete callback that was set. - Called the moment the tween reaches its final forward position, loops included - - - Sets the onKill callback for the tween, clearing any previous onKill callback that was set. - Called the moment the tween is killed - - - Sets the onWaypointChange callback for the tween, clearing any previous onWaypointChange callback that was set. - Called when a path tween's current waypoint changes - - - Sets the parameters of the tween (id, ease, loops, delay, timeScale, callbacks, etc) as the parameters of the given one. - Doesn't copy specific SetOptions settings: those will need to be applied manually each time. - Has no effect if the tween has already started. - NOTE: the tween's target will not be changed - Tween from which to copy the parameters - - - Sets the parameters of the tween (id, ease, loops, delay, timeScale, callbacks, etc) as the parameters of the given TweenParams. - Has no effect if the tween has already started. - TweenParams from which to copy the parameters - - - Adds the given tween to the end of the Sequence. - Has no effect if the Sequence has already started - The tween to append - - - Adds the given tween to the beginning of the Sequence, pushing forward the other nested content. - Has no effect if the Sequence has already started - The tween to prepend - - - Inserts the given tween at the same time position of the last tween, callback or intervale added to the Sequence. - Note that, in case of a Join after an interval, the insertion time will be the time where the interval starts, not where it finishes. - Has no effect if the Sequence has already started - - - Inserts the given tween at the given time position in the Sequence, - automatically adding an interval if needed. - Has no effect if the Sequence has already started - The time position where the tween will be placed - The tween to insert - - - Adds the given interval to the end of the Sequence. - Has no effect if the Sequence has already started - The interval duration - - - Adds the given interval to the beginning of the Sequence, pushing forward the other nested content. - Has no effect if the Sequence has already started - The interval duration - - - Adds the given callback to the end of the Sequence. - Has no effect if the Sequence has already started - The callback to append - - - Adds the given callback to the beginning of the Sequence, pushing forward the other nested content. - Has no effect if the Sequence has already started - The callback to prepend - - - Inserts the given callback at the given time position in the Sequence, - automatically adding an interval if needed. - Has no effect if the Sequence has already started - The time position where the callback will be placed - The callback to insert - - - Changes a TO tween into a FROM tween: sets the current target's position as the tween's endValue - then immediately sends the target to the previously set endValue. - - - Changes a TO tween into a FROM tween: sets the current target's position as the tween's endValue - then immediately sends the target to the previously set endValue. - If TRUE the FROM value will be calculated as relative to the current one - - - Changes a TO tween into a FROM tween: sets the tween's starting value to the given one - and eventually sets the tween's target to that value immediately. - Value to start from - If TRUE sets the target to from value immediately, otherwise waits for the tween to start - - - Changes a TO tween into a FROM tween: sets the tween's starting value to the given one - and eventually sets the tween's target to that value immediately. - Alpha value to start from (in case of Fade tweens) - If TRUE sets the target to from value immediately, otherwise waits for the tween to start - - - Changes a TO tween into a FROM tween: sets the tween's starting value to the given one - and eventually sets the tween's target to that value immediately. - Value to start from (in case of Vector tweens that act on a single coordinate or scale tweens) - If TRUE sets the target to from value immediately, otherwise waits for the tween to start - - - Sets a delayed startup for the tween. - In case of Sequences behaves the same as , - which means the delay will repeat in case of loops (while with tweens it's ignored after the first loop cycle). - Has no effect if the tween has already started - - - EXPERIMENTAL: implemented in v1.2.340. - Sets a delayed startup for the tween with options to choose how the delay is applied in case of Sequences. - Has no effect if the tween has already started - Only used by types: If FALSE sets the delay as a one-time occurrence - (defaults to this for types), - otherwise as a Sequence interval which will repeat at the beginning of every loop cycle - - - Sets the tween as relative - (the endValue will be calculated as startValue + endValue instead than being used directly). - Has no effect on Sequences or if the tween has already started - - - If isRelative is TRUE sets the tween as relative - (the endValue will be calculated as startValue + endValue instead than being used directly). - Has no effect on Sequences or if the tween has already started - - - If isSpeedBased is TRUE sets the tween as speed based - (the duration will represent the number of units the tween moves x second). - Has no effect on Sequences, nested tweens, or if the tween has already started - - - If isSpeedBased is TRUE sets the tween as speed based - (the duration will represent the number of units the tween moves x second). - Has no effect on Sequences, nested tweens, or if the tween has already started - - - Options for float tweens - If TRUE the tween will smoothly snap all values to integers - - - Options for Vector2 tweens - If TRUE the tween will smoothly snap all values to integers - - - Options for Vector2 tweens - Selecting an axis will tween the vector only on that axis, leaving the others untouched - If TRUE the tween will smoothly snap all values to integers - - - Options for Vector3 tweens - If TRUE the tween will smoothly snap all values to integers - - - Options for Vector3 tweens - Selecting an axis will tween the vector only on that axis, leaving the others untouched - If TRUE the tween will smoothly snap all values to integers - - - Options for Vector4 tweens - If TRUE the tween will smoothly snap all values to integers - - - Options for Vector4 tweens - Selecting an axis will tween the vector only on that axis, leaving the others untouched - If TRUE the tween will smoothly snap all values to integers - - - Options for Quaternion tweens - If TRUE (default) the rotation will take the shortest route, and will not rotate more than 360°. - If FALSE the rotation will be fully accounted. Is always FALSE if the tween is set as relative - - - Options for Color tweens - If TRUE only the alpha value of the color will be tweened - - - Options for Vector4 tweens - If TRUE the tween will smoothly snap all values to integers - - - Options for Vector4 tweens - If TRUE, rich text will be interpreted correctly while animated, - otherwise all tags will be considered as normal text - The type of scramble to use, if any - A string containing the characters to use for scrambling. - Use as many characters as possible (minimum 10) because DOTween uses a fast scramble mode which gives better results with more characters. - Leave it to NULL to use default ones - - - Options for Vector3Array tweens - If TRUE the tween will smoothly snap all values to integers - - - Options for Vector3Array tweens - If TRUE the tween will smoothly snap all values to integers - - - Options for Path tweens (created via the DOPath shortcut) - The eventual movement axis to lock. You can input multiple axis if you separate them like this: - AxisConstrain.X | AxisConstraint.Y - The eventual rotation axis to lock. You can input multiple axis if you separate them like this: - AxisConstrain.X | AxisConstraint.Y - - - Options for Path tweens (created via the DOPath shortcut) - If TRUE the path will be automatically closed - The eventual movement axis to lock. You can input multiple axis if you separate them like this: - AxisConstrain.X | AxisConstraint.Y - The eventual rotation axis to lock. You can input multiple axis if you separate them like this: - AxisConstrain.X | AxisConstraint.Y - - - Additional LookAt options for Path tweens (created via the DOPath shortcut). - Orients the target towards the given position. - Must be chained directly to the tween creation method or to a SetOptions - The position to look at - The eventual direction to consider as "forward". - If left to NULL defaults to the regular forward side of the transform - The vector that defines in which direction up is (default: Vector3.up) - - - Additional LookAt options for Path tweens (created via the DOPath shortcut). - Orients the target towards the given position with options to keep the Z rotation stable. - Must be chained directly to the tween creation method or to a SetOptions - The position to look at - If TRUE doesn't rotate the target along the Z axis - - - Additional LookAt options for Path tweens (created via the DOPath shortcut). - Orients the target towards another transform. - Must be chained directly to the tween creation method or to a SetOptions - The transform to look at - The eventual direction to consider as "forward". - If left to NULL defaults to the regular forward side of the transform - The vector that defines in which direction up is (default: Vector3.up) - - - Additional LookAt options for Path tweens (created via the DOPath shortcut). - Orients the target towards another transform with options to keep the Z rotation stable. - Must be chained directly to the tween creation method or to a SetOptions - The transform to look at - If TRUE doesn't rotate the target along the Z axis - - - Additional LookAt options for Path tweens (created via the DOPath shortcut). - Orients the target to the path, with the given lookAhead. - Must be chained directly to the tween creation method or to a SetOptions - The percentage of lookAhead to use (0 to 1) - The eventual direction to consider as "forward". - If left to NULL defaults to the regular forward side of the transform - The vector that defines in which direction up is (default: Vector3.up) - - - Additional LookAt options for Path tweens (created via the DOPath shortcut). - Orients the path with options to keep the Z rotation stable. - Must be chained directly to the tween creation method or to a SetOptions - The percentage of lookAhead to use (0 to 1) - If TRUE doesn't rotate the target along the Z axis - - - - Types of log behaviours - - - - Log only warnings and errors - - - Log warnings, errors and additional infos - - - Log only errors - - - - Indicates either a Tweener or a Sequence - - - - TimeScale for the tween - - - If TRUE the tween wil go backwards - - - Object ID (usable for filtering with DOTween static methods). Can be anything except a string or an int - (use or for those) - - - String ID (usable for filtering with DOTween static methods). 2X faster than using an object id - - - Int ID (usable for filtering with DOTween static methods). 4X faster than using an object id, 2X faster than using a string id. - Default is -999 so avoid using an ID like that or it will capture all unset intIds - - - Tween target (usable for filtering with DOTween static methods). Automatically set by tween creation shortcuts - - - Called when the tween is set in a playing state, after any eventual delay. - Also called each time the tween resumes playing from a paused state - - - Called when the tween state changes from playing to paused. - If the tween has autoKill set to FALSE, this is called also when the tween reaches completion. - - - Called when the tween is rewinded, - either by calling Rewind or by reaching the start position while playing backwards. - Rewinding a tween that is already rewinded will not fire this callback - - - Called each time the tween updates - - - Called the moment the tween completes one loop cycle - - - Called the moment the tween reaches completion (loops included) - - - Called the moment the tween is killed - - - Called when a path tween's current waypoint changes - - - Tweeners-only (ignored by Sequences), returns TRUE if the tween was set as relative - - - - Set by SetTarget if DOTween's Debug Mode is on (see DOTween Utility Panel -> "Store GameObject's ID" debug option - - - - FALSE when tween is (or should be) despawned - set only by TweenManager - - - Gets and sets the time position (loops included, delays excluded) of the tween - - - Returns TRUE if the tween is set to loop (either a set number of times or infinitely) - - - TRUE after the tween was set in a play state at least once, AFTER any delay is elapsed - - - Time position within a single loop cycle - - - - Animates a single value - - - - Changes the start value of a tween and rewinds it (without pausing it). - Has no effect with tweens that are inside Sequences - The new start value - If bigger than 0 applies it as the new tween duration - - - Changes the end value of a tween and rewinds it (without pausing it). - Has no effect with tweens that are inside Sequences - The new end value - If bigger than 0 applies it as the new tween duration - If TRUE the start value will become the current target's value, otherwise it will stay the same - - - Changes the end value of a tween and rewinds it (without pausing it). - Has no effect with tweens that are inside Sequences - The new end value - If TRUE the start value will become the current target's value, otherwise it will stay the same - - - Changes the start and end value of a tween and rewinds it (without pausing it). - Has no effect with tweens that are inside Sequences - The new start value - The new end value - If bigger than 0 applies it as the new tween duration - - - - Used internally - - - - - Update type - - - - Updates every frame during Update calls - - - Updates every frame during LateUpdate calls - - - Updates using FixedUpdate calls - - - Updates using manual update calls - - - diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/DOTween.XML.meta b/Examples/Assets/Plugins/Demigiant/DOTween/DOTween.XML.meta deleted file mode 100644 index 7a866b5..0000000 --- a/Examples/Assets/Plugins/Demigiant/DOTween/DOTween.XML.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 34192c5e0d14aee43a0e86cc4823268a -TextScriptImporter: - userData: diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/DOTween.dll b/Examples/Assets/Plugins/Demigiant/DOTween/DOTween.dll deleted file mode 100644 index 986eb70..0000000 Binary files a/Examples/Assets/Plugins/Demigiant/DOTween/DOTween.dll and /dev/null differ diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/DOTween.dll.mdb b/Examples/Assets/Plugins/Demigiant/DOTween/DOTween.dll.mdb deleted file mode 100644 index 29b57c3..0000000 Binary files a/Examples/Assets/Plugins/Demigiant/DOTween/DOTween.dll.mdb and /dev/null differ diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/DOTween.dll.mdb.meta b/Examples/Assets/Plugins/Demigiant/DOTween/DOTween.dll.mdb.meta deleted file mode 100644 index f64a22a..0000000 --- a/Examples/Assets/Plugins/Demigiant/DOTween/DOTween.dll.mdb.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 4f007001a22b3d24dae350342c4d19c8 -DefaultImporter: - userData: diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/DOTween.dll.meta b/Examples/Assets/Plugins/Demigiant/DOTween/DOTween.dll.meta deleted file mode 100644 index 482dbb8..0000000 --- a/Examples/Assets/Plugins/Demigiant/DOTween/DOTween.dll.meta +++ /dev/null @@ -1,22 +0,0 @@ -fileFormatVersion: 2 -guid: a811bde74b26b53498b4f6d872b09b6d -PluginImporter: - serializedVersion: 1 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - platformData: - Any: - enabled: 1 - settings: {} - Editor: - enabled: 0 - settings: - DefaultValueInitialized: true - WindowsStoreApps: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/Editor.meta b/Examples/Assets/Plugins/Demigiant/DOTween/Editor.meta deleted file mode 100644 index 532edfb..0000000 --- a/Examples/Assets/Plugins/Demigiant/DOTween/Editor.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: b27f58ae5d5c33a4bb2d1f4f34bd036d -folderAsset: yes -DefaultImporter: - userData: diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/Editor/DOTweenEditor.XML b/Examples/Assets/Plugins/Demigiant/DOTween/Editor/DOTweenEditor.XML deleted file mode 100644 index 9ebc231..0000000 --- a/Examples/Assets/Plugins/Demigiant/DOTween/Editor/DOTweenEditor.XML +++ /dev/null @@ -1,107 +0,0 @@ - - - - DOTweenEditor - - - - - Starts the update loop of tween in the editor. Has no effect during playMode. - - Eventual callback to call after every update - - - - Stops the update loop and clears the onPreviewUpdated callback. - - If TRUE also resets the tweened objects to their original state - - - - Readies the tween for editor preview by setting its UpdateType to Manual plus eventual extra settings. - - The tween to ready - If TRUE (recommended) removes all callbacks (OnComplete/Rewind/etc) - If TRUE prevents the tween from being auto-killed at completion - If TRUE starts playing the tween immediately - - - Full major version + first minor version (ex: 2018.1f) - - - Major version - - - First minor version (ex: in 2018.1 it would be 1) - - - - Checks that the given editor texture use the correct import settings, - and applies them if they're incorrect. - - - - - Returns TRUE if setup is required - - - - - Returns TRUE if the file/directory at the given path exists. - - Path, relative to Unity's project folder - - - - - Converts the given project-relative path to a full path, - with backward (\) slashes). - - - - - Converts the given full path to a path usable with AssetDatabase methods - (relative to Unity's project folder, and with the correct Unity forward (/) slashes). - - - - - Connects to a asset. - If the asset already exists at the given path, loads it and returns it. - Otherwise, either returns NULL or automatically creates it before loading and returning it - (depending on the given parameters). - - Asset type - File path (relative to Unity's project folder) - If TRUE and the requested asset doesn't exist, forces its creation - - - - Full path for the given loaded assembly, assembly file included - - - - - Adds the given global define if it's not already present - - - - - Removes the given global define if it's present - - - - - Returns TRUE if the given global define is present in all the - or only in the given , depending on passed parameters. - - - to use. Leave NULL to check in all of them. - - - - Not used as menu item anymore, but as a utiity function - - - - diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/Editor/DOTweenEditor.XML.meta b/Examples/Assets/Plugins/Demigiant/DOTween/Editor/DOTweenEditor.XML.meta deleted file mode 100644 index 7cec113..0000000 --- a/Examples/Assets/Plugins/Demigiant/DOTween/Editor/DOTweenEditor.XML.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 2e2c6224d345d9249acfa6e8ef40bb2d -TextScriptImporter: - userData: diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/Editor/DOTweenEditor.dll b/Examples/Assets/Plugins/Demigiant/DOTween/Editor/DOTweenEditor.dll deleted file mode 100644 index 42fbb48..0000000 Binary files a/Examples/Assets/Plugins/Demigiant/DOTween/Editor/DOTweenEditor.dll and /dev/null differ diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb b/Examples/Assets/Plugins/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb deleted file mode 100644 index 1599fd5..0000000 Binary files a/Examples/Assets/Plugins/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb and /dev/null differ diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb.meta b/Examples/Assets/Plugins/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb.meta deleted file mode 100644 index bf461f3..0000000 --- a/Examples/Assets/Plugins/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 8f46310a8b0a8f04a92993c37c713243 -DefaultImporter: - userData: diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/Editor/DOTweenEditor.dll.meta b/Examples/Assets/Plugins/Demigiant/DOTween/Editor/DOTweenEditor.dll.meta deleted file mode 100644 index 53590f3..0000000 --- a/Examples/Assets/Plugins/Demigiant/DOTween/Editor/DOTweenEditor.dll.meta +++ /dev/null @@ -1,22 +0,0 @@ -fileFormatVersion: 2 -guid: 45d5034162d6cf04dbe46da84fc7d074 -PluginImporter: - serializedVersion: 1 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - platformData: - Any: - enabled: 0 - settings: {} - Editor: - enabled: 1 - settings: - DefaultValueInitialized: true - WindowsStoreApps: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/Editor/Imgs.meta b/Examples/Assets/Plugins/Demigiant/DOTween/Editor/Imgs.meta deleted file mode 100644 index a81ba5f..0000000 --- a/Examples/Assets/Plugins/Demigiant/DOTween/Editor/Imgs.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 0034ebae0c2a9344e897db1160d71b6d -folderAsset: yes -DefaultImporter: - userData: diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/Editor/Imgs/DOTweenIcon.png b/Examples/Assets/Plugins/Demigiant/DOTween/Editor/Imgs/DOTweenIcon.png deleted file mode 100644 index d06fc7c..0000000 Binary files a/Examples/Assets/Plugins/Demigiant/DOTween/Editor/Imgs/DOTweenIcon.png and /dev/null differ diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/Editor/Imgs/DOTweenIcon.png.meta b/Examples/Assets/Plugins/Demigiant/DOTween/Editor/Imgs/DOTweenIcon.png.meta deleted file mode 100644 index 61c3cce..0000000 --- a/Examples/Assets/Plugins/Demigiant/DOTween/Editor/Imgs/DOTweenIcon.png.meta +++ /dev/null @@ -1,47 +0,0 @@ -fileFormatVersion: 2 -guid: 8da095e39e9b4df488dfd436f81116d6 -TextureImporter: - fileIDToRecycleName: {} - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 0 - linearTexture: 1 - correctGamma: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: .25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 0 - seamlessCubemap: 0 - textureFormat: -3 - maxTextureSize: 128 - textureSettings: - filterMode: 1 - aniso: 1 - mipBias: -1 - wrapMode: 1 - nPOTScale: 0 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: .5, y: .5} - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spritePixelsToUnits: 100 - alphaIsTransparency: 1 - textureType: 2 - buildTargetSettings: [] - spriteSheet: - sprites: [] - spritePackingTag: - userData: diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/Editor/Imgs/Footer.png b/Examples/Assets/Plugins/Demigiant/DOTween/Editor/Imgs/Footer.png deleted file mode 100644 index e29d02f..0000000 Binary files a/Examples/Assets/Plugins/Demigiant/DOTween/Editor/Imgs/Footer.png and /dev/null differ diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/Editor/Imgs/Footer.png.meta b/Examples/Assets/Plugins/Demigiant/DOTween/Editor/Imgs/Footer.png.meta deleted file mode 100644 index 7ca1911..0000000 --- a/Examples/Assets/Plugins/Demigiant/DOTween/Editor/Imgs/Footer.png.meta +++ /dev/null @@ -1,47 +0,0 @@ -fileFormatVersion: 2 -guid: 7051dba417b3d53409f2918f1ea4938d -TextureImporter: - fileIDToRecycleName: {} - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 0 - linearTexture: 1 - correctGamma: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: .25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 0 - seamlessCubemap: 0 - textureFormat: -3 - maxTextureSize: 256 - textureSettings: - filterMode: 1 - aniso: 1 - mipBias: -1 - wrapMode: 1 - nPOTScale: 0 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: .5, y: .5} - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spritePixelsToUnits: 100 - alphaIsTransparency: 1 - textureType: 2 - buildTargetSettings: [] - spriteSheet: - sprites: [] - spritePackingTag: - userData: diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/Editor/Imgs/Footer_dark.png b/Examples/Assets/Plugins/Demigiant/DOTween/Editor/Imgs/Footer_dark.png deleted file mode 100644 index e48db5e..0000000 Binary files a/Examples/Assets/Plugins/Demigiant/DOTween/Editor/Imgs/Footer_dark.png and /dev/null differ diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/Editor/Imgs/Footer_dark.png.meta b/Examples/Assets/Plugins/Demigiant/DOTween/Editor/Imgs/Footer_dark.png.meta deleted file mode 100644 index f12a1a7..0000000 --- a/Examples/Assets/Plugins/Demigiant/DOTween/Editor/Imgs/Footer_dark.png.meta +++ /dev/null @@ -1,47 +0,0 @@ -fileFormatVersion: 2 -guid: 519694efe2bb2914788b151fbd8c01f4 -TextureImporter: - fileIDToRecycleName: {} - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - linearTexture: 0 - correctGamma: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: .25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 0 - seamlessCubemap: 0 - textureFormat: -1 - maxTextureSize: 1024 - textureSettings: - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapMode: -1 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: .5, y: .5} - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spritePixelsToUnits: 100 - alphaIsTransparency: 0 - textureType: -1 - buildTargetSettings: [] - spriteSheet: - sprites: [] - spritePackingTag: - userData: diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/Editor/Imgs/Header.jpg b/Examples/Assets/Plugins/Demigiant/DOTween/Editor/Imgs/Header.jpg deleted file mode 100644 index 4d710d7..0000000 Binary files a/Examples/Assets/Plugins/Demigiant/DOTween/Editor/Imgs/Header.jpg and /dev/null differ diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/Editor/Imgs/Header.jpg.meta b/Examples/Assets/Plugins/Demigiant/DOTween/Editor/Imgs/Header.jpg.meta deleted file mode 100644 index 26e4255..0000000 --- a/Examples/Assets/Plugins/Demigiant/DOTween/Editor/Imgs/Header.jpg.meta +++ /dev/null @@ -1,47 +0,0 @@ -fileFormatVersion: 2 -guid: 78a59ca99f8987941adb61f9e14a06a7 -TextureImporter: - fileIDToRecycleName: {} - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 0 - linearTexture: 1 - correctGamma: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: .25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 0 - seamlessCubemap: 0 - textureFormat: -3 - maxTextureSize: 512 - textureSettings: - filterMode: 1 - aniso: 1 - mipBias: -1 - wrapMode: 1 - nPOTScale: 0 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: .5, y: .5} - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spritePixelsToUnits: 100 - alphaIsTransparency: 1 - textureType: 2 - buildTargetSettings: [] - spriteSheet: - sprites: [] - spritePackingTag: - userData: diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/Modules.meta b/Examples/Assets/Plugins/Demigiant/DOTween/Modules.meta deleted file mode 100644 index 24cd2ac..0000000 --- a/Examples/Assets/Plugins/Demigiant/DOTween/Modules.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 143604b8bad857d47a6f7cc7a533e2dc -folderAsset: yes -DefaultImporter: - userData: diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTween.Modules.asmdef b/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTween.Modules.asmdef deleted file mode 100644 index 42ef5ab..0000000 --- a/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTween.Modules.asmdef +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "DOTween.Modules" -} diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleAudio.cs b/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleAudio.cs deleted file mode 100644 index c195b6c..0000000 --- a/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleAudio.cs +++ /dev/null @@ -1,202 +0,0 @@ -// Author: Daniele Giardini - http://www.demigiant.com -// Created: 2018/07/13 - -#if true // MODULE_MARKER -using System; -using DG.Tweening.Core; -using DG.Tweening.Plugins.Options; -using UnityEngine; -#if UNITY_5 || UNITY_2017_1_OR_NEWER -using UnityEngine.Audio; // Required for AudioMixer -#endif - -#pragma warning disable 1591 -namespace DG.Tweening -{ - public static class DOTweenModuleAudio - { - #region Shortcuts - - #region Audio - - /// Tweens an AudioSource's volume to the given value. - /// Also stores the AudioSource as the tween's target so it can be used for filtered operations - /// The end value to reach (0 to 1)The duration of the tween - public static TweenerCore DOFade(this AudioSource target, float endValue, float duration) - { - if (endValue < 0) endValue = 0; - else if (endValue > 1) endValue = 1; - TweenerCore t = DOTween.To(() => target.volume, x => target.volume = x, endValue, duration); - t.SetTarget(target); - return t; - } - - /// Tweens an AudioSource's pitch to the given value. - /// Also stores the AudioSource as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - public static TweenerCore DOPitch(this AudioSource target, float endValue, float duration) - { - TweenerCore t = DOTween.To(() => target.pitch, x => target.pitch = x, endValue, duration); - t.SetTarget(target); - return t; - } - - #endregion - -#if UNITY_5 || UNITY_2017_1_OR_NEWER - #region AudioMixer (Unity 5 or Newer) - - /// Tweens an AudioMixer's exposed float to the given value. - /// Also stores the AudioMixer as the tween's target so it can be used for filtered operations. - /// Note that you need to manually expose a float in an AudioMixerGroup in order to be able to tween it from an AudioMixer. - /// Name given to the exposed float to set - /// The end value to reachThe duration of the tween - public static TweenerCore DOSetFloat(this AudioMixer target, string floatName, float endValue, float duration) - { - TweenerCore t = DOTween.To(()=> { - float currVal; - target.GetFloat(floatName, out currVal); - return currVal; - }, x=> target.SetFloat(floatName, x), endValue, duration); - t.SetTarget(target); - return t; - } - - #region Operation Shortcuts - - /// - /// Completes all tweens that have this target as a reference - /// (meaning tweens that were started from this target, or that had this target added as an Id) - /// and returns the total number of tweens completed - /// (meaning the tweens that don't have infinite loops and were not already complete) - /// - /// For Sequences only: if TRUE also internal Sequence callbacks will be fired, - /// otherwise they will be ignored - public static int DOComplete(this AudioMixer target, bool withCallbacks = false) - { - return DOTween.Complete(target, withCallbacks); - } - - /// - /// Kills all tweens that have this target as a reference - /// (meaning tweens that were started from this target, or that had this target added as an Id) - /// and returns the total number of tweens killed. - /// - /// If TRUE completes the tween before killing it - public static int DOKill(this AudioMixer target, bool complete = false) - { - return DOTween.Kill(target, complete); - } - - /// - /// Flips the direction (backwards if it was going forward or viceversa) of all tweens that have this target as a reference - /// (meaning tweens that were started from this target, or that had this target added as an Id) - /// and returns the total number of tweens flipped. - /// - public static int DOFlip(this AudioMixer target) - { - return DOTween.Flip(target); - } - - /// - /// Sends to the given position all tweens that have this target as a reference - /// (meaning tweens that were started from this target, or that had this target added as an Id) - /// and returns the total number of tweens involved. - /// - /// Time position to reach - /// (if higher than the whole tween duration the tween will simply reach its end) - /// If TRUE will play the tween after reaching the given position, otherwise it will pause it - public static int DOGoto(this AudioMixer target, float to, bool andPlay = false) - { - return DOTween.Goto(target, to, andPlay); - } - - /// - /// Pauses all tweens that have this target as a reference - /// (meaning tweens that were started from this target, or that had this target added as an Id) - /// and returns the total number of tweens paused. - /// - public static int DOPause(this AudioMixer target) - { - return DOTween.Pause(target); - } - - /// - /// Plays all tweens that have this target as a reference - /// (meaning tweens that were started from this target, or that had this target added as an Id) - /// and returns the total number of tweens played. - /// - public static int DOPlay(this AudioMixer target) - { - return DOTween.Play(target); - } - - /// - /// Plays backwards all tweens that have this target as a reference - /// (meaning tweens that were started from this target, or that had this target added as an Id) - /// and returns the total number of tweens played. - /// - public static int DOPlayBackwards(this AudioMixer target) - { - return DOTween.PlayBackwards(target); - } - - /// - /// Plays forward all tweens that have this target as a reference - /// (meaning tweens that were started from this target, or that had this target added as an Id) - /// and returns the total number of tweens played. - /// - public static int DOPlayForward(this AudioMixer target) - { - return DOTween.PlayForward(target); - } - - /// - /// Restarts all tweens that have this target as a reference - /// (meaning tweens that were started from this target, or that had this target added as an Id) - /// and returns the total number of tweens restarted. - /// - public static int DORestart(this AudioMixer target) - { - return DOTween.Restart(target); - } - - /// - /// Rewinds all tweens that have this target as a reference - /// (meaning tweens that were started from this target, or that had this target added as an Id) - /// and returns the total number of tweens rewinded. - /// - public static int DORewind(this AudioMixer target) - { - return DOTween.Rewind(target); - } - - /// - /// Smoothly rewinds all tweens that have this target as a reference - /// (meaning tweens that were started from this target, or that had this target added as an Id) - /// and returns the total number of tweens rewinded. - /// - public static int DOSmoothRewind(this AudioMixer target) - { - return DOTween.SmoothRewind(target); - } - - /// - /// Toggles the paused state (plays if it was paused, pauses if it was playing) of all tweens that have this target as a reference - /// (meaning tweens that were started from this target, or that had this target added as an Id) - /// and returns the total number of tweens involved. - /// - public static int DOTogglePause(this AudioMixer target) - { - return DOTween.TogglePause(target); - } - - #endregion - - #endregion -#endif - - #endregion - } -} -#endif diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModulePhysics.cs b/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModulePhysics.cs deleted file mode 100644 index 08b0700..0000000 --- a/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModulePhysics.cs +++ /dev/null @@ -1,216 +0,0 @@ -// Author: Daniele Giardini - http://www.demigiant.com -// Created: 2018/07/13 - -#if true // MODULE_MARKER -using System; -using DG.Tweening.Core; -using DG.Tweening.Core.Enums; -using DG.Tweening.Plugins; -using DG.Tweening.Plugins.Core.PathCore; -using DG.Tweening.Plugins.Options; -using UnityEngine; - -#pragma warning disable 1591 -namespace DG.Tweening -{ - public static class DOTweenModulePhysics - { - #region Shortcuts - - #region Rigidbody - - /// Tweens a Rigidbody's position to the given value. - /// Also stores the rigidbody as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - /// If TRUE the tween will smoothly snap all values to integers - public static TweenerCore DOMove(this Rigidbody target, Vector3 endValue, float duration, bool snapping = false) - { - TweenerCore t = DOTween.To(() => target.position, target.MovePosition, endValue, duration); - t.SetOptions(snapping).SetTarget(target); - return t; - } - - /// Tweens a Rigidbody's X position to the given value. - /// Also stores the rigidbody as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - /// If TRUE the tween will smoothly snap all values to integers - public static TweenerCore DOMoveX(this Rigidbody target, float endValue, float duration, bool snapping = false) - { - TweenerCore t = DOTween.To(() => target.position, target.MovePosition, new Vector3(endValue, 0, 0), duration); - t.SetOptions(AxisConstraint.X, snapping).SetTarget(target); - return t; - } - - /// Tweens a Rigidbody's Y position to the given value. - /// Also stores the rigidbody as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - /// If TRUE the tween will smoothly snap all values to integers - public static TweenerCore DOMoveY(this Rigidbody target, float endValue, float duration, bool snapping = false) - { - TweenerCore t = DOTween.To(() => target.position, target.MovePosition, new Vector3(0, endValue, 0), duration); - t.SetOptions(AxisConstraint.Y, snapping).SetTarget(target); - return t; - } - - /// Tweens a Rigidbody's Z position to the given value. - /// Also stores the rigidbody as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - /// If TRUE the tween will smoothly snap all values to integers - public static TweenerCore DOMoveZ(this Rigidbody target, float endValue, float duration, bool snapping = false) - { - TweenerCore t = DOTween.To(() => target.position, target.MovePosition, new Vector3(0, 0, endValue), duration); - t.SetOptions(AxisConstraint.Z, snapping).SetTarget(target); - return t; - } - - /// Tweens a Rigidbody's rotation to the given value. - /// Also stores the rigidbody as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - /// Rotation mode - public static TweenerCore DORotate(this Rigidbody target, Vector3 endValue, float duration, RotateMode mode = RotateMode.Fast) - { - TweenerCore t = DOTween.To(() => target.rotation, target.MoveRotation, endValue, duration); - t.SetTarget(target); - t.plugOptions.rotateMode = mode; - return t; - } - - /// Tweens a Rigidbody's rotation so that it will look towards the given position. - /// Also stores the rigidbody as the tween's target so it can be used for filtered operations - /// The position to look atThe duration of the tween - /// Eventual axis constraint for the rotation - /// The vector that defines in which direction up is (default: Vector3.up) - public static TweenerCore DOLookAt(this Rigidbody target, Vector3 towards, float duration, AxisConstraint axisConstraint = AxisConstraint.None, Vector3? up = null) - { - TweenerCore t = DOTween.To(() => target.rotation, target.MoveRotation, towards, duration) - .SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetLookAt); - t.plugOptions.axisConstraint = axisConstraint; - t.plugOptions.up = (up == null) ? Vector3.up : (Vector3)up; - return t; - } - - #region Special - - /// Tweens a Rigidbody's position to the given value, while also applying a jump effect along the Y axis. - /// Returns a Sequence instead of a Tweener. - /// Also stores the Rigidbody as the tween's target so it can be used for filtered operations - /// The end value to reach - /// Power of the jump (the max height of the jump is represented by this plus the final Y offset) - /// Total number of jumps - /// The duration of the tween - /// If TRUE the tween will smoothly snap all values to integers - public static Sequence DOJump(this Rigidbody target, Vector3 endValue, float jumpPower, int numJumps, float duration, bool snapping = false) - { - if (numJumps < 1) numJumps = 1; - float startPosY = 0; - float offsetY = -1; - bool offsetYSet = false; - Sequence s = DOTween.Sequence(); - Tween yTween = DOTween.To(() => target.position, target.MovePosition, new Vector3(0, jumpPower, 0), duration / (numJumps * 2)) - .SetOptions(AxisConstraint.Y, snapping).SetEase(Ease.OutQuad).SetRelative() - .SetLoops(numJumps * 2, LoopType.Yoyo) - .OnStart(() => startPosY = target.position.y); - s.Append(DOTween.To(() => target.position, target.MovePosition, new Vector3(endValue.x, 0, 0), duration) - .SetOptions(AxisConstraint.X, snapping).SetEase(Ease.Linear) - ).Join(DOTween.To(() => target.position, target.MovePosition, new Vector3(0, 0, endValue.z), duration) - .SetOptions(AxisConstraint.Z, snapping).SetEase(Ease.Linear) - ).Join(yTween) - .SetTarget(target).SetEase(DOTween.defaultEaseType); - yTween.OnUpdate(() => { - if (!offsetYSet) { - offsetYSet = true; - offsetY = s.isRelative ? endValue.y : endValue.y - startPosY; - } - Vector3 pos = target.position; - pos.y += DOVirtual.EasedValue(0, offsetY, yTween.ElapsedPercentage(), Ease.OutQuad); - target.MovePosition(pos); - }); - return s; - } - - /// Tweens a Rigidbody's position through the given path waypoints, using the chosen path algorithm. - /// Also stores the Rigidbody as the tween's target so it can be used for filtered operations. - /// NOTE: to tween a rigidbody correctly it should be set to kinematic at least while being tweened. - /// BEWARE: doesn't work on Windows Phone store (waiting for Unity to fix their own bug). - /// If you plan to publish there you should use a regular transform.DOPath. - /// The waypoints to go through - /// The duration of the tween - /// The type of path: Linear (straight path), CatmullRom (curved CatmullRom path) or CubicBezier (curved with control points) - /// The path mode: 3D, side-scroller 2D, top-down 2D - /// The resolution of the path (useless in case of Linear paths): higher resolutions make for more detailed curved paths but are more expensive. - /// Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints - /// The color of the path (shown when gizmos are active in the Play panel and the tween is running) - public static TweenerCore DOPath( - this Rigidbody target, Vector3[] path, float duration, PathType pathType = PathType.Linear, - PathMode pathMode = PathMode.Full3D, int resolution = 10, Color? gizmoColor = null - ) - { - if (resolution < 1) resolution = 1; - TweenerCore t = DOTween.To(PathPlugin.Get(), () => target.position, target.MovePosition, new Path(pathType, path, resolution, gizmoColor), duration) - .SetTarget(target).SetUpdate(UpdateType.Fixed); - - t.plugOptions.isRigidbody = true; - t.plugOptions.mode = pathMode; - return t; - } - /// Tweens a Rigidbody's localPosition through the given path waypoints, using the chosen path algorithm. - /// Also stores the Rigidbody as the tween's target so it can be used for filtered operations - /// NOTE: to tween a rigidbody correctly it should be set to kinematic at least while being tweened. - /// BEWARE: doesn't work on Windows Phone store (waiting for Unity to fix their own bug). - /// If you plan to publish there you should use a regular transform.DOLocalPath. - /// The waypoint to go through - /// The duration of the tween - /// The type of path: Linear (straight path), CatmullRom (curved CatmullRom path) or CubicBezier (curved with control points) - /// The path mode: 3D, side-scroller 2D, top-down 2D - /// The resolution of the path: higher resolutions make for more detailed curved paths but are more expensive. - /// Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints - /// The color of the path (shown when gizmos are active in the Play panel and the tween is running) - public static TweenerCore DOLocalPath( - this Rigidbody target, Vector3[] path, float duration, PathType pathType = PathType.Linear, - PathMode pathMode = PathMode.Full3D, int resolution = 10, Color? gizmoColor = null - ) - { - if (resolution < 1) resolution = 1; - Transform trans = target.transform; - TweenerCore t = DOTween.To(PathPlugin.Get(), () => trans.localPosition, x => target.MovePosition(trans.parent == null ? x : trans.parent.TransformPoint(x)), new Path(pathType, path, resolution, gizmoColor), duration) - .SetTarget(target).SetUpdate(UpdateType.Fixed); - - t.plugOptions.isRigidbody = true; - t.plugOptions.mode = pathMode; - t.plugOptions.useLocalPosition = true; - return t; - } - // Used by path editor when creating the actual tween, so it can pass a pre-compiled path - internal static TweenerCore DOPath( - this Rigidbody target, Path path, float duration, PathMode pathMode = PathMode.Full3D - ) - { - TweenerCore t = DOTween.To(PathPlugin.Get(), () => target.position, target.MovePosition, path, duration) - .SetTarget(target); - - t.plugOptions.isRigidbody = true; - t.plugOptions.mode = pathMode; - return t; - } - internal static TweenerCore DOLocalPath( - this Rigidbody target, Path path, float duration, PathMode pathMode = PathMode.Full3D - ) - { - Transform trans = target.transform; - TweenerCore t = DOTween.To(PathPlugin.Get(), () => trans.localPosition, x => target.MovePosition(trans.parent == null ? x : trans.parent.TransformPoint(x)), path, duration) - .SetTarget(target); - - t.plugOptions.isRigidbody = true; - t.plugOptions.mode = pathMode; - t.plugOptions.useLocalPosition = true; - return t; - } - - #endregion - - #endregion - - #endregion - } -} -#endif diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModulePhysics.cs.meta b/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModulePhysics.cs.meta deleted file mode 100644 index 0ce0d75..0000000 --- a/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModulePhysics.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: dae9aa560b4242648a3affa2bfabc365 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModulePhysics2D.cs b/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModulePhysics2D.cs deleted file mode 100644 index eab2cbf..0000000 --- a/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModulePhysics2D.cs +++ /dev/null @@ -1,168 +0,0 @@ -// Author: Daniele Giardini - http://www.demigiant.com -// Created: 2018/07/13 - -#if true && (UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1_OR_NEWER) // MODULE_MARKER -using System; -using DG.Tweening.Core; -using DG.Tweening.Plugins; -using DG.Tweening.Plugins.Core.PathCore; -using DG.Tweening.Plugins.Options; -using UnityEngine; - -#pragma warning disable 1591 -namespace DG.Tweening -{ - public static class DOTweenModulePhysics2D - { - #region Shortcuts - - #region Rigidbody2D Shortcuts - - /// Tweens a Rigidbody2D's position to the given value. - /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - /// If TRUE the tween will smoothly snap all values to integers - public static TweenerCore DOMove(this Rigidbody2D target, Vector2 endValue, float duration, bool snapping = false) - { - TweenerCore t = DOTween.To(() => target.position, target.MovePosition, endValue, duration); - t.SetOptions(snapping).SetTarget(target); - return t; - } - - /// Tweens a Rigidbody2D's X position to the given value. - /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - /// If TRUE the tween will smoothly snap all values to integers - public static TweenerCore DOMoveX(this Rigidbody2D target, float endValue, float duration, bool snapping = false) - { - TweenerCore t = DOTween.To(() => target.position, target.MovePosition, new Vector2(endValue, 0), duration); - t.SetOptions(AxisConstraint.X, snapping).SetTarget(target); - return t; - } - - /// Tweens a Rigidbody2D's Y position to the given value. - /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - /// If TRUE the tween will smoothly snap all values to integers - public static TweenerCore DOMoveY(this Rigidbody2D target, float endValue, float duration, bool snapping = false) - { - TweenerCore t = DOTween.To(() => target.position, target.MovePosition, new Vector2(0, endValue), duration); - t.SetOptions(AxisConstraint.Y, snapping).SetTarget(target); - return t; - } - - /// Tweens a Rigidbody2D's rotation to the given value. - /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - public static TweenerCore DORotate(this Rigidbody2D target, float endValue, float duration) - { - TweenerCore t = DOTween.To(() => target.rotation, target.MoveRotation, endValue, duration); - t.SetTarget(target); - return t; - } - - #region Special - - /// Tweens a Rigidbody2D's position to the given value, while also applying a jump effect along the Y axis. - /// Returns a Sequence instead of a Tweener. - /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations. - /// IMPORTANT: a rigidbody2D can't be animated in a jump arc using MovePosition, so the tween will directly set the position - /// The end value to reach - /// Power of the jump (the max height of the jump is represented by this plus the final Y offset) - /// Total number of jumps - /// The duration of the tween - /// If TRUE the tween will smoothly snap all values to integers - public static Sequence DOJump(this Rigidbody2D target, Vector2 endValue, float jumpPower, int numJumps, float duration, bool snapping = false) - { - if (numJumps < 1) numJumps = 1; - float startPosY = 0; - float offsetY = -1; - bool offsetYSet = false; - Sequence s = DOTween.Sequence(); - Tween yTween = DOTween.To(() => target.position, x => target.position = x, new Vector2(0, jumpPower), duration / (numJumps * 2)) - .SetOptions(AxisConstraint.Y, snapping).SetEase(Ease.OutQuad).SetRelative() - .SetLoops(numJumps * 2, LoopType.Yoyo) - .OnStart(() => startPosY = target.position.y); - s.Append(DOTween.To(() => target.position, x => target.position = x, new Vector2(endValue.x, 0), duration) - .SetOptions(AxisConstraint.X, snapping).SetEase(Ease.Linear) - ).Join(yTween) - .SetTarget(target).SetEase(DOTween.defaultEaseType); - yTween.OnUpdate(() => { - if (!offsetYSet) { - offsetYSet = true; - offsetY = s.isRelative ? endValue.y : endValue.y - startPosY; - } - Vector3 pos = target.position; - pos.y += DOVirtual.EasedValue(0, offsetY, yTween.ElapsedPercentage(), Ease.OutQuad); - target.MovePosition(pos); - }); - return s; - } - - /// Tweens a Rigidbody2D's position through the given path waypoints, using the chosen path algorithm. - /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations. - /// NOTE: to tween a Rigidbody2D correctly it should be set to kinematic at least while being tweened. - /// BEWARE: doesn't work on Windows Phone store (waiting for Unity to fix their own bug). - /// If you plan to publish there you should use a regular transform.DOPath. - /// The waypoints to go through - /// The duration of the tween - /// The type of path: Linear (straight path), CatmullRom (curved CatmullRom path) or CubicBezier (curved with control points) - /// The path mode: 3D, side-scroller 2D, top-down 2D - /// The resolution of the path (useless in case of Linear paths): higher resolutions make for more detailed curved paths but are more expensive. - /// Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints - /// The color of the path (shown when gizmos are active in the Play panel and the tween is running) - public static TweenerCore DOPath( - this Rigidbody2D target, Vector2[] path, float duration, PathType pathType = PathType.Linear, - PathMode pathMode = PathMode.Full3D, int resolution = 10, Color? gizmoColor = null - ) - { - if (resolution < 1) resolution = 1; - int len = path.Length; - Vector3[] path3D = new Vector3[len]; - for (int i = 0; i < len; ++i) path3D[i] = path[i]; - TweenerCore t = DOTween.To(PathPlugin.Get(), () => target.position, x => target.MovePosition(x), new Path(pathType, path3D, resolution, gizmoColor), duration) - .SetTarget(target).SetUpdate(UpdateType.Fixed); - - t.plugOptions.isRigidbody = true; - t.plugOptions.mode = pathMode; - return t; - } - /// Tweens a Rigidbody2D's localPosition through the given path waypoints, using the chosen path algorithm. - /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations - /// NOTE: to tween a Rigidbody2D correctly it should be set to kinematic at least while being tweened. - /// BEWARE: doesn't work on Windows Phone store (waiting for Unity to fix their own bug). - /// If you plan to publish there you should use a regular transform.DOLocalPath. - /// The waypoint to go through - /// The duration of the tween - /// The type of path: Linear (straight path), CatmullRom (curved CatmullRom path) or CubicBezier (curved with control points) - /// The path mode: 3D, side-scroller 2D, top-down 2D - /// The resolution of the path: higher resolutions make for more detailed curved paths but are more expensive. - /// Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints - /// The color of the path (shown when gizmos are active in the Play panel and the tween is running) - public static TweenerCore DOLocalPath( - this Rigidbody2D target, Vector2[] path, float duration, PathType pathType = PathType.Linear, - PathMode pathMode = PathMode.Full3D, int resolution = 10, Color? gizmoColor = null - ) - { - if (resolution < 1) resolution = 1; - int len = path.Length; - Vector3[] path3D = new Vector3[len]; - for (int i = 0; i < len; ++i) path3D[i] = path[i]; - Transform trans = target.transform; - TweenerCore t = DOTween.To(PathPlugin.Get(), () => trans.localPosition, x => target.MovePosition(trans.parent == null ? x : trans.parent.TransformPoint(x)), new Path(pathType, path3D, resolution, gizmoColor), duration) - .SetTarget(target).SetUpdate(UpdateType.Fixed); - - t.plugOptions.isRigidbody = true; - t.plugOptions.mode = pathMode; - t.plugOptions.useLocalPosition = true; - return t; - } - - #endregion - - #endregion - - #endregion - } -} -#endif diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModulePhysics2D.cs.meta b/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModulePhysics2D.cs.meta deleted file mode 100644 index ca9ed29..0000000 --- a/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModulePhysics2D.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 230fe34542e175245ba74b4659dae700 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleSprite.cs b/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleSprite.cs deleted file mode 100644 index 549fff3..0000000 --- a/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleSprite.cs +++ /dev/null @@ -1,93 +0,0 @@ -// Author: Daniele Giardini - http://www.demigiant.com -// Created: 2018/07/13 - -#if true && (UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1_OR_NEWER) // MODULE_MARKER -using System; -using UnityEngine; -using DG.Tweening.Core; -using DG.Tweening.Plugins.Options; - -#pragma warning disable 1591 -namespace DG.Tweening -{ - public static class DOTweenModuleSprite - { - #region Shortcuts - - #region SpriteRenderer - - /// Tweens a SpriteRenderer's color to the given value. - /// Also stores the spriteRenderer as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - public static TweenerCore DOColor(this SpriteRenderer target, Color endValue, float duration) - { - TweenerCore t = DOTween.To(() => target.color, x => target.color = x, endValue, duration); - t.SetTarget(target); - return t; - } - - /// Tweens a Material's alpha color to the given value. - /// Also stores the spriteRenderer as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - public static TweenerCore DOFade(this SpriteRenderer target, float endValue, float duration) - { - TweenerCore t = DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration); - t.SetTarget(target); - return t; - } - - /// Tweens a SpriteRenderer's color using the given gradient - /// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener). - /// Also stores the image as the tween's target so it can be used for filtered operations - /// The gradient to useThe duration of the tween - public static Sequence DOGradientColor(this SpriteRenderer target, Gradient gradient, float duration) - { - Sequence s = DOTween.Sequence(); - GradientColorKey[] colors = gradient.colorKeys; - int len = colors.Length; - for (int i = 0; i < len; ++i) { - GradientColorKey c = colors[i]; - if (i == 0 && c.time <= 0) { - target.color = c.color; - continue; - } - float colorDuration = i == len - 1 - ? duration - s.Duration(false) // Verifies that total duration is correct - : duration * (i == 0 ? c.time : c.time - colors[i - 1].time); - s.Append(target.DOColor(c.color, colorDuration).SetEase(Ease.Linear)); - } - s.SetTarget(target); - return s; - } - - #endregion - - #region Blendables - - #region SpriteRenderer - - /// Tweens a SpriteRenderer's color to the given value, - /// in a way that allows other DOBlendableColor tweens to work together on the same target, - /// instead than fight each other as multiple DOColor would do. - /// Also stores the SpriteRenderer as the tween's target so it can be used for filtered operations - /// The value to tween toThe duration of the tween - public static Tweener DOBlendableColor(this SpriteRenderer target, Color endValue, float duration) - { - endValue = endValue - target.color; - Color to = new Color(0, 0, 0, 0); - return DOTween.To(() => to, x => { - Color diff = x - to; - to = x; - target.color += diff; - }, endValue, duration) - .Blendable().SetTarget(target); - } - - #endregion - - #endregion - - #endregion - } -} -#endif diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleSprite.cs.meta b/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleSprite.cs.meta deleted file mode 100644 index a0c67c4..0000000 --- a/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleSprite.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 188918ab119d93148aa0de59ccf5286b -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleUI.cs b/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleUI.cs deleted file mode 100644 index ee32bed..0000000 --- a/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleUI.cs +++ /dev/null @@ -1,634 +0,0 @@ -// Author: Daniele Giardini - http://www.demigiant.com -// Created: 2018/07/13 - -#if true && (UNITY_4_6 || UNITY_5 || UNITY_2017_1_OR_NEWER) // MODULE_MARKER - -using System; -using System.Globalization; -using UnityEngine; -using UnityEngine.UI; -using DG.Tweening.Core; -using DG.Tweening.Core.Enums; -using DG.Tweening.Plugins.Options; - -#pragma warning disable 1591 -namespace DG.Tweening -{ - public static class DOTweenModuleUI - { - #region Shortcuts - - #region CanvasGroup - - /// Tweens a CanvasGroup's alpha color to the given value. - /// Also stores the canvasGroup as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - public static TweenerCore DOFade(this CanvasGroup target, float endValue, float duration) - { - TweenerCore t = DOTween.To(() => target.alpha, x => target.alpha = x, endValue, duration); - t.SetTarget(target); - return t; - } - - #endregion - - #region Graphic - - /// Tweens an Graphic's color to the given value. - /// Also stores the image as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - public static TweenerCore DOColor(this Graphic target, Color endValue, float duration) - { - TweenerCore t = DOTween.To(() => target.color, x => target.color = x, endValue, duration); - t.SetTarget(target); - return t; - } - - /// Tweens an Graphic's alpha color to the given value. - /// Also stores the image as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - public static TweenerCore DOFade(this Graphic target, float endValue, float duration) - { - TweenerCore t = DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration); - t.SetTarget(target); - return t; - } - - #endregion - - #region Image - - /// Tweens an Image's color to the given value. - /// Also stores the image as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - public static TweenerCore DOColor(this Image target, Color endValue, float duration) - { - TweenerCore t = DOTween.To(() => target.color, x => target.color = x, endValue, duration); - t.SetTarget(target); - return t; - } - - /// Tweens an Image's alpha color to the given value. - /// Also stores the image as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - public static TweenerCore DOFade(this Image target, float endValue, float duration) - { - TweenerCore t = DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration); - t.SetTarget(target); - return t; - } - - /// Tweens an Image's fillAmount to the given value. - /// Also stores the image as the tween's target so it can be used for filtered operations - /// The end value to reach (0 to 1)The duration of the tween - public static TweenerCore DOFillAmount(this Image target, float endValue, float duration) - { - if (endValue > 1) endValue = 1; - else if (endValue < 0) endValue = 0; - TweenerCore t = DOTween.To(() => target.fillAmount, x => target.fillAmount = x, endValue, duration); - t.SetTarget(target); - return t; - } - - /// Tweens an Image's colors using the given gradient - /// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener). - /// Also stores the image as the tween's target so it can be used for filtered operations - /// The gradient to useThe duration of the tween - public static Sequence DOGradientColor(this Image target, Gradient gradient, float duration) - { - Sequence s = DOTween.Sequence(); - GradientColorKey[] colors = gradient.colorKeys; - int len = colors.Length; - for (int i = 0; i < len; ++i) { - GradientColorKey c = colors[i]; - if (i == 0 && c.time <= 0) { - target.color = c.color; - continue; - } - float colorDuration = i == len - 1 - ? duration - s.Duration(false) // Verifies that total duration is correct - : duration * (i == 0 ? c.time : c.time - colors[i - 1].time); - s.Append(target.DOColor(c.color, colorDuration).SetEase(Ease.Linear)); - } - s.SetTarget(target); - return s; - } - - #endregion - - #region LayoutElement - - /// Tweens an LayoutElement's flexibleWidth/Height to the given value. - /// Also stores the LayoutElement as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - /// If TRUE the tween will smoothly snap all values to integers - public static TweenerCore DOFlexibleSize(this LayoutElement target, Vector2 endValue, float duration, bool snapping = false) - { - TweenerCore t = DOTween.To(() => new Vector2(target.flexibleWidth, target.flexibleHeight), x => { - target.flexibleWidth = x.x; - target.flexibleHeight = x.y; - }, endValue, duration); - t.SetOptions(snapping).SetTarget(target); - return t; - } - - /// Tweens an LayoutElement's minWidth/Height to the given value. - /// Also stores the LayoutElement as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - /// If TRUE the tween will smoothly snap all values to integers - public static TweenerCore DOMinSize(this LayoutElement target, Vector2 endValue, float duration, bool snapping = false) - { - TweenerCore t = DOTween.To(() => new Vector2(target.minWidth, target.minHeight), x => { - target.minWidth = x.x; - target.minHeight = x.y; - }, endValue, duration); - t.SetOptions(snapping).SetTarget(target); - return t; - } - - /// Tweens an LayoutElement's preferredWidth/Height to the given value. - /// Also stores the LayoutElement as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - /// If TRUE the tween will smoothly snap all values to integers - public static TweenerCore DOPreferredSize(this LayoutElement target, Vector2 endValue, float duration, bool snapping = false) - { - TweenerCore t = DOTween.To(() => new Vector2(target.preferredWidth, target.preferredHeight), x => { - target.preferredWidth = x.x; - target.preferredHeight = x.y; - }, endValue, duration); - t.SetOptions(snapping).SetTarget(target); - return t; - } - - #endregion - - #region Outline - - /// Tweens a Outline's effectColor to the given value. - /// Also stores the Outline as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - public static TweenerCore DOColor(this Outline target, Color endValue, float duration) - { - TweenerCore t = DOTween.To(() => target.effectColor, x => target.effectColor = x, endValue, duration); - t.SetTarget(target); - return t; - } - - /// Tweens a Outline's effectColor alpha to the given value. - /// Also stores the Outline as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - public static TweenerCore DOFade(this Outline target, float endValue, float duration) - { - TweenerCore t = DOTween.ToAlpha(() => target.effectColor, x => target.effectColor = x, endValue, duration); - t.SetTarget(target); - return t; - } - - /// Tweens a Outline's effectDistance to the given value. - /// Also stores the Outline as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - public static TweenerCore DOScale(this Outline target, Vector2 endValue, float duration) - { - TweenerCore t = DOTween.To(() => target.effectDistance, x => target.effectDistance = x, endValue, duration); - t.SetTarget(target); - return t; - } - - #endregion - - #region RectTransform - - /// Tweens a RectTransform's anchoredPosition to the given value. - /// Also stores the RectTransform as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - /// If TRUE the tween will smoothly snap all values to integers - public static TweenerCore DOAnchorPos(this RectTransform target, Vector2 endValue, float duration, bool snapping = false) - { - TweenerCore t = DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, endValue, duration); - t.SetOptions(snapping).SetTarget(target); - return t; - } - /// Tweens a RectTransform's anchoredPosition X to the given value. - /// Also stores the RectTransform as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - /// If TRUE the tween will smoothly snap all values to integers - public static TweenerCore DOAnchorPosX(this RectTransform target, float endValue, float duration, bool snapping = false) - { - TweenerCore t = DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, new Vector2(endValue, 0), duration); - t.SetOptions(AxisConstraint.X, snapping).SetTarget(target); - return t; - } - /// Tweens a RectTransform's anchoredPosition Y to the given value. - /// Also stores the RectTransform as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - /// If TRUE the tween will smoothly snap all values to integers - public static TweenerCore DOAnchorPosY(this RectTransform target, float endValue, float duration, bool snapping = false) - { - TweenerCore t = DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, new Vector2(0, endValue), duration); - t.SetOptions(AxisConstraint.Y, snapping).SetTarget(target); - return t; - } - - /// Tweens a RectTransform's anchoredPosition3D to the given value. - /// Also stores the RectTransform as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - /// If TRUE the tween will smoothly snap all values to integers - public static TweenerCore DOAnchorPos3D(this RectTransform target, Vector3 endValue, float duration, bool snapping = false) - { - TweenerCore t = DOTween.To(() => target.anchoredPosition3D, x => target.anchoredPosition3D = x, endValue, duration); - t.SetOptions(snapping).SetTarget(target); - return t; - } - /// Tweens a RectTransform's anchoredPosition3D X to the given value. - /// Also stores the RectTransform as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - /// If TRUE the tween will smoothly snap all values to integers - public static TweenerCore DOAnchorPos3DX(this RectTransform target, float endValue, float duration, bool snapping = false) - { - TweenerCore t = DOTween.To(() => target.anchoredPosition3D, x => target.anchoredPosition3D = x, new Vector3(endValue, 0, 0), duration); - t.SetOptions(AxisConstraint.X, snapping).SetTarget(target); - return t; - } - /// Tweens a RectTransform's anchoredPosition3D Y to the given value. - /// Also stores the RectTransform as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - /// If TRUE the tween will smoothly snap all values to integers - public static TweenerCore DOAnchorPos3DY(this RectTransform target, float endValue, float duration, bool snapping = false) - { - TweenerCore t = DOTween.To(() => target.anchoredPosition3D, x => target.anchoredPosition3D = x, new Vector3(0, endValue, 0), duration); - t.SetOptions(AxisConstraint.Y, snapping).SetTarget(target); - return t; - } - /// Tweens a RectTransform's anchoredPosition3D Z to the given value. - /// Also stores the RectTransform as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - /// If TRUE the tween will smoothly snap all values to integers - public static TweenerCore DOAnchorPos3DZ(this RectTransform target, float endValue, float duration, bool snapping = false) - { - TweenerCore t = DOTween.To(() => target.anchoredPosition3D, x => target.anchoredPosition3D = x, new Vector3(0, 0, endValue), duration); - t.SetOptions(AxisConstraint.Z, snapping).SetTarget(target); - return t; - } - - /// Tweens a RectTransform's anchorMax to the given value. - /// Also stores the RectTransform as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - /// If TRUE the tween will smoothly snap all values to integers - public static TweenerCore DOAnchorMax(this RectTransform target, Vector2 endValue, float duration, bool snapping = false) - { - TweenerCore t = DOTween.To(() => target.anchorMax, x => target.anchorMax = x, endValue, duration); - t.SetOptions(snapping).SetTarget(target); - return t; - } - - /// Tweens a RectTransform's anchorMin to the given value. - /// Also stores the RectTransform as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - /// If TRUE the tween will smoothly snap all values to integers - public static TweenerCore DOAnchorMin(this RectTransform target, Vector2 endValue, float duration, bool snapping = false) - { - TweenerCore t = DOTween.To(() => target.anchorMin, x => target.anchorMin = x, endValue, duration); - t.SetOptions(snapping).SetTarget(target); - return t; - } - - /// Tweens a RectTransform's pivot to the given value. - /// Also stores the RectTransform as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - public static TweenerCore DOPivot(this RectTransform target, Vector2 endValue, float duration) - { - TweenerCore t = DOTween.To(() => target.pivot, x => target.pivot = x, endValue, duration); - t.SetTarget(target); - return t; - } - /// Tweens a RectTransform's pivot X to the given value. - /// Also stores the RectTransform as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - public static TweenerCore DOPivotX(this RectTransform target, float endValue, float duration) - { - TweenerCore t = DOTween.To(() => target.pivot, x => target.pivot = x, new Vector2(endValue, 0), duration); - t.SetOptions(AxisConstraint.X).SetTarget(target); - return t; - } - /// Tweens a RectTransform's pivot Y to the given value. - /// Also stores the RectTransform as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - public static TweenerCore DOPivotY(this RectTransform target, float endValue, float duration) - { - TweenerCore t = DOTween.To(() => target.pivot, x => target.pivot = x, new Vector2(0, endValue), duration); - t.SetOptions(AxisConstraint.Y).SetTarget(target); - return t; - } - - /// Tweens a RectTransform's sizeDelta to the given value. - /// Also stores the RectTransform as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - /// If TRUE the tween will smoothly snap all values to integers - public static TweenerCore DOSizeDelta(this RectTransform target, Vector2 endValue, float duration, bool snapping = false) - { - TweenerCore t = DOTween.To(() => target.sizeDelta, x => target.sizeDelta = x, endValue, duration); - t.SetOptions(snapping).SetTarget(target); - return t; - } - - /// Punches a RectTransform's anchoredPosition towards the given direction and then back to the starting one - /// as if it was connected to the starting position via an elastic. - /// Also stores the RectTransform as the tween's target so it can be used for filtered operations - /// The direction and strength of the punch (added to the RectTransform's current position) - /// The duration of the tween - /// Indicates how much will the punch vibrate - /// Represents how much (0 to 1) the vector will go beyond the starting position when bouncing backwards. - /// 1 creates a full oscillation between the punch direction and the opposite direction, - /// while 0 oscillates only between the punch and the start position - /// If TRUE the tween will smoothly snap all values to integers - public static Tweener DOPunchAnchorPos(this RectTransform target, Vector2 punch, float duration, int vibrato = 10, float elasticity = 1, bool snapping = false) - { - return DOTween.Punch(() => target.anchoredPosition, x => target.anchoredPosition = x, punch, duration, vibrato, elasticity) - .SetTarget(target).SetOptions(snapping); - } - - /// Shakes a RectTransform's anchoredPosition with the given values. - /// Also stores the RectTransform as the tween's target so it can be used for filtered operations - /// The duration of the tween - /// The shake strength - /// Indicates how much will the shake vibrate - /// Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). - /// Setting it to 0 will shake along a single direction. - /// If TRUE the tween will smoothly snap all values to integers - /// If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not - public static Tweener DOShakeAnchorPos(this RectTransform target, float duration, float strength = 100, int vibrato = 10, float randomness = 90, bool snapping = false, bool fadeOut = true) - { - return DOTween.Shake(() => target.anchoredPosition, x => target.anchoredPosition = x, duration, strength, vibrato, randomness, true, fadeOut) - .SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetShake).SetOptions(snapping); - } - /// Shakes a RectTransform's anchoredPosition with the given values. - /// Also stores the RectTransform as the tween's target so it can be used for filtered operations - /// The duration of the tween - /// The shake strength on each axis - /// Indicates how much will the shake vibrate - /// Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). - /// Setting it to 0 will shake along a single direction. - /// If TRUE the tween will smoothly snap all values to integers - /// If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not - public static Tweener DOShakeAnchorPos(this RectTransform target, float duration, Vector2 strength, int vibrato = 10, float randomness = 90, bool snapping = false, bool fadeOut = true) - { - return DOTween.Shake(() => target.anchoredPosition, x => target.anchoredPosition = x, duration, strength, vibrato, randomness, fadeOut) - .SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetShake).SetOptions(snapping); - } - - #region Special - - /// Tweens a RectTransform's anchoredPosition to the given value, while also applying a jump effect along the Y axis. - /// Returns a Sequence instead of a Tweener. - /// Also stores the RectTransform as the tween's target so it can be used for filtered operations - /// The end value to reach - /// Power of the jump (the max height of the jump is represented by this plus the final Y offset) - /// Total number of jumps - /// The duration of the tween - /// If TRUE the tween will smoothly snap all values to integers - public static Sequence DOJumpAnchorPos(this RectTransform target, Vector2 endValue, float jumpPower, int numJumps, float duration, bool snapping = false) - { - if (numJumps < 1) numJumps = 1; - float startPosY = 0; - float offsetY = -1; - bool offsetYSet = false; - - // Separate Y Tween so we can elaborate elapsedPercentage on that insted of on the Sequence - // (in case users add a delay or other elements to the Sequence) - Sequence s = DOTween.Sequence(); - Tween yTween = DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, new Vector2(0, jumpPower), duration / (numJumps * 2)) - .SetOptions(AxisConstraint.Y, snapping).SetEase(Ease.OutQuad).SetRelative() - .SetLoops(numJumps * 2, LoopType.Yoyo) - .OnStart(()=> startPosY = target.anchoredPosition.y); - s.Append(DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, new Vector2(endValue.x, 0), duration) - .SetOptions(AxisConstraint.X, snapping).SetEase(Ease.Linear) - ).Join(yTween) - .SetTarget(target).SetEase(DOTween.defaultEaseType); - s.OnUpdate(() => { - if (!offsetYSet) { - offsetYSet = true; - offsetY = s.isRelative ? endValue.y : endValue.y - startPosY; - } - Vector2 pos = target.anchoredPosition; - pos.y += DOVirtual.EasedValue(0, offsetY, s.ElapsedDirectionalPercentage(), Ease.OutQuad); - target.anchoredPosition = pos; - }); - return s; - } - - #endregion - - #endregion - - #region ScrollRect - - /// Tweens a ScrollRect's horizontal/verticalNormalizedPosition to the given value. - /// Also stores the ScrollRect as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - /// If TRUE the tween will smoothly snap all values to integers - public static Tweener DONormalizedPos(this ScrollRect target, Vector2 endValue, float duration, bool snapping = false) - { - return DOTween.To(() => new Vector2(target.horizontalNormalizedPosition, target.verticalNormalizedPosition), - x => { - target.horizontalNormalizedPosition = x.x; - target.verticalNormalizedPosition = x.y; - }, endValue, duration) - .SetOptions(snapping).SetTarget(target); - } - /// Tweens a ScrollRect's horizontalNormalizedPosition to the given value. - /// Also stores the ScrollRect as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - /// If TRUE the tween will smoothly snap all values to integers - public static Tweener DOHorizontalNormalizedPos(this ScrollRect target, float endValue, float duration, bool snapping = false) - { - return DOTween.To(() => target.horizontalNormalizedPosition, x => target.horizontalNormalizedPosition = x, endValue, duration) - .SetOptions(snapping).SetTarget(target); - } - /// Tweens a ScrollRect's verticalNormalizedPosition to the given value. - /// Also stores the ScrollRect as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - /// If TRUE the tween will smoothly snap all values to integers - public static Tweener DOVerticalNormalizedPos(this ScrollRect target, float endValue, float duration, bool snapping = false) - { - return DOTween.To(() => target.verticalNormalizedPosition, x => target.verticalNormalizedPosition = x, endValue, duration) - .SetOptions(snapping).SetTarget(target); - } - - #endregion - - #region Slider - - /// Tweens a Slider's value to the given value. - /// Also stores the Slider as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - /// If TRUE the tween will smoothly snap all values to integers - public static TweenerCore DOValue(this Slider target, float endValue, float duration, bool snapping = false) - { - TweenerCore t = DOTween.To(() => target.value, x => target.value = x, endValue, duration); - t.SetOptions(snapping).SetTarget(target); - return t; - } - - #endregion - - #region Text - - /// Tweens a Text's color to the given value. - /// Also stores the Text as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - public static TweenerCore DOColor(this Text target, Color endValue, float duration) - { - TweenerCore t = DOTween.To(() => target.color, x => target.color = x, endValue, duration); - t.SetTarget(target); - return t; - } - - /// - /// Tweens a Text's text from one integer to another, with options for thousands separators - /// - /// The value to start from - /// The end value to reach - /// The duration of the tween - /// If TRUE (default) also adds thousands separators - /// The to use (InvariantCulture if NULL) - public static TweenerCore DOCounter( - this Text target, int fromValue, int endValue, float duration, bool addThousandsSeparator = true, CultureInfo culture = null - ){ - int v = fromValue; - CultureInfo cInfo = !addThousandsSeparator ? null : culture ?? CultureInfo.InvariantCulture; - TweenerCore t = DOTween.To(() => v, x => { - v = x; - target.text = addThousandsSeparator - ? v.ToString("N0", cInfo) - : v.ToString(); - }, endValue, duration); - t.SetTarget(target); - return t; - } - - /// Tweens a Text's alpha color to the given value. - /// Also stores the Text as the tween's target so it can be used for filtered operations - /// The end value to reachThe duration of the tween - public static TweenerCore DOFade(this Text target, float endValue, float duration) - { - TweenerCore t = DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration); - t.SetTarget(target); - return t; - } - - /// Tweens a Text's text to the given value. - /// Also stores the Text as the tween's target so it can be used for filtered operations - /// The end string to tween toThe duration of the tween - /// If TRUE (default), rich text will be interpreted correctly while animated, - /// otherwise all tags will be considered as normal text - /// The type of scramble mode to use, if any - /// A string containing the characters to use for scrambling. - /// Use as many characters as possible (minimum 10) because DOTween uses a fast scramble mode which gives better results with more characters. - /// Leave it to NULL (default) to use default ones - public static TweenerCore DOText(this Text target, string endValue, float duration, bool richTextEnabled = true, ScrambleMode scrambleMode = ScrambleMode.None, string scrambleChars = null) - { - if (endValue == null) { - if (Debugger.logPriority > 0) Debugger.LogWarning("You can't pass a NULL string to DOText: an empty string will be used instead to avoid errors"); - endValue = ""; - } - TweenerCore t = DOTween.To(() => target.text, x => target.text = x, endValue, duration); - t.SetOptions(richTextEnabled, scrambleMode, scrambleChars) - .SetTarget(target); - return t; - } - - #endregion - - #region Blendables - - #region Graphic - - /// Tweens a Graphic's color to the given value, - /// in a way that allows other DOBlendableColor tweens to work together on the same target, - /// instead than fight each other as multiple DOColor would do. - /// Also stores the Graphic as the tween's target so it can be used for filtered operations - /// The value to tween toThe duration of the tween - public static Tweener DOBlendableColor(this Graphic target, Color endValue, float duration) - { - endValue = endValue - target.color; - Color to = new Color(0, 0, 0, 0); - return DOTween.To(() => to, x => { - Color diff = x - to; - to = x; - target.color += diff; - }, endValue, duration) - .Blendable().SetTarget(target); - } - - #endregion - - #region Image - - /// Tweens a Image's color to the given value, - /// in a way that allows other DOBlendableColor tweens to work together on the same target, - /// instead than fight each other as multiple DOColor would do. - /// Also stores the Image as the tween's target so it can be used for filtered operations - /// The value to tween toThe duration of the tween - public static Tweener DOBlendableColor(this Image target, Color endValue, float duration) - { - endValue = endValue - target.color; - Color to = new Color(0, 0, 0, 0); - return DOTween.To(() => to, x => { - Color diff = x - to; - to = x; - target.color += diff; - }, endValue, duration) - .Blendable().SetTarget(target); - } - - #endregion - - #region Text - - /// Tweens a Text's color BY the given value, - /// in a way that allows other DOBlendableColor tweens to work together on the same target, - /// instead than fight each other as multiple DOColor would do. - /// Also stores the Text as the tween's target so it can be used for filtered operations - /// The value to tween toThe duration of the tween - public static Tweener DOBlendableColor(this Text target, Color endValue, float duration) - { - endValue = endValue - target.color; - Color to = new Color(0, 0, 0, 0); - return DOTween.To(() => to, x => { - Color diff = x - to; - to = x; - target.color += diff; - }, endValue, duration) - .Blendable().SetTarget(target); - } - - #endregion - - #endregion - - #endregion - - // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ - // ███ INTERNAL CLASSES ████████████████████████████████████████████████████████████████████████████████████████████████ - // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ - - public static class Utils - { - /// - /// Converts the anchoredPosition of the first RectTransform to the second RectTransform, - /// taking into consideration offset, anchors and pivot, and returns the new anchoredPosition - /// - public static Vector2 SwitchToRectTransform(RectTransform from, RectTransform to) - { - Vector2 localPoint; - Vector2 fromPivotDerivedOffset = new Vector2(from.rect.width * 0.5f + from.rect.xMin, from.rect.height * 0.5f + from.rect.yMin); - Vector2 screenP = RectTransformUtility.WorldToScreenPoint(null, from.position); - screenP += fromPivotDerivedOffset; - RectTransformUtility.ScreenPointToLocalPointInRectangle(to, screenP, null, out localPoint); - Vector2 pivotDerivedOffset = new Vector2(to.rect.width * 0.5f + to.rect.xMin, to.rect.height * 0.5f + to.rect.yMin); - return to.anchoredPosition + localPoint - pivotDerivedOffset; - } - } - } -} -#endif diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleUI.cs.meta b/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleUI.cs.meta deleted file mode 100644 index 60d55ef..0000000 --- a/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleUI.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: a060394c03331a64392db53a10e7f2d1 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleUnityVersion.cs b/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleUnityVersion.cs deleted file mode 100644 index 49a22bc..0000000 --- a/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleUnityVersion.cs +++ /dev/null @@ -1,403 +0,0 @@ -// Author: Daniele Giardini - http://www.demigiant.com -// Created: 2018/07/13 - -using System; -using UnityEngine; -using DG.Tweening.Core; -using DG.Tweening.Plugins.Options; -#if UNITY_2018_1_OR_NEWER && (NET_4_6 || NET_STANDARD_2_0) -using System.Threading.Tasks; -#endif - -#pragma warning disable 1591 -namespace DG.Tweening -{ - /// - /// Shortcuts/functions that are not strictly related to specific Modules - /// but are available only on some Unity versions - /// - public static class DOTweenModuleUnityVersion - { -#if UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1_OR_NEWER - #region Unity 4.3 or Newer - - #region Material - - /// Tweens a Material's color using the given gradient - /// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener). - /// Also stores the image as the tween's target so it can be used for filtered operations - /// The gradient to useThe duration of the tween - public static Sequence DOGradientColor(this Material target, Gradient gradient, float duration) - { - Sequence s = DOTween.Sequence(); - GradientColorKey[] colors = gradient.colorKeys; - int len = colors.Length; - for (int i = 0; i < len; ++i) { - GradientColorKey c = colors[i]; - if (i == 0 && c.time <= 0) { - target.color = c.color; - continue; - } - float colorDuration = i == len - 1 - ? duration - s.Duration(false) // Verifies that total duration is correct - : duration * (i == 0 ? c.time : c.time - colors[i - 1].time); - s.Append(target.DOColor(c.color, colorDuration).SetEase(Ease.Linear)); - } - s.SetTarget(target); - return s; - } - /// Tweens a Material's named color property using the given gradient - /// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener). - /// Also stores the image as the tween's target so it can be used for filtered operations - /// The gradient to use - /// The name of the material property to tween (like _Tint or _SpecColor) - /// The duration of the tween - public static Sequence DOGradientColor(this Material target, Gradient gradient, string property, float duration) - { - Sequence s = DOTween.Sequence(); - GradientColorKey[] colors = gradient.colorKeys; - int len = colors.Length; - for (int i = 0; i < len; ++i) { - GradientColorKey c = colors[i]; - if (i == 0 && c.time <= 0) { - target.SetColor(property, c.color); - continue; - } - float colorDuration = i == len - 1 - ? duration - s.Duration(false) // Verifies that total duration is correct - : duration * (i == 0 ? c.time : c.time - colors[i - 1].time); - s.Append(target.DOColor(c.color, property, colorDuration).SetEase(Ease.Linear)); - } - s.SetTarget(target); - return s; - } - - #endregion - - #endregion -#endif - -#if UNITY_5_3_OR_NEWER || UNITY_2017_1_OR_NEWER - #region Unity 5.3 or Newer - - #region CustomYieldInstructions - - /// - /// Returns a that waits until the tween is killed or complete. - /// It can be used inside a coroutine as a yield. - /// Example usage:yield return myTween.WaitForCompletion(true); - /// - public static CustomYieldInstruction WaitForCompletion(this Tween t, bool returnCustomYieldInstruction) - { - if (!t.active) { - if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t); - return null; - } - return new DOTweenCYInstruction.WaitForCompletion(t); - } - - /// - /// Returns a that waits until the tween is killed or rewinded. - /// It can be used inside a coroutine as a yield. - /// Example usage:yield return myTween.WaitForRewind(); - /// - public static CustomYieldInstruction WaitForRewind(this Tween t, bool returnCustomYieldInstruction) - { - if (!t.active) { - if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t); - return null; - } - return new DOTweenCYInstruction.WaitForRewind(t); - } - - /// - /// Returns a that waits until the tween is killed. - /// It can be used inside a coroutine as a yield. - /// Example usage:yield return myTween.WaitForKill(); - /// - public static CustomYieldInstruction WaitForKill(this Tween t, bool returnCustomYieldInstruction) - { - if (!t.active) { - if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t); - return null; - } - return new DOTweenCYInstruction.WaitForKill(t); - } - - /// - /// Returns a that waits until the tween is killed or has gone through the given amount of loops. - /// It can be used inside a coroutine as a yield. - /// Example usage:yield return myTween.WaitForElapsedLoops(2); - /// - /// Elapsed loops to wait for - public static CustomYieldInstruction WaitForElapsedLoops(this Tween t, int elapsedLoops, bool returnCustomYieldInstruction) - { - if (!t.active) { - if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t); - return null; - } - return new DOTweenCYInstruction.WaitForElapsedLoops(t, elapsedLoops); - } - - /// - /// Returns a that waits until the tween is killed - /// or has reached the given time position (loops included, delays excluded). - /// It can be used inside a coroutine as a yield. - /// Example usage:yield return myTween.WaitForPosition(2.5f); - /// - /// Position (loops included, delays excluded) to wait for - public static CustomYieldInstruction WaitForPosition(this Tween t, float position, bool returnCustomYieldInstruction) - { - if (!t.active) { - if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t); - return null; - } - return new DOTweenCYInstruction.WaitForPosition(t, position); - } - - /// - /// Returns a that waits until the tween is killed or started - /// (meaning when the tween is set in a playing state the first time, after any eventual delay). - /// It can be used inside a coroutine as a yield. - /// Example usage:yield return myTween.WaitForStart(); - /// - public static CustomYieldInstruction WaitForStart(this Tween t, bool returnCustomYieldInstruction) - { - if (!t.active) { - if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t); - return null; - } - return new DOTweenCYInstruction.WaitForStart(t); - } - - #endregion - - #endregion -#endif - -#if UNITY_2018_1_OR_NEWER - #region Unity 2018.1 or Newer - - #region Material - - /// Tweens a Material's named texture offset property with the given ID to the given value. - /// Also stores the material as the tween's target so it can be used for filtered operations - /// The end value to reach - /// The ID of the material property to tween (also called nameID in Unity's manual) - /// The duration of the tween - public static TweenerCore DOOffset(this Material target, Vector2 endValue, int propertyID, float duration) - { - if (!target.HasProperty(propertyID)) { - if (Debugger.logPriority > 0) Debugger.LogMissingMaterialProperty(propertyID); - return null; - } - TweenerCore t = DOTween.To(() => target.GetTextureOffset(propertyID), x => target.SetTextureOffset(propertyID, x), endValue, duration); - t.SetTarget(target); - return t; - } - - /// Tweens a Material's named texture scale property with the given ID to the given value. - /// Also stores the material as the tween's target so it can be used for filtered operations - /// The end value to reach - /// The ID of the material property to tween (also called nameID in Unity's manual) - /// The duration of the tween - public static TweenerCore DOTiling(this Material target, Vector2 endValue, int propertyID, float duration) - { - if (!target.HasProperty(propertyID)) { - if (Debugger.logPriority > 0) Debugger.LogMissingMaterialProperty(propertyID); - return null; - } - TweenerCore t = DOTween.To(() => target.GetTextureScale(propertyID), x => target.SetTextureScale(propertyID, x), endValue, duration); - t.SetTarget(target); - return t; - } - - #endregion - - #region .NET 4.6 or Newer - -#if (NET_4_6 || NET_STANDARD_2_0) - - #region Async Instructions - - /// - /// Returns an async that waits until the tween is killed or complete. - /// It can be used inside an async operation. - /// Example usage:await myTween.WaitForCompletion(); - /// - public static async Task AsyncWaitForCompletion(this Tween t) - { - if (!t.active) { - if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t); - return; - } - while (t.active && !t.IsComplete()) await Task.Yield(); - } - - /// - /// Returns an async that waits until the tween is killed or rewinded. - /// It can be used inside an async operation. - /// Example usage:await myTween.AsyncWaitForRewind(); - /// - public static async Task AsyncWaitForRewind(this Tween t) - { - if (!t.active) { - if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t); - return; - } - while (t.active && (!t.playedOnce || t.position * (t.CompletedLoops() + 1) > 0)) await Task.Yield(); - } - - /// - /// Returns an async that waits until the tween is killed. - /// It can be used inside an async operation. - /// Example usage:await myTween.AsyncWaitForKill(); - /// - public static async Task AsyncWaitForKill(this Tween t) - { - if (!t.active) { - if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t); - return; - } - while (t.active) await Task.Yield(); - } - - /// - /// Returns an async that waits until the tween is killed or has gone through the given amount of loops. - /// It can be used inside an async operation. - /// Example usage:await myTween.AsyncWaitForElapsedLoops(); - /// - /// Elapsed loops to wait for - public static async Task AsyncWaitForElapsedLoops(this Tween t, int elapsedLoops) - { - if (!t.active) { - if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t); - return; - } - while (t.active && t.CompletedLoops() < elapsedLoops) await Task.Yield(); - } - - /// - /// Returns an async that waits until the tween is killed or started - /// (meaning when the tween is set in a playing state the first time, after any eventual delay). - /// It can be used inside an async operation. - /// Example usage:await myTween.AsyncWaitForPosition(); - /// - /// Position (loops included, delays excluded) to wait for - public static async Task AsyncWaitForPosition(this Tween t, float position) - { - if (!t.active) { - if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t); - return; - } - while (t.active && t.position * (t.CompletedLoops() + 1) < position) await Task.Yield(); - } - - /// - /// Returns an async that waits until the tween is killed. - /// It can be used inside an async operation. - /// Example usage:await myTween.AsyncWaitForKill(); - /// - public static async Task AsyncWaitForStart(this Tween t) - { - if (!t.active) { - if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t); - return; - } - while (t.active && !t.playedOnce) await Task.Yield(); - } - - #endregion -#endif - - #endregion - - #endregion -#endif - } - - // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ - // ███ CLASSES █████████████████████████████████████████████████████████████████████████████████████████████████████████ - // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ - -#if UNITY_5_3_OR_NEWER || UNITY_2017_1_OR_NEWER - public static class DOTweenCYInstruction - { - public class WaitForCompletion : CustomYieldInstruction - { - public override bool keepWaiting { get { - return t.active && !t.IsComplete(); - }} - readonly Tween t; - public WaitForCompletion(Tween tween) - { - t = tween; - } - } - - public class WaitForRewind : CustomYieldInstruction - { - public override bool keepWaiting { get { - return t.active && (!t.playedOnce || t.position * (t.CompletedLoops() + 1) > 0); - }} - readonly Tween t; - public WaitForRewind(Tween tween) - { - t = tween; - } - } - - public class WaitForKill : CustomYieldInstruction - { - public override bool keepWaiting { get { - return t.active; - }} - readonly Tween t; - public WaitForKill(Tween tween) - { - t = tween; - } - } - - public class WaitForElapsedLoops : CustomYieldInstruction - { - public override bool keepWaiting { get { - return t.active && t.CompletedLoops() < elapsedLoops; - }} - readonly Tween t; - readonly int elapsedLoops; - public WaitForElapsedLoops(Tween tween, int elapsedLoops) - { - t = tween; - this.elapsedLoops = elapsedLoops; - } - } - - public class WaitForPosition : CustomYieldInstruction - { - public override bool keepWaiting { get { - return t.active && t.position * (t.CompletedLoops() + 1) < position; - }} - readonly Tween t; - readonly float position; - public WaitForPosition(Tween tween, float position) - { - t = tween; - this.position = position; - } - } - - public class WaitForStart : CustomYieldInstruction - { - public override bool keepWaiting { get { - return t.active && !t.playedOnce; - }} - readonly Tween t; - public WaitForStart(Tween tween) - { - t = tween; - } - } - } -#endif -} diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleUnityVersion.cs.meta b/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleUnityVersion.cs.meta deleted file mode 100644 index 290189f..0000000 --- a/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleUnityVersion.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 63c02322328255542995bd02b47b0457 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs b/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs deleted file mode 100644 index 8a1fb5f..0000000 --- a/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs +++ /dev/null @@ -1,155 +0,0 @@ -// Author: Daniele Giardini - http://www.demigiant.com -// Created: 2018/07/13 - -using System; -using System.Reflection; -using UnityEngine; -using DG.Tweening.Core; -using DG.Tweening.Plugins.Core.PathCore; -using DG.Tweening.Plugins.Options; - -#pragma warning disable 1591 -namespace DG.Tweening -{ - /// - /// Utility functions that deal with available Modules. - /// Modules defines: - /// - DOTAUDIO - /// - DOTPHYSICS - /// - DOTPHYSICS2D - /// - DOTSPRITE - /// - DOTUI - /// Extra defines set and used for implementation of external assets: - /// - DOTWEEN_TMP ► TextMesh Pro - /// - DOTWEEN_TK2D ► 2D Toolkit - /// - public static class DOTweenModuleUtils - { - static bool _initialized; - - #region Reflection - - /// - /// Called via Reflection by DOTweenComponent on Awake - /// -#if UNITY_2018_1_OR_NEWER - [UnityEngine.Scripting.Preserve] -#endif - public static void Init() - { - if (_initialized) return; - - _initialized = true; - DOTweenExternalCommand.SetOrientationOnPath += Physics.SetOrientationOnPath; - -#if UNITY_EDITOR -#if UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1 - UnityEditor.EditorApplication.playmodeStateChanged += PlaymodeStateChanged; -#else - UnityEditor.EditorApplication.playModeStateChanged += PlaymodeStateChanged; -#endif -#endif - } - -#if UNITY_2018_1_OR_NEWER -#pragma warning disable - [UnityEngine.Scripting.Preserve] - // Just used to preserve methods when building, never called - static void Preserver() - { - Assembly[] loadedAssemblies = AppDomain.CurrentDomain.GetAssemblies(); - MethodInfo mi = typeof(MonoBehaviour).GetMethod("Stub"); - } -#pragma warning restore -#endif - - #endregion - -#if UNITY_EDITOR - // Fires OnApplicationPause in DOTweenComponent even when Editor is paused (otherwise it's only fired at runtime) -#if UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1 - static void PlaymodeStateChanged() - #else - static void PlaymodeStateChanged(UnityEditor.PlayModeStateChange state) -#endif - { - if (DOTween.instance == null) return; - DOTween.instance.OnApplicationPause(UnityEditor.EditorApplication.isPaused); - } -#endif - - // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ - // ███ INTERNAL CLASSES ████████████████████████████████████████████████████████████████████████████████████████████████ - // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ - - public static class Physics - { - // Called via DOTweenExternalCommand callback - public static void SetOrientationOnPath(PathOptions options, Tween t, Quaternion newRot, Transform trans) - { -#if true // PHYSICS_MARKER - if (options.isRigidbody) ((Rigidbody)t.target).rotation = newRot; - else trans.rotation = newRot; -#else - trans.rotation = newRot; -#endif - } - - // Returns FALSE if the DOTween's Physics2D Module is disabled, or if there's no Rigidbody2D attached - public static bool HasRigidbody2D(Component target) - { -#if true // PHYSICS2D_MARKER - return target.GetComponent() != null; -#else - return false; -#endif - } - - #region Called via Reflection - - - // Called via Reflection by DOTweenPathInspector - // Returns FALSE if the DOTween's Physics Module is disabled, or if there's no rigidbody attached -#if UNITY_2018_1_OR_NEWER - [UnityEngine.Scripting.Preserve] -#endif - public static bool HasRigidbody(Component target) - { -#if true // PHYSICS_MARKER - return target.GetComponent() != null; -#else - return false; -#endif - } - - // Called via Reflection by DOTweenPath -#if UNITY_2018_1_OR_NEWER - [UnityEngine.Scripting.Preserve] -#endif - public static TweenerCore CreateDOTweenPathTween( - MonoBehaviour target, bool tweenRigidbody, bool isLocal, Path path, float duration, PathMode pathMode - ){ - TweenerCore t; -#if true // PHYSICS_MARKER - Rigidbody rBody = tweenRigidbody ? target.GetComponent() : null; - if (tweenRigidbody && rBody != null) { - t = isLocal - ? rBody.DOLocalPath(path, duration, pathMode) - : rBody.DOPath(path, duration, pathMode); - } else { - t = isLocal - ? target.transform.DOLocalPath(path, duration, pathMode) - : target.transform.DOPath(path, duration, pathMode); - } -#else - t = isLocal - ? target.transform.DOLocalPath(path, duration, pathMode) - : target.transform.DOPath(path, duration, pathMode); -#endif - return t; - } - - #endregion - } - } -} diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs.meta b/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs.meta deleted file mode 100644 index ab62186..0000000 --- a/Examples/Assets/Plugins/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 7bcaf917d9cf5b84090421a5a2abe42e -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/readme.txt b/Examples/Assets/Plugins/Demigiant/DOTween/readme.txt deleted file mode 100644 index 37ff7ef..0000000 --- a/Examples/Assets/Plugins/Demigiant/DOTween/readme.txt +++ /dev/null @@ -1,29 +0,0 @@ -DOTween and DOTween Pro are copyright (c) 2014-2018 Daniele Giardini - Demigiant - -// IMPORTANT!!! ///////////////////////////////////////////// -// Upgrading DOTween from versions older than 1.2.000 /////// -// (or DOTween Pro older than 1.0.000) ////////////////////// -------------------------------------------------------------- -If you're upgrading your project from a version of DOTween older than 1.2.000 (or DOTween Pro older than 1.0.000) please follow these instructions carefully. -1) Import the new version in the same folder as the previous one, overwriting old files. A lot of errors will appear but don't worry -2) Close and reopen Unity (and your project). This is fundamental: skipping this step will cause a bloodbath -3) Open DOTween's Utility Panel (Tools > Demigiant > DOTween Utility Panel) if it doesn't open automatically, then press "Setup DOTween...": this will run the upgrade setup -4) From the Add/Remove Modules panel that opens, activate/deactivate Modules for Unity systems and for external assets (Pro version only) - -// GET STARTED ////////////////////////////////////////////// - -- After importing a new DOTween update, select DOTween's Utility Panel from the "Tools/Demigiant" menu (if it doesn't open automatically) and press the "Setup DOTween..." button to activate/deactivate Modules. You can also access a Preferences Tab from there to choose default settings for DOTween. -- In your code, add "using DG.Tweening" to each class where you want to use DOTween. -- You're ready to tween. Check out the links below for full documentation and license info. - - -// LINKS /////////////////////////////////////////////////////// - -DOTween website (documentation, examples, etc): http://dotween.demigiant.com -DOTween license: http://dotween.demigiant.com/license.php -DOTween repository (Google Code): https://code.google.com/p/dotween/ -Demigiant website (documentation, examples, etc): http://www.demigiant.com - -// NOTES ////////////////////////////////////////////////////// - -- DOTween's Utility Panel can be found under "Tools > Demigiant > DOTween Utility Panel" and also contains other useful options, plus a tab to set DOTween's preferences \ No newline at end of file diff --git a/Examples/Assets/Plugins/Demigiant/DOTween/readme.txt.meta b/Examples/Assets/Plugins/Demigiant/DOTween/readme.txt.meta deleted file mode 100644 index 3799165..0000000 --- a/Examples/Assets/Plugins/Demigiant/DOTween/readme.txt.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: fccfc62abf2eb0a4db614853430894fd -TextScriptImporter: - userData: diff --git a/Examples/Assets/SRP/UniversalRenderPipelineAsset.asset b/Examples/Assets/SRP/UniversalRenderPipelineAsset.asset index 7b4abd1..93654ce 100644 --- a/Examples/Assets/SRP/UniversalRenderPipelineAsset.asset +++ b/Examples/Assets/SRP/UniversalRenderPipelineAsset.asset @@ -23,7 +23,7 @@ MonoBehaviour: m_RequireOpaqueTexture: 0 m_OpaqueDownsampling: 1 m_SupportsTerrainHoles: 1 - m_SupportsHDR: 1 + m_SupportsHDR: 0 m_MSAA: 1 m_RenderScale: 1 m_MainLightRenderingMode: 1 @@ -37,12 +37,12 @@ MonoBehaviour: m_AdditionalLightsShadowResolutionTierMedium: 512 m_AdditionalLightsShadowResolutionTierHigh: 1024 m_ShadowDistance: 50 - m_ShadowCascadeCount: 1 + m_ShadowCascadeCount: 3 m_Cascade2Split: 0.25 m_Cascade3Split: {x: 0.1, y: 0.3} m_Cascade4Split: {x: 0.067, y: 0.2, z: 0.467} m_CascadeBorder: 0.2 - m_ShadowDepthBias: 0 + m_ShadowDepthBias: 0.48 m_ShadowNormalBias: 0 m_SoftShadowsSupported: 1 m_UseSRPBatcher: 1 diff --git a/Examples/Packages/manifest.json b/Examples/Packages/manifest.json index 35ddb9c..e829f02 100644 --- a/Examples/Packages/manifest.json +++ b/Examples/Packages/manifest.json @@ -44,15 +44,17 @@ "com.unity.modules.video": "1.0.0", "com.unity.modules.vr": "1.0.0", "com.unity.modules.wind": "1.0.0", - "com.unity.modules.xr": "1.0.0" + "com.unity.modules.xr": "1.0.0", + "com.demigiant.dotween": "1.2.42" }, "scopedRegistries": [ { "name": "package.openupm.com", "url": "https://package.openupm.com", "scopes": [ + "com.demigiant.dotween", "com.openupm" ] } ] -} +} \ No newline at end of file diff --git a/Examples/Packages/packages-lock.json b/Examples/Packages/packages-lock.json index 5ac71c7..084bb29 100644 --- a/Examples/Packages/packages-lock.json +++ b/Examples/Packages/packages-lock.json @@ -7,6 +7,13 @@ "dependencies": {}, "hash": "946b9003f057b25bfdf4a7833f5a087edd27d1d8" }, + "com.demigiant.dotween": { + "version": "1.2.42", + "depth": 0, + "source": "registry", + "dependencies": {}, + "url": "https://package.openupm.com" + }, "com.mischief.markdownviewer": { "version": "https://github.com/gwaredd/UnityMarkdownViewer.git", "depth": 0, diff --git a/Examples/ProjectSettings/PackageManagerSettings.asset b/Examples/ProjectSettings/PackageManagerSettings.asset index e0c2a23..98c0b6e 100644 --- a/Examples/ProjectSettings/PackageManagerSettings.asset +++ b/Examples/ProjectSettings/PackageManagerSettings.asset @@ -29,6 +29,7 @@ MonoBehaviour: m_Name: package.openupm.com m_Url: https://package.openupm.com m_Scopes: + - com.demigiant.dotween - com.openupm m_IsDefault: 0 m_Capabilities: 0