├── 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
├── Fonts.meta
├── Fonts
│ ├── GothamBlack.otf
│ ├── GothamBlack.otf.meta
│ ├── GothamBold.ttf
│ ├── GothamBold.ttf.meta
│ ├── GothamMedium.ttf
│ └── GothamMedium.ttf.meta
├── Materials.meta
├── Materials
│ ├── CoinsRewardedFx.mat
│ ├── CoinsRewardedFx.mat.meta
│ ├── GemsRewardedFx.mat
│ └── GemsRewardedFx.mat.meta
├── Prefabs.meta
├── Prefabs
│ ├── CoinsRewardedFX.prefab
│ ├── CoinsRewardedFX.prefab.meta
│ ├── GemsRewardedFX.prefab
│ └── GemsRewardedFX.prefab.meta
├── Resources.meta
├── Resources
│ ├── DOTweenSettings.asset
│ └── DOTweenSettings.asset.meta
├── Scenes.meta
├── Scenes
│ ├── scene.unity
│ └── scene.unity.meta
├── Scripts.meta
├── Scripts
│ ├── Admob.cs
│ ├── Admob.cs.meta
│ ├── Admob_v2.cs
│ ├── GameData.cs
│ ├── GameData.cs.meta
│ ├── RewardBox.cs
│ └── RewardBox.cs.meta
├── Sprites.meta
└── Sprites
│ ├── Ad.png
│ ├── Ad.png.meta
│ ├── Fading.png
│ ├── Fading.png.meta
│ ├── ProgressBarAndFill.png
│ ├── ProgressBarAndFill.png.meta
│ ├── RewardWatchedCheck.png
│ ├── RewardWatchedCheck.png.meta
│ ├── UI_SquareRounded.png
│ ├── UI_SquareRounded.png.meta
│ ├── UI_SquareRounded2.png
│ ├── UI_SquareRounded2.png.meta
│ ├── _coin.png
│ ├── _coin.png.meta
│ ├── _gem.png
│ ├── _gem.png.meta
│ ├── bg.png
│ ├── bg.png.meta
│ ├── closeBtn.png
│ ├── closeBtn.png.meta
│ ├── coins.png
│ ├── coins.png.meta
│ ├── gems.png
│ └── gems.png.meta
├── LICENCE
└── README.md
/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_MultipleRewardSystem_AdmobAds/3cf8503533808835a83d5775d769e6622c4b2ffa/Assets/Demigiant/DOTween/DOTween.dll
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/DOTween.dll.mdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_MultipleRewardSystem_AdmobAds/3cf8503533808835a83d5775d769e6622c4b2ffa/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_MultipleRewardSystem_AdmobAds/3cf8503533808835a83d5775d769e6622c4b2ffa/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll
--------------------------------------------------------------------------------
/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_MultipleRewardSystem_AdmobAds/3cf8503533808835a83d5775d769e6622c4b2ffa/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_MultipleRewardSystem_AdmobAds/3cf8503533808835a83d5775d769e6622c4b2ffa/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_MultipleRewardSystem_AdmobAds/3cf8503533808835a83d5775d769e6622c4b2ffa/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_MultipleRewardSystem_AdmobAds/3cf8503533808835a83d5775d769e6622c4b2ffa/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_MultipleRewardSystem_AdmobAds/3cf8503533808835a83d5775d769e6622c4b2ffa/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 true && (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/Fonts.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f07f2bde910ae67438a82737f6f9f65b
3 | folderAsset: yes
4 | timeCreated: 1579170229
5 | licenseType: Free
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/Fonts/GothamBlack.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_MultipleRewardSystem_AdmobAds/3cf8503533808835a83d5775d769e6622c4b2ffa/Assets/Fonts/GothamBlack.otf
--------------------------------------------------------------------------------
/Assets/Fonts/GothamBlack.otf.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 9e4d6edb0530ffb4f8a017de27aef081
3 | timeCreated: 1534925389
4 | licenseType: Free
5 | TrueTypeFontImporter:
6 | serializedVersion: 4
7 | fontSize: 16
8 | forceTextureCase: -2
9 | characterSpacing: 0
10 | characterPadding: 1
11 | includeFontData: 1
12 | fontName: Gotham Black
13 | fontNames:
14 | - Gotham Black
15 | fallbackFontReferences: []
16 | customCharacters:
17 | fontRenderingMode: 0
18 | ascentCalculationMode: 1
19 | useLegacyBoundsCalculation: 0
20 | userData:
21 | assetBundleName:
22 | assetBundleVariant:
23 |
--------------------------------------------------------------------------------
/Assets/Fonts/GothamBold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_MultipleRewardSystem_AdmobAds/3cf8503533808835a83d5775d769e6622c4b2ffa/Assets/Fonts/GothamBold.ttf
--------------------------------------------------------------------------------
/Assets/Fonts/GothamBold.ttf.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f8765a1462adc5442bb5f4934363c57a
3 | timeCreated: 1534925389
4 | licenseType: Free
5 | TrueTypeFontImporter:
6 | serializedVersion: 4
7 | fontSize: 16
8 | forceTextureCase: -2
9 | characterSpacing: 0
10 | characterPadding: 1
11 | includeFontData: 1
12 | fontName: Gotham
13 | fontNames:
14 | - Gotham
15 | fallbackFontReferences:
16 | - {fileID: 12800000, guid: 6fa82a20d453217439b0cb204d6f3b11, type: 3}
17 | - {fileID: 12800000, guid: 90ebd97028ac193459feabd2a96c8c05, type: 3}
18 | - {fileID: 12800000, guid: 29bce8544d628604c8330b8b5d08d9c0, type: 3}
19 | - {fileID: 12800000, guid: dfd830b903d5b9c4ab70faac87dd0f3e, type: 3}
20 | - {fileID: 12800000, guid: d184665bd75589f4e8cb600d70561af8, type: 3}
21 | - {fileID: 12800000, guid: 2b054b8ddd2d76b4d849160afadfdfdf, type: 3}
22 | customCharacters:
23 | fontRenderingMode: 0
24 | ascentCalculationMode: 1
25 | useLegacyBoundsCalculation: 0
26 | userData:
27 | assetBundleName:
28 | assetBundleVariant:
29 |
--------------------------------------------------------------------------------
/Assets/Fonts/GothamMedium.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_MultipleRewardSystem_AdmobAds/3cf8503533808835a83d5775d769e6622c4b2ffa/Assets/Fonts/GothamMedium.ttf
--------------------------------------------------------------------------------
/Assets/Fonts/GothamMedium.ttf.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 6fa82a20d453217439b0cb204d6f3b11
3 | timeCreated: 1534925389
4 | licenseType: Free
5 | TrueTypeFontImporter:
6 | serializedVersion: 4
7 | fontSize: 16
8 | forceTextureCase: -2
9 | characterSpacing: 0
10 | characterPadding: 1
11 | includeFontData: 1
12 | fontName: Gotham
13 | fontNames:
14 | - Gotham
15 | fallbackFontReferences:
16 | - {fileID: 12800000, guid: 29bce8544d628604c8330b8b5d08d9c0, type: 3}
17 | - {fileID: 12800000, guid: 2b054b8ddd2d76b4d849160afadfdfdf, type: 3}
18 | customCharacters:
19 | fontRenderingMode: 0
20 | ascentCalculationMode: 1
21 | useLegacyBoundsCalculation: 0
22 | userData:
23 | assetBundleName:
24 | assetBundleVariant:
25 |
--------------------------------------------------------------------------------
/Assets/Materials.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: cf97f0257114b99499af98df8635d0b6
3 | folderAsset: yes
4 | timeCreated: 1595682796
5 | licenseType: Pro
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/Materials/CoinsRewardedFx.mat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_MultipleRewardSystem_AdmobAds/3cf8503533808835a83d5775d769e6622c4b2ffa/Assets/Materials/CoinsRewardedFx.mat
--------------------------------------------------------------------------------
/Assets/Materials/CoinsRewardedFx.mat.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 300d143caa33e4444863d8de2af5b96e
3 | timeCreated: 1595682813
4 | licenseType: Pro
5 | NativeFormatImporter:
6 | mainObjectFileID: 2100000
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/Materials/GemsRewardedFx.mat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_MultipleRewardSystem_AdmobAds/3cf8503533808835a83d5775d769e6622c4b2ffa/Assets/Materials/GemsRewardedFx.mat
--------------------------------------------------------------------------------
/Assets/Materials/GemsRewardedFx.mat.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 82cb87a94eb68e4499709ea742b22e3d
3 | timeCreated: 1595682813
4 | licenseType: Pro
5 | NativeFormatImporter:
6 | mainObjectFileID: 2100000
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/Prefabs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 35bd24b398a903944878895653cac8fe
3 | folderAsset: yes
4 | timeCreated: 1595683340
5 | licenseType: Pro
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/Prefabs/CoinsRewardedFX.prefab:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_MultipleRewardSystem_AdmobAds/3cf8503533808835a83d5775d769e6622c4b2ffa/Assets/Prefabs/CoinsRewardedFX.prefab
--------------------------------------------------------------------------------
/Assets/Prefabs/CoinsRewardedFX.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4bf5b830a7f0b764a87569b1e3da3626
3 | timeCreated: 1595683345
4 | licenseType: Pro
5 | NativeFormatImporter:
6 | mainObjectFileID: 100100000
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/Prefabs/GemsRewardedFX.prefab:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_MultipleRewardSystem_AdmobAds/3cf8503533808835a83d5775d769e6622c4b2ffa/Assets/Prefabs/GemsRewardedFX.prefab
--------------------------------------------------------------------------------
/Assets/Prefabs/GemsRewardedFX.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f14b8c1c3406b2444aff75edf40e6f73
3 | timeCreated: 1595684532
4 | licenseType: Pro
5 | NativeFormatImporter:
6 | mainObjectFileID: 100100000
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/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_MultipleRewardSystem_AdmobAds/3cf8503533808835a83d5775d769e6622c4b2ffa/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/Scenes.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 43391eb0033f4a841ad8321464941df2
3 | folderAsset: yes
4 | timeCreated: 1579170025
5 | licenseType: Free
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/Scenes/scene.unity:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_MultipleRewardSystem_AdmobAds/3cf8503533808835a83d5775d769e6622c4b2ffa/Assets/Scenes/scene.unity
--------------------------------------------------------------------------------
/Assets/Scenes/scene.unity.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 1f52252a0246b14469c564956fb3993e
3 | timeCreated: 1579170025
4 | licenseType: Free
5 | DefaultImporter:
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Scripts.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: aaebe24f7ee1f0e4ea48208409982723
3 | folderAsset: yes
4 | timeCreated: 1579170229
5 | licenseType: Free
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/Scripts/Admob.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using GoogleMobileAds.Api;
3 | using System;
4 |
5 | public class Admob : MonoBehaviour {
6 |
7 | public string appID = "ca-app-pub-3940256099942544~3347511713";
8 | public string rewardAdID = "ca-app-pub-3940256099942544/5224354917";
9 |
10 | [Space]
11 | [SerializeField] RewardBox rewardBox;
12 |
13 | RewardBasedVideoAd rewardAd;
14 |
15 | void Start ( ) {
16 | MobileAds.Initialize ( appID );
17 |
18 | rewardAd = RewardBasedVideoAd.Instance;
19 |
20 | //Attach rewardAd events
21 | rewardAd.OnAdLoaded += RewardAd_OnAdLoaded;
22 | rewardAd.OnAdFailedToLoad += RewardAd_OnAdFailedToLoad;
23 | rewardAd.OnAdClosed += RewardAd_OnAdClosed;
24 | rewardAd.OnAdRewarded += RewardAd_OnAdRewarded;
25 | }
26 |
27 | //Request Reward Ad
28 | public void RequestRewardAd ( ) {
29 | rewardAd.LoadAd ( GetNewAdRequest ( ), rewardAdID );
30 | }
31 |
32 | //Reward events
33 | void RewardAd_OnAdRewarded ( object sender, Reward e ) {
34 | rewardBox.isAdWatched = true;
35 | }
36 |
37 | void RewardAd_OnAdClosed ( object sender, EventArgs e ) {
38 | rewardBox.AdClose ( );
39 | }
40 |
41 | void RewardAd_OnAdFailedToLoad ( object sender, AdFailedToLoadEventArgs e ) {
42 | rewardBox.AdClose ( );
43 | }
44 |
45 | void RewardAd_OnAdLoaded ( object sender, EventArgs e ) {
46 | //Show the Ad
47 | rewardAd.Show ( );
48 | }
49 |
50 | // General Methods
51 | AdRequest GetNewAdRequest ( ) {
52 | return new AdRequest.Builder ( ).Build ( );
53 | }
54 |
55 | void OnDestroy ( ) {
56 | //Dettach rewardAD events
57 | rewardAd.OnAdLoaded -= RewardAd_OnAdLoaded;
58 | rewardAd.OnAdFailedToLoad -= RewardAd_OnAdFailedToLoad;
59 | rewardAd.OnAdClosed -= RewardAd_OnAdClosed;
60 | rewardAd.OnAdRewarded -= RewardAd_OnAdRewarded;
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/Assets/Scripts/Admob.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 1026979c249222f4d8d5b0626c5ef600
3 | timeCreated: 1595873447
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/Scripts/Admob_v2.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using GoogleMobileAds.Api;
3 | using System;
4 |
5 | //New Admob Reward API
6 |
7 | public class Admob_v2 : MonoBehaviour {
8 |
9 | public string rewardAdID = "ca-app-pub-3940256099942544/5224354917";
10 |
11 | [Space]
12 | [SerializeField] RewardBox rewardBox;
13 |
14 | RewardedAd rewardAd;
15 |
16 | void Start ( ) {
17 | MobileAds.Initialize ( initStatus=>{} );
18 | }
19 |
20 | //Request Reward Ad
21 | public void RequestRewardAd ( ) {
22 | //Remove existing events first to avoid executing an event twice.
23 | if (rewardAd != null)
24 | RemoveRewardAdEvents();
25 |
26 | rewardAd = new RewardedAd( rewardAdID );
27 |
28 | //Attach rewardAd events
29 | AddRewardAdEvents();
30 |
31 | rewardAd.LoadAd ( GetNewAdRequest ( ) );
32 | }
33 |
34 | //Reward events
35 | void RewardAd_OnUserEarnedReward ( object sender, Reward e ) {
36 | rewardBox.isAdWatched = true;
37 | }
38 |
39 | void RewardAd_OnAdClosed ( object sender, EventArgs e ) {
40 | rewardBox.AdClose ( );
41 | }
42 |
43 | void RewardAd_OnAdFailedToLoad ( object sender, AdErrorEventArgs e ) {
44 | rewardBox.AdClose ( );
45 | }
46 |
47 | void RewardAd_OnAdLoaded ( object sender, EventArgs e ) {
48 | //Show the Ad
49 | rewardAd.Show ( );
50 | }
51 |
52 | // General Methods
53 | AdRequest GetNewAdRequest ( ) {
54 | return new AdRequest.Builder ( ).Build ( );
55 | }
56 |
57 | void AddRewardAdEvents(){
58 | //Add rewardAD events
59 | rewardAd.OnAdLoaded += RewardAd_OnAdLoaded;
60 | rewardAd.OnAdFailedToLoad += RewardAd_OnAdFailedToLoad;
61 | rewardAd.OnAdClosed += RewardAd_OnAdClosed;
62 | rewardAd.OnUserEarnedReward += RewardAd_OnUserEarnedReward;
63 | }
64 |
65 | void RemoveRewardAdEvents(){
66 | //Remove rewardAD events
67 | rewardAd.OnAdLoaded -= RewardAd_OnAdLoaded;
68 | rewardAd.OnAdFailedToLoad -= RewardAd_OnAdFailedToLoad;
69 | rewardAd.OnAdClosed -= RewardAd_OnAdClosed;
70 | rewardAd.OnUserEarnedReward -= RewardAd_OnUserEarnedReward;
71 | }
72 |
73 | void OnDestroy ( ) {
74 | RemoveRewardAdEvents();
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/Assets/Scripts/GameData.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 |
3 | public static class GameData {
4 | private static int _coins = 0;
5 | private static int _gems = 0;
6 |
7 | // The static Constructor is the best place
8 | // to load already saved data in a file or in PlayerPrefs.
9 | static GameData ( ) {
10 | _coins = PlayerPrefs.GetInt ( "Coins", 0 );
11 | _gems = PlayerPrefs.GetInt ( "Gems", 0 );
12 | }
13 |
14 |
15 | // set{ PlayerPrefs.SetInt ( "Coins", (_coins = value) ); }
16 | //
17 | // is equivalent to :
18 | //
19 | // set {
20 | // _coins = value;
21 | // PlayerPrefs.SetInt ( "Coins", _coins);
22 | // }
23 | public static int Coins {
24 | get{ return _coins; }
25 | set{ PlayerPrefs.SetInt ( "Coins", (_coins = value) ); }
26 | }
27 |
28 | public static int Gems {
29 | get{ return _gems; }
30 | set{ PlayerPrefs.SetInt ( "Gems", (_gems = value) ); }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Assets/Scripts/GameData.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d3227943df383ce49bc8b564a2b14cb8
3 | timeCreated: 1595863327
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/Scripts/RewardBox.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using UnityEngine.UI;
3 | using System.Collections;
4 | using DG.Tweening;
5 | using System;
6 |
7 | public class RewardBox : MonoBehaviour {
8 |
9 | public enum UserRewardType {
10 | Coins,
11 | Gems
12 | }
13 |
14 | [Serializable] public struct UserReward {
15 | public UserRewardType RewardType;
16 | public Sprite Icon;
17 | public int Amount;
18 | }
19 |
20 | [SerializeField] GameObject rewardBoxUICanvas;
21 | [SerializeField] Transform rewardsParent;
22 | [SerializeField] Transform rewardsCheckMarksParent;
23 | [SerializeField] GameObject noMoreRewardsPanel;
24 |
25 | [Space]
26 | [Header ( "Progress Bar UI" )]
27 | [SerializeField] Image progressBarFill;
28 |
29 | [Space]
30 | [Header ( "Remaining Ads UI & Watch Ad Button" )]
31 | [SerializeField] GameObject remainingAdsBadge;
32 | Text remainingAdsBadgeText;
33 |
34 | [Space]
35 | [SerializeField] Button watchAdButton;
36 | Text watchAdButtonText;
37 | string watchAdButtonDefaultText;
38 |
39 | [Space]
40 | [SerializeField] Text watchedAdsText;
41 |
42 | [Space]
43 | [Header ( "Coins & Gems Text UI" )]
44 | [SerializeField] Text coinsText;
45 | [SerializeField] Text gemsText;
46 |
47 | [Space]
48 | [Header ( "Rewards FX" )]
49 | [SerializeField] ParticleSystem coinsRewardFx;
50 | [SerializeField] ParticleSystem gemssRewardFx;
51 |
52 | [Space]
53 | [Header ( "Admob reference" )]
54 | [SerializeField] Admob admob;
55 |
56 | [Space]
57 | [Header ( "Time to wait (Minutes) before activating Rewards again" )]
58 | public double waitTimeToActivateRewards;
59 |
60 | [Space]
61 | [Header ( "Rewards Informations" )]
62 | const int TOTAL_REWARDS = 6;
63 | public UserReward[] userRewards = new UserReward[TOTAL_REWARDS];
64 |
65 | static UserReward currentReward;
66 | static int currentRewardIndex = 0;
67 |
68 | public bool isAdWatched;
69 |
70 | void Awake ( ) {
71 | // Get the remaining ads text UI element inside the remainingAdsBadge.
72 | remainingAdsBadgeText = remainingAdsBadge.transform.GetChild ( 0 ).GetComponent ( );
73 |
74 | // Get watched ads Text UI element and save the default text of the button
75 | watchAdButtonText = watchAdButton.transform.GetChild ( 0 ).GetComponent ( );
76 | watchAdButtonDefaultText = watchAdButtonText.text;
77 | }
78 |
79 | void Start ( ) {
80 | CheckForAvailableRewards ( );
81 |
82 | DrawRewardsUI ( );
83 |
84 | UpdateCoinsTextUI ( );
85 | UpdateGemsTextUI ( );
86 |
87 | UpdateRemainingRewardsTextUI ( );
88 | UpdateWatchedADsTextUI ( );
89 | }
90 |
91 | void DrawRewardsUI ( ) {
92 | for ( int i = currentRewardIndex; i < TOTAL_REWARDS; i++ ) {
93 | UserReward reward = userRewards [ i ];
94 |
95 | //Update UI elements
96 | //Reward Icon UI
97 | rewardsParent.GetChild ( i ).GetChild ( 1 ).GetComponent ( ).sprite = reward.Icon;
98 | //Reward Amount UI
99 | rewardsParent.GetChild ( i ).GetChild ( 2 ).GetComponent ( ).text = reward.Amount.ToString ( );
100 | }
101 | }
102 |
103 | public void WatchAdButtonClick ( ) {
104 | isAdWatched = false;
105 | watchAdButton.interactable = false;
106 | watchAdButtonText.text = "LOADING..";
107 |
108 | //Request & Show Ad
109 |
110 | #if UNITY_EDITOR
111 | StartCoroutine ( SimulateEditorRequestRewardAd ( ) );
112 |
113 | #elif UNITY_ANDROID
114 | admob.RequestRewardAd();
115 |
116 | #endif
117 | }
118 |
119 | #if UNITY_EDITOR
120 | IEnumerator SimulateEditorRequestRewardAd ( ) {
121 | yield return new WaitForSeconds ( UnityEngine.Random.Range ( 0.3f, 1.3f ) );
122 |
123 | isAdWatched = true;
124 | AdClose ( );
125 | }
126 | #endif
127 |
128 | public void AdClose ( ) {
129 | watchAdButtonText.text = watchAdButtonDefaultText;
130 |
131 | //on ad closed
132 | if ( isAdWatched ) {
133 | //User watched the full AD
134 | watchAdButton.interactable = false;
135 | currentReward = userRewards [ currentRewardIndex ];
136 | currentRewardIndex++;
137 | float progressValue = ( float )currentRewardIndex / TOTAL_REWARDS;
138 |
139 | progressBarFill.DOFillAmount ( progressValue, 1.5f ).OnComplete ( RewardUser );
140 |
141 | } else {
142 | //User didn't complete the AD
143 | watchAdButton.interactable = true;
144 | }
145 | }
146 |
147 | void RewardUser ( ) {
148 | watchAdButton.interactable = true;
149 |
150 | //Check Reward type
151 | if ( currentReward.RewardType == UserRewardType.Coins ) {
152 | //Coins Reward
153 | Debug.Log ( "Coins Reward : +" + currentReward.Amount + "" );
154 |
155 | GameData.Coins += currentReward.Amount;
156 | UpdateCoinsTextUI ( );
157 |
158 | coinsRewardFx.Play ( );
159 |
160 |
161 | } else if ( currentReward.RewardType == UserRewardType.Gems ) {
162 | //Gems Reward
163 | Debug.Log ( "Gems Reward : +" + currentReward.Amount + "" );
164 |
165 | GameData.Gems += currentReward.Amount;
166 | UpdateGemsTextUI ( );
167 |
168 | gemssRewardFx.Play ( );
169 | }
170 |
171 |
172 | UpdateRemainingRewardsTextUI ( );
173 | UpdateWatchedADsTextUI ( );
174 |
175 | MarkRewardAsCheked ( currentRewardIndex - 1 );
176 |
177 | //Save Progress
178 | PlayerPrefs.SetInt ( "CurrentRewardIndex", currentRewardIndex );
179 |
180 | //Check if it's last Reward
181 | if ( currentRewardIndex == TOTAL_REWARDS ) {
182 | //Save current system DateTime
183 | PlayerPrefs.SetString ( "RewardsCompletionDateTime", DateTime.Now.ToString ( ) );
184 | }
185 | }
186 |
187 | void MarkRewardAsCheked ( int rewardIndex ) {
188 | // hide the reward & show it's corresponding check mark.
189 | rewardsParent.GetChild ( rewardIndex ).gameObject.SetActive ( false );
190 | rewardsCheckMarksParent.GetChild ( rewardIndex ).gameObject.SetActive ( true );
191 |
192 | //Update Progress Bar
193 | float progressValue = ( float )currentRewardIndex / TOTAL_REWARDS;
194 | progressBarFill.fillAmount = progressValue;
195 |
196 | //If it's the last Reward
197 | if ( rewardIndex == TOTAL_REWARDS - 1 ) {
198 | watchAdButton.interactable = false;
199 | remainingAdsBadge.SetActive ( false );
200 | noMoreRewardsPanel.SetActive ( true );
201 |
202 | currentRewardIndex = TOTAL_REWARDS;
203 | }
204 | }
205 |
206 | void CheckForAvailableRewards ( ) {
207 | currentRewardIndex = PlayerPrefs.GetInt ( "CurrentRewardIndex", 0 );
208 |
209 | //Check if it's the last Reward
210 | if ( currentRewardIndex == TOTAL_REWARDS ) {
211 | //Get saved date time
212 | DateTime rewardsCompletionDateTime = DateTime.Parse ( PlayerPrefs.GetString ( "RewardsCompletionDateTime", DateTime.Now.ToString ( ) ) );
213 | DateTime currentDateTime = DateTime.Now;
214 |
215 | //Get total minutes between this 2 dates
216 | double elapsedMinutes = (currentDateTime - rewardsCompletionDateTime).TotalMinutes;
217 |
218 | Debug.Log ( "Time Passed Since Last Reward: " + elapsedMinutes );
219 |
220 | if ( elapsedMinutes >= waitTimeToActivateRewards ) {
221 | // Activate Rewards again
222 | PlayerPrefs.SetString ( "RewardsCompletionDateTime", "" );
223 | PlayerPrefs.SetInt ( "CurrentRewardIndex", 0 );
224 | currentRewardIndex = 0;
225 |
226 | }else{
227 | // show message to the user to wait more.
228 | Debug.Log ("wait for "+(waitTimeToActivateRewards-elapsedMinutes)+" Minutes");
229 | }
230 | }
231 |
232 | //Check if already watched some ads
233 | if ( currentRewardIndex > 0 ) {
234 | for ( int i = 0; i < currentRewardIndex; i++ ) {
235 | MarkRewardAsCheked ( i );
236 | }
237 | }
238 | }
239 |
240 | //Watched Ads & Remaining Rewards Text UI Update
241 | void UpdateRemainingRewardsTextUI ( ) {
242 | remainingAdsBadgeText.text = (TOTAL_REWARDS - currentRewardIndex).ToString ( );
243 | }
244 |
245 | void UpdateWatchedADsTextUI ( ) {
246 | watchedAdsText.text = string.Format ( "{0}/{1}", currentRewardIndex, TOTAL_REWARDS );
247 | }
248 |
249 | //Coins & Gems Text UI Update
250 | void UpdateCoinsTextUI ( ) {
251 | coinsText.text = GameData.Coins.ToString ( );
252 | }
253 |
254 | void UpdateGemsTextUI ( ) {
255 | gemsText.text = GameData.Gems.ToString ( );
256 | }
257 |
258 | //Open & Close Reward box
259 | public void OpenUI ( ) {
260 | rewardBoxUICanvas.SetActive ( true );
261 | }
262 |
263 | public void CloseUI ( ) {
264 | rewardBoxUICanvas.SetActive ( false );
265 | }
266 |
267 | //Editor delete playerPrefs if you hit the Delete key
268 | #if UNITY_EDITOR
269 | void Update ( ) {
270 | if ( Input.GetKeyUp ( KeyCode.Delete ) ) {
271 | PlayerPrefs.DeleteAll ( );
272 | Debug.Log ( "Player Prefs deleted ..." );
273 | }
274 | }
275 | #endif
276 |
277 |
278 | }
279 |
--------------------------------------------------------------------------------
/Assets/Scripts/RewardBox.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c801300c5054a874286624a7a2ed0f6d
3 | timeCreated: 1595863637
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/Sprites.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d19d94f115f65fe4f8fe52e04fdc2794
3 | folderAsset: yes
4 | timeCreated: 1595523484
5 | licenseType: Pro
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/Sprites/Ad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_MultipleRewardSystem_AdmobAds/3cf8503533808835a83d5775d769e6622c4b2ffa/Assets/Sprites/Ad.png
--------------------------------------------------------------------------------
/Assets/Sprites/Ad.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a20059297912f6d4eab9633d24e8e545
3 | timeCreated: 1595528891
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/Sprites/Fading.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_MultipleRewardSystem_AdmobAds/3cf8503533808835a83d5775d769e6622c4b2ffa/Assets/Sprites/Fading.png
--------------------------------------------------------------------------------
/Assets/Sprites/Fading.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 43766be45d614a74cb70d1f2abf366b5
3 | timeCreated: 1595585363
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/Sprites/ProgressBarAndFill.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_MultipleRewardSystem_AdmobAds/3cf8503533808835a83d5775d769e6622c4b2ffa/Assets/Sprites/ProgressBarAndFill.png
--------------------------------------------------------------------------------
/Assets/Sprites/ProgressBarAndFill.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 708d8d1541d2a024fb8dafc805ee9cae
3 | timeCreated: 1595673675
4 | licenseType: Pro
5 | TextureImporter:
6 | fileIDToRecycleName:
7 | 21300000: ProgressBar_0
8 | 21300002: ProgressBar_1
9 | serializedVersion: 4
10 | mipmaps:
11 | mipMapMode: 0
12 | enableMipMap: 0
13 | sRGBTexture: 1
14 | linearTexture: 0
15 | fadeOut: 0
16 | borderMipMap: 0
17 | mipMapFadeDistanceStart: 1
18 | mipMapFadeDistanceEnd: 3
19 | bumpmap:
20 | convertToNormalMap: 0
21 | externalNormalMap: 0
22 | heightScale: 0.25
23 | normalMapFilter: 0
24 | isReadable: 0
25 | grayScaleToAlpha: 0
26 | generateCubemap: 6
27 | cubemapConvolution: 0
28 | seamlessCubemap: 0
29 | textureFormat: 1
30 | maxTextureSize: 2048
31 | textureSettings:
32 | filterMode: -1
33 | aniso: -1
34 | mipBias: -1
35 | wrapMode: 1
36 | nPOTScale: 0
37 | lightmap: 0
38 | compressionQuality: 50
39 | spriteMode: 2
40 | spriteExtrude: 1
41 | spriteMeshType: 1
42 | alignment: 0
43 | spritePivot: {x: 0.5, y: 0.5}
44 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
45 | spritePixelsToUnits: 100
46 | alphaUsage: 1
47 | alphaIsTransparency: 1
48 | spriteTessellationDetail: -1
49 | textureType: 8
50 | textureShape: 1
51 | maxTextureSizeSet: 0
52 | compressionQualitySet: 0
53 | textureFormatSet: 0
54 | platformSettings:
55 | - buildTarget: DefaultTexturePlatform
56 | maxTextureSize: 2048
57 | textureFormat: -1
58 | textureCompression: 1
59 | compressionQuality: 50
60 | crunchedCompression: 0
61 | allowsAlphaSplitting: 0
62 | overridden: 0
63 | - buildTarget: Standalone
64 | maxTextureSize: 2048
65 | textureFormat: -1
66 | textureCompression: 1
67 | compressionQuality: 50
68 | crunchedCompression: 0
69 | allowsAlphaSplitting: 0
70 | overridden: 0
71 | - buildTarget: Android
72 | maxTextureSize: 2048
73 | textureFormat: -1
74 | textureCompression: 1
75 | compressionQuality: 50
76 | crunchedCompression: 0
77 | allowsAlphaSplitting: 0
78 | overridden: 0
79 | spriteSheet:
80 | serializedVersion: 2
81 | sprites:
82 | - serializedVersion: 2
83 | name: ProgressBar_0
84 | rect:
85 | serializedVersion: 2
86 | x: 18
87 | y: 146
88 | width: 1186
89 | height: 136
90 | alignment: 0
91 | pivot: {x: 0, y: 0}
92 | border: {x: 0, y: 0, z: 0, w: 0}
93 | outline: []
94 | tessellationDetail: 0
95 | - serializedVersion: 2
96 | name: ProgressBar_1
97 | rect:
98 | serializedVersion: 2
99 | x: 21
100 | y: 0
101 | width: 1180
102 | height: 124
103 | alignment: 0
104 | pivot: {x: 0, y: 0}
105 | border: {x: 0, y: 0, z: 0, w: 0}
106 | outline: []
107 | tessellationDetail: 0
108 | outline: []
109 | spritePackingTag:
110 | userData:
111 | assetBundleName:
112 | assetBundleVariant:
113 |
--------------------------------------------------------------------------------
/Assets/Sprites/RewardWatchedCheck.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_MultipleRewardSystem_AdmobAds/3cf8503533808835a83d5775d769e6622c4b2ffa/Assets/Sprites/RewardWatchedCheck.png
--------------------------------------------------------------------------------
/Assets/Sprites/RewardWatchedCheck.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: fc723002d01583645846e2585535e3ff
3 | timeCreated: 1595670717
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/Sprites/UI_SquareRounded.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_MultipleRewardSystem_AdmobAds/3cf8503533808835a83d5775d769e6622c4b2ffa/Assets/Sprites/UI_SquareRounded.png
--------------------------------------------------------------------------------
/Assets/Sprites/UI_SquareRounded.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d42dfabb7c8ae4641b45c73dc675e686
3 | timeCreated: 1595528308
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: 40, y: 40, z: 40, w: 40}
43 | spritePixelsToUnits: 500
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/Sprites/UI_SquareRounded2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_MultipleRewardSystem_AdmobAds/3cf8503533808835a83d5775d769e6622c4b2ffa/Assets/Sprites/UI_SquareRounded2.png
--------------------------------------------------------------------------------
/Assets/Sprites/UI_SquareRounded2.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 5de274a265cc12a409e5dac221d7db44
3 | timeCreated: 1595528308
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: 40, y: 40, z: 40, w: 40}
43 | spritePixelsToUnits: 200
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/Sprites/_coin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_MultipleRewardSystem_AdmobAds/3cf8503533808835a83d5775d769e6622c4b2ffa/Assets/Sprites/_coin.png
--------------------------------------------------------------------------------
/Assets/Sprites/_coin.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: aa2b4ad11139a2e468194da2fd99b127
3 | timeCreated: 1595682855
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/Sprites/_gem.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_MultipleRewardSystem_AdmobAds/3cf8503533808835a83d5775d769e6622c4b2ffa/Assets/Sprites/_gem.png
--------------------------------------------------------------------------------
/Assets/Sprites/_gem.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: dc1459b439a362848818ef1e963eea68
3 | timeCreated: 1595682869
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/Sprites/bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_MultipleRewardSystem_AdmobAds/3cf8503533808835a83d5775d769e6622c4b2ffa/Assets/Sprites/bg.png
--------------------------------------------------------------------------------
/Assets/Sprites/bg.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b410dd694f436904fbced873378b8338
3 | timeCreated: 1595849938
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: 0
39 | spriteMeshType: 0
40 | alignment: 0
41 | spritePivot: {x: 0.5, y: 0.5}
42 | spriteBorder: {x: 160, y: 0, z: 160, w: 0}
43 | spritePixelsToUnits: 400
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/Sprites/closeBtn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_MultipleRewardSystem_AdmobAds/3cf8503533808835a83d5775d769e6622c4b2ffa/Assets/Sprites/closeBtn.png
--------------------------------------------------------------------------------
/Assets/Sprites/closeBtn.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 1a4b49adc84f707469a81ee53aed1c8c
3 | timeCreated: 1595524385
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/Sprites/coins.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_MultipleRewardSystem_AdmobAds/3cf8503533808835a83d5775d769e6622c4b2ffa/Assets/Sprites/coins.png
--------------------------------------------------------------------------------
/Assets/Sprites/coins.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 52778a45265b85544989b862c6a03d5b
3 | timeCreated: 1595535651
4 | licenseType: Pro
5 | TextureImporter:
6 | fileIDToRecycleName:
7 | 21300000: coins_0
8 | 21300002: coins_1
9 | 21300004: coins_2
10 | 21300006: coins_3
11 | 21300008: coins_4
12 | 21300010: coins_5
13 | serializedVersion: 4
14 | mipmaps:
15 | mipMapMode: 0
16 | enableMipMap: 0
17 | sRGBTexture: 1
18 | linearTexture: 0
19 | fadeOut: 0
20 | borderMipMap: 0
21 | mipMapFadeDistanceStart: 1
22 | mipMapFadeDistanceEnd: 3
23 | bumpmap:
24 | convertToNormalMap: 0
25 | externalNormalMap: 0
26 | heightScale: 0.25
27 | normalMapFilter: 0
28 | isReadable: 0
29 | grayScaleToAlpha: 0
30 | generateCubemap: 6
31 | cubemapConvolution: 0
32 | seamlessCubemap: 0
33 | textureFormat: 1
34 | maxTextureSize: 2048
35 | textureSettings:
36 | filterMode: -1
37 | aniso: -1
38 | mipBias: -1
39 | wrapMode: 1
40 | nPOTScale: 0
41 | lightmap: 0
42 | compressionQuality: 50
43 | spriteMode: 2
44 | spriteExtrude: 1
45 | spriteMeshType: 1
46 | alignment: 0
47 | spritePivot: {x: 0.5, y: 0.5}
48 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
49 | spritePixelsToUnits: 100
50 | alphaUsage: 1
51 | alphaIsTransparency: 1
52 | spriteTessellationDetail: -1
53 | textureType: 8
54 | textureShape: 1
55 | maxTextureSizeSet: 0
56 | compressionQualitySet: 0
57 | textureFormatSet: 0
58 | platformSettings:
59 | - buildTarget: DefaultTexturePlatform
60 | maxTextureSize: 2048
61 | textureFormat: -1
62 | textureCompression: 1
63 | compressionQuality: 50
64 | crunchedCompression: 0
65 | allowsAlphaSplitting: 0
66 | overridden: 0
67 | - buildTarget: Standalone
68 | maxTextureSize: 2048
69 | textureFormat: -1
70 | textureCompression: 1
71 | compressionQuality: 50
72 | crunchedCompression: 0
73 | allowsAlphaSplitting: 0
74 | overridden: 0
75 | - buildTarget: Android
76 | maxTextureSize: 2048
77 | textureFormat: -1
78 | textureCompression: 1
79 | compressionQuality: 50
80 | crunchedCompression: 0
81 | allowsAlphaSplitting: 0
82 | overridden: 0
83 | spriteSheet:
84 | serializedVersion: 2
85 | sprites:
86 | - serializedVersion: 2
87 | name: coins_0
88 | rect:
89 | serializedVersion: 2
90 | x: 8
91 | y: 28
92 | width: 108
93 | height: 109
94 | alignment: 0
95 | pivot: {x: 0, y: 0}
96 | border: {x: 0, y: 0, z: 0, w: 0}
97 | outline: []
98 | tessellationDetail: 0
99 | - serializedVersion: 2
100 | name: coins_1
101 | rect:
102 | serializedVersion: 2
103 | x: 144
104 | y: 24
105 | width: 143
106 | height: 139
107 | alignment: 0
108 | pivot: {x: 0, y: 0}
109 | border: {x: 0, y: 0, z: 0, w: 0}
110 | outline: []
111 | tessellationDetail: 0
112 | - serializedVersion: 2
113 | name: coins_2
114 | rect:
115 | serializedVersion: 2
116 | x: 312
117 | y: 14
118 | width: 159
119 | height: 152
120 | alignment: 0
121 | pivot: {x: 0, y: 0}
122 | border: {x: 0, y: 0, z: 0, w: 0}
123 | outline: []
124 | tessellationDetail: 0
125 | - serializedVersion: 2
126 | name: coins_3
127 | rect:
128 | serializedVersion: 2
129 | x: 504
130 | y: 22
131 | width: 151
132 | height: 143
133 | alignment: 0
134 | pivot: {x: 0, y: 0}
135 | border: {x: 0, y: 0, z: 0, w: 0}
136 | outline: []
137 | tessellationDetail: 0
138 | - serializedVersion: 2
139 | name: coins_4
140 | rect:
141 | serializedVersion: 2
142 | x: 686
143 | y: 14
144 | width: 174
145 | height: 168
146 | alignment: 0
147 | pivot: {x: 0, y: 0}
148 | border: {x: 0, y: 0, z: 0, w: 0}
149 | outline: []
150 | tessellationDetail: 0
151 | - serializedVersion: 2
152 | name: coins_5
153 | rect:
154 | serializedVersion: 2
155 | x: 888
156 | y: 8
157 | width: 194
158 | height: 190
159 | alignment: 0
160 | pivot: {x: 0, y: 0}
161 | border: {x: 0, y: 0, z: 0, w: 0}
162 | outline: []
163 | tessellationDetail: 0
164 | outline: []
165 | spritePackingTag:
166 | userData:
167 | assetBundleName:
168 | assetBundleVariant:
169 |
--------------------------------------------------------------------------------
/Assets/Sprites/gems.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/herbou/Unity_MultipleRewardSystem_AdmobAds/3cf8503533808835a83d5775d769e6622c4b2ffa/Assets/Sprites/gems.png
--------------------------------------------------------------------------------
/Assets/Sprites/gems.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e9466fff830cbda42835e3fc082f4942
3 | timeCreated: 1595604838
4 | licenseType: Pro
5 | TextureImporter:
6 | fileIDToRecycleName:
7 | 21300000: gems_0
8 | 21300002: gems_1
9 | serializedVersion: 4
10 | mipmaps:
11 | mipMapMode: 0
12 | enableMipMap: 0
13 | sRGBTexture: 1
14 | linearTexture: 0
15 | fadeOut: 0
16 | borderMipMap: 0
17 | mipMapFadeDistanceStart: 1
18 | mipMapFadeDistanceEnd: 3
19 | bumpmap:
20 | convertToNormalMap: 0
21 | externalNormalMap: 0
22 | heightScale: 0.25
23 | normalMapFilter: 0
24 | isReadable: 0
25 | grayScaleToAlpha: 0
26 | generateCubemap: 6
27 | cubemapConvolution: 0
28 | seamlessCubemap: 0
29 | textureFormat: 1
30 | maxTextureSize: 2048
31 | textureSettings:
32 | filterMode: -1
33 | aniso: -1
34 | mipBias: -1
35 | wrapMode: 1
36 | nPOTScale: 0
37 | lightmap: 0
38 | compressionQuality: 50
39 | spriteMode: 2
40 | spriteExtrude: 1
41 | spriteMeshType: 1
42 | alignment: 0
43 | spritePivot: {x: 0.5, y: 0.5}
44 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
45 | spritePixelsToUnits: 100
46 | alphaUsage: 1
47 | alphaIsTransparency: 1
48 | spriteTessellationDetail: -1
49 | textureType: 8
50 | textureShape: 1
51 | maxTextureSizeSet: 0
52 | compressionQualitySet: 0
53 | textureFormatSet: 0
54 | platformSettings:
55 | - buildTarget: DefaultTexturePlatform
56 | maxTextureSize: 2048
57 | textureFormat: -1
58 | textureCompression: 1
59 | compressionQuality: 50
60 | crunchedCompression: 0
61 | allowsAlphaSplitting: 0
62 | overridden: 0
63 | - buildTarget: Standalone
64 | maxTextureSize: 2048
65 | textureFormat: -1
66 | textureCompression: 1
67 | compressionQuality: 50
68 | crunchedCompression: 0
69 | allowsAlphaSplitting: 0
70 | overridden: 0
71 | - buildTarget: Android
72 | maxTextureSize: 2048
73 | textureFormat: -1
74 | textureCompression: 1
75 | compressionQuality: 50
76 | crunchedCompression: 0
77 | allowsAlphaSplitting: 0
78 | overridden: 0
79 | spriteSheet:
80 | serializedVersion: 2
81 | sprites:
82 | - serializedVersion: 2
83 | name: gems_0
84 | rect:
85 | serializedVersion: 2
86 | x: 5
87 | y: 46
88 | width: 202
89 | height: 210
90 | alignment: 0
91 | pivot: {x: 0, y: 0}
92 | border: {x: 0, y: 0, z: 0, w: 0}
93 | outline: []
94 | tessellationDetail: 0
95 | - serializedVersion: 2
96 | name: gems_1
97 | rect:
98 | serializedVersion: 2
99 | x: 280
100 | y: 12
101 | width: 270
102 | height: 283
103 | alignment: 0
104 | pivot: {x: 0, y: 0}
105 | border: {x: 0, y: 0, z: 0, w: 0}
106 | outline: []
107 | tessellationDetail: 0
108 | outline: []
109 | spritePackingTag:
110 | userData:
111 | assetBundleName:
112 | assetBundleVariant:
113 |
--------------------------------------------------------------------------------
/LICENCE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 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 | # How to make Parchisi game Reward system in Unity with Admob Ads
2 |
3 |
4 | Click on the image bellow to watch the video tutorial:
5 | 
6 |
7 |
8 |
9 | ## ❤️ Donate
10 |
11 |
12 |
--------------------------------------------------------------------------------