├── .github
└── FUNDING.yml
├── Assets
├── Demigiant.meta
├── Demigiant
│ ├── DOTween.meta
│ └── DOTween
│ │ ├── DOTween.XML
│ │ ├── DOTween.XML.meta
│ │ ├── DOTween.dll
│ │ ├── DOTween.dll.mdb
│ │ ├── DOTween.dll.mdb.meta
│ │ ├── DOTween.dll.meta
│ │ ├── Editor.meta
│ │ ├── Editor
│ │ ├── DOTweenEditor.XML
│ │ ├── DOTweenEditor.XML.meta
│ │ ├── DOTweenEditor.dll
│ │ ├── DOTweenEditor.dll.mdb
│ │ ├── DOTweenEditor.dll.mdb.meta
│ │ ├── DOTweenEditor.dll.meta
│ │ ├── Imgs.meta
│ │ └── Imgs
│ │ │ ├── DOTweenIcon.png
│ │ │ ├── DOTweenIcon.png.meta
│ │ │ ├── Footer.png
│ │ │ ├── Footer.png.meta
│ │ │ ├── Footer_dark.png
│ │ │ ├── Footer_dark.png.meta
│ │ │ ├── Header.jpg
│ │ │ └── Header.jpg.meta
│ │ ├── Modules.meta
│ │ ├── Modules
│ │ ├── DOTweenModuleAudio.cs
│ │ ├── DOTweenModuleAudio.cs.meta
│ │ ├── DOTweenModulePhysics.cs
│ │ ├── DOTweenModulePhysics.cs.meta
│ │ ├── DOTweenModulePhysics2D.cs
│ │ ├── DOTweenModulePhysics2D.cs.meta
│ │ ├── DOTweenModuleSprite.cs
│ │ ├── DOTweenModuleSprite.cs.meta
│ │ ├── DOTweenModuleUI.cs
│ │ ├── DOTweenModuleUI.cs.meta
│ │ ├── DOTweenModuleUnityVersion.cs
│ │ ├── DOTweenModuleUnityVersion.cs.meta
│ │ ├── DOTweenModuleUtils.cs
│ │ └── DOTweenModuleUtils.cs.meta
│ │ ├── readme.txt
│ │ └── readme.txt.meta
├── Demo.cs
├── Demo.cs.meta
├── PickerWheel.meta
├── PickerWheel
│ ├── Prefabs.meta
│ ├── Prefabs
│ │ ├── Line.prefab
│ │ ├── Line.prefab.meta
│ │ ├── PickerWheel.prefab
│ │ ├── PickerWheel.prefab.meta
│ │ ├── Piece.prefab
│ │ └── Piece.prefab.meta
│ ├── Scripts.meta
│ ├── Scripts
│ │ ├── PickerWheel.cs
│ │ ├── PickerWheel.cs.meta
│ │ ├── WheelPiece.cs
│ │ └── WheelPiece.cs.meta
│ ├── Sounds.meta
│ ├── Sounds
│ │ ├── tick1.ogg
│ │ ├── tick1.ogg.meta
│ │ ├── tick2.ogg
│ │ └── tick2.ogg.meta
│ ├── Sprites.meta
│ └── Sprites
│ │ ├── Circle.png
│ │ ├── Circle.png.meta
│ │ ├── Circle2.png
│ │ ├── Circle2.png.meta
│ │ ├── Indicator.png
│ │ ├── Indicator.png.meta
│ │ ├── R_Square.png
│ │ ├── R_Square.png.meta
│ │ ├── characters.png
│ │ └── characters.png.meta
├── Resources.meta
├── Resources
│ ├── DOTweenSettings.asset
│ └── DOTweenSettings.asset.meta
├── scene.unity
└── scene.unity.meta
├── EasyUI_PickerWheel_v2.unitypackage
├── LICENCE
└── README.md
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | custom: ['https://paypal.me/hamzaherbou']
2 |
--------------------------------------------------------------------------------
/Assets/Demigiant.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 60b61ea8547d527499bad3f147ebf1c8
3 | folderAsset: yes
4 | timeCreated: 1588071187
5 | licenseType: Pro
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ff2995b81492f8e428d00102357d9fad
3 | folderAsset: yes
4 | timeCreated: 1583073395
5 | licenseType: Free
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/DOTween.XML.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 34192c5e0d14aee43a0e86cc4823268a
3 | TextScriptImporter:
4 | userData:
5 | assetBundleName:
6 | assetBundleVariant:
7 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/DOTween.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_PickerWheelUI/dcc34e17f424cd1d820123ab37901dda7e92ed40/Assets/Demigiant/DOTween/DOTween.dll
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/DOTween.dll.mdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_PickerWheelUI/dcc34e17f424cd1d820123ab37901dda7e92ed40/Assets/Demigiant/DOTween/DOTween.dll.mdb
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/DOTween.dll.mdb.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4f007001a22b3d24dae350342c4d19c8
3 | DefaultImporter:
4 | userData:
5 | assetBundleName:
6 | assetBundleVariant:
7 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/DOTween.dll.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a811bde74b26b53498b4f6d872b09b6d
3 | PluginImporter:
4 | serializedVersion: 2
5 | iconMap: {}
6 | executionOrder: {}
7 | isPreloaded: 0
8 | isOverridable: 0
9 | platformData:
10 | data:
11 | first:
12 | Any:
13 | second:
14 | enabled: 1
15 | settings: {}
16 | userData:
17 | assetBundleName:
18 | assetBundleVariant:
19 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Editor.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 8e9b8824969709a44871102b2356a7ca
3 | folderAsset: yes
4 | timeCreated: 1583073395
5 | licenseType: Free
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Editor/DOTweenEditor.XML:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | DOTweenEditor
5 |
6 |
7 |
8 |
9 | Starts the update loop of tween in the editor. Has no effect during playMode.
10 |
11 | Eventual callback to call after every update
12 |
13 |
14 |
15 | Stops the update loop and clears the onPreviewUpdated callback.
16 |
17 | If TRUE also resets the tweened objects to their original state
18 |
19 |
20 |
21 | Readies the tween for editor preview by setting its UpdateType to Manual plus eventual extra settings.
22 |
23 | The tween to ready
24 | If TRUE (recommended) removes all callbacks (OnComplete/Rewind/etc)
25 | If TRUE prevents the tween from being auto-killed at completion
26 | If TRUE starts playing the tween immediately
27 |
28 |
29 |
30 | Checks that the given editor texture use the correct import settings,
31 | and applies them if they're incorrect.
32 |
33 |
34 |
35 |
36 | Returns TRUE if setup is required
37 |
38 |
39 |
40 |
41 | Returns TRUE if the file/directory at the given path exists.
42 |
43 | Path, relative to Unity's project folder
44 |
45 |
46 |
47 |
48 | Converts the given project-relative path to a full path,
49 | with backward (\) slashes).
50 |
51 |
52 |
53 |
54 | Converts the given full path to a path usable with AssetDatabase methods
55 | (relative to Unity's project folder, and with the correct Unity forward (/) slashes).
56 |
57 |
58 |
59 |
60 | Connects to a asset.
61 | If the asset already exists at the given path, loads it and returns it.
62 | Otherwise, either returns NULL or automatically creates it before loading and returning it
63 | (depending on the given parameters).
64 |
65 | Asset type
66 | File path (relative to Unity's project folder)
67 | If TRUE and the requested asset doesn't exist, forces its creation
68 |
69 |
70 |
71 | Full path for the given loaded assembly, assembly file included
72 |
73 |
74 |
75 |
76 | Adds the given global define if it's not already present
77 |
78 |
79 |
80 |
81 | Removes the given global define if it's present
82 |
83 |
84 |
85 |
86 | Returns TRUE if the given global define is present in all the
87 | or only in the given , depending on passed parameters.
88 |
89 |
90 | to use. Leave NULL to check in all of them.
91 |
92 |
93 |
94 | Not used as menu item anymore, but as a utiity function
95 |
96 |
97 |
98 |
99 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Editor/DOTweenEditor.XML.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2e2c6224d345d9249acfa6e8ef40bb2d
3 | TextScriptImporter:
4 | userData:
5 | assetBundleName:
6 | assetBundleVariant:
7 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_PickerWheelUI/dcc34e17f424cd1d820123ab37901dda7e92ed40/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_PickerWheelUI/dcc34e17f424cd1d820123ab37901dda7e92ed40/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 8f46310a8b0a8f04a92993c37c713243
3 | DefaultImporter:
4 | userData:
5 | assetBundleName:
6 | assetBundleVariant:
7 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 45d5034162d6cf04dbe46da84fc7d074
3 | PluginImporter:
4 | serializedVersion: 2
5 | iconMap: {}
6 | executionOrder: {}
7 | isPreloaded: 0
8 | isOverridable: 0
9 | platformData:
10 | data:
11 | first:
12 | Any:
13 | second:
14 | enabled: 1
15 | settings: {}
16 | userData:
17 | assetBundleName:
18 | assetBundleVariant:
19 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Editor/Imgs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 256ba9b1b70474243a741a1b2f1c2aff
3 | folderAsset: yes
4 | timeCreated: 1583073395
5 | licenseType: Free
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Editor/Imgs/DOTweenIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_PickerWheelUI/dcc34e17f424cd1d820123ab37901dda7e92ed40/Assets/Demigiant/DOTween/Editor/Imgs/DOTweenIcon.png
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Editor/Imgs/DOTweenIcon.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 8da095e39e9b4df488dfd436f81116d6
3 | TextureImporter:
4 | fileIDToRecycleName: {}
5 | serializedVersion: 4
6 | mipmaps:
7 | mipMapMode: 0
8 | enableMipMap: 0
9 | sRGBTexture: 0
10 | linearTexture: 1
11 | fadeOut: 0
12 | borderMipMap: 0
13 | mipMapFadeDistanceStart: 1
14 | mipMapFadeDistanceEnd: 3
15 | bumpmap:
16 | convertToNormalMap: 0
17 | externalNormalMap: 0
18 | heightScale: 0.25
19 | normalMapFilter: 0
20 | isReadable: 0
21 | grayScaleToAlpha: 0
22 | generateCubemap: 6
23 | cubemapConvolution: 0
24 | seamlessCubemap: 0
25 | textureFormat: -3
26 | maxTextureSize: 128
27 | textureSettings:
28 | filterMode: 1
29 | aniso: 1
30 | mipBias: -1
31 | wrapMode: 1
32 | nPOTScale: 0
33 | lightmap: 0
34 | compressionQuality: 50
35 | spriteMode: 0
36 | spriteExtrude: 1
37 | spriteMeshType: 1
38 | alignment: 0
39 | spritePivot: {x: 0.5, y: 0.5}
40 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
41 | spritePixelsToUnits: 100
42 | alphaUsage: 1
43 | alphaIsTransparency: 1
44 | spriteTessellationDetail: -1
45 | textureType: 2
46 | textureShape: 1
47 | maxTextureSizeSet: 0
48 | compressionQualitySet: 0
49 | textureFormatSet: 0
50 | platformSettings:
51 | - buildTarget: DefaultTexturePlatform
52 | maxTextureSize: 128
53 | textureFormat: -1
54 | textureCompression: 0
55 | compressionQuality: 50
56 | crunchedCompression: 0
57 | allowsAlphaSplitting: 0
58 | overridden: 0
59 | spriteSheet:
60 | serializedVersion: 2
61 | sprites: []
62 | outline: []
63 | spritePackingTag:
64 | userData:
65 | assetBundleName:
66 | assetBundleVariant:
67 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Editor/Imgs/Footer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_PickerWheelUI/dcc34e17f424cd1d820123ab37901dda7e92ed40/Assets/Demigiant/DOTween/Editor/Imgs/Footer.png
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Editor/Imgs/Footer.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 7051dba417b3d53409f2918f1ea4938d
3 | TextureImporter:
4 | fileIDToRecycleName: {}
5 | serializedVersion: 4
6 | mipmaps:
7 | mipMapMode: 0
8 | enableMipMap: 0
9 | sRGBTexture: 0
10 | linearTexture: 1
11 | fadeOut: 0
12 | borderMipMap: 0
13 | mipMapFadeDistanceStart: 1
14 | mipMapFadeDistanceEnd: 3
15 | bumpmap:
16 | convertToNormalMap: 0
17 | externalNormalMap: 0
18 | heightScale: 0.25
19 | normalMapFilter: 0
20 | isReadable: 0
21 | grayScaleToAlpha: 0
22 | generateCubemap: 6
23 | cubemapConvolution: 0
24 | seamlessCubemap: 0
25 | textureFormat: -3
26 | maxTextureSize: 256
27 | textureSettings:
28 | filterMode: 1
29 | aniso: 1
30 | mipBias: -1
31 | wrapMode: 1
32 | nPOTScale: 0
33 | lightmap: 0
34 | compressionQuality: 50
35 | spriteMode: 0
36 | spriteExtrude: 1
37 | spriteMeshType: 1
38 | alignment: 0
39 | spritePivot: {x: 0.5, y: 0.5}
40 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
41 | spritePixelsToUnits: 100
42 | alphaUsage: 1
43 | alphaIsTransparency: 1
44 | spriteTessellationDetail: -1
45 | textureType: 2
46 | textureShape: 1
47 | maxTextureSizeSet: 0
48 | compressionQualitySet: 0
49 | textureFormatSet: 0
50 | platformSettings:
51 | - buildTarget: DefaultTexturePlatform
52 | maxTextureSize: 256
53 | textureFormat: -1
54 | textureCompression: 0
55 | compressionQuality: 50
56 | crunchedCompression: 0
57 | allowsAlphaSplitting: 0
58 | overridden: 0
59 | spriteSheet:
60 | serializedVersion: 2
61 | sprites: []
62 | outline: []
63 | spritePackingTag:
64 | userData:
65 | assetBundleName:
66 | assetBundleVariant:
67 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Editor/Imgs/Footer_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_PickerWheelUI/dcc34e17f424cd1d820123ab37901dda7e92ed40/Assets/Demigiant/DOTween/Editor/Imgs/Footer_dark.png
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Editor/Imgs/Footer_dark.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 519694efe2bb2914788b151fbd8c01f4
3 | timeCreated: 1583073895
4 | licenseType: Free
5 | TextureImporter:
6 | fileIDToRecycleName: {}
7 | serializedVersion: 4
8 | mipmaps:
9 | mipMapMode: 0
10 | enableMipMap: 0
11 | sRGBTexture: 0
12 | linearTexture: 0
13 | fadeOut: 0
14 | borderMipMap: 0
15 | mipMapFadeDistanceStart: 1
16 | mipMapFadeDistanceEnd: 3
17 | bumpmap:
18 | convertToNormalMap: 0
19 | externalNormalMap: 0
20 | heightScale: 0.25
21 | normalMapFilter: 0
22 | isReadable: 0
23 | grayScaleToAlpha: 0
24 | generateCubemap: 6
25 | cubemapConvolution: 0
26 | seamlessCubemap: 0
27 | textureFormat: -1
28 | maxTextureSize: 1024
29 | textureSettings:
30 | filterMode: 1
31 | aniso: 1
32 | mipBias: -1
33 | wrapMode: 1
34 | nPOTScale: 0
35 | lightmap: 0
36 | compressionQuality: 50
37 | spriteMode: 0
38 | spriteExtrude: 1
39 | spriteMeshType: 1
40 | alignment: 0
41 | spritePivot: {x: 0.5, y: 0.5}
42 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 | spritePixelsToUnits: 100
44 | alphaUsage: 1
45 | alphaIsTransparency: 1
46 | spriteTessellationDetail: -1
47 | textureType: 2
48 | textureShape: 1
49 | maxTextureSizeSet: 0
50 | compressionQualitySet: 0
51 | textureFormatSet: 0
52 | platformSettings:
53 | - buildTarget: DefaultTexturePlatform
54 | maxTextureSize: 256
55 | textureFormat: -1
56 | textureCompression: 1
57 | compressionQuality: 50
58 | crunchedCompression: 0
59 | allowsAlphaSplitting: 0
60 | overridden: 0
61 | spriteSheet:
62 | serializedVersion: 2
63 | sprites: []
64 | outline: []
65 | spritePackingTag:
66 | userData:
67 | assetBundleName:
68 | assetBundleVariant:
69 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Editor/Imgs/Header.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_PickerWheelUI/dcc34e17f424cd1d820123ab37901dda7e92ed40/Assets/Demigiant/DOTween/Editor/Imgs/Header.jpg
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Editor/Imgs/Header.jpg.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 78a59ca99f8987941adb61f9e14a06a7
3 | TextureImporter:
4 | fileIDToRecycleName: {}
5 | serializedVersion: 4
6 | mipmaps:
7 | mipMapMode: 0
8 | enableMipMap: 0
9 | sRGBTexture: 0
10 | linearTexture: 1
11 | fadeOut: 0
12 | borderMipMap: 0
13 | mipMapFadeDistanceStart: 1
14 | mipMapFadeDistanceEnd: 3
15 | bumpmap:
16 | convertToNormalMap: 0
17 | externalNormalMap: 0
18 | heightScale: 0.25
19 | normalMapFilter: 0
20 | isReadable: 0
21 | grayScaleToAlpha: 0
22 | generateCubemap: 6
23 | cubemapConvolution: 0
24 | seamlessCubemap: 0
25 | textureFormat: -3
26 | maxTextureSize: 512
27 | textureSettings:
28 | filterMode: 1
29 | aniso: 1
30 | mipBias: -1
31 | wrapMode: 1
32 | nPOTScale: 0
33 | lightmap: 0
34 | compressionQuality: 50
35 | spriteMode: 0
36 | spriteExtrude: 1
37 | spriteMeshType: 1
38 | alignment: 0
39 | spritePivot: {x: 0.5, y: 0.5}
40 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
41 | spritePixelsToUnits: 100
42 | alphaUsage: 1
43 | alphaIsTransparency: 1
44 | spriteTessellationDetail: -1
45 | textureType: 2
46 | textureShape: 1
47 | maxTextureSizeSet: 0
48 | compressionQualitySet: 0
49 | textureFormatSet: 0
50 | platformSettings:
51 | - buildTarget: DefaultTexturePlatform
52 | maxTextureSize: 512
53 | textureFormat: -1
54 | textureCompression: 0
55 | compressionQuality: 50
56 | crunchedCompression: 0
57 | allowsAlphaSplitting: 0
58 | overridden: 0
59 | spriteSheet:
60 | serializedVersion: 2
61 | sprites: []
62 | outline: []
63 | spritePackingTag:
64 | userData:
65 | assetBundleName:
66 | assetBundleVariant:
67 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Modules.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d9fdfa00b09598f45a85b1aa2eed799d
3 | folderAsset: yes
4 | timeCreated: 1583073395
5 | licenseType: Free
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Modules/DOTweenModuleAudio.cs:
--------------------------------------------------------------------------------
1 | // Author: Daniele Giardini - http://www.demigiant.com
2 | // Created: 2018/07/13
3 |
4 | #if false // MODULE_MARKER
5 | using System;
6 | using DG.Tweening.Core;
7 | using DG.Tweening.Plugins.Options;
8 | using UnityEngine;
9 | #if UNITY_5 || UNITY_2017_1_OR_NEWER
10 | using UnityEngine.Audio; // Required for AudioMixer
11 | #endif
12 |
13 | #pragma warning disable 1591
14 | namespace DG.Tweening
15 | {
16 | public static class DOTweenModuleAudio
17 | {
18 | #region Shortcuts
19 |
20 | #region Audio
21 |
22 | /// Tweens an AudioSource's volume to the given value.
23 | /// Also stores the AudioSource as the tween's target so it can be used for filtered operations
24 | /// The end value to reach (0 to 1)The duration of the tween
25 | public static TweenerCore DOFade(this AudioSource target, float endValue, float duration)
26 | {
27 | if (endValue < 0) endValue = 0;
28 | else if (endValue > 1) endValue = 1;
29 | TweenerCore t = DOTween.To(() => target.volume, x => target.volume = x, endValue, duration);
30 | t.SetTarget(target);
31 | return t;
32 | }
33 |
34 | /// Tweens an AudioSource's pitch to the given value.
35 | /// Also stores the AudioSource as the tween's target so it can be used for filtered operations
36 | /// The end value to reachThe duration of the tween
37 | public static TweenerCore DOPitch(this AudioSource target, float endValue, float duration)
38 | {
39 | TweenerCore t = DOTween.To(() => target.pitch, x => target.pitch = x, endValue, duration);
40 | t.SetTarget(target);
41 | return t;
42 | }
43 |
44 | #endregion
45 |
46 | #if UNITY_5 || UNITY_2017_1_OR_NEWER
47 | #region AudioMixer (Unity 5 or Newer)
48 |
49 | /// Tweens an AudioMixer's exposed float to the given value.
50 | /// Also stores the AudioMixer as the tween's target so it can be used for filtered operations.
51 | /// Note that you need to manually expose a float in an AudioMixerGroup in order to be able to tween it from an AudioMixer.
52 | /// Name given to the exposed float to set
53 | /// The end value to reachThe duration of the tween
54 | public static TweenerCore DOSetFloat(this AudioMixer target, string floatName, float endValue, float duration)
55 | {
56 | TweenerCore t = DOTween.To(()=> {
57 | float currVal;
58 | target.GetFloat(floatName, out currVal);
59 | return currVal;
60 | }, x=> target.SetFloat(floatName, x), endValue, duration);
61 | t.SetTarget(target);
62 | return t;
63 | }
64 |
65 | #region Operation Shortcuts
66 |
67 | ///
68 | /// Completes all tweens that have this target as a reference
69 | /// (meaning tweens that were started from this target, or that had this target added as an Id)
70 | /// and returns the total number of tweens completed
71 | /// (meaning the tweens that don't have infinite loops and were not already complete)
72 | ///
73 | /// For Sequences only: if TRUE also internal Sequence callbacks will be fired,
74 | /// otherwise they will be ignored
75 | public static int DOComplete(this AudioMixer target, bool withCallbacks = false)
76 | {
77 | return DOTween.Complete(target, withCallbacks);
78 | }
79 |
80 | ///
81 | /// Kills all tweens that have this target as a reference
82 | /// (meaning tweens that were started from this target, or that had this target added as an Id)
83 | /// and returns the total number of tweens killed.
84 | ///
85 | /// If TRUE completes the tween before killing it
86 | public static int DOKill(this AudioMixer target, bool complete = false)
87 | {
88 | return DOTween.Kill(target, complete);
89 | }
90 |
91 | ///
92 | /// Flips the direction (backwards if it was going forward or viceversa) of all tweens that have this target as a reference
93 | /// (meaning tweens that were started from this target, or that had this target added as an Id)
94 | /// and returns the total number of tweens flipped.
95 | ///
96 | public static int DOFlip(this AudioMixer target)
97 | {
98 | return DOTween.Flip(target);
99 | }
100 |
101 | ///
102 | /// Sends to the given position all tweens that have this target as a reference
103 | /// (meaning tweens that were started from this target, or that had this target added as an Id)
104 | /// and returns the total number of tweens involved.
105 | ///
106 | /// Time position to reach
107 | /// (if higher than the whole tween duration the tween will simply reach its end)
108 | /// If TRUE will play the tween after reaching the given position, otherwise it will pause it
109 | public static int DOGoto(this AudioMixer target, float to, bool andPlay = false)
110 | {
111 | return DOTween.Goto(target, to, andPlay);
112 | }
113 |
114 | ///
115 | /// Pauses all tweens that have this target as a reference
116 | /// (meaning tweens that were started from this target, or that had this target added as an Id)
117 | /// and returns the total number of tweens paused.
118 | ///
119 | public static int DOPause(this AudioMixer target)
120 | {
121 | return DOTween.Pause(target);
122 | }
123 |
124 | ///
125 | /// Plays all tweens that have this target as a reference
126 | /// (meaning tweens that were started from this target, or that had this target added as an Id)
127 | /// and returns the total number of tweens played.
128 | ///
129 | public static int DOPlay(this AudioMixer target)
130 | {
131 | return DOTween.Play(target);
132 | }
133 |
134 | ///
135 | /// Plays backwards all tweens that have this target as a reference
136 | /// (meaning tweens that were started from this target, or that had this target added as an Id)
137 | /// and returns the total number of tweens played.
138 | ///
139 | public static int DOPlayBackwards(this AudioMixer target)
140 | {
141 | return DOTween.PlayBackwards(target);
142 | }
143 |
144 | ///
145 | /// Plays forward all tweens that have this target as a reference
146 | /// (meaning tweens that were started from this target, or that had this target added as an Id)
147 | /// and returns the total number of tweens played.
148 | ///
149 | public static int DOPlayForward(this AudioMixer target)
150 | {
151 | return DOTween.PlayForward(target);
152 | }
153 |
154 | ///
155 | /// Restarts all tweens that have this target as a reference
156 | /// (meaning tweens that were started from this target, or that had this target added as an Id)
157 | /// and returns the total number of tweens restarted.
158 | ///
159 | public static int DORestart(this AudioMixer target)
160 | {
161 | return DOTween.Restart(target);
162 | }
163 |
164 | ///
165 | /// Rewinds all tweens that have this target as a reference
166 | /// (meaning tweens that were started from this target, or that had this target added as an Id)
167 | /// and returns the total number of tweens rewinded.
168 | ///
169 | public static int DORewind(this AudioMixer target)
170 | {
171 | return DOTween.Rewind(target);
172 | }
173 |
174 | ///
175 | /// Smoothly rewinds all tweens that have this target as a reference
176 | /// (meaning tweens that were started from this target, or that had this target added as an Id)
177 | /// and returns the total number of tweens rewinded.
178 | ///
179 | public static int DOSmoothRewind(this AudioMixer target)
180 | {
181 | return DOTween.SmoothRewind(target);
182 | }
183 |
184 | ///
185 | /// Toggles the paused state (plays if it was paused, pauses if it was playing) of all tweens that have this target as a reference
186 | /// (meaning tweens that were started from this target, or that had this target added as an Id)
187 | /// and returns the total number of tweens involved.
188 | ///
189 | public static int DOTogglePause(this AudioMixer target)
190 | {
191 | return DOTween.TogglePause(target);
192 | }
193 |
194 | #endregion
195 |
196 | #endregion
197 | #endif
198 |
199 | #endregion
200 | }
201 | }
202 | #endif
203 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Modules/DOTweenModuleAudio.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b766d08851589514b97afb23c6f30a70
3 | MonoImporter:
4 | serializedVersion: 2
5 | defaultReferences: []
6 | executionOrder: 0
7 | icon: {instanceID: 0}
8 | userData:
9 | assetBundleName:
10 | assetBundleVariant:
11 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Modules/DOTweenModulePhysics.cs:
--------------------------------------------------------------------------------
1 | // Author: Daniele Giardini - http://www.demigiant.com
2 | // Created: 2018/07/13
3 |
4 | #if false // MODULE_MARKER
5 | using System;
6 | using DG.Tweening.Core;
7 | using DG.Tweening.Core.Enums;
8 | using DG.Tweening.Plugins;
9 | using DG.Tweening.Plugins.Core.PathCore;
10 | using DG.Tweening.Plugins.Options;
11 | using UnityEngine;
12 |
13 | #pragma warning disable 1591
14 | namespace DG.Tweening
15 | {
16 | public static class DOTweenModulePhysics
17 | {
18 | #region Shortcuts
19 |
20 | #region Rigidbody
21 |
22 | /// Tweens a Rigidbody's position to the given value.
23 | /// Also stores the rigidbody as the tween's target so it can be used for filtered operations
24 | /// The end value to reachThe duration of the tween
25 | /// If TRUE the tween will smoothly snap all values to integers
26 | public static TweenerCore DOMove(this Rigidbody target, Vector3 endValue, float duration, bool snapping = false)
27 | {
28 | TweenerCore t = DOTween.To(() => target.position, target.MovePosition, endValue, duration);
29 | t.SetOptions(snapping).SetTarget(target);
30 | return t;
31 | }
32 |
33 | /// Tweens a Rigidbody's X position to the given value.
34 | /// Also stores the rigidbody as the tween's target so it can be used for filtered operations
35 | /// The end value to reachThe duration of the tween
36 | /// If TRUE the tween will smoothly snap all values to integers
37 | public static TweenerCore DOMoveX(this Rigidbody target, float endValue, float duration, bool snapping = false)
38 | {
39 | TweenerCore t = DOTween.To(() => target.position, target.MovePosition, new Vector3(endValue, 0, 0), duration);
40 | t.SetOptions(AxisConstraint.X, snapping).SetTarget(target);
41 | return t;
42 | }
43 |
44 | /// Tweens a Rigidbody's Y position to the given value.
45 | /// Also stores the rigidbody as the tween's target so it can be used for filtered operations
46 | /// The end value to reachThe duration of the tween
47 | /// If TRUE the tween will smoothly snap all values to integers
48 | public static TweenerCore DOMoveY(this Rigidbody target, float endValue, float duration, bool snapping = false)
49 | {
50 | TweenerCore t = DOTween.To(() => target.position, target.MovePosition, new Vector3(0, endValue, 0), duration);
51 | t.SetOptions(AxisConstraint.Y, snapping).SetTarget(target);
52 | return t;
53 | }
54 |
55 | /// Tweens a Rigidbody's Z position to the given value.
56 | /// Also stores the rigidbody as the tween's target so it can be used for filtered operations
57 | /// The end value to reachThe duration of the tween
58 | /// If TRUE the tween will smoothly snap all values to integers
59 | public static TweenerCore DOMoveZ(this Rigidbody target, float endValue, float duration, bool snapping = false)
60 | {
61 | TweenerCore t = DOTween.To(() => target.position, target.MovePosition, new Vector3(0, 0, endValue), duration);
62 | t.SetOptions(AxisConstraint.Z, snapping).SetTarget(target);
63 | return t;
64 | }
65 |
66 | /// Tweens a Rigidbody's rotation to the given value.
67 | /// Also stores the rigidbody as the tween's target so it can be used for filtered operations
68 | /// The end value to reachThe duration of the tween
69 | /// Rotation mode
70 | public static TweenerCore DORotate(this Rigidbody target, Vector3 endValue, float duration, RotateMode mode = RotateMode.Fast)
71 | {
72 | TweenerCore t = DOTween.To(() => target.rotation, target.MoveRotation, endValue, duration);
73 | t.SetTarget(target);
74 | t.plugOptions.rotateMode = mode;
75 | return t;
76 | }
77 |
78 | /// Tweens a Rigidbody's rotation so that it will look towards the given position.
79 | /// Also stores the rigidbody as the tween's target so it can be used for filtered operations
80 | /// The position to look atThe duration of the tween
81 | /// Eventual axis constraint for the rotation
82 | /// The vector that defines in which direction up is (default: Vector3.up)
83 | public static TweenerCore DOLookAt(this Rigidbody target, Vector3 towards, float duration, AxisConstraint axisConstraint = AxisConstraint.None, Vector3? up = null)
84 | {
85 | TweenerCore t = DOTween.To(() => target.rotation, target.MoveRotation, towards, duration)
86 | .SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetLookAt);
87 | t.plugOptions.axisConstraint = axisConstraint;
88 | t.plugOptions.up = (up == null) ? Vector3.up : (Vector3)up;
89 | return t;
90 | }
91 |
92 | #region Special
93 |
94 | /// Tweens a Rigidbody's position to the given value, while also applying a jump effect along the Y axis.
95 | /// Returns a Sequence instead of a Tweener.
96 | /// Also stores the Rigidbody as the tween's target so it can be used for filtered operations
97 | /// The end value to reach
98 | /// Power of the jump (the max height of the jump is represented by this plus the final Y offset)
99 | /// Total number of jumps
100 | /// The duration of the tween
101 | /// If TRUE the tween will smoothly snap all values to integers
102 | public static Sequence DOJump(this Rigidbody target, Vector3 endValue, float jumpPower, int numJumps, float duration, bool snapping = false)
103 | {
104 | if (numJumps < 1) numJumps = 1;
105 | float startPosY = 0;
106 | float offsetY = -1;
107 | bool offsetYSet = false;
108 | Sequence s = DOTween.Sequence();
109 | Tween yTween = DOTween.To(() => target.position, target.MovePosition, new Vector3(0, jumpPower, 0), duration / (numJumps * 2))
110 | .SetOptions(AxisConstraint.Y, snapping).SetEase(Ease.OutQuad).SetRelative()
111 | .SetLoops(numJumps * 2, LoopType.Yoyo)
112 | .OnStart(() => startPosY = target.position.y);
113 | s.Append(DOTween.To(() => target.position, target.MovePosition, new Vector3(endValue.x, 0, 0), duration)
114 | .SetOptions(AxisConstraint.X, snapping).SetEase(Ease.Linear)
115 | ).Join(DOTween.To(() => target.position, target.MovePosition, new Vector3(0, 0, endValue.z), duration)
116 | .SetOptions(AxisConstraint.Z, snapping).SetEase(Ease.Linear)
117 | ).Join(yTween)
118 | .SetTarget(target).SetEase(DOTween.defaultEaseType);
119 | yTween.OnUpdate(() => {
120 | if (!offsetYSet) {
121 | offsetYSet = true;
122 | offsetY = s.isRelative ? endValue.y : endValue.y - startPosY;
123 | }
124 | Vector3 pos = target.position;
125 | pos.y += DOVirtual.EasedValue(0, offsetY, yTween.ElapsedPercentage(), Ease.OutQuad);
126 | target.MovePosition(pos);
127 | });
128 | return s;
129 | }
130 |
131 | /// Tweens a Rigidbody's position through the given path waypoints, using the chosen path algorithm.
132 | /// Also stores the Rigidbody as the tween's target so it can be used for filtered operations.
133 | /// NOTE: to tween a rigidbody correctly it should be set to kinematic at least while being tweened.
134 | /// BEWARE: doesn't work on Windows Phone store (waiting for Unity to fix their own bug).
135 | /// If you plan to publish there you should use a regular transform.DOPath.
136 | /// The waypoints to go through
137 | /// The duration of the tween
138 | /// The type of path: Linear (straight path) or CatmullRom (curved CatmullRom path)
139 | /// The path mode: 3D, side-scroller 2D, top-down 2D
140 | /// The resolution of the path (useless in case of Linear paths): higher resolutions make for more detailed curved paths but are more expensive.
141 | /// Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints
142 | /// The color of the path (shown when gizmos are active in the Play panel and the tween is running)
143 | public static TweenerCore DOPath(
144 | this Rigidbody target, Vector3[] path, float duration, PathType pathType = PathType.Linear,
145 | PathMode pathMode = PathMode.Full3D, int resolution = 10, Color? gizmoColor = null
146 | )
147 | {
148 | if (resolution < 1) resolution = 1;
149 | TweenerCore t = DOTween.To(PathPlugin.Get(), () => target.position, target.MovePosition, new Path(pathType, path, resolution, gizmoColor), duration)
150 | .SetTarget(target).SetUpdate(UpdateType.Fixed);
151 |
152 | t.plugOptions.isRigidbody = true;
153 | t.plugOptions.mode = pathMode;
154 | return t;
155 | }
156 | /// Tweens a Rigidbody's localPosition through the given path waypoints, using the chosen path algorithm.
157 | /// Also stores the Rigidbody as the tween's target so it can be used for filtered operations
158 | /// NOTE: to tween a rigidbody correctly it should be set to kinematic at least while being tweened.
159 | /// BEWARE: doesn't work on Windows Phone store (waiting for Unity to fix their own bug).
160 | /// If you plan to publish there you should use a regular transform.DOLocalPath.
161 | /// The waypoint to go through
162 | /// The duration of the tween
163 | /// The type of path: Linear (straight path) or CatmullRom (curved CatmullRom path)
164 | /// The path mode: 3D, side-scroller 2D, top-down 2D
165 | /// The resolution of the path: higher resolutions make for more detailed curved paths but are more expensive.
166 | /// Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints
167 | /// The color of the path (shown when gizmos are active in the Play panel and the tween is running)
168 | public static TweenerCore DOLocalPath(
169 | this Rigidbody target, Vector3[] path, float duration, PathType pathType = PathType.Linear,
170 | PathMode pathMode = PathMode.Full3D, int resolution = 10, Color? gizmoColor = null
171 | )
172 | {
173 | if (resolution < 1) resolution = 1;
174 | Transform trans = target.transform;
175 | 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)
176 | .SetTarget(target).SetUpdate(UpdateType.Fixed);
177 |
178 | t.plugOptions.isRigidbody = true;
179 | t.plugOptions.mode = pathMode;
180 | t.plugOptions.useLocalPosition = true;
181 | return t;
182 | }
183 | // Used by path editor when creating the actual tween, so it can pass a pre-compiled path
184 | internal static TweenerCore DOPath(
185 | this Rigidbody target, Path path, float duration, PathMode pathMode = PathMode.Full3D
186 | )
187 | {
188 | TweenerCore t = DOTween.To(PathPlugin.Get(), () => target.position, target.MovePosition, path, duration)
189 | .SetTarget(target);
190 |
191 | t.plugOptions.isRigidbody = true;
192 | t.plugOptions.mode = pathMode;
193 | return t;
194 | }
195 | internal static TweenerCore DOLocalPath(
196 | this Rigidbody target, Path path, float duration, PathMode pathMode = PathMode.Full3D
197 | )
198 | {
199 | Transform trans = target.transform;
200 | TweenerCore t = DOTween.To(PathPlugin.Get(), () => trans.localPosition, x => target.MovePosition(trans.parent == null ? x : trans.parent.TransformPoint(x)), path, duration)
201 | .SetTarget(target);
202 |
203 | t.plugOptions.isRigidbody = true;
204 | t.plugOptions.mode = pathMode;
205 | t.plugOptions.useLocalPosition = true;
206 | return t;
207 | }
208 |
209 | #endregion
210 |
211 | #endregion
212 |
213 | #endregion
214 | }
215 | }
216 | #endif
217 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Modules/DOTweenModulePhysics.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: dae9aa560b4242648a3affa2bfabc365
3 | MonoImporter:
4 | serializedVersion: 2
5 | defaultReferences: []
6 | executionOrder: 0
7 | icon: {instanceID: 0}
8 | userData:
9 | assetBundleName:
10 | assetBundleVariant:
11 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Modules/DOTweenModulePhysics2D.cs:
--------------------------------------------------------------------------------
1 | // Author: Daniele Giardini - http://www.demigiant.com
2 | // Created: 2018/07/13
3 |
4 | #if false && (UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1_OR_NEWER) // MODULE_MARKER
5 | using System;
6 | using DG.Tweening.Core;
7 | using DG.Tweening.Plugins.Options;
8 | using UnityEngine;
9 |
10 | #pragma warning disable 1591
11 | namespace DG.Tweening
12 | {
13 | public static class DOTweenModulePhysics2D
14 | {
15 | #region Shortcuts
16 |
17 | #region Rigidbody2D Shortcuts
18 |
19 | /// Tweens a Rigidbody2D's position to the given value.
20 | /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations
21 | /// The end value to reachThe duration of the tween
22 | /// If TRUE the tween will smoothly snap all values to integers
23 | public static TweenerCore DOMove(this Rigidbody2D target, Vector2 endValue, float duration, bool snapping = false)
24 | {
25 | TweenerCore t = DOTween.To(() => target.position, target.MovePosition, endValue, duration);
26 | t.SetOptions(snapping).SetTarget(target);
27 | return t;
28 | }
29 |
30 | /// Tweens a Rigidbody2D's X position to the given value.
31 | /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations
32 | /// The end value to reachThe duration of the tween
33 | /// If TRUE the tween will smoothly snap all values to integers
34 | public static TweenerCore DOMoveX(this Rigidbody2D target, float endValue, float duration, bool snapping = false)
35 | {
36 | TweenerCore t = DOTween.To(() => target.position, target.MovePosition, new Vector2(endValue, 0), duration);
37 | t.SetOptions(AxisConstraint.X, snapping).SetTarget(target);
38 | return t;
39 | }
40 |
41 | /// Tweens a Rigidbody2D's Y position to the given value.
42 | /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations
43 | /// The end value to reachThe duration of the tween
44 | /// If TRUE the tween will smoothly snap all values to integers
45 | public static TweenerCore DOMoveY(this Rigidbody2D target, float endValue, float duration, bool snapping = false)
46 | {
47 | TweenerCore t = DOTween.To(() => target.position, target.MovePosition, new Vector2(0, endValue), duration);
48 | t.SetOptions(AxisConstraint.Y, snapping).SetTarget(target);
49 | return t;
50 | }
51 |
52 | /// Tweens a Rigidbody2D's rotation to the given value.
53 | /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations
54 | /// The end value to reachThe duration of the tween
55 | public static TweenerCore DORotate(this Rigidbody2D target, float endValue, float duration)
56 | {
57 | TweenerCore t = DOTween.To(() => target.rotation, target.MoveRotation, endValue, duration);
58 | t.SetTarget(target);
59 | return t;
60 | }
61 |
62 | #region Special
63 |
64 | /// Tweens a Rigidbody2D's position to the given value, while also applying a jump effect along the Y axis.
65 | /// Returns a Sequence instead of a Tweener.
66 | /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations.
67 | /// IMPORTANT: a rigidbody2D can't be animated in a jump arc using MovePosition, so the tween will directly set the position
68 | /// The end value to reach
69 | /// Power of the jump (the max height of the jump is represented by this plus the final Y offset)
70 | /// Total number of jumps
71 | /// The duration of the tween
72 | /// If TRUE the tween will smoothly snap all values to integers
73 | public static Sequence DOJump(this Rigidbody2D target, Vector2 endValue, float jumpPower, int numJumps, float duration, bool snapping = false)
74 | {
75 | if (numJumps < 1) numJumps = 1;
76 | float startPosY = 0;
77 | float offsetY = -1;
78 | bool offsetYSet = false;
79 | Sequence s = DOTween.Sequence();
80 | Tween yTween = DOTween.To(() => target.position, x => target.position = x, new Vector2(0, jumpPower), duration / (numJumps * 2))
81 | .SetOptions(AxisConstraint.Y, snapping).SetEase(Ease.OutQuad).SetRelative()
82 | .SetLoops(numJumps * 2, LoopType.Yoyo)
83 | .OnStart(() => startPosY = target.position.y);
84 | s.Append(DOTween.To(() => target.position, x => target.position = x, new Vector2(endValue.x, 0), duration)
85 | .SetOptions(AxisConstraint.X, snapping).SetEase(Ease.Linear)
86 | ).Join(yTween)
87 | .SetTarget(target).SetEase(DOTween.defaultEaseType);
88 | yTween.OnUpdate(() => {
89 | if (!offsetYSet) {
90 | offsetYSet = true;
91 | offsetY = s.isRelative ? endValue.y : endValue.y - startPosY;
92 | }
93 | Vector3 pos = target.position;
94 | pos.y += DOVirtual.EasedValue(0, offsetY, yTween.ElapsedPercentage(), Ease.OutQuad);
95 | target.MovePosition(pos);
96 | });
97 | return s;
98 | }
99 |
100 | #endregion
101 |
102 | #endregion
103 |
104 | #endregion
105 | }
106 | }
107 | #endif
108 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Modules/DOTweenModulePhysics2D.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 230fe34542e175245ba74b4659dae700
3 | MonoImporter:
4 | serializedVersion: 2
5 | defaultReferences: []
6 | executionOrder: 0
7 | icon: {instanceID: 0}
8 | userData:
9 | assetBundleName:
10 | assetBundleVariant:
11 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Modules/DOTweenModuleSprite.cs:
--------------------------------------------------------------------------------
1 | // Author: Daniele Giardini - http://www.demigiant.com
2 | // Created: 2018/07/13
3 |
4 | #if false && (UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1_OR_NEWER) // MODULE_MARKER
5 | using System;
6 | using UnityEngine;
7 | using DG.Tweening.Core;
8 | using DG.Tweening.Plugins.Options;
9 |
10 | #pragma warning disable 1591
11 | namespace DG.Tweening
12 | {
13 | public static class DOTweenModuleSprite
14 | {
15 | #region Shortcuts
16 |
17 | #region SpriteRenderer
18 |
19 | /// Tweens a SpriteRenderer's color to the given value.
20 | /// Also stores the spriteRenderer as the tween's target so it can be used for filtered operations
21 | /// The end value to reachThe duration of the tween
22 | public static TweenerCore DOColor(this SpriteRenderer target, Color endValue, float duration)
23 | {
24 | TweenerCore t = DOTween.To(() => target.color, x => target.color = x, endValue, duration);
25 | t.SetTarget(target);
26 | return t;
27 | }
28 |
29 | /// Tweens a Material's alpha color to the given value.
30 | /// Also stores the spriteRenderer as the tween's target so it can be used for filtered operations
31 | /// The end value to reachThe duration of the tween
32 | public static TweenerCore DOFade(this SpriteRenderer target, float endValue, float duration)
33 | {
34 | TweenerCore t = DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration);
35 | t.SetTarget(target);
36 | return t;
37 | }
38 |
39 | /// Tweens a SpriteRenderer's color using the given gradient
40 | /// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener).
41 | /// Also stores the image as the tween's target so it can be used for filtered operations
42 | /// The gradient to useThe duration of the tween
43 | public static Sequence DOGradientColor(this SpriteRenderer target, Gradient gradient, float duration)
44 | {
45 | Sequence s = DOTween.Sequence();
46 | GradientColorKey[] colors = gradient.colorKeys;
47 | int len = colors.Length;
48 | for (int i = 0; i < len; ++i) {
49 | GradientColorKey c = colors[i];
50 | if (i == 0 && c.time <= 0) {
51 | target.color = c.color;
52 | continue;
53 | }
54 | float colorDuration = i == len - 1
55 | ? duration - s.Duration(false) // Verifies that total duration is correct
56 | : duration * (i == 0 ? c.time : c.time - colors[i - 1].time);
57 | s.Append(target.DOColor(c.color, colorDuration).SetEase(Ease.Linear));
58 | }
59 | s.SetTarget(target);
60 | return s;
61 | }
62 |
63 | #endregion
64 |
65 | #region Blendables
66 |
67 | #region SpriteRenderer
68 |
69 | /// Tweens a SpriteRenderer's color to the given value,
70 | /// in a way that allows other DOBlendableColor tweens to work together on the same target,
71 | /// instead than fight each other as multiple DOColor would do.
72 | /// Also stores the SpriteRenderer as the tween's target so it can be used for filtered operations
73 | /// The value to tween toThe duration of the tween
74 | public static Tweener DOBlendableColor(this SpriteRenderer target, Color endValue, float duration)
75 | {
76 | endValue = endValue - target.color;
77 | Color to = new Color(0, 0, 0, 0);
78 | return DOTween.To(() => to, x => {
79 | Color diff = x - to;
80 | to = x;
81 | target.color += diff;
82 | }, endValue, duration)
83 | .Blendable().SetTarget(target);
84 | }
85 |
86 | #endregion
87 |
88 | #endregion
89 |
90 | #endregion
91 | }
92 | }
93 | #endif
94 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Modules/DOTweenModuleSprite.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 188918ab119d93148aa0de59ccf5286b
3 | MonoImporter:
4 | serializedVersion: 2
5 | defaultReferences: []
6 | executionOrder: 0
7 | icon: {instanceID: 0}
8 | userData:
9 | assetBundleName:
10 | assetBundleVariant:
11 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Modules/DOTweenModuleUI.cs:
--------------------------------------------------------------------------------
1 | // Author: Daniele Giardini - http://www.demigiant.com
2 | // Created: 2018/07/13
3 |
4 | #if true && (UNITY_4_6 || UNITY_5 || UNITY_2017_1_OR_NEWER) // MODULE_MARKER
5 | using System;
6 | using UnityEngine;
7 | using UnityEngine.UI;
8 | using DG.Tweening.Core;
9 | using DG.Tweening.Core.Enums;
10 | using DG.Tweening.Plugins.Options;
11 |
12 | #pragma warning disable 1591
13 | namespace DG.Tweening
14 | {
15 | public static class DOTweenModuleUI
16 | {
17 | #region Shortcuts
18 |
19 | #region CanvasGroup
20 |
21 | /// Tweens a CanvasGroup's alpha color to the given value.
22 | /// Also stores the canvasGroup as the tween's target so it can be used for filtered operations
23 | /// The end value to reachThe duration of the tween
24 | public static TweenerCore DOFade(this CanvasGroup target, float endValue, float duration)
25 | {
26 | TweenerCore t = DOTween.To(() => target.alpha, x => target.alpha = x, endValue, duration);
27 | t.SetTarget(target);
28 | return t;
29 | }
30 |
31 | #endregion
32 |
33 | #region Graphic
34 |
35 | /// Tweens an Graphic's color to the given value.
36 | /// Also stores the image as the tween's target so it can be used for filtered operations
37 | /// The end value to reachThe duration of the tween
38 | public static TweenerCore DOColor(this Graphic target, Color endValue, float duration)
39 | {
40 | TweenerCore t = DOTween.To(() => target.color, x => target.color = x, endValue, duration);
41 | t.SetTarget(target);
42 | return t;
43 | }
44 |
45 | /// Tweens an Graphic's alpha color to the given value.
46 | /// Also stores the image as the tween's target so it can be used for filtered operations
47 | /// The end value to reachThe duration of the tween
48 | public static TweenerCore DOFade(this Graphic target, float endValue, float duration)
49 | {
50 | TweenerCore t = DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration);
51 | t.SetTarget(target);
52 | return t;
53 | }
54 |
55 | #endregion
56 |
57 | #region Image
58 |
59 | /// Tweens an Image's color to the given value.
60 | /// Also stores the image as the tween's target so it can be used for filtered operations
61 | /// The end value to reachThe duration of the tween
62 | public static TweenerCore DOColor(this Image target, Color endValue, float duration)
63 | {
64 | TweenerCore t = DOTween.To(() => target.color, x => target.color = x, endValue, duration);
65 | t.SetTarget(target);
66 | return t;
67 | }
68 |
69 | /// Tweens an Image's alpha color to the given value.
70 | /// Also stores the image as the tween's target so it can be used for filtered operations
71 | /// The end value to reachThe duration of the tween
72 | public static TweenerCore DOFade(this Image target, float endValue, float duration)
73 | {
74 | TweenerCore t = DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration);
75 | t.SetTarget(target);
76 | return t;
77 | }
78 |
79 | /// Tweens an Image's fillAmount to the given value.
80 | /// Also stores the image as the tween's target so it can be used for filtered operations
81 | /// The end value to reach (0 to 1)The duration of the tween
82 | public static TweenerCore DOFillAmount(this Image target, float endValue, float duration)
83 | {
84 | if (endValue > 1) endValue = 1;
85 | else if (endValue < 0) endValue = 0;
86 | TweenerCore t = DOTween.To(() => target.fillAmount, x => target.fillAmount = x, endValue, duration);
87 | t.SetTarget(target);
88 | return t;
89 | }
90 |
91 | /// Tweens an Image's colors using the given gradient
92 | /// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener).
93 | /// Also stores the image as the tween's target so it can be used for filtered operations
94 | /// The gradient to useThe duration of the tween
95 | public static Sequence DOGradientColor(this Image target, Gradient gradient, float duration)
96 | {
97 | Sequence s = DOTween.Sequence();
98 | GradientColorKey[] colors = gradient.colorKeys;
99 | int len = colors.Length;
100 | for (int i = 0; i < len; ++i) {
101 | GradientColorKey c = colors[i];
102 | if (i == 0 && c.time <= 0) {
103 | target.color = c.color;
104 | continue;
105 | }
106 | float colorDuration = i == len - 1
107 | ? duration - s.Duration(false) // Verifies that total duration is correct
108 | : duration * (i == 0 ? c.time : c.time - colors[i - 1].time);
109 | s.Append(target.DOColor(c.color, colorDuration).SetEase(Ease.Linear));
110 | }
111 | s.SetTarget(target);
112 | return s;
113 | }
114 |
115 | #endregion
116 |
117 | #region LayoutElement
118 |
119 | /// Tweens an LayoutElement's flexibleWidth/Height to the given value.
120 | /// Also stores the LayoutElement as the tween's target so it can be used for filtered operations
121 | /// The end value to reachThe duration of the tween
122 | /// If TRUE the tween will smoothly snap all values to integers
123 | public static TweenerCore DOFlexibleSize(this LayoutElement target, Vector2 endValue, float duration, bool snapping = false)
124 | {
125 | TweenerCore t = DOTween.To(() => new Vector2(target.flexibleWidth, target.flexibleHeight), x => {
126 | target.flexibleWidth = x.x;
127 | target.flexibleHeight = x.y;
128 | }, endValue, duration);
129 | t.SetOptions(snapping).SetTarget(target);
130 | return t;
131 | }
132 |
133 | /// Tweens an LayoutElement's minWidth/Height to the given value.
134 | /// Also stores the LayoutElement as the tween's target so it can be used for filtered operations
135 | /// The end value to reachThe duration of the tween
136 | /// If TRUE the tween will smoothly snap all values to integers
137 | public static TweenerCore DOMinSize(this LayoutElement target, Vector2 endValue, float duration, bool snapping = false)
138 | {
139 | TweenerCore t = DOTween.To(() => new Vector2(target.minWidth, target.minHeight), x => {
140 | target.minWidth = x.x;
141 | target.minHeight = x.y;
142 | }, endValue, duration);
143 | t.SetOptions(snapping).SetTarget(target);
144 | return t;
145 | }
146 |
147 | /// Tweens an LayoutElement's preferredWidth/Height to the given value.
148 | /// Also stores the LayoutElement as the tween's target so it can be used for filtered operations
149 | /// The end value to reachThe duration of the tween
150 | /// If TRUE the tween will smoothly snap all values to integers
151 | public static TweenerCore DOPreferredSize(this LayoutElement target, Vector2 endValue, float duration, bool snapping = false)
152 | {
153 | TweenerCore t = DOTween.To(() => new Vector2(target.preferredWidth, target.preferredHeight), x => {
154 | target.preferredWidth = x.x;
155 | target.preferredHeight = x.y;
156 | }, endValue, duration);
157 | t.SetOptions(snapping).SetTarget(target);
158 | return t;
159 | }
160 |
161 | #endregion
162 |
163 | #region Outline
164 |
165 | /// Tweens a Outline's effectColor to the given value.
166 | /// Also stores the Outline as the tween's target so it can be used for filtered operations
167 | /// The end value to reachThe duration of the tween
168 | public static TweenerCore DOColor(this Outline target, Color endValue, float duration)
169 | {
170 | TweenerCore t = DOTween.To(() => target.effectColor, x => target.effectColor = x, endValue, duration);
171 | t.SetTarget(target);
172 | return t;
173 | }
174 |
175 | /// Tweens a Outline's effectColor alpha to the given value.
176 | /// Also stores the Outline as the tween's target so it can be used for filtered operations
177 | /// The end value to reachThe duration of the tween
178 | public static TweenerCore DOFade(this Outline target, float endValue, float duration)
179 | {
180 | TweenerCore t = DOTween.ToAlpha(() => target.effectColor, x => target.effectColor = x, endValue, duration);
181 | t.SetTarget(target);
182 | return t;
183 | }
184 |
185 | /// Tweens a Outline's effectDistance to the given value.
186 | /// Also stores the Outline as the tween's target so it can be used for filtered operations
187 | /// The end value to reachThe duration of the tween
188 | public static TweenerCore DOScale(this Outline target, Vector2 endValue, float duration)
189 | {
190 | TweenerCore t = DOTween.To(() => target.effectDistance, x => target.effectDistance = x, endValue, duration);
191 | t.SetTarget(target);
192 | return t;
193 | }
194 |
195 | #endregion
196 |
197 | #region RectTransform
198 |
199 | /// Tweens a RectTransform's anchoredPosition to the given value.
200 | /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
201 | /// The end value to reachThe duration of the tween
202 | /// If TRUE the tween will smoothly snap all values to integers
203 | public static TweenerCore DOAnchorPos(this RectTransform target, Vector2 endValue, float duration, bool snapping = false)
204 | {
205 | TweenerCore t = DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, endValue, duration);
206 | t.SetOptions(snapping).SetTarget(target);
207 | return t;
208 | }
209 | /// Tweens a RectTransform's anchoredPosition X to the given value.
210 | /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
211 | /// The end value to reachThe duration of the tween
212 | /// If TRUE the tween will smoothly snap all values to integers
213 | public static TweenerCore DOAnchorPosX(this RectTransform target, float endValue, float duration, bool snapping = false)
214 | {
215 | TweenerCore t = DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, new Vector2(endValue, 0), duration);
216 | t.SetOptions(AxisConstraint.X, snapping).SetTarget(target);
217 | return t;
218 | }
219 | /// Tweens a RectTransform's anchoredPosition Y to the given value.
220 | /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
221 | /// The end value to reachThe duration of the tween
222 | /// If TRUE the tween will smoothly snap all values to integers
223 | public static TweenerCore DOAnchorPosY(this RectTransform target, float endValue, float duration, bool snapping = false)
224 | {
225 | TweenerCore t = DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, new Vector2(0, endValue), duration);
226 | t.SetOptions(AxisConstraint.Y, snapping).SetTarget(target);
227 | return t;
228 | }
229 |
230 | /// Tweens a RectTransform's anchoredPosition3D to the given value.
231 | /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
232 | /// The end value to reachThe duration of the tween
233 | /// If TRUE the tween will smoothly snap all values to integers
234 | public static TweenerCore DOAnchorPos3D(this RectTransform target, Vector3 endValue, float duration, bool snapping = false)
235 | {
236 | TweenerCore t = DOTween.To(() => target.anchoredPosition3D, x => target.anchoredPosition3D = x, endValue, duration);
237 | t.SetOptions(snapping).SetTarget(target);
238 | return t;
239 | }
240 | /// Tweens a RectTransform's anchoredPosition3D X to the given value.
241 | /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
242 | /// The end value to reachThe duration of the tween
243 | /// If TRUE the tween will smoothly snap all values to integers
244 | public static TweenerCore DOAnchorPos3DX(this RectTransform target, float endValue, float duration, bool snapping = false)
245 | {
246 | TweenerCore t = DOTween.To(() => target.anchoredPosition3D, x => target.anchoredPosition3D = x, new Vector3(endValue, 0, 0), duration);
247 | t.SetOptions(AxisConstraint.X, snapping).SetTarget(target);
248 | return t;
249 | }
250 | /// Tweens a RectTransform's anchoredPosition3D Y to the given value.
251 | /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
252 | /// The end value to reachThe duration of the tween
253 | /// If TRUE the tween will smoothly snap all values to integers
254 | public static TweenerCore DOAnchorPos3DY(this RectTransform target, float endValue, float duration, bool snapping = false)
255 | {
256 | TweenerCore t = DOTween.To(() => target.anchoredPosition3D, x => target.anchoredPosition3D = x, new Vector3(0, endValue, 0), duration);
257 | t.SetOptions(AxisConstraint.Y, snapping).SetTarget(target);
258 | return t;
259 | }
260 | /// Tweens a RectTransform's anchoredPosition3D Z to the given value.
261 | /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
262 | /// The end value to reachThe duration of the tween
263 | /// If TRUE the tween will smoothly snap all values to integers
264 | public static TweenerCore DOAnchorPos3DZ(this RectTransform target, float endValue, float duration, bool snapping = false)
265 | {
266 | TweenerCore t = DOTween.To(() => target.anchoredPosition3D, x => target.anchoredPosition3D = x, new Vector3(0, 0, endValue), duration);
267 | t.SetOptions(AxisConstraint.Z, snapping).SetTarget(target);
268 | return t;
269 | }
270 |
271 | /// Tweens a RectTransform's anchorMax to the given value.
272 | /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
273 | /// The end value to reachThe duration of the tween
274 | /// If TRUE the tween will smoothly snap all values to integers
275 | public static TweenerCore DOAnchorMax(this RectTransform target, Vector2 endValue, float duration, bool snapping = false)
276 | {
277 | TweenerCore t = DOTween.To(() => target.anchorMax, x => target.anchorMax = x, endValue, duration);
278 | t.SetOptions(snapping).SetTarget(target);
279 | return t;
280 | }
281 |
282 | /// Tweens a RectTransform's anchorMin to the given value.
283 | /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
284 | /// The end value to reachThe duration of the tween
285 | /// If TRUE the tween will smoothly snap all values to integers
286 | public static TweenerCore DOAnchorMin(this RectTransform target, Vector2 endValue, float duration, bool snapping = false)
287 | {
288 | TweenerCore t = DOTween.To(() => target.anchorMin, x => target.anchorMin = x, endValue, duration);
289 | t.SetOptions(snapping).SetTarget(target);
290 | return t;
291 | }
292 |
293 | /// Tweens a RectTransform's pivot to the given value.
294 | /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
295 | /// The end value to reachThe duration of the tween
296 | public static TweenerCore DOPivot(this RectTransform target, Vector2 endValue, float duration)
297 | {
298 | TweenerCore t = DOTween.To(() => target.pivot, x => target.pivot = x, endValue, duration);
299 | t.SetTarget(target);
300 | return t;
301 | }
302 | /// Tweens a RectTransform's pivot X to the given value.
303 | /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
304 | /// The end value to reachThe duration of the tween
305 | public static TweenerCore DOPivotX(this RectTransform target, float endValue, float duration)
306 | {
307 | TweenerCore t = DOTween.To(() => target.pivot, x => target.pivot = x, new Vector2(endValue, 0), duration);
308 | t.SetOptions(AxisConstraint.X).SetTarget(target);
309 | return t;
310 | }
311 | /// Tweens a RectTransform's pivot Y to the given value.
312 | /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
313 | /// The end value to reachThe duration of the tween
314 | public static TweenerCore DOPivotY(this RectTransform target, float endValue, float duration)
315 | {
316 | TweenerCore t = DOTween.To(() => target.pivot, x => target.pivot = x, new Vector2(0, endValue), duration);
317 | t.SetOptions(AxisConstraint.Y).SetTarget(target);
318 | return t;
319 | }
320 |
321 | /// Tweens a RectTransform's sizeDelta to the given value.
322 | /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
323 | /// The end value to reachThe duration of the tween
324 | /// If TRUE the tween will smoothly snap all values to integers
325 | public static TweenerCore DOSizeDelta(this RectTransform target, Vector2 endValue, float duration, bool snapping = false)
326 | {
327 | TweenerCore t = DOTween.To(() => target.sizeDelta, x => target.sizeDelta = x, endValue, duration);
328 | t.SetOptions(snapping).SetTarget(target);
329 | return t;
330 | }
331 |
332 | /// Punches a RectTransform's anchoredPosition towards the given direction and then back to the starting one
333 | /// as if it was connected to the starting position via an elastic.
334 | /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
335 | /// The direction and strength of the punch (added to the RectTransform's current position)
336 | /// The duration of the tween
337 | /// Indicates how much will the punch vibrate
338 | /// Represents how much (0 to 1) the vector will go beyond the starting position when bouncing backwards.
339 | /// 1 creates a full oscillation between the punch direction and the opposite direction,
340 | /// while 0 oscillates only between the punch and the start position
341 | /// If TRUE the tween will smoothly snap all values to integers
342 | public static Tweener DOPunchAnchorPos(this RectTransform target, Vector2 punch, float duration, int vibrato = 10, float elasticity = 1, bool snapping = false)
343 | {
344 | return DOTween.Punch(() => target.anchoredPosition, x => target.anchoredPosition = x, punch, duration, vibrato, elasticity)
345 | .SetTarget(target).SetOptions(snapping);
346 | }
347 |
348 | /// Shakes a RectTransform's anchoredPosition with the given values.
349 | /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
350 | /// The duration of the tween
351 | /// The shake strength
352 | /// Indicates how much will the shake vibrate
353 | /// Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware).
354 | /// Setting it to 0 will shake along a single direction.
355 | /// If TRUE the tween will smoothly snap all values to integers
356 | /// If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not
357 | public static Tweener DOShakeAnchorPos(this RectTransform target, float duration, float strength = 100, int vibrato = 10, float randomness = 90, bool snapping = false, bool fadeOut = true)
358 | {
359 | return DOTween.Shake(() => target.anchoredPosition, x => target.anchoredPosition = x, duration, strength, vibrato, randomness, true, fadeOut)
360 | .SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetShake).SetOptions(snapping);
361 | }
362 | /// Shakes a RectTransform's anchoredPosition with the given values.
363 | /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
364 | /// The duration of the tween
365 | /// The shake strength on each axis
366 | /// Indicates how much will the shake vibrate
367 | /// Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware).
368 | /// Setting it to 0 will shake along a single direction.
369 | /// If TRUE the tween will smoothly snap all values to integers
370 | /// If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not
371 | public static Tweener DOShakeAnchorPos(this RectTransform target, float duration, Vector2 strength, int vibrato = 10, float randomness = 90, bool snapping = false, bool fadeOut = true)
372 | {
373 | return DOTween.Shake(() => target.anchoredPosition, x => target.anchoredPosition = x, duration, strength, vibrato, randomness, fadeOut)
374 | .SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetShake).SetOptions(snapping);
375 | }
376 |
377 | #region Special
378 |
379 | /// Tweens a RectTransform's anchoredPosition to the given value, while also applying a jump effect along the Y axis.
380 | /// Returns a Sequence instead of a Tweener.
381 | /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
382 | /// The end value to reach
383 | /// Power of the jump (the max height of the jump is represented by this plus the final Y offset)
384 | /// Total number of jumps
385 | /// The duration of the tween
386 | /// If TRUE the tween will smoothly snap all values to integers
387 | public static Sequence DOJumpAnchorPos(this RectTransform target, Vector2 endValue, float jumpPower, int numJumps, float duration, bool snapping = false)
388 | {
389 | if (numJumps < 1) numJumps = 1;
390 | float startPosY = 0;
391 | float offsetY = -1;
392 | bool offsetYSet = false;
393 |
394 | // Separate Y Tween so we can elaborate elapsedPercentage on that insted of on the Sequence
395 | // (in case users add a delay or other elements to the Sequence)
396 | Sequence s = DOTween.Sequence();
397 | Tween yTween = DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, new Vector2(0, jumpPower), duration / (numJumps * 2))
398 | .SetOptions(AxisConstraint.Y, snapping).SetEase(Ease.OutQuad).SetRelative()
399 | .SetLoops(numJumps * 2, LoopType.Yoyo)
400 | .OnStart(()=> startPosY = target.anchoredPosition.y);
401 | s.Append(DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, new Vector2(endValue.x, 0), duration)
402 | .SetOptions(AxisConstraint.X, snapping).SetEase(Ease.Linear)
403 | ).Join(yTween)
404 | .SetTarget(target).SetEase(DOTween.defaultEaseType);
405 | s.OnUpdate(() => {
406 | if (!offsetYSet) {
407 | offsetYSet = true;
408 | offsetY = s.isRelative ? endValue.y : endValue.y - startPosY;
409 | }
410 | Vector2 pos = target.anchoredPosition;
411 | pos.y += DOVirtual.EasedValue(0, offsetY, s.ElapsedDirectionalPercentage(), Ease.OutQuad);
412 | target.anchoredPosition = pos;
413 | });
414 | return s;
415 | }
416 |
417 | #endregion
418 |
419 | #endregion
420 |
421 | #region ScrollRect
422 |
423 | /// Tweens a ScrollRect's horizontal/verticalNormalizedPosition to the given value.
424 | /// Also stores the ScrollRect as the tween's target so it can be used for filtered operations
425 | /// The end value to reachThe duration of the tween
426 | /// If TRUE the tween will smoothly snap all values to integers
427 | public static Tweener DONormalizedPos(this ScrollRect target, Vector2 endValue, float duration, bool snapping = false)
428 | {
429 | return DOTween.To(() => new Vector2(target.horizontalNormalizedPosition, target.verticalNormalizedPosition),
430 | x => {
431 | target.horizontalNormalizedPosition = x.x;
432 | target.verticalNormalizedPosition = x.y;
433 | }, endValue, duration)
434 | .SetOptions(snapping).SetTarget(target);
435 | }
436 | /// Tweens a ScrollRect's horizontalNormalizedPosition to the given value.
437 | /// Also stores the ScrollRect as the tween's target so it can be used for filtered operations
438 | /// The end value to reachThe duration of the tween
439 | /// If TRUE the tween will smoothly snap all values to integers
440 | public static Tweener DOHorizontalNormalizedPos(this ScrollRect target, float endValue, float duration, bool snapping = false)
441 | {
442 | return DOTween.To(() => target.horizontalNormalizedPosition, x => target.horizontalNormalizedPosition = x, endValue, duration)
443 | .SetOptions(snapping).SetTarget(target);
444 | }
445 | /// Tweens a ScrollRect's verticalNormalizedPosition to the given value.
446 | /// Also stores the ScrollRect as the tween's target so it can be used for filtered operations
447 | /// The end value to reachThe duration of the tween
448 | /// If TRUE the tween will smoothly snap all values to integers
449 | public static Tweener DOVerticalNormalizedPos(this ScrollRect target, float endValue, float duration, bool snapping = false)
450 | {
451 | return DOTween.To(() => target.verticalNormalizedPosition, x => target.verticalNormalizedPosition = x, endValue, duration)
452 | .SetOptions(snapping).SetTarget(target);
453 | }
454 |
455 | #endregion
456 |
457 | #region Slider
458 |
459 | /// Tweens a Slider's value to the given value.
460 | /// Also stores the Slider as the tween's target so it can be used for filtered operations
461 | /// The end value to reachThe duration of the tween
462 | /// If TRUE the tween will smoothly snap all values to integers
463 | public static TweenerCore DOValue(this Slider target, float endValue, float duration, bool snapping = false)
464 | {
465 | TweenerCore t = DOTween.To(() => target.value, x => target.value = x, endValue, duration);
466 | t.SetOptions(snapping).SetTarget(target);
467 | return t;
468 | }
469 |
470 | #endregion
471 |
472 | #region Text
473 |
474 | /// Tweens a Text's color to the given value.
475 | /// Also stores the Text as the tween's target so it can be used for filtered operations
476 | /// The end value to reachThe duration of the tween
477 | public static TweenerCore DOColor(this Text target, Color endValue, float duration)
478 | {
479 | TweenerCore t = DOTween.To(() => target.color, x => target.color = x, endValue, duration);
480 | t.SetTarget(target);
481 | return t;
482 | }
483 |
484 | /// Tweens a Text's alpha color to the given value.
485 | /// Also stores the Text as the tween's target so it can be used for filtered operations
486 | /// The end value to reachThe duration of the tween
487 | public static TweenerCore DOFade(this Text target, float endValue, float duration)
488 | {
489 | TweenerCore t = DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration);
490 | t.SetTarget(target);
491 | return t;
492 | }
493 |
494 | /// Tweens a Text's text to the given value.
495 | /// Also stores the Text as the tween's target so it can be used for filtered operations
496 | /// The end string to tween toThe duration of the tween
497 | /// If TRUE (default), rich text will be interpreted correctly while animated,
498 | /// otherwise all tags will be considered as normal text
499 | /// The type of scramble mode to use, if any
500 | /// A string containing the characters to use for scrambling.
501 | /// Use as many characters as possible (minimum 10) because DOTween uses a fast scramble mode which gives better results with more characters.
502 | /// Leave it to NULL (default) to use default ones
503 | public static TweenerCore DOText(this Text target, string endValue, float duration, bool richTextEnabled = true, ScrambleMode scrambleMode = ScrambleMode.None, string scrambleChars = null)
504 | {
505 | if (endValue == null) {
506 | 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");
507 | endValue = "";
508 | }
509 | TweenerCore t = DOTween.To(() => target.text, x => target.text = x, endValue, duration);
510 | t.SetOptions(richTextEnabled, scrambleMode, scrambleChars)
511 | .SetTarget(target);
512 | return t;
513 | }
514 |
515 | #endregion
516 |
517 | #region Blendables
518 |
519 | #region Graphic
520 |
521 | /// Tweens a Graphic's color to the given value,
522 | /// in a way that allows other DOBlendableColor tweens to work together on the same target,
523 | /// instead than fight each other as multiple DOColor would do.
524 | /// Also stores the Graphic as the tween's target so it can be used for filtered operations
525 | /// The value to tween toThe duration of the tween
526 | public static Tweener DOBlendableColor(this Graphic target, Color endValue, float duration)
527 | {
528 | endValue = endValue - target.color;
529 | Color to = new Color(0, 0, 0, 0);
530 | return DOTween.To(() => to, x => {
531 | Color diff = x - to;
532 | to = x;
533 | target.color += diff;
534 | }, endValue, duration)
535 | .Blendable().SetTarget(target);
536 | }
537 |
538 | #endregion
539 |
540 | #region Image
541 |
542 | /// Tweens a Image's color to the given value,
543 | /// in a way that allows other DOBlendableColor tweens to work together on the same target,
544 | /// instead than fight each other as multiple DOColor would do.
545 | /// Also stores the Image as the tween's target so it can be used for filtered operations
546 | /// The value to tween toThe duration of the tween
547 | public static Tweener DOBlendableColor(this Image target, Color endValue, float duration)
548 | {
549 | endValue = endValue - target.color;
550 | Color to = new Color(0, 0, 0, 0);
551 | return DOTween.To(() => to, x => {
552 | Color diff = x - to;
553 | to = x;
554 | target.color += diff;
555 | }, endValue, duration)
556 | .Blendable().SetTarget(target);
557 | }
558 |
559 | #endregion
560 |
561 | #region Text
562 |
563 | /// Tweens a Text's color BY the given value,
564 | /// in a way that allows other DOBlendableColor tweens to work together on the same target,
565 | /// instead than fight each other as multiple DOColor would do.
566 | /// Also stores the Text as the tween's target so it can be used for filtered operations
567 | /// The value to tween toThe duration of the tween
568 | public static Tweener DOBlendableColor(this Text target, Color endValue, float duration)
569 | {
570 | endValue = endValue - target.color;
571 | Color to = new Color(0, 0, 0, 0);
572 | return DOTween.To(() => to, x => {
573 | Color diff = x - to;
574 | to = x;
575 | target.color += diff;
576 | }, endValue, duration)
577 | .Blendable().SetTarget(target);
578 | }
579 |
580 | #endregion
581 |
582 | #endregion
583 |
584 | #endregion
585 |
586 | // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
587 | // ███ INTERNAL CLASSES ████████████████████████████████████████████████████████████████████████████████████████████████
588 | // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
589 |
590 | public static class Utils
591 | {
592 | ///
593 | /// Converts the anchoredPosition of the first RectTransform to the second RectTransform,
594 | /// taking into consideration offset, anchors and pivot, and returns the new anchoredPosition
595 | ///
596 | public static Vector2 SwitchToRectTransform(RectTransform from, RectTransform to)
597 | {
598 | Vector2 localPoint;
599 | Vector2 fromPivotDerivedOffset = new Vector2(from.rect.width * 0.5f + from.rect.xMin, from.rect.height * 0.5f + from.rect.yMin);
600 | Vector2 screenP = RectTransformUtility.WorldToScreenPoint(null, from.position);
601 | screenP += fromPivotDerivedOffset;
602 | RectTransformUtility.ScreenPointToLocalPointInRectangle(to, screenP, null, out localPoint);
603 | Vector2 pivotDerivedOffset = new Vector2(to.rect.width * 0.5f + to.rect.xMin, to.rect.height * 0.5f + to.rect.yMin);
604 | return to.anchoredPosition + localPoint - pivotDerivedOffset;
605 | }
606 | }
607 | }
608 | }
609 | #endif
610 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Modules/DOTweenModuleUI.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a060394c03331a64392db53a10e7f2d1
3 | MonoImporter:
4 | serializedVersion: 2
5 | defaultReferences: []
6 | executionOrder: 0
7 | icon: {instanceID: 0}
8 | userData:
9 | assetBundleName:
10 | assetBundleVariant:
11 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Modules/DOTweenModuleUnityVersion.cs:
--------------------------------------------------------------------------------
1 | // Author: Daniele Giardini - http://www.demigiant.com
2 | // Created: 2018/07/13
3 |
4 | using System;
5 | using UnityEngine;
6 | using DG.Tweening.Core;
7 | using DG.Tweening.Plugins.Options;
8 |
9 | #pragma warning disable 1591
10 | namespace DG.Tweening
11 | {
12 | ///
13 | /// Shortcuts/functions that are not strictly related to specific Modules
14 | /// but are available only on some Unity versions
15 | ///
16 | public static class DOTweenModuleUnityVersion
17 | {
18 | #if UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1_OR_NEWER
19 | #region Unity 4.3 or Newer
20 |
21 | #region Material
22 |
23 | /// Tweens a Material's color using the given gradient
24 | /// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener).
25 | /// Also stores the image as the tween's target so it can be used for filtered operations
26 | /// The gradient to useThe duration of the tween
27 | public static Sequence DOGradientColor(this Material target, Gradient gradient, float duration)
28 | {
29 | Sequence s = DOTween.Sequence();
30 | GradientColorKey[] colors = gradient.colorKeys;
31 | int len = colors.Length;
32 | for (int i = 0; i < len; ++i) {
33 | GradientColorKey c = colors[i];
34 | if (i == 0 && c.time <= 0) {
35 | target.color = c.color;
36 | continue;
37 | }
38 | float colorDuration = i == len - 1
39 | ? duration - s.Duration(false) // Verifies that total duration is correct
40 | : duration * (i == 0 ? c.time : c.time - colors[i - 1].time);
41 | s.Append(target.DOColor(c.color, colorDuration).SetEase(Ease.Linear));
42 | }
43 | s.SetTarget(target);
44 | return s;
45 | }
46 | /// Tweens a Material's named color property using the given gradient
47 | /// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener).
48 | /// Also stores the image as the tween's target so it can be used for filtered operations
49 | /// The gradient to use
50 | /// The name of the material property to tween (like _Tint or _SpecColor)
51 | /// The duration of the tween
52 | public static Sequence DOGradientColor(this Material target, Gradient gradient, string property, float duration)
53 | {
54 | Sequence s = DOTween.Sequence();
55 | GradientColorKey[] colors = gradient.colorKeys;
56 | int len = colors.Length;
57 | for (int i = 0; i < len; ++i) {
58 | GradientColorKey c = colors[i];
59 | if (i == 0 && c.time <= 0) {
60 | target.SetColor(property, c.color);
61 | continue;
62 | }
63 | float colorDuration = i == len - 1
64 | ? duration - s.Duration(false) // Verifies that total duration is correct
65 | : duration * (i == 0 ? c.time : c.time - colors[i - 1].time);
66 | s.Append(target.DOColor(c.color, property, colorDuration).SetEase(Ease.Linear));
67 | }
68 | s.SetTarget(target);
69 | return s;
70 | }
71 |
72 | #endregion
73 |
74 | #endregion
75 | #endif
76 |
77 | #if UNITY_5_3_OR_NEWER || UNITY_2017_1_OR_NEWER
78 | #region Unity 5.3 or Newer
79 |
80 | #region CustomYieldInstructions
81 |
82 | ///
83 | /// Returns a that waits until the tween is killed or complete.
84 | /// It can be used inside a coroutine as a yield.
85 | /// Example usage:yield return myTween.WaitForCompletion(true);
86 | ///
87 | public static CustomYieldInstruction WaitForCompletion(this Tween t, bool returnCustomYieldInstruction)
88 | {
89 | if (!t.active) {
90 | if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
91 | return null;
92 | }
93 | return new DOTweenCYInstruction.WaitForCompletion(t);
94 | }
95 |
96 | ///
97 | /// Returns a that waits until the tween is killed or rewinded.
98 | /// It can be used inside a coroutine as a yield.
99 | /// Example usage:yield return myTween.WaitForRewind();
100 | ///
101 | public static CustomYieldInstruction WaitForRewind(this Tween t, bool returnCustomYieldInstruction)
102 | {
103 | if (!t.active) {
104 | if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
105 | return null;
106 | }
107 | return new DOTweenCYInstruction.WaitForRewind(t);
108 | }
109 |
110 | ///
111 | /// Returns a that waits until the tween is killed.
112 | /// It can be used inside a coroutine as a yield.
113 | /// Example usage:yield return myTween.WaitForKill();
114 | ///
115 | public static CustomYieldInstruction WaitForKill(this Tween t, bool returnCustomYieldInstruction)
116 | {
117 | if (!t.active) {
118 | if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
119 | return null;
120 | }
121 | return new DOTweenCYInstruction.WaitForKill(t);
122 | }
123 |
124 | ///
125 | /// Returns a that waits until the tween is killed or has gone through the given amount of loops.
126 | /// It can be used inside a coroutine as a yield.
127 | /// Example usage:yield return myTween.WaitForElapsedLoops(2);
128 | ///
129 | /// Elapsed loops to wait for
130 | public static CustomYieldInstruction WaitForElapsedLoops(this Tween t, int elapsedLoops, bool returnCustomYieldInstruction)
131 | {
132 | if (!t.active) {
133 | if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
134 | return null;
135 | }
136 | return new DOTweenCYInstruction.WaitForElapsedLoops(t, elapsedLoops);
137 | }
138 |
139 | ///
140 | /// Returns a that waits until the tween is killed or has reached the given position (loops included, delays excluded).
141 | /// It can be used inside a coroutine as a yield.
142 | /// Example usage:yield return myTween.WaitForPosition(2.5f);
143 | ///
144 | /// Position (loops included, delays excluded) to wait for
145 | public static CustomYieldInstruction WaitForPosition(this Tween t, float position, bool returnCustomYieldInstruction)
146 | {
147 | if (!t.active) {
148 | if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
149 | return null;
150 | }
151 | return new DOTweenCYInstruction.WaitForPosition(t, position);
152 | }
153 |
154 | ///
155 | /// Returns a that waits until the tween is killed or started
156 | /// (meaning when the tween is set in a playing state the first time, after any eventual delay).
157 | /// It can be used inside a coroutine as a yield.
158 | /// Example usage:yield return myTween.WaitForStart();
159 | ///
160 | public static CustomYieldInstruction WaitForStart(this Tween t, bool returnCustomYieldInstruction)
161 | {
162 | if (!t.active) {
163 | if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
164 | return null;
165 | }
166 | return new DOTweenCYInstruction.WaitForStart(t);
167 | }
168 |
169 | #endregion
170 |
171 | #endregion
172 | #endif
173 |
174 | #if UNITY_2018_1_OR_NEWER
175 | #region Unity 2018.1 or Newer
176 |
177 | #region Material
178 |
179 | /// Tweens a Material's named texture offset property with the given ID to the given value.
180 | /// Also stores the material as the tween's target so it can be used for filtered operations
181 | /// The end value to reach
182 | /// The ID of the material property to tween (also called nameID in Unity's manual)
183 | /// The duration of the tween
184 | public static TweenerCore DOOffset(this Material target, Vector2 endValue, int propertyID, float duration)
185 | {
186 | if (!target.HasProperty(propertyID)) {
187 | if (Debugger.logPriority > 0) Debugger.LogMissingMaterialProperty(propertyID);
188 | return null;
189 | }
190 | TweenerCore t = DOTween.To(() => target.GetTextureOffset(propertyID), x => target.SetTextureOffset(propertyID, x), endValue, duration);
191 | t.SetTarget(target);
192 | return t;
193 | }
194 |
195 | /// Tweens a Material's named texture scale property with the given ID to the given value.
196 | /// Also stores the material as the tween's target so it can be used for filtered operations
197 | /// The end value to reach
198 | /// The ID of the material property to tween (also called nameID in Unity's manual)
199 | /// The duration of the tween
200 | public static TweenerCore DOTiling(this Material target, Vector2 endValue, int propertyID, float duration)
201 | {
202 | if (!target.HasProperty(propertyID)) {
203 | if (Debugger.logPriority > 0) Debugger.LogMissingMaterialProperty(propertyID);
204 | return null;
205 | }
206 | TweenerCore t = DOTween.To(() => target.GetTextureScale(propertyID), x => target.SetTextureScale(propertyID, x), endValue, duration);
207 | t.SetTarget(target);
208 | return t;
209 | }
210 |
211 | #endregion
212 |
213 | #endregion
214 | #endif
215 | }
216 |
217 | // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
218 | // ███ CLASSES █████████████████████████████████████████████████████████████████████████████████████████████████████████
219 | // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
220 |
221 | #if UNITY_5_3_OR_NEWER || UNITY_2017_1_OR_NEWER
222 | public static class DOTweenCYInstruction
223 | {
224 | public class WaitForCompletion : CustomYieldInstruction
225 | {
226 | public override bool keepWaiting { get {
227 | return t.active && !t.IsComplete();
228 | }}
229 | readonly Tween t;
230 | public WaitForCompletion(Tween tween)
231 | {
232 | t = tween;
233 | }
234 | }
235 |
236 | public class WaitForRewind : CustomYieldInstruction
237 | {
238 | public override bool keepWaiting { get {
239 | return t.active && (!t.playedOnce || t.position * (t.CompletedLoops() + 1) > 0);
240 | }}
241 | readonly Tween t;
242 | public WaitForRewind(Tween tween)
243 | {
244 | t = tween;
245 | }
246 | }
247 |
248 | public class WaitForKill : CustomYieldInstruction
249 | {
250 | public override bool keepWaiting { get {
251 | return t.active;
252 | }}
253 | readonly Tween t;
254 | public WaitForKill(Tween tween)
255 | {
256 | t = tween;
257 | }
258 | }
259 |
260 | public class WaitForElapsedLoops : CustomYieldInstruction
261 | {
262 | public override bool keepWaiting { get {
263 | return t.active && t.CompletedLoops() < elapsedLoops;
264 | }}
265 | readonly Tween t;
266 | readonly int elapsedLoops;
267 | public WaitForElapsedLoops(Tween tween, int elapsedLoops)
268 | {
269 | t = tween;
270 | this.elapsedLoops = elapsedLoops;
271 | }
272 | }
273 |
274 | public class WaitForPosition : CustomYieldInstruction
275 | {
276 | public override bool keepWaiting { get {
277 | return t.active && t.position * (t.CompletedLoops() + 1) < position;
278 | }}
279 | readonly Tween t;
280 | readonly float position;
281 | public WaitForPosition(Tween tween, float position)
282 | {
283 | t = tween;
284 | this.position = position;
285 | }
286 | }
287 |
288 | public class WaitForStart : CustomYieldInstruction
289 | {
290 | public override bool keepWaiting { get {
291 | return t.active && !t.playedOnce;
292 | }}
293 | readonly Tween t;
294 | public WaitForStart(Tween tween)
295 | {
296 | t = tween;
297 | }
298 | }
299 | }
300 | #endif
301 | }
302 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Modules/DOTweenModuleUnityVersion.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 63c02322328255542995bd02b47b0457
3 | MonoImporter:
4 | serializedVersion: 2
5 | defaultReferences: []
6 | executionOrder: 0
7 | icon: {instanceID: 0}
8 | userData:
9 | assetBundleName:
10 | assetBundleVariant:
11 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs:
--------------------------------------------------------------------------------
1 | // Author: Daniele Giardini - http://www.demigiant.com
2 | // Created: 2018/07/13
3 |
4 | using System;
5 | using System.Reflection;
6 | using UnityEngine;
7 | using DG.Tweening.Core;
8 | using DG.Tweening.Plugins.Core.PathCore;
9 | using DG.Tweening.Plugins.Options;
10 |
11 | #pragma warning disable 1591
12 | namespace DG.Tweening
13 | {
14 | ///
15 | /// Utility functions that deal with available Modules.
16 | /// Modules defines:
17 | /// - DOTAUDIO
18 | /// - DOTPHYSICS
19 | /// - DOTPHYSICS2D
20 | /// - DOTSPRITE
21 | /// - DOTUI
22 | /// Extra defines set and used for implementation of external assets:
23 | /// - DOTWEEN_TMP ► TextMesh Pro
24 | /// - DOTWEEN_TK2D ► 2D Toolkit
25 | ///
26 | public static class DOTweenModuleUtils
27 | {
28 | static bool _initialized;
29 |
30 | #region Reflection
31 |
32 | ///
33 | /// Called via Reflection by DOTweenComponent on Awake
34 | ///
35 | #if UNITY_2018_1_OR_NEWER
36 | [UnityEngine.Scripting.Preserve]
37 | #endif
38 | public static void Init()
39 | {
40 | if (_initialized) return;
41 |
42 | _initialized = true;
43 | DOTweenExternalCommand.SetOrientationOnPath += Physics.SetOrientationOnPath;
44 |
45 | #if UNITY_EDITOR
46 | #if UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1
47 | UnityEditor.EditorApplication.playmodeStateChanged += PlaymodeStateChanged;
48 | #else
49 | UnityEditor.EditorApplication.playModeStateChanged += PlaymodeStateChanged;
50 | #endif
51 | #endif
52 | }
53 |
54 | #if UNITY_2018_1_OR_NEWER
55 | #pragma warning disable
56 | [UnityEngine.Scripting.Preserve]
57 | // Just used to preserve methods when building, never called
58 | static void Preserver()
59 | {
60 | Assembly[] loadedAssemblies = AppDomain.CurrentDomain.GetAssemblies();
61 | MethodInfo mi = typeof(MonoBehaviour).GetMethod("Stub");
62 | }
63 | #pragma warning restore
64 | #endif
65 |
66 | #endregion
67 |
68 | #if UNITY_EDITOR
69 | // Fires OnApplicationPause in DOTweenComponent even when Editor is paused (otherwise it's only fired at runtime)
70 | #if UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1
71 | static void PlaymodeStateChanged()
72 | #else
73 | static void PlaymodeStateChanged(UnityEditor.PlayModeStateChange state)
74 | #endif
75 | {
76 | if (DOTween.instance == null) return;
77 | DOTween.instance.OnApplicationPause(UnityEditor.EditorApplication.isPaused);
78 | }
79 | #endif
80 |
81 | // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
82 | // ███ INTERNAL CLASSES ████████████████████████████████████████████████████████████████████████████████████████████████
83 | // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
84 |
85 | public static class Physics
86 | {
87 | // Called via DOTweenExternalCommand callback
88 | public static void SetOrientationOnPath(PathOptions options, Tween t, Quaternion newRot, Transform trans)
89 | {
90 | #if false // PHYSICS_MARKER
91 | if (options.isRigidbody) ((Rigidbody)t.target).rotation = newRot;
92 | else trans.rotation = newRot;
93 | #else
94 | trans.rotation = newRot;
95 | #endif
96 | }
97 |
98 | // Returns FALSE if the DOTween's Physics2D Module is disabled, or if there's no Rigidbody2D attached
99 | public static bool HasRigidbody2D(Component target)
100 | {
101 | #if false // PHYSICS2D_MARKER
102 | return target.GetComponent() != null;
103 | #else
104 | return false;
105 | #endif
106 | }
107 |
108 | #region Called via Reflection
109 |
110 |
111 | // Called via Reflection by DOTweenPathInspector
112 | // Returns FALSE if the DOTween's Physics Module is disabled, or if there's no rigidbody attached
113 | #if UNITY_2018_1_OR_NEWER
114 | [UnityEngine.Scripting.Preserve]
115 | #endif
116 | public static bool HasRigidbody(Component target)
117 | {
118 | #if false // PHYSICS_MARKER
119 | return target.GetComponent() != null;
120 | #else
121 | return false;
122 | #endif
123 | }
124 |
125 | // Called via Reflection by DOTweenPath
126 | #if UNITY_2018_1_OR_NEWER
127 | [UnityEngine.Scripting.Preserve]
128 | #endif
129 | public static TweenerCore CreateDOTweenPathTween(
130 | MonoBehaviour target, bool tweenRigidbody, bool isLocal, Path path, float duration, PathMode pathMode
131 | ){
132 | TweenerCore t;
133 | #if false // PHYSICS_MARKER
134 | Rigidbody rBody = tweenRigidbody ? target.GetComponent() : null;
135 | if (tweenRigidbody && rBody != null) {
136 | t = isLocal
137 | ? rBody.DOLocalPath(path, duration, pathMode)
138 | : rBody.DOPath(path, duration, pathMode);
139 | } else {
140 | t = isLocal
141 | ? target.transform.DOLocalPath(path, duration, pathMode)
142 | : target.transform.DOPath(path, duration, pathMode);
143 | }
144 | #else
145 | t = isLocal
146 | ? target.transform.DOLocalPath(path, duration, pathMode)
147 | : target.transform.DOPath(path, duration, pathMode);
148 | #endif
149 | return t;
150 | }
151 |
152 | #endregion
153 | }
154 | }
155 | }
156 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 7bcaf917d9cf5b84090421a5a2abe42e
3 | MonoImporter:
4 | serializedVersion: 2
5 | defaultReferences: []
6 | executionOrder: 0
7 | icon: {instanceID: 0}
8 | userData:
9 | assetBundleName:
10 | assetBundleVariant:
11 |
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/readme.txt:
--------------------------------------------------------------------------------
1 | DOTween and DOTween Pro are copyright (c) 2014-2018 Daniele Giardini - Demigiant
2 |
3 | // IMPORTANT!!! /////////////////////////////////////////////
4 | // Upgrading DOTween from versions older than 1.2.000 ///////
5 | // (or DOTween Pro older than 1.0.000) //////////////////////
6 | -------------------------------------------------------------
7 | 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.
8 | 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
9 | 2) Close and reopen Unity (and your project). This is fundamental: skipping this step will cause a bloodbath
10 | 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
11 | 4) From the Add/Remove Modules panel that opens, activate/deactivate Modules for Unity systems and for external assets (Pro version only)
12 |
13 | // GET STARTED //////////////////////////////////////////////
14 |
15 | - 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.
16 | - In your code, add "using DG.Tweening" to each class where you want to use DOTween.
17 | - You're ready to tween. Check out the links below for full documentation and license info.
18 |
19 |
20 | // LINKS ///////////////////////////////////////////////////////
21 |
22 | DOTween website (documentation, examples, etc): http://dotween.demigiant.com
23 | DOTween license: http://dotween.demigiant.com/license.php
24 | DOTween repository (Google Code): https://code.google.com/p/dotween/
25 | Demigiant website (documentation, examples, etc): http://www.demigiant.com
26 |
27 | // NOTES //////////////////////////////////////////////////////
28 |
29 | - 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
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/readme.txt.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: fccfc62abf2eb0a4db614853430894fd
3 | TextScriptImporter:
4 | userData:
5 | assetBundleName:
6 | assetBundleVariant:
7 |
--------------------------------------------------------------------------------
/Assets/Demo.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine ;
2 | using EasyUI.PickerWheelUI ;
3 | using UnityEngine.UI ;
4 |
5 | public class Demo : MonoBehaviour {
6 | [SerializeField] private Button uiSpinButton ;
7 | [SerializeField] private Text uiSpinButtonText ;
8 |
9 | [SerializeField] private PickerWheel pickerWheel ;
10 |
11 |
12 | private void Start () {
13 | uiSpinButton.onClick.AddListener (() => {
14 |
15 | uiSpinButton.interactable = false ;
16 | uiSpinButtonText.text = "Spinning" ;
17 |
18 | pickerWheel.OnSpinEnd (wheelPiece => {
19 | Debug.Log (
20 | @" Index: " + wheelPiece.Index + " Label: " + wheelPiece.Label
21 | + "\n Amount: " + wheelPiece.Amount + " Chance: " + wheelPiece.Chance + "%"
22 | ) ;
23 |
24 | uiSpinButton.interactable = true ;
25 | uiSpinButtonText.text = "Spin" ;
26 | }) ;
27 |
28 | pickerWheel.Spin () ;
29 |
30 | }) ;
31 |
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/Assets/Demo.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 568bac541fb53e54aa3ec7bb2c48ddb6
3 | timeCreated: 1624617160
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Assets/PickerWheel.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a63d97e9bc5517848827256f36a3c010
3 | folderAsset: yes
4 | timeCreated: 1624441565
5 | licenseType: Pro
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/PickerWheel/Prefabs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2e5e36233a1d9e042a3494f79ca133b1
3 | folderAsset: yes
4 | timeCreated: 1624441604
5 | licenseType: Pro
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/PickerWheel/Prefabs/Line.prefab:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_PickerWheelUI/dcc34e17f424cd1d820123ab37901dda7e92ed40/Assets/PickerWheel/Prefabs/Line.prefab
--------------------------------------------------------------------------------
/Assets/PickerWheel/Prefabs/Line.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 052d5aa0d2632e04c90d4d5027f9dd37
3 | timeCreated: 1624471608
4 | licenseType: Pro
5 | NativeFormatImporter:
6 | mainObjectFileID: 100100000
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/PickerWheel/Prefabs/PickerWheel.prefab:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_PickerWheelUI/dcc34e17f424cd1d820123ab37901dda7e92ed40/Assets/PickerWheel/Prefabs/PickerWheel.prefab
--------------------------------------------------------------------------------
/Assets/PickerWheel/Prefabs/PickerWheel.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 160be82451391f6448834ec65286e007
3 | timeCreated: 1624536965
4 | licenseType: Pro
5 | NativeFormatImporter:
6 | mainObjectFileID: 100100000
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/PickerWheel/Prefabs/Piece.prefab:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_PickerWheelUI/dcc34e17f424cd1d820123ab37901dda7e92ed40/Assets/PickerWheel/Prefabs/Piece.prefab
--------------------------------------------------------------------------------
/Assets/PickerWheel/Prefabs/Piece.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a10fef7bc23b5a64a929387e97c9b936
3 | timeCreated: 1624468097
4 | licenseType: Pro
5 | NativeFormatImporter:
6 | mainObjectFileID: 100100000
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/PickerWheel/Scripts.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e873e278eec27aa40bfb1bd6911e1ee5
3 | folderAsset: yes
4 | timeCreated: 1624441574
5 | licenseType: Pro
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/PickerWheel/Scripts/PickerWheel.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine ;
2 | using UnityEngine.UI ;
3 | using DG.Tweening ;
4 | using UnityEngine.Events ;
5 | using System.Collections.Generic ;
6 |
7 | namespace EasyUI.PickerWheelUI {
8 |
9 | public class PickerWheel : MonoBehaviour {
10 |
11 | [Header ("References :")]
12 | [SerializeField] private GameObject linePrefab ;
13 | [SerializeField] private Transform linesParent ;
14 |
15 | [Space]
16 | [SerializeField] private Transform PickerWheelTransform ;
17 | [SerializeField] private Transform wheelCircle ;
18 | [SerializeField] private GameObject wheelPiecePrefab ;
19 | [SerializeField] private Transform wheelPiecesParent ;
20 |
21 | [Space]
22 | [Header ("Sounds :")]
23 | [SerializeField] private AudioSource audioSource ;
24 | [SerializeField] private AudioClip tickAudioClip ;
25 | [SerializeField] [Range (0f, 1f)] private float volume = .5f ;
26 | [SerializeField] [Range (-3f, 3f)] private float pitch = 1f ;
27 |
28 | [Space]
29 | [Header ("Picker wheel settings :")]
30 | [Range (1, 20)] public int spinDuration = 8 ;
31 | [SerializeField] [Range (.2f, 2f)] private float wheelSize = 1f ;
32 |
33 | [Space]
34 | [Header ("Picker wheel pieces :")]
35 | public WheelPiece[] wheelPieces ;
36 |
37 | // Events
38 | private UnityAction onSpinStartEvent ;
39 | private UnityAction onSpinEndEvent ;
40 |
41 |
42 | private bool _isSpinning = false ;
43 |
44 | public bool IsSpinning { get { return _isSpinning ; } }
45 |
46 |
47 | private Vector2 pieceMinSize = new Vector2 (81f, 146f) ;
48 | private Vector2 pieceMaxSize = new Vector2 (144f, 213f) ;
49 | private int piecesMin = 2 ;
50 | private int piecesMax = 12 ;
51 |
52 | private float pieceAngle ;
53 | private float halfPieceAngle ;
54 | private float halfPieceAngleWithPaddings ;
55 |
56 |
57 | private double accumulatedWeight ;
58 | private System.Random rand = new System.Random () ;
59 |
60 | private List nonZeroChancesIndices = new List () ;
61 |
62 | private void Start () {
63 | pieceAngle = 360 / wheelPieces.Length ;
64 | halfPieceAngle = pieceAngle / 2f ;
65 | halfPieceAngleWithPaddings = halfPieceAngle - (halfPieceAngle / 4f) ;
66 |
67 | Generate () ;
68 |
69 | CalculateWeightsAndIndices () ;
70 | if (nonZeroChancesIndices.Count == 0)
71 | Debug.LogError ("You can't set all pieces chance to zero") ;
72 |
73 |
74 | SetupAudio () ;
75 |
76 | }
77 |
78 | private void SetupAudio () {
79 | audioSource.clip = tickAudioClip ;
80 | audioSource.volume = volume ;
81 | audioSource.pitch = pitch ;
82 | }
83 |
84 | private void Generate () {
85 | wheelPiecePrefab = InstantiatePiece () ;
86 |
87 | RectTransform rt = wheelPiecePrefab.transform.GetChild (0).GetComponent () ;
88 | float pieceWidth = Mathf.Lerp (pieceMinSize.x, pieceMaxSize.x, 1f - Mathf.InverseLerp (piecesMin, piecesMax, wheelPieces.Length)) ;
89 | float pieceHeight = Mathf.Lerp (pieceMinSize.y, pieceMaxSize.y, 1f - Mathf.InverseLerp (piecesMin, piecesMax, wheelPieces.Length)) ;
90 | rt.SetSizeWithCurrentAnchors (RectTransform.Axis.Horizontal, pieceWidth) ;
91 | rt.SetSizeWithCurrentAnchors (RectTransform.Axis.Vertical, pieceHeight) ;
92 |
93 | for (int i = 0; i < wheelPieces.Length; i++)
94 | DrawPiece (i) ;
95 |
96 | Destroy (wheelPiecePrefab) ;
97 | }
98 |
99 | private void DrawPiece (int index) {
100 | WheelPiece piece = wheelPieces [ index ] ;
101 | Transform pieceTrns = InstantiatePiece ().transform.GetChild (0) ;
102 |
103 | pieceTrns.GetChild (0).GetComponent ().sprite = piece.Icon ;
104 | pieceTrns.GetChild (1).GetComponent ().text = piece.Label ;
105 | pieceTrns.GetChild (2).GetComponent ().text = piece.Amount.ToString () ;
106 |
107 | //Line
108 | Transform lineTrns = Instantiate (linePrefab, linesParent.position, Quaternion.identity, linesParent).transform ;
109 | lineTrns.RotateAround (wheelPiecesParent.position, Vector3.back, (pieceAngle * index) + halfPieceAngle) ;
110 |
111 | pieceTrns.RotateAround (wheelPiecesParent.position, Vector3.back, pieceAngle * index) ;
112 | }
113 |
114 | private GameObject InstantiatePiece () {
115 | return Instantiate (wheelPiecePrefab, wheelPiecesParent.position, Quaternion.identity, wheelPiecesParent) ;
116 | }
117 |
118 |
119 | public void Spin () {
120 | if (!_isSpinning) {
121 | _isSpinning = true ;
122 | if (onSpinStartEvent != null)
123 | onSpinStartEvent.Invoke () ;
124 |
125 | int index = GetRandomPieceIndex () ;
126 | WheelPiece piece = wheelPieces [ index ] ;
127 |
128 | if (piece.Chance == 0 && nonZeroChancesIndices.Count != 0) {
129 | index = nonZeroChancesIndices [ Random.Range (0, nonZeroChancesIndices.Count) ] ;
130 | piece = wheelPieces [ index ] ;
131 | }
132 |
133 | float angle = -(pieceAngle * index) ;
134 |
135 | float rightOffset = (angle - halfPieceAngleWithPaddings) % 360 ;
136 | float leftOffset = (angle + halfPieceAngleWithPaddings) % 360 ;
137 |
138 | float randomAngle = Random.Range (leftOffset, rightOffset) ;
139 |
140 | Vector3 targetRotation = Vector3.back * (randomAngle + 2 * 360 * spinDuration) ;
141 |
142 | //float prevAngle = wheelCircle.eulerAngles.z + halfPieceAngle ;
143 | float prevAngle, currentAngle ;
144 | prevAngle = currentAngle = wheelCircle.eulerAngles.z ;
145 |
146 | bool isIndicatorOnTheLine = false ;
147 |
148 | wheelCircle
149 | .DORotate (targetRotation, spinDuration, RotateMode.Fast)
150 | .SetEase (Ease.InOutQuart)
151 | .OnUpdate (() => {
152 | float diff = Mathf.Abs (prevAngle - currentAngle) ;
153 | if (diff >= halfPieceAngle) {
154 | if (isIndicatorOnTheLine) {
155 | audioSource.PlayOneShot (audioSource.clip) ;
156 | }
157 | prevAngle = currentAngle ;
158 | isIndicatorOnTheLine = !isIndicatorOnTheLine ;
159 | }
160 | currentAngle = wheelCircle.eulerAngles.z ;
161 | })
162 | .OnComplete (() => {
163 | _isSpinning = false ;
164 | if (onSpinEndEvent != null)
165 | onSpinEndEvent.Invoke (piece) ;
166 |
167 | onSpinStartEvent = null ;
168 | onSpinEndEvent = null ;
169 | }) ;
170 |
171 | }
172 | }
173 |
174 | private void FixedUpdate () {
175 |
176 | }
177 |
178 | public void OnSpinStart (UnityAction action) {
179 | onSpinStartEvent = action ;
180 | }
181 |
182 | public void OnSpinEnd (UnityAction action) {
183 | onSpinEndEvent = action ;
184 | }
185 |
186 |
187 | private int GetRandomPieceIndex () {
188 | double r = rand.NextDouble () * accumulatedWeight ;
189 |
190 | for (int i = 0; i < wheelPieces.Length; i++)
191 | if (wheelPieces [ i ]._weight >= r)
192 | return i ;
193 |
194 | return 0 ;
195 | }
196 |
197 | private void CalculateWeightsAndIndices () {
198 | for (int i = 0; i < wheelPieces.Length; i++) {
199 | WheelPiece piece = wheelPieces [ i ] ;
200 |
201 | //add weights:
202 | accumulatedWeight += piece.Chance ;
203 | piece._weight = accumulatedWeight ;
204 |
205 | //add index :
206 | piece.Index = i ;
207 |
208 | //save non zero chance indices:
209 | if (piece.Chance > 0)
210 | nonZeroChancesIndices.Add (i) ;
211 | }
212 | }
213 |
214 |
215 |
216 |
217 | private void OnValidate () {
218 | if (PickerWheelTransform != null)
219 | PickerWheelTransform.localScale = new Vector3 (wheelSize, wheelSize, 1f) ;
220 |
221 | if (wheelPieces.Length > piecesMax || wheelPieces.Length < piecesMin)
222 | Debug.LogError ("[ PickerWheelwheel ] pieces length must be between " + piecesMin + " and " + piecesMax) ;
223 | }
224 | }
225 | }
--------------------------------------------------------------------------------
/Assets/PickerWheel/Scripts/PickerWheel.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: aa4bebc7bfe9d394592353853ce4bc26
3 | timeCreated: 1624461960
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Assets/PickerWheel/Scripts/WheelPiece.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine ;
2 |
3 | namespace EasyUI.PickerWheelUI {
4 | [System.Serializable]
5 | public class WheelPiece {
6 | public UnityEngine.Sprite Icon ;
7 | public string Label ;
8 |
9 | [Tooltip ("Reward amount")] public int Amount ;
10 |
11 | [Tooltip ("Probability in %")]
12 | [Range (0f, 100f)]
13 | public float Chance = 100f ;
14 |
15 | [HideInInspector] public int Index ;
16 | [HideInInspector] public double _weight = 0f ;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Assets/PickerWheel/Scripts/WheelPiece.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d0c7412f9a659ea44b9498b33e050c64
3 | timeCreated: 1624461812
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Assets/PickerWheel/Sounds.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4a9de0e02a692604b92e2090f5cb1cad
3 | folderAsset: yes
4 | timeCreated: 1630410958
5 | licenseType: Pro
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/PickerWheel/Sounds/tick1.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_PickerWheelUI/dcc34e17f424cd1d820123ab37901dda7e92ed40/Assets/PickerWheel/Sounds/tick1.ogg
--------------------------------------------------------------------------------
/Assets/PickerWheel/Sounds/tick1.ogg.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 8ab9f96308f525a49a7ac7a50256d6ed
3 | timeCreated: 1630425408
4 | licenseType: Pro
5 | AudioImporter:
6 | serializedVersion: 6
7 | defaultSettings:
8 | loadType: 0
9 | sampleRateSetting: 0
10 | sampleRateOverride: 44100
11 | compressionFormat: 1
12 | quality: 1
13 | conversionMode: 0
14 | platformSettingOverrides: {}
15 | forceToMono: 0
16 | normalize: 1
17 | preloadAudioData: 1
18 | loadInBackground: 0
19 | 3D: 1
20 | userData:
21 | assetBundleName:
22 | assetBundleVariant:
23 |
--------------------------------------------------------------------------------
/Assets/PickerWheel/Sounds/tick2.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_PickerWheelUI/dcc34e17f424cd1d820123ab37901dda7e92ed40/Assets/PickerWheel/Sounds/tick2.ogg
--------------------------------------------------------------------------------
/Assets/PickerWheel/Sounds/tick2.ogg.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 43186eb953e63e546b2c31cb280f58d8
3 | timeCreated: 1630425408
4 | licenseType: Pro
5 | AudioImporter:
6 | serializedVersion: 6
7 | defaultSettings:
8 | loadType: 0
9 | sampleRateSetting: 0
10 | sampleRateOverride: 44100
11 | compressionFormat: 1
12 | quality: 1
13 | conversionMode: 0
14 | platformSettingOverrides: {}
15 | forceToMono: 0
16 | normalize: 1
17 | preloadAudioData: 1
18 | loadInBackground: 0
19 | 3D: 1
20 | userData:
21 | assetBundleName:
22 | assetBundleVariant:
23 |
--------------------------------------------------------------------------------
/Assets/PickerWheel/Sprites.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 04fcea86d8c17c143b80a47bd923557c
3 | folderAsset: yes
4 | timeCreated: 1624441585
5 | licenseType: Pro
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/PickerWheel/Sprites/Circle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_PickerWheelUI/dcc34e17f424cd1d820123ab37901dda7e92ed40/Assets/PickerWheel/Sprites/Circle.png
--------------------------------------------------------------------------------
/Assets/PickerWheel/Sprites/Circle.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e7ec3340202c146438f4406d0c3f4cea
3 | timeCreated: 1624443532
4 | licenseType: Pro
5 | TextureImporter:
6 | fileIDToRecycleName: {}
7 | serializedVersion: 4
8 | mipmaps:
9 | mipMapMode: 0
10 | enableMipMap: 0
11 | sRGBTexture: 1
12 | linearTexture: 0
13 | fadeOut: 0
14 | borderMipMap: 0
15 | mipMapFadeDistanceStart: 1
16 | mipMapFadeDistanceEnd: 3
17 | bumpmap:
18 | convertToNormalMap: 0
19 | externalNormalMap: 0
20 | heightScale: 0.25
21 | normalMapFilter: 0
22 | isReadable: 0
23 | grayScaleToAlpha: 0
24 | generateCubemap: 6
25 | cubemapConvolution: 0
26 | seamlessCubemap: 0
27 | textureFormat: 1
28 | maxTextureSize: 2048
29 | textureSettings:
30 | filterMode: -1
31 | aniso: -1
32 | mipBias: -1
33 | wrapMode: 1
34 | nPOTScale: 0
35 | lightmap: 0
36 | compressionQuality: 50
37 | spriteMode: 1
38 | spriteExtrude: 1
39 | spriteMeshType: 1
40 | alignment: 0
41 | spritePivot: {x: 0.5, y: 0.5}
42 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 | spritePixelsToUnits: 100
44 | alphaUsage: 1
45 | alphaIsTransparency: 1
46 | spriteTessellationDetail: -1
47 | textureType: 8
48 | textureShape: 1
49 | maxTextureSizeSet: 0
50 | compressionQualitySet: 0
51 | textureFormatSet: 0
52 | platformSettings:
53 | - buildTarget: DefaultTexturePlatform
54 | maxTextureSize: 2048
55 | textureFormat: -1
56 | textureCompression: 1
57 | compressionQuality: 50
58 | crunchedCompression: 0
59 | allowsAlphaSplitting: 0
60 | overridden: 0
61 | spriteSheet:
62 | serializedVersion: 2
63 | sprites: []
64 | outline: []
65 | spritePackingTag:
66 | userData:
67 | assetBundleName:
68 | assetBundleVariant:
69 |
--------------------------------------------------------------------------------
/Assets/PickerWheel/Sprites/Circle2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_PickerWheelUI/dcc34e17f424cd1d820123ab37901dda7e92ed40/Assets/PickerWheel/Sprites/Circle2.png
--------------------------------------------------------------------------------
/Assets/PickerWheel/Sprites/Circle2.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 66a11d9e6213172488075040ca0dbf21
3 | timeCreated: 1624536587
4 | licenseType: Pro
5 | TextureImporter:
6 | fileIDToRecycleName: {}
7 | serializedVersion: 4
8 | mipmaps:
9 | mipMapMode: 0
10 | enableMipMap: 0
11 | sRGBTexture: 1
12 | linearTexture: 0
13 | fadeOut: 0
14 | borderMipMap: 0
15 | mipMapFadeDistanceStart: 1
16 | mipMapFadeDistanceEnd: 3
17 | bumpmap:
18 | convertToNormalMap: 0
19 | externalNormalMap: 0
20 | heightScale: 0.25
21 | normalMapFilter: 0
22 | isReadable: 0
23 | grayScaleToAlpha: 0
24 | generateCubemap: 6
25 | cubemapConvolution: 0
26 | seamlessCubemap: 0
27 | textureFormat: 1
28 | maxTextureSize: 2048
29 | textureSettings:
30 | filterMode: -1
31 | aniso: -1
32 | mipBias: -1
33 | wrapMode: 1
34 | nPOTScale: 0
35 | lightmap: 0
36 | compressionQuality: 50
37 | spriteMode: 1
38 | spriteExtrude: 1
39 | spriteMeshType: 1
40 | alignment: 0
41 | spritePivot: {x: 0.5, y: 0.5}
42 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 | spritePixelsToUnits: 100
44 | alphaUsage: 1
45 | alphaIsTransparency: 1
46 | spriteTessellationDetail: -1
47 | textureType: 8
48 | textureShape: 1
49 | maxTextureSizeSet: 0
50 | compressionQualitySet: 0
51 | textureFormatSet: 0
52 | platformSettings:
53 | - buildTarget: DefaultTexturePlatform
54 | maxTextureSize: 2048
55 | textureFormat: -1
56 | textureCompression: 1
57 | compressionQuality: 50
58 | crunchedCompression: 0
59 | allowsAlphaSplitting: 0
60 | overridden: 0
61 | spriteSheet:
62 | serializedVersion: 2
63 | sprites: []
64 | outline: []
65 | spritePackingTag:
66 | userData:
67 | assetBundleName:
68 | assetBundleVariant:
69 |
--------------------------------------------------------------------------------
/Assets/PickerWheel/Sprites/Indicator.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_PickerWheelUI/dcc34e17f424cd1d820123ab37901dda7e92ed40/Assets/PickerWheel/Sprites/Indicator.png
--------------------------------------------------------------------------------
/Assets/PickerWheel/Sprites/Indicator.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4cd9a0b0f428054429109957c248e4ae
3 | timeCreated: 1624543807
4 | licenseType: Pro
5 | TextureImporter:
6 | fileIDToRecycleName: {}
7 | serializedVersion: 4
8 | mipmaps:
9 | mipMapMode: 0
10 | enableMipMap: 0
11 | sRGBTexture: 1
12 | linearTexture: 0
13 | fadeOut: 0
14 | borderMipMap: 0
15 | mipMapFadeDistanceStart: 1
16 | mipMapFadeDistanceEnd: 3
17 | bumpmap:
18 | convertToNormalMap: 0
19 | externalNormalMap: 0
20 | heightScale: 0.25
21 | normalMapFilter: 0
22 | isReadable: 0
23 | grayScaleToAlpha: 0
24 | generateCubemap: 6
25 | cubemapConvolution: 0
26 | seamlessCubemap: 0
27 | textureFormat: 1
28 | maxTextureSize: 2048
29 | textureSettings:
30 | filterMode: -1
31 | aniso: -1
32 | mipBias: -1
33 | wrapMode: 1
34 | nPOTScale: 0
35 | lightmap: 0
36 | compressionQuality: 50
37 | spriteMode: 1
38 | spriteExtrude: 1
39 | spriteMeshType: 1
40 | alignment: 0
41 | spritePivot: {x: 0.5, y: 0.5}
42 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 | spritePixelsToUnits: 100
44 | alphaUsage: 1
45 | alphaIsTransparency: 1
46 | spriteTessellationDetail: -1
47 | textureType: 8
48 | textureShape: 1
49 | maxTextureSizeSet: 0
50 | compressionQualitySet: 0
51 | textureFormatSet: 0
52 | platformSettings:
53 | - buildTarget: DefaultTexturePlatform
54 | maxTextureSize: 2048
55 | textureFormat: -1
56 | textureCompression: 1
57 | compressionQuality: 50
58 | crunchedCompression: 0
59 | allowsAlphaSplitting: 0
60 | overridden: 0
61 | spriteSheet:
62 | serializedVersion: 2
63 | sprites: []
64 | outline: []
65 | spritePackingTag:
66 | userData:
67 | assetBundleName:
68 | assetBundleVariant:
69 |
--------------------------------------------------------------------------------
/Assets/PickerWheel/Sprites/R_Square.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_PickerWheelUI/dcc34e17f424cd1d820123ab37901dda7e92ed40/Assets/PickerWheel/Sprites/R_Square.png
--------------------------------------------------------------------------------
/Assets/PickerWheel/Sprites/R_Square.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 19a48c273e699344789bafa1e0e9ed23
3 | timeCreated: 1624537972
4 | licenseType: Pro
5 | TextureImporter:
6 | fileIDToRecycleName: {}
7 | serializedVersion: 4
8 | mipmaps:
9 | mipMapMode: 0
10 | enableMipMap: 0
11 | sRGBTexture: 1
12 | linearTexture: 0
13 | fadeOut: 0
14 | borderMipMap: 0
15 | mipMapFadeDistanceStart: 1
16 | mipMapFadeDistanceEnd: 3
17 | bumpmap:
18 | convertToNormalMap: 0
19 | externalNormalMap: 0
20 | heightScale: 0.25
21 | normalMapFilter: 0
22 | isReadable: 0
23 | grayScaleToAlpha: 0
24 | generateCubemap: 6
25 | cubemapConvolution: 0
26 | seamlessCubemap: 0
27 | textureFormat: 1
28 | maxTextureSize: 2048
29 | textureSettings:
30 | filterMode: -1
31 | aniso: -1
32 | mipBias: -1
33 | wrapMode: 1
34 | nPOTScale: 0
35 | lightmap: 0
36 | compressionQuality: 50
37 | spriteMode: 1
38 | spriteExtrude: 1
39 | spriteMeshType: 0
40 | alignment: 0
41 | spritePivot: {x: 0.5, y: 0.5}
42 | spriteBorder: {x: 17, y: 17, z: 17, w: 17}
43 | spritePixelsToUnits: 100
44 | alphaUsage: 1
45 | alphaIsTransparency: 1
46 | spriteTessellationDetail: -1
47 | textureType: 8
48 | textureShape: 1
49 | maxTextureSizeSet: 0
50 | compressionQualitySet: 0
51 | textureFormatSet: 0
52 | platformSettings:
53 | - buildTarget: DefaultTexturePlatform
54 | maxTextureSize: 2048
55 | textureFormat: -1
56 | textureCompression: 1
57 | compressionQuality: 50
58 | crunchedCompression: 0
59 | allowsAlphaSplitting: 0
60 | overridden: 0
61 | - buildTarget: Standalone
62 | maxTextureSize: 2048
63 | textureFormat: -1
64 | textureCompression: 1
65 | compressionQuality: 50
66 | crunchedCompression: 0
67 | allowsAlphaSplitting: 0
68 | overridden: 0
69 | - buildTarget: Android
70 | maxTextureSize: 2048
71 | textureFormat: -1
72 | textureCompression: 1
73 | compressionQuality: 50
74 | crunchedCompression: 0
75 | allowsAlphaSplitting: 0
76 | overridden: 0
77 | spriteSheet:
78 | serializedVersion: 2
79 | sprites: []
80 | outline: []
81 | spritePackingTag:
82 | userData:
83 | assetBundleName:
84 | assetBundleVariant:
85 |
--------------------------------------------------------------------------------
/Assets/PickerWheel/Sprites/characters.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_PickerWheelUI/dcc34e17f424cd1d820123ab37901dda7e92ed40/Assets/PickerWheel/Sprites/characters.png
--------------------------------------------------------------------------------
/Assets/PickerWheel/Sprites/characters.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 6e980baa502e72148bbc79fb42c81d10
3 | timeCreated: 1624466117
4 | licenseType: Pro
5 | TextureImporter:
6 | fileIDToRecycleName:
7 | 21300000: characters_0
8 | 21300002: characters_1
9 | 21300004: characters_2
10 | 21300006: characters_3
11 | 21300008: characters_4
12 | 21300010: characters_5
13 | 21300012: characters_6
14 | 21300014: characters_7
15 | 21300016: characters_8
16 | 21300018: characters_9
17 | 21300020: characters_10
18 | 21300022: characters_11
19 | 21300024: characters_12
20 | 21300026: characters_13
21 | 21300028: characters_14
22 | 21300030: characters_15
23 | 21300032: characters_16
24 | 21300034: characters_17
25 | 21300036: characters_18
26 | 21300038: characters_19
27 | serializedVersion: 4
28 | mipmaps:
29 | mipMapMode: 0
30 | enableMipMap: 0
31 | sRGBTexture: 1
32 | linearTexture: 0
33 | fadeOut: 0
34 | borderMipMap: 0
35 | mipMapFadeDistanceStart: 1
36 | mipMapFadeDistanceEnd: 3
37 | bumpmap:
38 | convertToNormalMap: 0
39 | externalNormalMap: 0
40 | heightScale: 0.25
41 | normalMapFilter: 0
42 | isReadable: 0
43 | grayScaleToAlpha: 0
44 | generateCubemap: 6
45 | cubemapConvolution: 0
46 | seamlessCubemap: 0
47 | textureFormat: 1
48 | maxTextureSize: 2048
49 | textureSettings:
50 | filterMode: -1
51 | aniso: -1
52 | mipBias: -1
53 | wrapMode: 1
54 | nPOTScale: 0
55 | lightmap: 0
56 | compressionQuality: 50
57 | spriteMode: 2
58 | spriteExtrude: 1
59 | spriteMeshType: 1
60 | alignment: 0
61 | spritePivot: {x: 0.5, y: 0.5}
62 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
63 | spritePixelsToUnits: 100
64 | alphaUsage: 1
65 | alphaIsTransparency: 1
66 | spriteTessellationDetail: -1
67 | textureType: 8
68 | textureShape: 1
69 | maxTextureSizeSet: 0
70 | compressionQualitySet: 0
71 | textureFormatSet: 0
72 | platformSettings:
73 | - buildTarget: DefaultTexturePlatform
74 | maxTextureSize: 2048
75 | textureFormat: -1
76 | textureCompression: 1
77 | compressionQuality: 50
78 | crunchedCompression: 0
79 | allowsAlphaSplitting: 0
80 | overridden: 0
81 | - buildTarget: Standalone
82 | maxTextureSize: 2048
83 | textureFormat: -1
84 | textureCompression: 1
85 | compressionQuality: 50
86 | crunchedCompression: 0
87 | allowsAlphaSplitting: 0
88 | overridden: 0
89 | - buildTarget: Android
90 | maxTextureSize: 2048
91 | textureFormat: -1
92 | textureCompression: 1
93 | compressionQuality: 50
94 | crunchedCompression: 0
95 | allowsAlphaSplitting: 0
96 | overridden: 0
97 | spriteSheet:
98 | serializedVersion: 2
99 | sprites:
100 | - serializedVersion: 2
101 | name: characters_0
102 | rect:
103 | serializedVersion: 2
104 | x: 44
105 | y: 813
106 | width: 159
107 | height: 104
108 | alignment: 0
109 | pivot: {x: 0, y: 0}
110 | border: {x: 0, y: 0, z: 0, w: 0}
111 | outline: []
112 | tessellationDetail: 0
113 | - serializedVersion: 2
114 | name: characters_1
115 | rect:
116 | serializedVersion: 2
117 | x: 296
118 | y: 812
119 | width: 148
120 | height: 126
121 | alignment: 0
122 | pivot: {x: 0, y: 0}
123 | border: {x: 0, y: 0, z: 0, w: 0}
124 | outline: []
125 | tessellationDetail: 0
126 | - serializedVersion: 2
127 | name: characters_2
128 | rect:
129 | serializedVersion: 2
130 | x: 565
131 | y: 812
132 | width: 105
133 | height: 146
134 | alignment: 0
135 | pivot: {x: 0, y: 0}
136 | border: {x: 0, y: 0, z: 0, w: 0}
137 | outline: []
138 | tessellationDetail: 0
139 | - serializedVersion: 2
140 | name: characters_3
141 | rect:
142 | serializedVersion: 2
143 | x: 798
144 | y: 812
145 | width: 135
146 | height: 115
147 | alignment: 0
148 | pivot: {x: 0, y: 0}
149 | border: {x: 0, y: 0, z: 0, w: 0}
150 | outline: []
151 | tessellationDetail: 0
152 | - serializedVersion: 2
153 | name: characters_4
154 | rect:
155 | serializedVersion: 2
156 | x: 1049
157 | y: 813
158 | width: 127
159 | height: 155
160 | alignment: 0
161 | pivot: {x: 0, y: 0}
162 | border: {x: 0, y: 0, z: 0, w: 0}
163 | outline: []
164 | tessellationDetail: 0
165 | - serializedVersion: 2
166 | name: characters_5
167 | rect:
168 | serializedVersion: 2
169 | x: 59
170 | y: 570
171 | width: 129
172 | height: 144
173 | alignment: 0
174 | pivot: {x: 0, y: 0}
175 | border: {x: 0, y: 0, z: 0, w: 0}
176 | outline: []
177 | tessellationDetail: 0
178 | - serializedVersion: 2
179 | name: characters_6
180 | rect:
181 | serializedVersion: 2
182 | x: 291
183 | y: 568
184 | width: 160
185 | height: 118
186 | alignment: 0
187 | pivot: {x: 0, y: 0}
188 | border: {x: 0, y: 0, z: 0, w: 0}
189 | outline: []
190 | tessellationDetail: 0
191 | - serializedVersion: 2
192 | name: characters_7
193 | rect:
194 | serializedVersion: 2
195 | x: 511
196 | y: 544
197 | width: 213
198 | height: 138
199 | alignment: 0
200 | pivot: {x: 0, y: 0}
201 | border: {x: 0, y: 0, z: 0, w: 0}
202 | outline: []
203 | tessellationDetail: 0
204 | - serializedVersion: 2
205 | name: characters_8
206 | rect:
207 | serializedVersion: 2
208 | x: 800
209 | y: 568
210 | width: 126
211 | height: 146
212 | alignment: 0
213 | pivot: {x: 0, y: 0}
214 | border: {x: 0, y: 0, z: 0, w: 0}
215 | outline: []
216 | tessellationDetail: 0
217 | - serializedVersion: 2
218 | name: characters_9
219 | rect:
220 | serializedVersion: 2
221 | x: 1030
222 | y: 568
223 | width: 163
224 | height: 120
225 | alignment: 0
226 | pivot: {x: 0, y: 0}
227 | border: {x: 0, y: 0, z: 0, w: 0}
228 | outline: []
229 | tessellationDetail: 0
230 | - serializedVersion: 2
231 | name: characters_10
232 | rect:
233 | serializedVersion: 2
234 | x: 57
235 | y: 316
236 | width: 133
237 | height: 159
238 | alignment: 0
239 | pivot: {x: 0, y: 0}
240 | border: {x: 0, y: 0, z: 0, w: 0}
241 | outline: []
242 | tessellationDetail: 0
243 | - serializedVersion: 2
244 | name: characters_11
245 | rect:
246 | serializedVersion: 2
247 | x: 299
248 | y: 316
249 | width: 143
250 | height: 137
251 | alignment: 0
252 | pivot: {x: 0, y: 0}
253 | border: {x: 0, y: 0, z: 0, w: 0}
254 | outline: []
255 | tessellationDetail: 0
256 | - serializedVersion: 2
257 | name: characters_12
258 | rect:
259 | serializedVersion: 2
260 | x: 528
261 | y: 316
262 | width: 178
263 | height: 109
264 | alignment: 0
265 | pivot: {x: 0, y: 0}
266 | border: {x: 0, y: 0, z: 0, w: 0}
267 | outline: []
268 | tessellationDetail: 0
269 | - serializedVersion: 2
270 | name: characters_13
271 | rect:
272 | serializedVersion: 2
273 | x: 793
274 | y: 315
275 | width: 144
276 | height: 156
277 | alignment: 0
278 | pivot: {x: 0, y: 0}
279 | border: {x: 0, y: 0, z: 0, w: 0}
280 | outline: []
281 | tessellationDetail: 0
282 | - serializedVersion: 2
283 | name: characters_14
284 | rect:
285 | serializedVersion: 2
286 | x: 1032
287 | y: 314
288 | width: 161
289 | height: 134
290 | alignment: 0
291 | pivot: {x: 0, y: 0}
292 | border: {x: 0, y: 0, z: 0, w: 0}
293 | outline: []
294 | tessellationDetail: 0
295 | - serializedVersion: 2
296 | name: characters_15
297 | rect:
298 | serializedVersion: 2
299 | x: 28
300 | y: 58
301 | width: 190
302 | height: 122
303 | alignment: 0
304 | pivot: {x: 0, y: 0}
305 | border: {x: 0, y: 0, z: 0, w: 0}
306 | outline: []
307 | tessellationDetail: 0
308 | - serializedVersion: 2
309 | name: characters_16
310 | rect:
311 | serializedVersion: 2
312 | x: 302
313 | y: 58
314 | width: 138
315 | height: 133
316 | alignment: 0
317 | pivot: {x: 0, y: 0}
318 | border: {x: 0, y: 0, z: 0, w: 0}
319 | outline: []
320 | tessellationDetail: 0
321 | - serializedVersion: 2
322 | name: characters_17
323 | rect:
324 | serializedVersion: 2
325 | x: 526
326 | y: 57
327 | width: 185
328 | height: 133
329 | alignment: 0
330 | pivot: {x: 0, y: 0}
331 | border: {x: 0, y: 0, z: 0, w: 0}
332 | outline: []
333 | tessellationDetail: 0
334 | - serializedVersion: 2
335 | name: characters_18
336 | rect:
337 | serializedVersion: 2
338 | x: 793
339 | y: 59
340 | width: 144
341 | height: 160
342 | alignment: 0
343 | pivot: {x: 0, y: 0}
344 | border: {x: 0, y: 0, z: 0, w: 0}
345 | outline: []
346 | tessellationDetail: 0
347 | - serializedVersion: 2
348 | name: characters_19
349 | rect:
350 | serializedVersion: 2
351 | x: 1037
352 | y: 60
353 | width: 150
354 | height: 150
355 | alignment: 0
356 | pivot: {x: 0, y: 0}
357 | border: {x: 0, y: 0, z: 0, w: 0}
358 | outline: []
359 | tessellationDetail: 0
360 | outline: []
361 | spritePackingTag:
362 | userData:
363 | assetBundleName:
364 | assetBundleVariant:
365 |
--------------------------------------------------------------------------------
/Assets/Resources.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d34bd436d9a191e498daaae26d806db9
3 | folderAsset: yes
4 | timeCreated: 1588003063
5 | licenseType: Pro
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/Resources/DOTweenSettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_PickerWheelUI/dcc34e17f424cd1d820123ab37901dda7e92ed40/Assets/Resources/DOTweenSettings.asset
--------------------------------------------------------------------------------
/Assets/Resources/DOTweenSettings.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 33ce0682656ed4441b56df9ec9276b0f
3 | timeCreated: 1583073896
4 | licenseType: Free
5 | NativeFormatImporter:
6 | mainObjectFileID: 11400000
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/scene.unity:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_PickerWheelUI/dcc34e17f424cd1d820123ab37901dda7e92ed40/Assets/scene.unity
--------------------------------------------------------------------------------
/Assets/scene.unity.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f6f19cab75be894429a900ab27289609
3 | timeCreated: 1624441543
4 | licenseType: Pro
5 | DefaultImporter:
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/EasyUI_PickerWheel_v2.unitypackage:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_PickerWheelUI/dcc34e17f424cd1d820123ab37901dda7e92ed40/EasyUI_PickerWheel_v2.unitypackage
--------------------------------------------------------------------------------
/LICENCE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Hamza Herbou
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | # Easy Fortune Spin Wheel UI
3 | A powerful,Customizable, and esay-to-use Spin Wheel UI for Unity
4 |
5 | ### Video tutorial : https://youtu.be/jZ_cuxTPPsA
6 |
7 |
8 | ## ■ How to use? :
9 | ### 1. Add ```DoTween``` package: http://dotween.demigiant.com/download.php
10 | ### 2. Add ```EasyUI_PickerWheel``` package.
11 | ### 3. Create a Canvas and add```PickerWheel``` prefab to it.
12 | ```Assets/PickerWheel/Prefabs/PickerWheel.prefab```
13 | ### 4. Create a ```Demo.cs``` script.
14 | ### 5. Add ```EasyUI.PickerWheelUI``` namespace.
15 | ### 6. Demo.cs :
16 | ```c#
17 | using UnityEngine;
18 | using EasyUI.PickerWheelUI; //required
19 |
20 | public class Demo : MonoBehaviour {
21 | // Reference to the PickerWheel GameObject (step 3):
22 | [SerializeField] private PickerWheel pickerWheel;
23 |
24 | private void Start () {
25 | // Start spinning:
26 | pickerWheel.Spin ();
27 | }
28 | }
29 | ```
30 |
31 | ## ■ Wheel Events : ```OnSpinStart ``` and ```OnSpinEnd ``` :
32 | ```c#
33 | using UnityEngine;
34 | using EasyUI.PickerWheelUI;
35 |
36 | public class Demo : MonoBehaviour {
37 | [SerializeField] private PickerWheel pickerWheel;
38 |
39 | private void Start () {
40 | pickerWheel.OnSpinStart (() => {
41 | Debug.Log ("Spin start..."));
42 | });
43 |
44 | pickerWheel.OnSpinEnd (wheelPiece => {
45 | Debug.Log ("Spin end :") ;
46 | Debug.Log ("Index : "+wheelPiece.Index);
47 | Debug.Log ("Chance : "+wheelPiece.Chance);
48 | Debug.Log ("Label : "+wheelPiece.Label);
49 | Debug.Log ("Amount : "+wheelPiece.Amount);
50 | });
51 |
52 | pickerWheel.Spin ();
53 | }
54 | }
55 | ```
56 |
57 |
58 |
59 |
60 | ## ❤️ Donate
61 |
62 |
63 |
--------------------------------------------------------------------------------