├── .DS_Store
├── .github
└── FUNDING.yml
├── .gitignore
├── Assets
├── Package.meta
└── Package
│ ├── 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
│ ├── Resources.meta
│ ├── Resources
│ ├── DOTweenSettings.asset
│ └── DOTweenSettings.asset.meta
│ ├── Samples~
│ ├── HowToUse.meta
│ └── HowToUse
│ │ ├── DynamicScrollScene.unity
│ │ ├── DynamicScrollScene.unity.meta
│ │ ├── ExampleData.cs
│ │ ├── ExampleData.cs.meta
│ │ ├── ExampleDynamicObject.cs
│ │ ├── ExampleDynamicObject.cs.meta
│ │ ├── ExampleObject.prefab
│ │ ├── ExampleObject.prefab.meta
│ │ ├── ExampleScroll.cs
│ │ └── ExampleScroll.cs.meta
│ ├── Scripts.meta
│ ├── Scripts
│ ├── DynamicScroll.cs
│ ├── DynamicScroll.cs.meta
│ ├── DynamicScrollObject.cs
│ ├── DynamicScrollObject.cs.meta
│ ├── DynamicScrollRect.cs
│ ├── DynamicScrollRect.cs.meta
│ ├── IScrollItem.cs
│ ├── IScrollItem.cs.meta
│ ├── Pooling.meta
│ ├── Pooling
│ │ ├── IPooling.cs
│ │ ├── IPooling.cs.meta
│ │ ├── Pooling.cs
│ │ ├── Pooling.cs.meta
│ │ ├── PoolingObject.cs
│ │ └── PoolingObject.cs.meta
│ ├── Utils.meta
│ └── Utils
│ │ ├── JsonHelper.cs
│ │ └── JsonHelper.cs.meta
│ ├── Tests.meta
│ ├── Tests
│ ├── EditMode.meta
│ ├── EditMode
│ │ ├── DynamicScrollRectTests.cs
│ │ ├── DynamicScrollRectTests.cs.meta
│ │ ├── Resources.meta
│ │ ├── Resources
│ │ │ ├── ItemTest.prefab
│ │ │ ├── ItemTest.prefab.meta
│ │ │ ├── VerticalScrollViewTest.prefab
│ │ │ └── VerticalScrollViewTest.prefab.meta
│ │ ├── com.mukarillo.dynamicscrollrect.tests.asmdef
│ │ └── com.mukarillo.dynamicscrollrect.tests.asmdef.meta
│ ├── PlayMode.meta
│ └── PlayMode
│ │ ├── DynamicScrollRectPlayModeTests.cs
│ │ ├── DynamicScrollRectPlayModeTests.cs.meta
│ │ ├── Resources.meta
│ │ ├── Resources
│ │ ├── ItemTest.prefab
│ │ ├── ItemTest.prefab.meta
│ │ ├── VerticalScrollViewTest.prefab
│ │ └── VerticalScrollViewTest.prefab.meta
│ │ ├── com.mukarillo.dynamicscrollrect.playmodetests.asmdef
│ │ └── com.mukarillo.dynamicscrollrect.playmodetests.asmdef.meta
│ ├── com.mukarillo.dynamicscrollrect.asmdef
│ ├── com.mukarillo.dynamicscrollrect.asmdef.meta
│ ├── package.json
│ └── package.json.meta
├── LICENSE
├── Logs
└── Packages-Update.log
├── Packages
└── manifest.json
├── ProjectSettings
├── AudioManager.asset
├── ClusterInputManager.asset
├── DynamicsManager.asset
├── EditorBuildSettings.asset
├── EditorSettings.asset
├── GraphicsSettings.asset
├── InputManager.asset
├── NavMeshAreas.asset
├── NetworkManager.asset
├── Physics2DSettings.asset
├── PresetManager.asset
├── ProjectSettings.asset
├── ProjectVersion.txt
├── QualitySettings.asset
├── TagManager.asset
├── TimeManager.asset
├── UnityConnectSettings.asset
├── VFXManager.asset
└── XRSettings.asset
├── README.md
├── ReadmeAssets
└── dynamic_list_example.gif
└── package.json
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mukarillo/UnityDynamicScrollRect/fe744ee56614f7a44e4bbd8e13d1bb2cae45edc4/.DS_Store
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4 | patreon: # Replace with a single Patreon username
5 | open_collective: # Replace with a single Open Collective username
6 | ko_fi: mukarillo
7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9 | liberapay: mukarillo
10 | issuehunt: # Replace with a single IssueHunt username
11 | otechie: # Replace with a single Otechie username
12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
13 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | [Ll]ibrary/
2 | [Tt]emp/
3 | [Oo]bj/
4 | [Bb]uild/
5 | [Bb]uilds/
6 | Assets/AssetStoreTools*
7 |
8 | # Visual Studio cache directory
9 | .vs/
10 |
11 | # Autogenerated VS/MD/Consulo solution and project files
12 | ExportedObj/
13 | .consulo/
14 | *.csproj
15 | *.unityproj
16 | *.sln
17 | *.suo
18 | *.tmp
19 | *.user
20 | *.userprefs
21 | *.pidb
22 | *.booproj
23 | *.svd
24 | *.pdb
25 | *.opendb
26 |
27 | # Unity3D generated meta files
28 | *.pidb.meta
29 | *.pdb.meta
30 |
31 | # Unity3D Generated File On Crash Reports
32 | sysinfo.txt
33 |
34 | # Builds
35 | *.apk
36 | *.unitypackage
37 |
--------------------------------------------------------------------------------
/Assets/Package.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 06fca1cead98944a884097672054a1d0
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Package/Demigiant.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e1b4315591d1c4e16be2d2d7036d3a8d
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Package/Demigiant/DOTween.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: fdf4295ef3c544029bcbbe29f14afa40
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Package/Demigiant/DOTween/DOTween.XML.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 34192c5e0d14aee43a0e86cc4823268a
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/Package/Demigiant/DOTween/DOTween.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mukarillo/UnityDynamicScrollRect/fe744ee56614f7a44e4bbd8e13d1bb2cae45edc4/Assets/Package/Demigiant/DOTween/DOTween.dll
--------------------------------------------------------------------------------
/Assets/Package/Demigiant/DOTween/DOTween.dll.mdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mukarillo/UnityDynamicScrollRect/fe744ee56614f7a44e4bbd8e13d1bb2cae45edc4/Assets/Package/Demigiant/DOTween/DOTween.dll.mdb
--------------------------------------------------------------------------------
/Assets/Package/Demigiant/DOTween/DOTween.dll.mdb.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4f007001a22b3d24dae350342c4d19c8
3 | DefaultImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/Package/Demigiant/DOTween/DOTween.dll.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a811bde74b26b53498b4f6d872b09b6d
3 | PluginImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | iconMap: {}
7 | executionOrder: {}
8 | defineConstraints: []
9 | isPreloaded: 0
10 | isOverridable: 0
11 | isExplicitlyReferenced: 0
12 | validateReferences: 1
13 | platformData:
14 | - first:
15 | Any:
16 | second:
17 | enabled: 1
18 | settings: {}
19 | - first:
20 | Editor: Editor
21 | second:
22 | enabled: 0
23 | settings:
24 | DefaultValueInitialized: true
25 | - first:
26 | Windows Store Apps: WindowsStoreApps
27 | second:
28 | enabled: 0
29 | settings:
30 | CPU: AnyCPU
31 | userData:
32 | assetBundleName:
33 | assetBundleVariant:
34 |
--------------------------------------------------------------------------------
/Assets/Package/Demigiant/DOTween/Editor.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4778098d2c58145f0b3fe0abe72db0fb
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Package/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/Package/Demigiant/DOTween/Editor/DOTweenEditor.XML.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2e2c6224d345d9249acfa6e8ef40bb2d
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/Package/Demigiant/DOTween/Editor/DOTweenEditor.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mukarillo/UnityDynamicScrollRect/fe744ee56614f7a44e4bbd8e13d1bb2cae45edc4/Assets/Package/Demigiant/DOTween/Editor/DOTweenEditor.dll
--------------------------------------------------------------------------------
/Assets/Package/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mukarillo/UnityDynamicScrollRect/fe744ee56614f7a44e4bbd8e13d1bb2cae45edc4/Assets/Package/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb
--------------------------------------------------------------------------------
/Assets/Package/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 8f46310a8b0a8f04a92993c37c713243
3 | DefaultImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/Package/Demigiant/DOTween/Editor/DOTweenEditor.dll.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 45d5034162d6cf04dbe46da84fc7d074
3 | PluginImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | iconMap: {}
7 | executionOrder: {}
8 | defineConstraints: []
9 | isPreloaded: 0
10 | isOverridable: 0
11 | isExplicitlyReferenced: 0
12 | validateReferences: 1
13 | platformData:
14 | - first:
15 | Any:
16 | second:
17 | enabled: 0
18 | settings: {}
19 | - first:
20 | Editor: Editor
21 | second:
22 | enabled: 1
23 | settings:
24 | DefaultValueInitialized: true
25 | - first:
26 | Windows Store Apps: WindowsStoreApps
27 | second:
28 | enabled: 0
29 | settings:
30 | CPU: AnyCPU
31 | userData:
32 | assetBundleName:
33 | assetBundleVariant:
34 |
--------------------------------------------------------------------------------
/Assets/Package/Demigiant/DOTween/Editor/Imgs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 505119723d1bc4a368f49e383bb92a09
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Package/Demigiant/DOTween/Editor/Imgs/DOTweenIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mukarillo/UnityDynamicScrollRect/fe744ee56614f7a44e4bbd8e13d1bb2cae45edc4/Assets/Package/Demigiant/DOTween/Editor/Imgs/DOTweenIcon.png
--------------------------------------------------------------------------------
/Assets/Package/Demigiant/DOTween/Editor/Imgs/DOTweenIcon.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 8da095e39e9b4df488dfd436f81116d6
3 | TextureImporter:
4 | internalIDToNameTable: []
5 | externalObjects: {}
6 | serializedVersion: 10
7 | mipmaps:
8 | mipMapMode: 0
9 | enableMipMap: 0
10 | sRGBTexture: 1
11 | linearTexture: 1
12 | fadeOut: 0
13 | borderMipMap: 0
14 | mipMapsPreserveCoverage: 0
15 | alphaTestReferenceValue: 0.5
16 | mipMapFadeDistanceStart: 1
17 | mipMapFadeDistanceEnd: 3
18 | bumpmap:
19 | convertToNormalMap: 0
20 | externalNormalMap: 0
21 | heightScale: 0.25
22 | normalMapFilter: 0
23 | isReadable: 0
24 | streamingMipmaps: 0
25 | streamingMipmapsPriority: 0
26 | grayScaleToAlpha: 0
27 | generateCubemap: 6
28 | cubemapConvolution: 0
29 | seamlessCubemap: 0
30 | textureFormat: -3
31 | maxTextureSize: 128
32 | textureSettings:
33 | serializedVersion: 2
34 | filterMode: 1
35 | aniso: 1
36 | mipBias: -100
37 | wrapU: 1
38 | wrapV: 1
39 | wrapW: 1
40 | nPOTScale: 0
41 | lightmap: 0
42 | compressionQuality: 50
43 | spriteMode: 0
44 | spriteExtrude: 1
45 | spriteMeshType: 1
46 | alignment: 0
47 | spritePivot: {x: 0.5, y: 0.5}
48 | spritePixelsToUnits: 100
49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
50 | spriteGenerateFallbackPhysicsShape: 1
51 | alphaUsage: 1
52 | alphaIsTransparency: 1
53 | spriteTessellationDetail: -1
54 | textureType: 2
55 | textureShape: 1
56 | singleChannelComponent: 0
57 | maxTextureSizeSet: 0
58 | compressionQualitySet: 0
59 | textureFormatSet: 0
60 | platformSettings:
61 | - serializedVersion: 2
62 | buildTarget: DefaultTexturePlatform
63 | maxTextureSize: 128
64 | resizeAlgorithm: 0
65 | textureFormat: -1
66 | textureCompression: 0
67 | compressionQuality: 50
68 | crunchedCompression: 0
69 | allowsAlphaSplitting: 0
70 | overridden: 0
71 | androidETC2FallbackOverride: 0
72 | spriteSheet:
73 | serializedVersion: 2
74 | sprites: []
75 | outline: []
76 | physicsShape: []
77 | bones: []
78 | spriteID:
79 | internalID: 0
80 | vertices: []
81 | indices:
82 | edges: []
83 | weights: []
84 | secondaryTextures: []
85 | spritePackingTag:
86 | pSDRemoveMatte: 0
87 | pSDShowRemoveMatteOption: 0
88 | userData:
89 | assetBundleName:
90 | assetBundleVariant:
91 |
--------------------------------------------------------------------------------
/Assets/Package/Demigiant/DOTween/Editor/Imgs/Footer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mukarillo/UnityDynamicScrollRect/fe744ee56614f7a44e4bbd8e13d1bb2cae45edc4/Assets/Package/Demigiant/DOTween/Editor/Imgs/Footer.png
--------------------------------------------------------------------------------
/Assets/Package/Demigiant/DOTween/Editor/Imgs/Footer.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 7051dba417b3d53409f2918f1ea4938d
3 | TextureImporter:
4 | internalIDToNameTable: []
5 | externalObjects: {}
6 | serializedVersion: 10
7 | mipmaps:
8 | mipMapMode: 0
9 | enableMipMap: 0
10 | sRGBTexture: 1
11 | linearTexture: 1
12 | fadeOut: 0
13 | borderMipMap: 0
14 | mipMapsPreserveCoverage: 0
15 | alphaTestReferenceValue: 0.5
16 | mipMapFadeDistanceStart: 1
17 | mipMapFadeDistanceEnd: 3
18 | bumpmap:
19 | convertToNormalMap: 0
20 | externalNormalMap: 0
21 | heightScale: 0.25
22 | normalMapFilter: 0
23 | isReadable: 0
24 | streamingMipmaps: 0
25 | streamingMipmapsPriority: 0
26 | grayScaleToAlpha: 0
27 | generateCubemap: 6
28 | cubemapConvolution: 0
29 | seamlessCubemap: 0
30 | textureFormat: -3
31 | maxTextureSize: 256
32 | textureSettings:
33 | serializedVersion: 2
34 | filterMode: 1
35 | aniso: 1
36 | mipBias: -100
37 | wrapU: 1
38 | wrapV: 1
39 | wrapW: 1
40 | nPOTScale: 0
41 | lightmap: 0
42 | compressionQuality: 50
43 | spriteMode: 0
44 | spriteExtrude: 1
45 | spriteMeshType: 1
46 | alignment: 0
47 | spritePivot: {x: 0.5, y: 0.5}
48 | spritePixelsToUnits: 100
49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
50 | spriteGenerateFallbackPhysicsShape: 1
51 | alphaUsage: 1
52 | alphaIsTransparency: 1
53 | spriteTessellationDetail: -1
54 | textureType: 2
55 | textureShape: 1
56 | singleChannelComponent: 0
57 | maxTextureSizeSet: 0
58 | compressionQualitySet: 0
59 | textureFormatSet: 0
60 | platformSettings:
61 | - serializedVersion: 2
62 | buildTarget: DefaultTexturePlatform
63 | maxTextureSize: 256
64 | resizeAlgorithm: 0
65 | textureFormat: -1
66 | textureCompression: 0
67 | compressionQuality: 50
68 | crunchedCompression: 0
69 | allowsAlphaSplitting: 0
70 | overridden: 0
71 | androidETC2FallbackOverride: 0
72 | spriteSheet:
73 | serializedVersion: 2
74 | sprites: []
75 | outline: []
76 | physicsShape: []
77 | bones: []
78 | spriteID:
79 | internalID: 0
80 | vertices: []
81 | indices:
82 | edges: []
83 | weights: []
84 | secondaryTextures: []
85 | spritePackingTag:
86 | pSDRemoveMatte: 0
87 | pSDShowRemoveMatteOption: 0
88 | userData:
89 | assetBundleName:
90 | assetBundleVariant:
91 |
--------------------------------------------------------------------------------
/Assets/Package/Demigiant/DOTween/Editor/Imgs/Footer_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mukarillo/UnityDynamicScrollRect/fe744ee56614f7a44e4bbd8e13d1bb2cae45edc4/Assets/Package/Demigiant/DOTween/Editor/Imgs/Footer_dark.png
--------------------------------------------------------------------------------
/Assets/Package/Demigiant/DOTween/Editor/Imgs/Footer_dark.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 519694efe2bb2914788b151fbd8c01f4
3 | TextureImporter:
4 | internalIDToNameTable: []
5 | externalObjects: {}
6 | serializedVersion: 10
7 | mipmaps:
8 | mipMapMode: 0
9 | enableMipMap: 0
10 | sRGBTexture: 1
11 | linearTexture: 0
12 | fadeOut: 0
13 | borderMipMap: 0
14 | mipMapsPreserveCoverage: 0
15 | alphaTestReferenceValue: 0.5
16 | mipMapFadeDistanceStart: 1
17 | mipMapFadeDistanceEnd: 3
18 | bumpmap:
19 | convertToNormalMap: 0
20 | externalNormalMap: 0
21 | heightScale: 0.25
22 | normalMapFilter: 0
23 | isReadable: 0
24 | streamingMipmaps: 0
25 | streamingMipmapsPriority: 0
26 | grayScaleToAlpha: 0
27 | generateCubemap: 6
28 | cubemapConvolution: 0
29 | seamlessCubemap: 0
30 | textureFormat: -1
31 | maxTextureSize: 1024
32 | textureSettings:
33 | serializedVersion: 2
34 | filterMode: 1
35 | aniso: 1
36 | mipBias: -100
37 | wrapU: 1
38 | wrapV: 1
39 | wrapW: 1
40 | nPOTScale: 0
41 | lightmap: 0
42 | compressionQuality: 50
43 | spriteMode: 0
44 | spriteExtrude: 1
45 | spriteMeshType: 1
46 | alignment: 0
47 | spritePivot: {x: 0.5, y: 0.5}
48 | spritePixelsToUnits: 100
49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
50 | spriteGenerateFallbackPhysicsShape: 1
51 | alphaUsage: 1
52 | alphaIsTransparency: 1
53 | spriteTessellationDetail: -1
54 | textureType: 2
55 | textureShape: 1
56 | singleChannelComponent: 0
57 | maxTextureSizeSet: 0
58 | compressionQualitySet: 0
59 | textureFormatSet: 0
60 | platformSettings:
61 | - serializedVersion: 2
62 | buildTarget: DefaultTexturePlatform
63 | maxTextureSize: 256
64 | resizeAlgorithm: 0
65 | textureFormat: -1
66 | textureCompression: 1
67 | compressionQuality: 50
68 | crunchedCompression: 0
69 | allowsAlphaSplitting: 0
70 | overridden: 0
71 | androidETC2FallbackOverride: 0
72 | spriteSheet:
73 | serializedVersion: 2
74 | sprites: []
75 | outline: []
76 | physicsShape: []
77 | bones: []
78 | spriteID:
79 | internalID: 0
80 | vertices: []
81 | indices:
82 | edges: []
83 | weights: []
84 | secondaryTextures: []
85 | spritePackingTag:
86 | pSDRemoveMatte: 0
87 | pSDShowRemoveMatteOption: 0
88 | userData:
89 | assetBundleName:
90 | assetBundleVariant:
91 |
--------------------------------------------------------------------------------
/Assets/Package/Demigiant/DOTween/Editor/Imgs/Header.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mukarillo/UnityDynamicScrollRect/fe744ee56614f7a44e4bbd8e13d1bb2cae45edc4/Assets/Package/Demigiant/DOTween/Editor/Imgs/Header.jpg
--------------------------------------------------------------------------------
/Assets/Package/Demigiant/DOTween/Editor/Imgs/Header.jpg.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 78a59ca99f8987941adb61f9e14a06a7
3 | TextureImporter:
4 | internalIDToNameTable: []
5 | externalObjects: {}
6 | serializedVersion: 10
7 | mipmaps:
8 | mipMapMode: 0
9 | enableMipMap: 0
10 | sRGBTexture: 1
11 | linearTexture: 1
12 | fadeOut: 0
13 | borderMipMap: 0
14 | mipMapsPreserveCoverage: 0
15 | alphaTestReferenceValue: 0.5
16 | mipMapFadeDistanceStart: 1
17 | mipMapFadeDistanceEnd: 3
18 | bumpmap:
19 | convertToNormalMap: 0
20 | externalNormalMap: 0
21 | heightScale: 0.25
22 | normalMapFilter: 0
23 | isReadable: 0
24 | streamingMipmaps: 0
25 | streamingMipmapsPriority: 0
26 | grayScaleToAlpha: 0
27 | generateCubemap: 6
28 | cubemapConvolution: 0
29 | seamlessCubemap: 0
30 | textureFormat: -3
31 | maxTextureSize: 512
32 | textureSettings:
33 | serializedVersion: 2
34 | filterMode: 1
35 | aniso: 1
36 | mipBias: -100
37 | wrapU: 1
38 | wrapV: 1
39 | wrapW: 1
40 | nPOTScale: 0
41 | lightmap: 0
42 | compressionQuality: 50
43 | spriteMode: 0
44 | spriteExtrude: 1
45 | spriteMeshType: 1
46 | alignment: 0
47 | spritePivot: {x: 0.5, y: 0.5}
48 | spritePixelsToUnits: 100
49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
50 | spriteGenerateFallbackPhysicsShape: 1
51 | alphaUsage: 1
52 | alphaIsTransparency: 1
53 | spriteTessellationDetail: -1
54 | textureType: 2
55 | textureShape: 1
56 | singleChannelComponent: 0
57 | maxTextureSizeSet: 0
58 | compressionQualitySet: 0
59 | textureFormatSet: 0
60 | platformSettings:
61 | - serializedVersion: 2
62 | buildTarget: DefaultTexturePlatform
63 | maxTextureSize: 512
64 | resizeAlgorithm: 0
65 | textureFormat: -1
66 | textureCompression: 0
67 | compressionQuality: 50
68 | crunchedCompression: 0
69 | allowsAlphaSplitting: 0
70 | overridden: 0
71 | androidETC2FallbackOverride: 0
72 | spriteSheet:
73 | serializedVersion: 2
74 | sprites: []
75 | outline: []
76 | physicsShape: []
77 | bones: []
78 | spriteID:
79 | internalID: 0
80 | vertices: []
81 | indices:
82 | edges: []
83 | weights: []
84 | secondaryTextures: []
85 | spritePackingTag:
86 | pSDRemoveMatte: 0
87 | pSDShowRemoveMatteOption: 0
88 | userData:
89 | assetBundleName:
90 | assetBundleVariant:
91 |
--------------------------------------------------------------------------------
/Assets/Package/Demigiant/DOTween/Modules.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a5ed29b403837471d93cb2e642312c38
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Package/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/Package/Demigiant/DOTween/Modules/DOTweenModuleAudio.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b766d08851589514b97afb23c6f30a70
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Package/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/Package/Demigiant/DOTween/Modules/DOTweenModulePhysics.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: dae9aa560b4242648a3affa2bfabc365
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Package/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/Package/Demigiant/DOTween/Modules/DOTweenModulePhysics2D.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 230fe34542e175245ba74b4659dae700
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Package/Demigiant/DOTween/Modules/DOTweenModuleSprite.cs:
--------------------------------------------------------------------------------
1 | // Author: Daniele Giardini - http://www.demigiant.com
2 | // Created: 2018/07/13
3 |
4 | #if false && (UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1_OR_NEWER) // MODULE_MARKER
5 | using System;
6 | using UnityEngine;
7 | using DG.Tweening.Core;
8 | using DG.Tweening.Plugins.Options;
9 |
10 | #pragma warning disable 1591
11 | namespace DG.Tweening
12 | {
13 | public static class DOTweenModuleSprite
14 | {
15 | #region Shortcuts
16 |
17 | #region SpriteRenderer
18 |
19 | /// Tweens a SpriteRenderer's color to the given value.
20 | /// Also stores the spriteRenderer as the tween's target so it can be used for filtered operations
21 | /// The end value to reachThe duration of the tween
22 | public static TweenerCore DOColor(this SpriteRenderer target, Color endValue, float duration)
23 | {
24 | TweenerCore t = DOTween.To(() => target.color, x => target.color = x, endValue, duration);
25 | t.SetTarget(target);
26 | return t;
27 | }
28 |
29 | /// Tweens a Material's alpha color to the given value.
30 | /// Also stores the spriteRenderer as the tween's target so it can be used for filtered operations
31 | /// The end value to reachThe duration of the tween
32 | public static TweenerCore DOFade(this SpriteRenderer target, float endValue, float duration)
33 | {
34 | TweenerCore t = DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration);
35 | t.SetTarget(target);
36 | return t;
37 | }
38 |
39 | /// Tweens a SpriteRenderer's color using the given gradient
40 | /// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener).
41 | /// Also stores the image as the tween's target so it can be used for filtered operations
42 | /// The gradient to useThe duration of the tween
43 | public static Sequence DOGradientColor(this SpriteRenderer target, Gradient gradient, float duration)
44 | {
45 | Sequence s = DOTween.Sequence();
46 | GradientColorKey[] colors = gradient.colorKeys;
47 | int len = colors.Length;
48 | for (int i = 0; i < len; ++i) {
49 | GradientColorKey c = colors[i];
50 | if (i == 0 && c.time <= 0) {
51 | target.color = c.color;
52 | continue;
53 | }
54 | float colorDuration = i == len - 1
55 | ? duration - s.Duration(false) // Verifies that total duration is correct
56 | : duration * (i == 0 ? c.time : c.time - colors[i - 1].time);
57 | s.Append(target.DOColor(c.color, colorDuration).SetEase(Ease.Linear));
58 | }
59 | return s;
60 | }
61 |
62 | #endregion
63 |
64 | #region Blendables
65 |
66 | #region SpriteRenderer
67 |
68 | /// Tweens a SpriteRenderer's color to the given value,
69 | /// in a way that allows other DOBlendableColor tweens to work together on the same target,
70 | /// instead than fight each other as multiple DOColor would do.
71 | /// Also stores the SpriteRenderer as the tween's target so it can be used for filtered operations
72 | /// The value to tween toThe duration of the tween
73 | public static Tweener DOBlendableColor(this SpriteRenderer target, Color endValue, float duration)
74 | {
75 | endValue = endValue - target.color;
76 | Color to = new Color(0, 0, 0, 0);
77 | return DOTween.To(() => to, x => {
78 | Color diff = x - to;
79 | to = x;
80 | target.color += diff;
81 | }, endValue, duration)
82 | .Blendable().SetTarget(target);
83 | }
84 |
85 | #endregion
86 |
87 | #endregion
88 |
89 | #endregion
90 | }
91 | }
92 | #endif
93 |
--------------------------------------------------------------------------------
/Assets/Package/Demigiant/DOTween/Modules/DOTweenModuleSprite.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 188918ab119d93148aa0de59ccf5286b
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Package/Demigiant/DOTween/Modules/DOTweenModuleUI.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a060394c03331a64392db53a10e7f2d1
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Package/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 | return s;
44 | }
45 | /// Tweens a Material's named color property using the given gradient
46 | /// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener).
47 | /// Also stores the image as the tween's target so it can be used for filtered operations
48 | /// The gradient to use
49 | /// The name of the material property to tween (like _Tint or _SpecColor)
50 | /// The duration of the tween
51 | public static Sequence DOGradientColor(this Material target, Gradient gradient, string property, float duration)
52 | {
53 | Sequence s = DOTween.Sequence();
54 | GradientColorKey[] colors = gradient.colorKeys;
55 | int len = colors.Length;
56 | for (int i = 0; i < len; ++i) {
57 | GradientColorKey c = colors[i];
58 | if (i == 0 && c.time <= 0) {
59 | target.SetColor(property, c.color);
60 | continue;
61 | }
62 | float colorDuration = i == len - 1
63 | ? duration - s.Duration(false) // Verifies that total duration is correct
64 | : duration * (i == 0 ? c.time : c.time - colors[i - 1].time);
65 | s.Append(target.DOColor(c.color, property, colorDuration).SetEase(Ease.Linear));
66 | }
67 | return s;
68 | }
69 |
70 | #endregion
71 |
72 | #endregion
73 | #endif
74 |
75 | #if UNITY_5_3_OR_NEWER || UNITY_2017_1_OR_NEWER
76 | #region Unity 5.3 or Newer
77 |
78 | #region CustomYieldInstructions
79 |
80 | ///
81 | /// Returns a that waits until the tween is killed or complete.
82 | /// It can be used inside a coroutine as a yield.
83 | /// Example usage:yield return myTween.WaitForCompletion(true);
84 | ///
85 | public static CustomYieldInstruction WaitForCompletion(this Tween t, bool returnCustomYieldInstruction)
86 | {
87 | if (!t.active) {
88 | if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
89 | return null;
90 | }
91 | return new DOTweenCYInstruction.WaitForCompletion(t);
92 | }
93 |
94 | ///
95 | /// Returns a that waits until the tween is killed or rewinded.
96 | /// It can be used inside a coroutine as a yield.
97 | /// Example usage:yield return myTween.WaitForRewind();
98 | ///
99 | public static CustomYieldInstruction WaitForRewind(this Tween t, bool returnCustomYieldInstruction)
100 | {
101 | if (!t.active) {
102 | if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
103 | return null;
104 | }
105 | return new DOTweenCYInstruction.WaitForRewind(t);
106 | }
107 |
108 | ///
109 | /// Returns a that waits until the tween is killed.
110 | /// It can be used inside a coroutine as a yield.
111 | /// Example usage:yield return myTween.WaitForKill();
112 | ///
113 | public static CustomYieldInstruction WaitForKill(this Tween t, bool returnCustomYieldInstruction)
114 | {
115 | if (!t.active) {
116 | if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
117 | return null;
118 | }
119 | return new DOTweenCYInstruction.WaitForKill(t);
120 | }
121 |
122 | ///
123 | /// Returns a that waits until the tween is killed or has gone through the given amount of loops.
124 | /// It can be used inside a coroutine as a yield.
125 | /// Example usage:yield return myTween.WaitForElapsedLoops(2);
126 | ///
127 | /// Elapsed loops to wait for
128 | public static CustomYieldInstruction WaitForElapsedLoops(this Tween t, int elapsedLoops, bool returnCustomYieldInstruction)
129 | {
130 | if (!t.active) {
131 | if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
132 | return null;
133 | }
134 | return new DOTweenCYInstruction.WaitForElapsedLoops(t, elapsedLoops);
135 | }
136 |
137 | ///
138 | /// Returns a that waits until the tween is killed or has reached the given position (loops included, delays excluded).
139 | /// It can be used inside a coroutine as a yield.
140 | /// Example usage:yield return myTween.WaitForPosition(2.5f);
141 | ///
142 | /// Position (loops included, delays excluded) to wait for
143 | public static CustomYieldInstruction WaitForPosition(this Tween t, float position, bool returnCustomYieldInstruction)
144 | {
145 | if (!t.active) {
146 | if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
147 | return null;
148 | }
149 | return new DOTweenCYInstruction.WaitForPosition(t, position);
150 | }
151 |
152 | ///
153 | /// Returns a that waits until the tween is killed or started
154 | /// (meaning when the tween is set in a playing state the first time, after any eventual delay).
155 | /// It can be used inside a coroutine as a yield.
156 | /// Example usage:yield return myTween.WaitForStart();
157 | ///
158 | public static CustomYieldInstruction WaitForStart(this Tween t, bool returnCustomYieldInstruction)
159 | {
160 | if (!t.active) {
161 | if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
162 | return null;
163 | }
164 | return new DOTweenCYInstruction.WaitForStart(t);
165 | }
166 |
167 | #endregion
168 |
169 | #endregion
170 | #endif
171 |
172 | #if UNITY_2018_1_OR_NEWER
173 | #region Unity 2018.1 or Newer
174 |
175 | #region Material
176 |
177 | /// Tweens a Material's named texture offset property with the given ID to the given value.
178 | /// Also stores the material as the tween's target so it can be used for filtered operations
179 | /// The end value to reach
180 | /// The ID of the material property to tween (also called nameID in Unity's manual)
181 | /// The duration of the tween
182 | public static TweenerCore DOOffset(this Material target, Vector2 endValue, int propertyID, float duration)
183 | {
184 | if (!target.HasProperty(propertyID)) {
185 | if (Debugger.logPriority > 0) Debugger.LogMissingMaterialProperty(propertyID);
186 | return null;
187 | }
188 | TweenerCore t = DOTween.To(() => target.GetTextureOffset(propertyID), x => target.SetTextureOffset(propertyID, x), endValue, duration);
189 | t.SetTarget(target);
190 | return t;
191 | }
192 |
193 | /// Tweens a Material's named texture scale property with the given ID to the given value.
194 | /// Also stores the material as the tween's target so it can be used for filtered operations
195 | /// The end value to reach
196 | /// The ID of the material property to tween (also called nameID in Unity's manual)
197 | /// The duration of the tween
198 | public static TweenerCore DOTiling(this Material target, Vector2 endValue, int propertyID, float duration)
199 | {
200 | if (!target.HasProperty(propertyID)) {
201 | if (Debugger.logPriority > 0) Debugger.LogMissingMaterialProperty(propertyID);
202 | return null;
203 | }
204 | TweenerCore t = DOTween.To(() => target.GetTextureScale(propertyID), x => target.SetTextureScale(propertyID, x), endValue, duration);
205 | t.SetTarget(target);
206 | return t;
207 | }
208 |
209 | #endregion
210 |
211 | #endregion
212 | #endif
213 | }
214 |
215 | // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
216 | // ███ CLASSES █████████████████████████████████████████████████████████████████████████████████████████████████████████
217 | // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
218 |
219 | #if UNITY_5_3_OR_NEWER || UNITY_2017_1_OR_NEWER
220 | public static class DOTweenCYInstruction
221 | {
222 | public class WaitForCompletion : CustomYieldInstruction
223 | {
224 | public override bool keepWaiting { get {
225 | return t.active && !t.IsComplete();
226 | }}
227 | readonly Tween t;
228 | public WaitForCompletion(Tween tween)
229 | {
230 | t = tween;
231 | }
232 | }
233 |
234 | public class WaitForRewind : CustomYieldInstruction
235 | {
236 | public override bool keepWaiting { get {
237 | return t.active && (!t.playedOnce || t.position * (t.CompletedLoops() + 1) > 0);
238 | }}
239 | readonly Tween t;
240 | public WaitForRewind(Tween tween)
241 | {
242 | t = tween;
243 | }
244 | }
245 |
246 | public class WaitForKill : CustomYieldInstruction
247 | {
248 | public override bool keepWaiting { get {
249 | return t.active;
250 | }}
251 | readonly Tween t;
252 | public WaitForKill(Tween tween)
253 | {
254 | t = tween;
255 | }
256 | }
257 |
258 | public class WaitForElapsedLoops : CustomYieldInstruction
259 | {
260 | public override bool keepWaiting { get {
261 | return t.active && t.CompletedLoops() < elapsedLoops;
262 | }}
263 | readonly Tween t;
264 | readonly int elapsedLoops;
265 | public WaitForElapsedLoops(Tween tween, int elapsedLoops)
266 | {
267 | t = tween;
268 | this.elapsedLoops = elapsedLoops;
269 | }
270 | }
271 |
272 | public class WaitForPosition : CustomYieldInstruction
273 | {
274 | public override bool keepWaiting { get {
275 | return t.active && t.position * (t.CompletedLoops() + 1) < position;
276 | }}
277 | readonly Tween t;
278 | readonly float position;
279 | public WaitForPosition(Tween tween, float position)
280 | {
281 | t = tween;
282 | this.position = position;
283 | }
284 | }
285 |
286 | public class WaitForStart : CustomYieldInstruction
287 | {
288 | public override bool keepWaiting { get {
289 | return t.active && !t.playedOnce;
290 | }}
291 | readonly Tween t;
292 | public WaitForStart(Tween tween)
293 | {
294 | t = tween;
295 | }
296 | }
297 | }
298 | #endif
299 | }
300 |
--------------------------------------------------------------------------------
/Assets/Package/Demigiant/DOTween/Modules/DOTweenModuleUnityVersion.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 63c02322328255542995bd02b47b0457
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Package/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/Package/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 7bcaf917d9cf5b84090421a5a2abe42e
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Package/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/Package/Demigiant/DOTween/readme.txt.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: fccfc62abf2eb0a4db614853430894fd
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/Package/Resources.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f93b8bf0760c44ace934906961a2b09a
3 | folderAsset: yes
4 | timeCreated: 1530976898
5 | licenseType: Pro
6 | DefaultImporter:
7 | externalObjects: {}
8 | userData:
9 | assetBundleName:
10 | assetBundleVariant:
11 |
--------------------------------------------------------------------------------
/Assets/Package/Resources/DOTweenSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!114 &11400000
4 | MonoBehaviour:
5 | m_ObjectHideFlags: 0
6 | m_CorrespondingSourceObject: {fileID: 0}
7 | m_PrefabInstance: {fileID: 0}
8 | m_PrefabAsset: {fileID: 0}
9 | m_GameObject: {fileID: 0}
10 | m_Enabled: 1
11 | m_EditorHideFlags: 0
12 | m_Script: {fileID: 16995157, guid: a811bde74b26b53498b4f6d872b09b6d, type: 3}
13 | m_Name: DOTweenSettings
14 | m_EditorClassIdentifier:
15 | useSafeMode: 1
16 | safeModeOptions:
17 | nestedTweenFailureBehaviour: 0
18 | timeScale: 1
19 | useSmoothDeltaTime: 0
20 | maxSmoothUnscaledTime: 0.15
21 | rewindCallbackMode: 0
22 | showUnityEditorReport: 0
23 | logBehaviour: 0
24 | drawGizmos: 1
25 | defaultRecyclable: 0
26 | defaultAutoPlay: 3
27 | defaultUpdateType: 0
28 | defaultTimeScaleIndependent: 0
29 | defaultEaseType: 6
30 | defaultEaseOvershootOrAmplitude: 1.70158
31 | defaultEasePeriod: 0
32 | defaultAutoKill: 1
33 | defaultLoopType: 0
34 | showPreviewPanel: 1
35 | storeSettingsLocation: 0
36 | modules:
37 | showPanel: 0
38 | audioEnabled: 0
39 | physicsEnabled: 0
40 | physics2DEnabled: 0
41 | spriteEnabled: 0
42 | uiEnabled: 1
43 | textMeshProEnabled: 0
44 | tk2DEnabled: 0
45 | showPlayingTweens: 0
46 | showPausedTweens: 0
47 |
--------------------------------------------------------------------------------
/Assets/Package/Resources/DOTweenSettings.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d0bead497c9ce4ac5a9244c076cb14ae
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 11400000
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Package/Samples~/HowToUse.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 60159e14fc20549cb88b5f067981169d
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Package/Samples~/HowToUse/DynamicScrollScene.unity.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 862dbf2be77354c4e81f60f2d1ac8c03
3 | timeCreated: 1526738912
4 | licenseType: Pro
5 | DefaultImporter:
6 | externalObjects: {}
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/Package/Samples~/HowToUse/ExampleData.cs:
--------------------------------------------------------------------------------
1 | namespace example
2 | {
3 | [System.Serializable]
4 | public class ExampleData
5 | {
6 | public int postId;
7 | public int id;
8 | public string name;
9 | public string email;
10 | public string body;
11 |
12 | public bool fake;
13 |
14 | public ExampleData(bool fake)
15 | {
16 | this.fake = fake;
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Assets/Package/Samples~/HowToUse/ExampleData.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 88399190e5aaf4698ae966ac6415c559
3 | timeCreated: 1526735966
4 | licenseType: Pro
5 | MonoImporter:
6 | externalObjects: {}
7 | serializedVersion: 2
8 | defaultReferences: []
9 | executionOrder: 0
10 | icon: {instanceID: 0}
11 | userData:
12 | assetBundleName:
13 | assetBundleVariant:
14 |
--------------------------------------------------------------------------------
/Assets/Package/Samples~/HowToUse/ExampleDynamicObject.cs:
--------------------------------------------------------------------------------
1 | using dynamicscroll;
2 | using UnityEngine;
3 | using UnityEngine.UI;
4 |
5 | namespace example
6 | {
7 | public class ExampleDynamicObject : DynamicScrollObject
8 | {
9 | public override string objectName => "ExampleObject";
10 |
11 | private Image background;
12 | private Text idText;
13 | private Text nameEmailText;
14 | private Text bodyText;
15 | private Text positionText;
16 |
17 | public void Awake()
18 | {
19 | background = GetComponent();
20 | idText = transform.Find("PostId").GetComponent();
21 | nameEmailText = transform.Find("NameEmail").GetComponent();
22 | bodyText = transform.Find("Body").GetComponent();
23 | positionText = transform.Find("Position").GetComponent();
24 | }
25 |
26 | public override void UpdateScrollObject(ExampleData item, int index)
27 | {
28 | base.UpdateScrollObject(item, index);
29 |
30 | background.gameObject.SetActive(!item.fake);
31 | idText.gameObject.SetActive(!item.fake);
32 | nameEmailText.gameObject.SetActive(!item.fake);
33 | bodyText.gameObject.SetActive(!item.fake);
34 | positionText.gameObject.SetActive(!item.fake);
35 |
36 | idText.text = item.id.ToString();
37 | nameEmailText.text = $"{item.name} ({item.email})";
38 | bodyText.text = item.body;
39 | }
40 |
41 | public override void SetPositionInViewport(Vector2 position, Vector2 distanceFromCenter)
42 | {
43 | base.SetPositionInViewport(position, distanceFromCenter);
44 | positionText.text = position.ToString();
45 |
46 | if (IsCentralized)
47 | background.color = Color.white;
48 | else
49 | background.color = Color.Lerp(Color.green, Color.red, Mathf.Clamp01(Mathf.Max(distanceFromCenter.x, distanceFromCenter.y) / 1000f));
50 | }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/Assets/Package/Samples~/HowToUse/ExampleDynamicObject.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 926faa97b5a574ae7b4172f906215fd2
3 | timeCreated: 1526735765
4 | licenseType: Pro
5 | MonoImporter:
6 | externalObjects: {}
7 | serializedVersion: 2
8 | defaultReferences: []
9 | executionOrder: 0
10 | icon: {instanceID: 0}
11 | userData:
12 | assetBundleName:
13 | assetBundleVariant:
14 |
--------------------------------------------------------------------------------
/Assets/Package/Samples~/HowToUse/ExampleObject.prefab:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!1 &1035420038146306
4 | GameObject:
5 | m_ObjectHideFlags: 0
6 | m_CorrespondingSourceObject: {fileID: 0}
7 | m_PrefabInstance: {fileID: 0}
8 | m_PrefabAsset: {fileID: 0}
9 | serializedVersion: 6
10 | m_Component:
11 | - component: {fileID: 224598455554756272}
12 | - component: {fileID: 222129553311233108}
13 | - component: {fileID: 114930382425524664}
14 | m_Layer: 5
15 | m_Name: Body
16 | m_TagString: Untagged
17 | m_Icon: {fileID: 0}
18 | m_NavMeshLayer: 0
19 | m_StaticEditorFlags: 0
20 | m_IsActive: 1
21 | --- !u!224 &224598455554756272
22 | RectTransform:
23 | m_ObjectHideFlags: 0
24 | m_CorrespondingSourceObject: {fileID: 0}
25 | m_PrefabInstance: {fileID: 0}
26 | m_PrefabAsset: {fileID: 0}
27 | m_GameObject: {fileID: 1035420038146306}
28 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
29 | m_LocalPosition: {x: 0, y: 0, z: 0}
30 | m_LocalScale: {x: 1, y: 1, z: 1}
31 | m_Children: []
32 | m_Father: {fileID: 224160872783295448}
33 | m_RootOrder: 2
34 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
35 | m_AnchorMin: {x: 0, y: 0}
36 | m_AnchorMax: {x: 0.89100003, y: 0.53}
37 | m_AnchoredPosition: {x: 0, y: 0}
38 | m_SizeDelta: {x: 0, y: 0}
39 | m_Pivot: {x: 0.5, y: 0.5}
40 | --- !u!222 &222129553311233108
41 | CanvasRenderer:
42 | m_ObjectHideFlags: 0
43 | m_CorrespondingSourceObject: {fileID: 0}
44 | m_PrefabInstance: {fileID: 0}
45 | m_PrefabAsset: {fileID: 0}
46 | m_GameObject: {fileID: 1035420038146306}
47 | m_CullTransparentMesh: 0
48 | --- !u!114 &114930382425524664
49 | MonoBehaviour:
50 | m_ObjectHideFlags: 0
51 | m_CorrespondingSourceObject: {fileID: 0}
52 | m_PrefabInstance: {fileID: 0}
53 | m_PrefabAsset: {fileID: 0}
54 | m_GameObject: {fileID: 1035420038146306}
55 | m_Enabled: 1
56 | m_EditorHideFlags: 0
57 | m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
58 | m_Name:
59 | m_EditorClassIdentifier:
60 | m_Material: {fileID: 0}
61 | m_Color: {r: 0, g: 0, b: 0, a: 1}
62 | m_RaycastTarget: 1
63 | m_OnCullStateChanged:
64 | m_PersistentCalls:
65 | m_Calls: []
66 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
67 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
68 | m_FontData:
69 | m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
70 | m_FontSize: 14
71 | m_FontStyle: 2
72 | m_BestFit: 1
73 | m_MinSize: 10
74 | m_MaxSize: 40
75 | m_Alignment: 1
76 | m_AlignByGeometry: 0
77 | m_RichText: 1
78 | m_HorizontalOverflow: 0
79 | m_VerticalOverflow: 0
80 | m_LineSpacing: 1
81 | m_Text: New Text
82 | --- !u!1 &1071413000746652
83 | GameObject:
84 | m_ObjectHideFlags: 0
85 | m_CorrespondingSourceObject: {fileID: 0}
86 | m_PrefabInstance: {fileID: 0}
87 | m_PrefabAsset: {fileID: 0}
88 | serializedVersion: 6
89 | m_Component:
90 | - component: {fileID: 224160872783295448}
91 | - component: {fileID: 222105170160322944}
92 | - component: {fileID: 114663863510815856}
93 | m_Layer: 5
94 | m_Name: ExampleObject
95 | m_TagString: Untagged
96 | m_Icon: {fileID: 0}
97 | m_NavMeshLayer: 0
98 | m_StaticEditorFlags: 0
99 | m_IsActive: 1
100 | --- !u!224 &224160872783295448
101 | RectTransform:
102 | m_ObjectHideFlags: 0
103 | m_CorrespondingSourceObject: {fileID: 0}
104 | m_PrefabInstance: {fileID: 0}
105 | m_PrefabAsset: {fileID: 0}
106 | m_GameObject: {fileID: 1071413000746652}
107 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
108 | m_LocalPosition: {x: 0, y: 0, z: 0}
109 | m_LocalScale: {x: 1, y: 1, z: 1}
110 | m_Children:
111 | - {fileID: 224367270219441932}
112 | - {fileID: 224097879898709678}
113 | - {fileID: 224598455554756272}
114 | - {fileID: 224010535245120874}
115 | - {fileID: 3749306795765850029}
116 | m_Father: {fileID: 0}
117 | m_RootOrder: 0
118 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
119 | m_AnchorMin: {x: 0, y: 1}
120 | m_AnchorMax: {x: 0, y: 1}
121 | m_AnchoredPosition: {x: 0, y: 0}
122 | m_SizeDelta: {x: 330, y: 100}
123 | m_Pivot: {x: 0, y: 1}
124 | --- !u!222 &222105170160322944
125 | CanvasRenderer:
126 | m_ObjectHideFlags: 0
127 | m_CorrespondingSourceObject: {fileID: 0}
128 | m_PrefabInstance: {fileID: 0}
129 | m_PrefabAsset: {fileID: 0}
130 | m_GameObject: {fileID: 1071413000746652}
131 | m_CullTransparentMesh: 0
132 | --- !u!114 &114663863510815856
133 | MonoBehaviour:
134 | m_ObjectHideFlags: 0
135 | m_CorrespondingSourceObject: {fileID: 0}
136 | m_PrefabInstance: {fileID: 0}
137 | m_PrefabAsset: {fileID: 0}
138 | m_GameObject: {fileID: 1071413000746652}
139 | m_Enabled: 1
140 | m_EditorHideFlags: 0
141 | m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
142 | m_Name:
143 | m_EditorClassIdentifier:
144 | m_Material: {fileID: 0}
145 | m_Color: {r: 1, g: 1, b: 1, a: 1}
146 | m_RaycastTarget: 1
147 | m_OnCullStateChanged:
148 | m_PersistentCalls:
149 | m_Calls: []
150 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
151 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
152 | m_Sprite: {fileID: 0}
153 | m_Type: 0
154 | m_PreserveAspect: 0
155 | m_FillCenter: 1
156 | m_FillMethod: 4
157 | m_FillAmount: 1
158 | m_FillClockwise: 1
159 | m_FillOrigin: 0
160 | m_UseSpriteMesh: 0
161 | --- !u!1 &1488438940785088
162 | GameObject:
163 | m_ObjectHideFlags: 0
164 | m_CorrespondingSourceObject: {fileID: 0}
165 | m_PrefabInstance: {fileID: 0}
166 | m_PrefabAsset: {fileID: 0}
167 | serializedVersion: 6
168 | m_Component:
169 | - component: {fileID: 224010535245120874}
170 | - component: {fileID: 222500172355218160}
171 | - component: {fileID: 114099213283322324}
172 | m_Layer: 5
173 | m_Name: Image
174 | m_TagString: Untagged
175 | m_Icon: {fileID: 0}
176 | m_NavMeshLayer: 0
177 | m_StaticEditorFlags: 0
178 | m_IsActive: 1
179 | --- !u!224 &224010535245120874
180 | RectTransform:
181 | m_ObjectHideFlags: 0
182 | m_CorrespondingSourceObject: {fileID: 0}
183 | m_PrefabInstance: {fileID: 0}
184 | m_PrefabAsset: {fileID: 0}
185 | m_GameObject: {fileID: 1488438940785088}
186 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
187 | m_LocalPosition: {x: 0, y: 0, z: 0}
188 | m_LocalScale: {x: 1, y: 1, z: 1}
189 | m_Children: []
190 | m_Father: {fileID: 224160872783295448}
191 | m_RootOrder: 3
192 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
193 | m_AnchorMin: {x: 0, y: 0.5}
194 | m_AnchorMax: {x: 1, y: 0.5}
195 | m_AnchoredPosition: {x: 0, y: 5.13}
196 | m_SizeDelta: {x: 0, y: 2}
197 | m_Pivot: {x: 0.5, y: 0.5}
198 | --- !u!222 &222500172355218160
199 | CanvasRenderer:
200 | m_ObjectHideFlags: 0
201 | m_CorrespondingSourceObject: {fileID: 0}
202 | m_PrefabInstance: {fileID: 0}
203 | m_PrefabAsset: {fileID: 0}
204 | m_GameObject: {fileID: 1488438940785088}
205 | m_CullTransparentMesh: 0
206 | --- !u!114 &114099213283322324
207 | MonoBehaviour:
208 | m_ObjectHideFlags: 0
209 | m_CorrespondingSourceObject: {fileID: 0}
210 | m_PrefabInstance: {fileID: 0}
211 | m_PrefabAsset: {fileID: 0}
212 | m_GameObject: {fileID: 1488438940785088}
213 | m_Enabled: 1
214 | m_EditorHideFlags: 0
215 | m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
216 | m_Name:
217 | m_EditorClassIdentifier:
218 | m_Material: {fileID: 0}
219 | m_Color: {r: 0, g: 0, b: 0, a: 0.203}
220 | m_RaycastTarget: 1
221 | m_OnCullStateChanged:
222 | m_PersistentCalls:
223 | m_Calls: []
224 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
225 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
226 | m_Sprite: {fileID: 0}
227 | m_Type: 0
228 | m_PreserveAspect: 0
229 | m_FillCenter: 1
230 | m_FillMethod: 4
231 | m_FillAmount: 1
232 | m_FillClockwise: 1
233 | m_FillOrigin: 0
234 | m_UseSpriteMesh: 0
235 | --- !u!1 &1600269140053624
236 | GameObject:
237 | m_ObjectHideFlags: 0
238 | m_CorrespondingSourceObject: {fileID: 0}
239 | m_PrefabInstance: {fileID: 0}
240 | m_PrefabAsset: {fileID: 0}
241 | serializedVersion: 6
242 | m_Component:
243 | - component: {fileID: 224367270219441932}
244 | - component: {fileID: 222296114578165220}
245 | - component: {fileID: 114772967228215230}
246 | m_Layer: 5
247 | m_Name: PostId
248 | m_TagString: Untagged
249 | m_Icon: {fileID: 0}
250 | m_NavMeshLayer: 0
251 | m_StaticEditorFlags: 0
252 | m_IsActive: 1
253 | --- !u!224 &224367270219441932
254 | RectTransform:
255 | m_ObjectHideFlags: 0
256 | m_CorrespondingSourceObject: {fileID: 0}
257 | m_PrefabInstance: {fileID: 0}
258 | m_PrefabAsset: {fileID: 0}
259 | m_GameObject: {fileID: 1600269140053624}
260 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
261 | m_LocalPosition: {x: 0, y: 0, z: 0}
262 | m_LocalScale: {x: 1, y: 1, z: 1}
263 | m_Children: []
264 | m_Father: {fileID: 224160872783295448}
265 | m_RootOrder: 0
266 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
267 | m_AnchorMin: {x: 0, y: 0.8}
268 | m_AnchorMax: {x: 1, y: 1}
269 | m_AnchoredPosition: {x: 10, y: 0}
270 | m_SizeDelta: {x: -10, y: 0}
271 | m_Pivot: {x: 0, y: 1}
272 | --- !u!222 &222296114578165220
273 | CanvasRenderer:
274 | m_ObjectHideFlags: 0
275 | m_CorrespondingSourceObject: {fileID: 0}
276 | m_PrefabInstance: {fileID: 0}
277 | m_PrefabAsset: {fileID: 0}
278 | m_GameObject: {fileID: 1600269140053624}
279 | m_CullTransparentMesh: 0
280 | --- !u!114 &114772967228215230
281 | MonoBehaviour:
282 | m_ObjectHideFlags: 0
283 | m_CorrespondingSourceObject: {fileID: 0}
284 | m_PrefabInstance: {fileID: 0}
285 | m_PrefabAsset: {fileID: 0}
286 | m_GameObject: {fileID: 1600269140053624}
287 | m_Enabled: 1
288 | m_EditorHideFlags: 0
289 | m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
290 | m_Name:
291 | m_EditorClassIdentifier:
292 | m_Material: {fileID: 0}
293 | m_Color: {r: 0, g: 0, b: 0, a: 1}
294 | m_RaycastTarget: 0
295 | m_OnCullStateChanged:
296 | m_PersistentCalls:
297 | m_Calls: []
298 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
299 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
300 | m_FontData:
301 | m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
302 | m_FontSize: 14
303 | m_FontStyle: 0
304 | m_BestFit: 0
305 | m_MinSize: 10
306 | m_MaxSize: 40
307 | m_Alignment: 3
308 | m_AlignByGeometry: 1
309 | m_RichText: 0
310 | m_HorizontalOverflow: 0
311 | m_VerticalOverflow: 0
312 | m_LineSpacing: 1
313 | m_Text: 'Post Id: 1'
314 | --- !u!1 &1664755825594956
315 | GameObject:
316 | m_ObjectHideFlags: 0
317 | m_CorrespondingSourceObject: {fileID: 0}
318 | m_PrefabInstance: {fileID: 0}
319 | m_PrefabAsset: {fileID: 0}
320 | serializedVersion: 6
321 | m_Component:
322 | - component: {fileID: 224097879898709678}
323 | - component: {fileID: 222354433328536168}
324 | - component: {fileID: 114136235205940256}
325 | m_Layer: 5
326 | m_Name: NameEmail
327 | m_TagString: Untagged
328 | m_Icon: {fileID: 0}
329 | m_NavMeshLayer: 0
330 | m_StaticEditorFlags: 0
331 | m_IsActive: 1
332 | --- !u!224 &224097879898709678
333 | RectTransform:
334 | m_ObjectHideFlags: 0
335 | m_CorrespondingSourceObject: {fileID: 0}
336 | m_PrefabInstance: {fileID: 0}
337 | m_PrefabAsset: {fileID: 0}
338 | m_GameObject: {fileID: 1664755825594956}
339 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
340 | m_LocalPosition: {x: 0, y: 0, z: 0}
341 | m_LocalScale: {x: 1, y: 1, z: 1}
342 | m_Children: []
343 | m_Father: {fileID: 224160872783295448}
344 | m_RootOrder: 1
345 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
346 | m_AnchorMin: {x: 0, y: 0.57000005}
347 | m_AnchorMax: {x: 1, y: 0.8}
348 | m_AnchoredPosition: {x: 10, y: 0}
349 | m_SizeDelta: {x: -20, y: 0}
350 | m_Pivot: {x: 0, y: 1}
351 | --- !u!222 &222354433328536168
352 | CanvasRenderer:
353 | m_ObjectHideFlags: 0
354 | m_CorrespondingSourceObject: {fileID: 0}
355 | m_PrefabInstance: {fileID: 0}
356 | m_PrefabAsset: {fileID: 0}
357 | m_GameObject: {fileID: 1664755825594956}
358 | m_CullTransparentMesh: 0
359 | --- !u!114 &114136235205940256
360 | MonoBehaviour:
361 | m_ObjectHideFlags: 0
362 | m_CorrespondingSourceObject: {fileID: 0}
363 | m_PrefabInstance: {fileID: 0}
364 | m_PrefabAsset: {fileID: 0}
365 | m_GameObject: {fileID: 1664755825594956}
366 | m_Enabled: 1
367 | m_EditorHideFlags: 0
368 | m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
369 | m_Name:
370 | m_EditorClassIdentifier:
371 | m_Material: {fileID: 0}
372 | m_Color: {r: 0, g: 0, b: 0, a: 1}
373 | m_RaycastTarget: 0
374 | m_OnCullStateChanged:
375 | m_PersistentCalls:
376 | m_Calls: []
377 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
378 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
379 | m_FontData:
380 | m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
381 | m_FontSize: 14
382 | m_FontStyle: 1
383 | m_BestFit: 1
384 | m_MinSize: 10
385 | m_MaxSize: 40
386 | m_Alignment: 3
387 | m_AlignByGeometry: 1
388 | m_RichText: 1
389 | m_HorizontalOverflow: 0
390 | m_VerticalOverflow: 0
391 | m_LineSpacing: 1
392 | m_Text: sdas
393 | --- !u!1 &1976114528661958460
394 | GameObject:
395 | m_ObjectHideFlags: 0
396 | m_CorrespondingSourceObject: {fileID: 0}
397 | m_PrefabInstance: {fileID: 0}
398 | m_PrefabAsset: {fileID: 0}
399 | serializedVersion: 6
400 | m_Component:
401 | - component: {fileID: 3749306795765850029}
402 | - component: {fileID: 8974046195138079829}
403 | - component: {fileID: 4534683910325577530}
404 | m_Layer: 5
405 | m_Name: Position
406 | m_TagString: Untagged
407 | m_Icon: {fileID: 0}
408 | m_NavMeshLayer: 0
409 | m_StaticEditorFlags: 0
410 | m_IsActive: 1
411 | --- !u!224 &3749306795765850029
412 | RectTransform:
413 | m_ObjectHideFlags: 0
414 | m_CorrespondingSourceObject: {fileID: 0}
415 | m_PrefabInstance: {fileID: 0}
416 | m_PrefabAsset: {fileID: 0}
417 | m_GameObject: {fileID: 1976114528661958460}
418 | m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068}
419 | m_LocalPosition: {x: 0, y: 0, z: 0}
420 | m_LocalScale: {x: 1, y: 1, z: 1}
421 | m_Children: []
422 | m_Father: {fileID: 224160872783295448}
423 | m_RootOrder: 4
424 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90}
425 | m_AnchorMin: {x: 0.89100003, y: 0}
426 | m_AnchorMax: {x: 1, y: 0.57000005}
427 | m_AnchoredPosition: {x: -17.985016, y: -29.935997}
428 | m_SizeDelta: {x: 18.16, y: -21.029999}
429 | m_Pivot: {x: 0.5, y: 1}
430 | --- !u!222 &8974046195138079829
431 | CanvasRenderer:
432 | m_ObjectHideFlags: 0
433 | m_CorrespondingSourceObject: {fileID: 0}
434 | m_PrefabInstance: {fileID: 0}
435 | m_PrefabAsset: {fileID: 0}
436 | m_GameObject: {fileID: 1976114528661958460}
437 | m_CullTransparentMesh: 0
438 | --- !u!114 &4534683910325577530
439 | MonoBehaviour:
440 | m_ObjectHideFlags: 0
441 | m_CorrespondingSourceObject: {fileID: 0}
442 | m_PrefabInstance: {fileID: 0}
443 | m_PrefabAsset: {fileID: 0}
444 | m_GameObject: {fileID: 1976114528661958460}
445 | m_Enabled: 1
446 | m_EditorHideFlags: 0
447 | m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
448 | m_Name:
449 | m_EditorClassIdentifier:
450 | m_Material: {fileID: 0}
451 | m_Color: {r: 0, g: 0, b: 0, a: 1}
452 | m_RaycastTarget: 1
453 | m_OnCullStateChanged:
454 | m_PersistentCalls:
455 | m_Calls: []
456 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
457 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
458 | m_FontData:
459 | m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
460 | m_FontSize: 14
461 | m_FontStyle: 2
462 | m_BestFit: 1
463 | m_MinSize: 10
464 | m_MaxSize: 40
465 | m_Alignment: 1
466 | m_AlignByGeometry: 0
467 | m_RichText: 1
468 | m_HorizontalOverflow: 0
469 | m_VerticalOverflow: 0
470 | m_LineSpacing: 1
471 | m_Text: New Text
472 |
--------------------------------------------------------------------------------
/Assets/Package/Samples~/HowToUse/ExampleObject.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 3a80a1cdcf7fa4d5f94d375a5ea195de
3 | timeCreated: 1526737851
4 | licenseType: Pro
5 | NativeFormatImporter:
6 | externalObjects: {}
7 | mainObjectFileID: 100100000
8 | userData:
9 | assetBundleName:
10 | assetBundleVariant:
11 |
--------------------------------------------------------------------------------
/Assets/Package/Samples~/HowToUse/ExampleScroll.cs:
--------------------------------------------------------------------------------
1 | using System.Collections;
2 | using UnityEngine;
3 | using dynamicscroll;
4 |
5 | namespace example
6 | {
7 | public class ExampleScroll : MonoBehaviour
8 | {
9 | public DynamicScrollRect verticalScroll;
10 | public DynamicScrollRect horizontalScroll;
11 | public GameObject referenceObject;
12 |
13 | private ExampleData[] mData;
14 |
15 | private DynamicScroll mVerticalDynamicScroll = new DynamicScroll();
16 | private DynamicScroll mHorizontalDynamicScroll = new DynamicScroll();
17 |
18 | public IEnumerator Start()
19 | {
20 | WWW www = new WWW(@"https://jsonplaceholder.typicode.com/comments");
21 | yield return www;
22 | mData = JsonHelper.getJsonArray(www.text);
23 |
24 | mHorizontalDynamicScroll.spacing = 5f;
25 | mHorizontalDynamicScroll.Initiate(horizontalScroll, mData, 0, referenceObject);
26 |
27 | mVerticalDynamicScroll.spacing = 5f;
28 | mVerticalDynamicScroll.centralizeOnStop = true;
29 | mVerticalDynamicScroll.Initiate(verticalScroll, mData, 0, referenceObject);
30 |
31 | Debug.Log("Example Horizontal Data : " + mHorizontalDynamicScroll.RawDataList.Count);
32 | Debug.Log("Example Vertical Data : " + mVerticalDynamicScroll.RawDataList.Count);
33 | }
34 |
35 | public void Update()
36 | {
37 | if (Input.GetKeyDown(KeyCode.Alpha1)) Move(1);
38 | if (Input.GetKeyDown(KeyCode.Alpha2)) Move(2);
39 | if (Input.GetKeyDown(KeyCode.Alpha3)) Move(3);
40 | if (Input.GetKeyDown(KeyCode.Alpha4)) Move(4);
41 | if (Input.GetKeyDown(KeyCode.Alpha5)) Move(5);
42 | if (Input.GetKeyDown(KeyCode.Alpha6)) Move(6);
43 | if (Input.GetKeyDown(KeyCode.Alpha7)) Move(7);
44 | if (Input.GetKeyDown(KeyCode.Alpha8)) Move(8);
45 | if (Input.GetKeyDown(KeyCode.Alpha9)) Move(9);
46 |
47 | if (Input.GetKeyDown(KeyCode.Alpha0)) Move(300);
48 | }
49 |
50 | private void Move(int index)
51 | {
52 | mVerticalDynamicScroll.MoveToIndex(index, 2f);
53 | mHorizontalDynamicScroll.MoveToIndex(index, 2f);
54 | }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/Assets/Package/Samples~/HowToUse/ExampleScroll.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 7a4d2141341c9488db266266a5d214c4
3 | timeCreated: 1526735569
4 | licenseType: Pro
5 | MonoImporter:
6 | externalObjects: {}
7 | serializedVersion: 2
8 | defaultReferences: []
9 | executionOrder: 0
10 | icon: {instanceID: 0}
11 | userData:
12 | assetBundleName:
13 | assetBundleVariant:
14 |
--------------------------------------------------------------------------------
/Assets/Package/Scripts.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 9a117b0929a4f4cab9ec89ffd21f82a4
3 | folderAsset: yes
4 | timeCreated: 1526734709
5 | licenseType: Pro
6 | DefaultImporter:
7 | externalObjects: {}
8 | userData:
9 | assetBundleName:
10 | assetBundleVariant:
11 |
--------------------------------------------------------------------------------
/Assets/Package/Scripts/DynamicScroll.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 04ceaa4c5a5d64c75be8ead41799873d
3 | timeCreated: 1526734709
4 | licenseType: Pro
5 | MonoImporter:
6 | externalObjects: {}
7 | serializedVersion: 2
8 | defaultReferences: []
9 | executionOrder: 0
10 | icon: {instanceID: 0}
11 | userData:
12 | assetBundleName:
13 | assetBundleVariant:
14 |
--------------------------------------------------------------------------------
/Assets/Package/Scripts/DynamicScrollObject.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using pooling;
3 | using UnityEngine;
4 |
5 | namespace dynamicscroll
6 | {
7 | //OBJECT ANCHOR MUST BE MID MID
8 | public abstract class DynamicScrollObject : PoolingObject, IScrollItem, IComparable
9 | {
10 | protected Action refreshListAction;
11 | protected RectTransform rectTransform;
12 |
13 | public virtual float CurrentHeight
14 | {
15 | get => RectTransform.sizeDelta.y;
16 | set => RectTransform.sizeDelta = new Vector2(RectTransform.sizeDelta.x, value);
17 | }
18 |
19 | public virtual float CurrentWidth
20 | {
21 | get => RectTransform.sizeDelta.x;
22 | set => RectTransform.sizeDelta = new Vector2(value, RectTransform.sizeDelta.y);
23 | }
24 |
25 | public virtual int CurrentIndex { get; set; }
26 | public bool IsCentralized { get; private set; }
27 | public Vector2 PositionInViewport { get; private set; }
28 | public Vector2 DistanceFromCenter { get; private set; }
29 |
30 | public RectTransform RectTransform
31 | {
32 | get
33 | {
34 | if (rectTransform == null) rectTransform = GetComponent();
35 | return rectTransform;
36 | }
37 | }
38 |
39 | public virtual void Reset() { }
40 |
41 | public virtual void UpdateScrollObject(T item, int index)
42 | {
43 | CurrentIndex = index;
44 | OnObjectIsNotCentralized();
45 | }
46 |
47 | public virtual void SetRefreshListAction(Action action)
48 | {
49 | refreshListAction = action;
50 | }
51 |
52 | public virtual void SetPositionInViewport(Vector2 position, Vector2 distanceFromCenter)
53 | {
54 | PositionInViewport = position;
55 | DistanceFromCenter = distanceFromCenter;
56 | }
57 |
58 | public virtual void OnObjectIsCentralized()
59 | {
60 | IsCentralized = true;
61 | }
62 |
63 | public virtual void OnObjectIsNotCentralized()
64 | {
65 | IsCentralized = false;
66 | }
67 |
68 | public int CompareTo(object obj)
69 | {
70 | if (obj is DynamicScrollObject scrollObject)
71 | return CurrentIndex.CompareTo(scrollObject.CurrentIndex);
72 |
73 | return -1;
74 | }
75 | }
76 | }
--------------------------------------------------------------------------------
/Assets/Package/Scripts/DynamicScrollObject.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b5d5c0c805e014765806bb1c27fa5ba0
3 | timeCreated: 1526734709
4 | licenseType: Pro
5 | MonoImporter:
6 | externalObjects: {}
7 | serializedVersion: 2
8 | defaultReferences: []
9 | executionOrder: 0
10 | icon: {instanceID: 0}
11 | userData:
12 | assetBundleName:
13 | assetBundleVariant:
14 |
--------------------------------------------------------------------------------
/Assets/Package/Scripts/DynamicScrollRect.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using UnityEngine.Events;
3 | using UnityEngine.EventSystems;
4 | using UnityEngine.UI;
5 |
6 | namespace dynamicscroll
7 | {
8 | public class DynamicScrollRectEvent : UnityEvent { }
9 | public class DynamicScrollRect : ScrollRect
10 | {
11 | public DynamicScrollRectEvent onEndDrag = new DynamicScrollRectEvent();
12 | public DynamicScrollRectEvent onBeginDrag = new DynamicScrollRectEvent();
13 | public DynamicScrollRectEvent onStopMoving = new DynamicScrollRectEvent();
14 |
15 | public MovementType realMovementType;
16 | public bool needElasticReturn;
17 | public Vector2 clampedPosition;
18 |
19 | private bool dragging = false;
20 | private bool isWaitingToStop = false;
21 | private Vector2 pointerStartLocalCursor = Vector2.zero;
22 |
23 | protected override void Awake()
24 | {
25 | base.Awake();
26 |
27 | if (viewport == null)
28 | viewport = transform.Find("Viewport").GetComponent();
29 |
30 | if (content == null)
31 | content = viewport.Find("Content").GetComponent();
32 | }
33 |
34 | public override void OnBeginDrag(PointerEventData eventData)
35 | {
36 | onBeginDrag?.Invoke(eventData);
37 |
38 | if (realMovementType != MovementType.Elastic)
39 | {
40 | base.OnBeginDrag(eventData);
41 | return;
42 | }
43 |
44 | dragging = true;
45 |
46 | if (eventData.button != PointerEventData.InputButton.Left)
47 | return;
48 |
49 | if (!IsActive())
50 | return;
51 |
52 | UpdateBounds();
53 |
54 | pointerStartLocalCursor = Vector2.zero;
55 | RectTransformUtility.ScreenPointToLocalPointInRectangle(viewRect, eventData.position, eventData.pressEventCamera, out pointerStartLocalCursor);
56 | m_ContentStartPosition = content.anchoredPosition;
57 |
58 | base.OnBeginDrag(eventData);
59 | }
60 |
61 | public override void OnEndDrag(PointerEventData eventData)
62 | {
63 | isWaitingToStop = true;
64 | dragging = false;
65 | base.OnEndDrag(eventData);
66 | onEndDrag?.Invoke(eventData);
67 | }
68 |
69 | public override void OnDrag(PointerEventData eventData)
70 | {
71 | if (realMovementType != MovementType.Elastic)
72 | {
73 | base.OnDrag(eventData);
74 | return;
75 | }
76 |
77 | if (eventData.button != PointerEventData.InputButton.Left)
78 | return;
79 |
80 | if (!IsActive())
81 | return;
82 |
83 | if (!RectTransformUtility.ScreenPointToLocalPointInRectangle(viewRect, eventData.position, eventData.pressEventCamera, out var localCursor))
84 | return;
85 |
86 | UpdateBounds();
87 |
88 | var pointerDelta = localCursor - pointerStartLocalCursor;
89 | var position = m_ContentStartPosition + pointerDelta;
90 |
91 | var offset = CalculateOffset(position - content.anchoredPosition);
92 | position += offset;
93 | var viewBounds = new Bounds(viewRect.rect.center, viewRect.rect.size);
94 |
95 | if (needElasticReturn)
96 | {
97 | if (offset.x != 0)
98 | position.x = position.x - RubberDelta(offset.x, viewBounds.size.x);
99 | if (offset.y != 0)
100 | position.y = position.y - RubberDelta(offset.y, viewBounds.size.y);
101 | }
102 |
103 | SetContentAnchoredPosition(position);
104 | }
105 |
106 | private float RubberDelta(float overStretching, float viewSize)
107 | {
108 | return (1 - (1 / ((Mathf.Abs(overStretching) * 0.55f / viewSize) + 1))) * viewSize * Mathf.Sign(overStretching);
109 | }
110 |
111 | protected override void LateUpdate()
112 | {
113 | if (isWaitingToStop && velocity.magnitude < 0.01f)
114 | {
115 | OnMovementStop();
116 | isWaitingToStop = false;
117 | }
118 |
119 | if (realMovementType != MovementType.Elastic)
120 | {
121 | base.LateUpdate();
122 | return;
123 | }
124 |
125 | if (!content)
126 | return;
127 |
128 | EnsureLayoutHasRebuilt();
129 | UpdateBounds();
130 | var deltaTime = Time.unscaledDeltaTime;
131 | var offset = CalculateOffset(Vector2.zero);
132 | if (!dragging && (offset != Vector2.zero || velocity != Vector2.zero))
133 | {
134 | var position = content.anchoredPosition;
135 | var vel = velocity;
136 |
137 | for (var axis = 0; axis < 2; axis++)
138 | {
139 | if (offset[axis] != 0)
140 | {
141 | var speed = velocity[axis];
142 | position[axis] = Mathf.SmoothDamp(content.anchoredPosition[axis], content.anchoredPosition[axis] + offset[axis], ref speed, elasticity, Mathf.Infinity, deltaTime);
143 | if (Mathf.Abs(speed) < 1)
144 | speed = 0;
145 | vel[axis] = speed;
146 | }
147 | else if (inertia)
148 | {
149 | vel[axis] *= Mathf.Pow(decelerationRate, deltaTime);
150 | if (Mathf.Abs(velocity[axis]) < 1)
151 | vel[axis] = 0;
152 | position[axis] += velocity[axis] * deltaTime;
153 | }
154 | else
155 | {
156 | vel[axis] = 0;
157 | }
158 | }
159 |
160 | velocity = vel;
161 |
162 | SetContentAnchoredPosition(position);
163 | }
164 |
165 | base.LateUpdate();
166 | }
167 |
168 | private void OnMovementStop()
169 | {
170 | isWaitingToStop = false;
171 | onStopMoving?.Invoke(null);
172 | }
173 |
174 | private void EnsureLayoutHasRebuilt()
175 | {
176 | if (!CanvasUpdateRegistry.IsRebuildingLayout())
177 | Canvas.ForceUpdateCanvases();
178 | }
179 |
180 | private Vector2 CalculateOffset(Vector2 delta)
181 | {
182 | var mViewBounds = new Bounds(viewRect.rect.center, viewRect.rect.size);
183 | return InternalCalculateOffset(ref mViewBounds, ref delta);
184 | }
185 |
186 | internal Vector2 InternalCalculateOffset(ref Bounds viewBounds, ref Vector2 delta)
187 | {
188 | var offset = Vector2.zero;
189 | if (!needElasticReturn)
190 | return offset;
191 |
192 | var min = new Vector2(content.anchoredPosition.x - content.rect.width / 2, (content.anchoredPosition.y - clampedPosition.y) - content.rect.height / 2);
193 | var max = new Vector2((content.anchoredPosition.x - clampedPosition.x) + content.rect.width / 2, content.anchoredPosition.y + content.rect.height / 2);
194 |
195 | if (horizontal)
196 | {
197 | min.x += delta.x;
198 | max.x += delta.x;
199 | if (min.x > viewBounds.min.x)
200 | offset.x = viewBounds.min.x - min.x;
201 | else if (max.x < viewBounds.max.x)
202 | offset.x = viewBounds.max.x - max.x;
203 | }
204 |
205 | if (vertical)
206 | {
207 | min.y += delta.y;
208 | max.y += delta.y;
209 |
210 | if (max.y < viewBounds.max.y)
211 | offset.y = viewBounds.max.y - max.y;
212 | else if (min.y > viewBounds.min.y)
213 | offset.y = viewBounds.min.y - min.y;
214 | }
215 |
216 | return offset;
217 | }
218 | }
219 | }
--------------------------------------------------------------------------------
/Assets/Package/Scripts/DynamicScrollRect.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4b58cf81a900d4afe8b67215639eacb4
3 | timeCreated: 1530976121
4 | licenseType: Pro
5 | MonoImporter:
6 | externalObjects: {}
7 | serializedVersion: 2
8 | defaultReferences: []
9 | executionOrder: 0
10 | icon: {instanceID: 0}
11 | userData:
12 | assetBundleName:
13 | assetBundleVariant:
14 |
--------------------------------------------------------------------------------
/Assets/Package/Scripts/IScrollItem.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 |
3 | namespace dynamicscroll
4 | {
5 | public interface IScrollItem
6 | {
7 | void Reset();
8 | int CurrentIndex { get; set; }
9 | RectTransform RectTransform { get; }
10 | }
11 | }
--------------------------------------------------------------------------------
/Assets/Package/Scripts/IScrollItem.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: dbd7479258caa47dfbb5a5939941a561
3 | timeCreated: 1526734709
4 | licenseType: Pro
5 | MonoImporter:
6 | externalObjects: {}
7 | serializedVersion: 2
8 | defaultReferences: []
9 | executionOrder: 0
10 | icon: {instanceID: 0}
11 | userData:
12 | assetBundleName:
13 | assetBundleVariant:
14 |
--------------------------------------------------------------------------------
/Assets/Package/Scripts/Pooling.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: cc7337fba9f77457a85eba7d31d30f04
3 | folderAsset: yes
4 | timeCreated: 1526769722
5 | licenseType: Pro
6 | DefaultImporter:
7 | externalObjects: {}
8 | userData:
9 | assetBundleName:
10 | assetBundleVariant:
11 |
--------------------------------------------------------------------------------
/Assets/Package/Scripts/Pooling/IPooling.cs:
--------------------------------------------------------------------------------
1 | namespace pooling
2 | {
3 | public interface IPooling
4 | {
5 | string objectName { get; }
6 | bool isUsing { get; set; }
7 | void OnCollect();
8 | void OnRelease();
9 | }
10 | }
--------------------------------------------------------------------------------
/Assets/Package/Scripts/Pooling/IPooling.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b679bcb20289247508c06d935e60ad4b
3 | timeCreated: 1526734907
4 | licenseType: Pro
5 | MonoImporter:
6 | externalObjects: {}
7 | serializedVersion: 2
8 | defaultReferences: []
9 | executionOrder: 0
10 | icon: {instanceID: 0}
11 | userData:
12 | assetBundleName:
13 | assetBundleVariant:
14 |
--------------------------------------------------------------------------------
/Assets/Package/Scripts/Pooling/Pooling.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using UnityEngine;
3 |
4 | namespace pooling
5 | {
6 | public class Pooling : List where T : MonoBehaviour, IPooling
7 | {
8 | public bool createMoreIfNeeded = true;
9 |
10 | private Transform mParent;
11 | private Vector3 mStartPos;
12 | private GameObject referenceObject;
13 |
14 | public delegate void ObjectCreationCallback(T obj);
15 | public event ObjectCreationCallback OnObjectCreationCallBack;
16 |
17 | public Pooling Initialize(GameObject refObject, Transform parent)
18 | {
19 | return Initialize(0, refObject, parent);
20 | }
21 |
22 | public Pooling Initialize(int amount, GameObject refObject, Transform parent, bool startState = false)
23 | {
24 | return Initialize(amount, refObject, parent, Vector3.zero, startState);
25 | }
26 |
27 | public Pooling Initialize(int amount, GameObject refObject, Transform parent, Vector3 worldPos, bool startState = false)
28 | {
29 | mParent = parent;
30 | mStartPos = worldPos;
31 | referenceObject = refObject;
32 |
33 | Clear();
34 |
35 | for (var i = 0; i < amount; i++)
36 | {
37 | var obj = CreateObject();
38 |
39 | if(startState) obj.OnCollect();
40 | else obj.OnRelease();
41 |
42 | Add(obj);
43 | }
44 |
45 | return this;
46 | }
47 |
48 | public T Collect(Transform parent = null, Vector3? position = null, bool localPosition = true)
49 | {
50 | var obj = Find(x => x.isUsing == false);
51 | if (obj == null && createMoreIfNeeded)
52 | {
53 | obj = CreateObject(parent, position);
54 | Add(obj);
55 | }
56 |
57 | if (obj == null) return obj;
58 |
59 | obj.transform.SetParent(parent ?? mParent);
60 | if (localPosition)
61 | obj.transform.localPosition = position ?? mStartPos;
62 | else
63 | obj.transform.position = position ?? mStartPos;
64 | obj.OnCollect();
65 |
66 | return obj;
67 | }
68 |
69 | public void Release(T obj)
70 | {
71 | if(obj != null)
72 | obj.OnRelease();
73 | }
74 |
75 | public List GetAllWithState(bool active)
76 | {
77 | return FindAll(x => x.isUsing == active);
78 | }
79 |
80 | private T CreateObject(Transform parent = null, Vector3? position = null)
81 | {
82 | var go = GameObject.Instantiate(referenceObject, position ?? mStartPos, Quaternion.identity, parent ?? mParent);
83 | var obj = go.GetComponent() ?? go.AddComponent();
84 | obj.transform.localPosition = position ?? mStartPos;
85 | obj.name = obj.objectName + Count;
86 |
87 | if(OnObjectCreationCallBack != null)
88 | OnObjectCreationCallBack.Invoke(obj);
89 |
90 | return obj;
91 | }
92 | }
93 | }
--------------------------------------------------------------------------------
/Assets/Package/Scripts/Pooling/Pooling.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 6f34632602a2e40d8a861fb488dc2450
3 | timeCreated: 1526734907
4 | licenseType: Pro
5 | MonoImporter:
6 | externalObjects: {}
7 | serializedVersion: 2
8 | defaultReferences: []
9 | executionOrder: 0
10 | icon: {instanceID: 0}
11 | userData:
12 | assetBundleName:
13 | assetBundleVariant:
14 |
--------------------------------------------------------------------------------
/Assets/Package/Scripts/Pooling/PoolingObject.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 |
3 | namespace pooling
4 | {
5 | public abstract class PoolingObject : MonoBehaviour, IPooling
6 | {
7 | public virtual string objectName{ get { return ""; } }
8 | public bool isUsing { get; set; }
9 |
10 | public virtual void OnCollect()
11 | {
12 | isUsing = true;
13 | gameObject.SetActive(true);
14 | }
15 |
16 | public virtual void OnRelease()
17 | {
18 | isUsing = false;
19 | gameObject.SetActive(false);
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/Assets/Package/Scripts/Pooling/PoolingObject.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e88262557cbee4913a53e0bf96e79000
3 | timeCreated: 1526734907
4 | licenseType: Pro
5 | MonoImporter:
6 | externalObjects: {}
7 | serializedVersion: 2
8 | defaultReferences: []
9 | executionOrder: 0
10 | icon: {instanceID: 0}
11 | userData:
12 | assetBundleName:
13 | assetBundleVariant:
14 |
--------------------------------------------------------------------------------
/Assets/Package/Scripts/Utils.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f8065a7e5ceca4ca29ed5d04326ab362
3 | folderAsset: yes
4 | timeCreated: 1526736675
5 | licenseType: Pro
6 | DefaultImporter:
7 | externalObjects: {}
8 | userData:
9 | assetBundleName:
10 | assetBundleVariant:
11 |
--------------------------------------------------------------------------------
/Assets/Package/Scripts/Utils/JsonHelper.cs:
--------------------------------------------------------------------------------
1 | //Code from ffleurey at https://forum.unity.com/threads/how-to-load-an-array-with-jsonutility.375735/
2 |
3 | using UnityEngine;
4 | using System;
5 |
6 | public class JsonHelper
7 | {
8 | public static T[] getJsonArray(string json)
9 | {
10 | string newJson = "{ \"array\": " + json + "}";
11 | Wrapper wrapper = JsonUtility.FromJson> (newJson);
12 | return wrapper.array;
13 | }
14 |
15 | [Serializable]
16 | private class Wrapper
17 | {
18 | public T[] array;
19 | }
20 | }
--------------------------------------------------------------------------------
/Assets/Package/Scripts/Utils/JsonHelper.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 39acf7d14d3ce4db1b2ac28a593871f4
3 | timeCreated: 1526736693
4 | licenseType: Pro
5 | MonoImporter:
6 | externalObjects: {}
7 | serializedVersion: 2
8 | defaultReferences: []
9 | executionOrder: 0
10 | icon: {instanceID: 0}
11 | userData:
12 | assetBundleName:
13 | assetBundleVariant:
14 |
--------------------------------------------------------------------------------
/Assets/Package/Tests.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: cb558ed92e28c41aa9447bb8b8554a09
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Package/Tests/EditMode.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 8e09adf3dd45f49b0a7e4ec2109e0a57
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Package/Tests/EditMode/DynamicScrollRectTests.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Threading;
3 | using System.Threading.Tasks;
4 | using NUnit.Framework;
5 | using UnityEngine;
6 |
7 | namespace dynamicscroll.tests {
8 | public class DynamicScrollRectTests {
9 |
10 | private DynamicScroll dynamicScroll;
11 | private DynamicScrollRect scrollRect;
12 | private List data;
13 | private GameObject referenceObject;
14 |
15 | [SetUp]
16 | public void Setup() {
17 |
18 | referenceObject = GameObject.Instantiate(Resources.Load("ItemTest"));
19 | scrollRect = GameObject.Instantiate(Resources.Load("VerticalScrollViewTest"));
20 | dynamicScroll = new DynamicScroll();
21 |
22 | data = new List {
23 | new MockData("0x12345"),
24 | new MockData("0x22345"),
25 | new MockData("0x32345"),
26 | new MockData("0x42345")
27 | };
28 |
29 | }
30 |
31 | [Test]
32 | public void InitiateScroll_Success() {
33 | dynamicScroll.Initiate(scrollRect, data,0, referenceObject);
34 |
35 | Assert.Greater(dynamicScroll.objectPool.Count, 0);
36 | Assert.AreEqual(dynamicScroll.RawDataList.Count, data.Count);
37 | }
38 |
39 | [Test]
40 | public void InitiateScroll_WithInvalid_ScrollRect_Failed() {
41 |
42 | Assert.That(() => dynamicScroll.Initiate(null, data,0, referenceObject),
43 | Throws.TypeOf());
44 | }
45 |
46 | [Test]
47 | public void InitiateScroll_WithInvalid_Index_Failed() {
48 |
49 | Assert.That(() => dynamicScroll.Initiate(scrollRect, data,10000, referenceObject),
50 | Throws.TypeOf());
51 | }
52 | }
53 |
54 | public class MockObject : DynamicScrollObject {
55 |
56 | }
57 |
58 | [System.Serializable]
59 | public class MockData {
60 | public string dataId;
61 |
62 | public MockData(string dataId) {
63 | dataId = this.dataId;
64 | }
65 | }
66 | }
--------------------------------------------------------------------------------
/Assets/Package/Tests/EditMode/DynamicScrollRectTests.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 100c5900c46a042e79061a35af31db08
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Package/Tests/EditMode/Resources.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: da7ce32745a114408a2e170ce928726c
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Package/Tests/EditMode/Resources/ItemTest.prefab:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!1 &1035420038146306
4 | GameObject:
5 | m_ObjectHideFlags: 0
6 | m_CorrespondingSourceObject: {fileID: 0}
7 | m_PrefabInstance: {fileID: 0}
8 | m_PrefabAsset: {fileID: 0}
9 | serializedVersion: 6
10 | m_Component:
11 | - component: {fileID: 224598455554756272}
12 | - component: {fileID: 222129553311233108}
13 | - component: {fileID: 114930382425524664}
14 | m_Layer: 5
15 | m_Name: Body
16 | m_TagString: Untagged
17 | m_Icon: {fileID: 0}
18 | m_NavMeshLayer: 0
19 | m_StaticEditorFlags: 0
20 | m_IsActive: 1
21 | --- !u!224 &224598455554756272
22 | RectTransform:
23 | m_ObjectHideFlags: 0
24 | m_CorrespondingSourceObject: {fileID: 0}
25 | m_PrefabInstance: {fileID: 0}
26 | m_PrefabAsset: {fileID: 0}
27 | m_GameObject: {fileID: 1035420038146306}
28 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
29 | m_LocalPosition: {x: 0, y: 0, z: 0}
30 | m_LocalScale: {x: 1, y: 1, z: 1}
31 | m_Children: []
32 | m_Father: {fileID: 224160872783295448}
33 | m_RootOrder: 2
34 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
35 | m_AnchorMin: {x: 0, y: 0}
36 | m_AnchorMax: {x: 0.89100003, y: 0.53}
37 | m_AnchoredPosition: {x: 0, y: 0}
38 | m_SizeDelta: {x: 0, y: 0}
39 | m_Pivot: {x: 0.5, y: 0.5}
40 | --- !u!222 &222129553311233108
41 | CanvasRenderer:
42 | m_ObjectHideFlags: 0
43 | m_CorrespondingSourceObject: {fileID: 0}
44 | m_PrefabInstance: {fileID: 0}
45 | m_PrefabAsset: {fileID: 0}
46 | m_GameObject: {fileID: 1035420038146306}
47 | m_CullTransparentMesh: 0
48 | --- !u!114 &114930382425524664
49 | MonoBehaviour:
50 | m_ObjectHideFlags: 0
51 | m_CorrespondingSourceObject: {fileID: 0}
52 | m_PrefabInstance: {fileID: 0}
53 | m_PrefabAsset: {fileID: 0}
54 | m_GameObject: {fileID: 1035420038146306}
55 | m_Enabled: 1
56 | m_EditorHideFlags: 0
57 | m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
58 | m_Name:
59 | m_EditorClassIdentifier:
60 | m_Material: {fileID: 0}
61 | m_Color: {r: 0, g: 0, b: 0, a: 1}
62 | m_RaycastTarget: 1
63 | m_OnCullStateChanged:
64 | m_PersistentCalls:
65 | m_Calls: []
66 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
67 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
68 | m_FontData:
69 | m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
70 | m_FontSize: 14
71 | m_FontStyle: 2
72 | m_BestFit: 1
73 | m_MinSize: 10
74 | m_MaxSize: 40
75 | m_Alignment: 1
76 | m_AlignByGeometry: 0
77 | m_RichText: 1
78 | m_HorizontalOverflow: 0
79 | m_VerticalOverflow: 0
80 | m_LineSpacing: 1
81 | m_Text: New Text
82 | --- !u!1 &1071413000746652
83 | GameObject:
84 | m_ObjectHideFlags: 0
85 | m_CorrespondingSourceObject: {fileID: 0}
86 | m_PrefabInstance: {fileID: 0}
87 | m_PrefabAsset: {fileID: 0}
88 | serializedVersion: 6
89 | m_Component:
90 | - component: {fileID: 224160872783295448}
91 | - component: {fileID: 222105170160322944}
92 | - component: {fileID: 114663863510815856}
93 | m_Layer: 5
94 | m_Name: ExampleObject
95 | m_TagString: Untagged
96 | m_Icon: {fileID: 0}
97 | m_NavMeshLayer: 0
98 | m_StaticEditorFlags: 0
99 | m_IsActive: 1
100 | --- !u!224 &224160872783295448
101 | RectTransform:
102 | m_ObjectHideFlags: 0
103 | m_CorrespondingSourceObject: {fileID: 0}
104 | m_PrefabInstance: {fileID: 0}
105 | m_PrefabAsset: {fileID: 0}
106 | m_GameObject: {fileID: 1071413000746652}
107 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
108 | m_LocalPosition: {x: 0, y: 0, z: 0}
109 | m_LocalScale: {x: 1, y: 1, z: 1}
110 | m_Children:
111 | - {fileID: 224367270219441932}
112 | - {fileID: 224097879898709678}
113 | - {fileID: 224598455554756272}
114 | - {fileID: 224010535245120874}
115 | - {fileID: 3749306795765850029}
116 | m_Father: {fileID: 0}
117 | m_RootOrder: 0
118 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
119 | m_AnchorMin: {x: 0, y: 1}
120 | m_AnchorMax: {x: 0, y: 1}
121 | m_AnchoredPosition: {x: 0, y: 0}
122 | m_SizeDelta: {x: 330, y: 100}
123 | m_Pivot: {x: 0, y: 1}
124 | --- !u!222 &222105170160322944
125 | CanvasRenderer:
126 | m_ObjectHideFlags: 0
127 | m_CorrespondingSourceObject: {fileID: 0}
128 | m_PrefabInstance: {fileID: 0}
129 | m_PrefabAsset: {fileID: 0}
130 | m_GameObject: {fileID: 1071413000746652}
131 | m_CullTransparentMesh: 0
132 | --- !u!114 &114663863510815856
133 | MonoBehaviour:
134 | m_ObjectHideFlags: 0
135 | m_CorrespondingSourceObject: {fileID: 0}
136 | m_PrefabInstance: {fileID: 0}
137 | m_PrefabAsset: {fileID: 0}
138 | m_GameObject: {fileID: 1071413000746652}
139 | m_Enabled: 1
140 | m_EditorHideFlags: 0
141 | m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
142 | m_Name:
143 | m_EditorClassIdentifier:
144 | m_Material: {fileID: 0}
145 | m_Color: {r: 1, g: 1, b: 1, a: 1}
146 | m_RaycastTarget: 1
147 | m_OnCullStateChanged:
148 | m_PersistentCalls:
149 | m_Calls: []
150 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
151 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
152 | m_Sprite: {fileID: 0}
153 | m_Type: 0
154 | m_PreserveAspect: 0
155 | m_FillCenter: 1
156 | m_FillMethod: 4
157 | m_FillAmount: 1
158 | m_FillClockwise: 1
159 | m_FillOrigin: 0
160 | m_UseSpriteMesh: 0
161 | --- !u!1 &1488438940785088
162 | GameObject:
163 | m_ObjectHideFlags: 0
164 | m_CorrespondingSourceObject: {fileID: 0}
165 | m_PrefabInstance: {fileID: 0}
166 | m_PrefabAsset: {fileID: 0}
167 | serializedVersion: 6
168 | m_Component:
169 | - component: {fileID: 224010535245120874}
170 | - component: {fileID: 222500172355218160}
171 | - component: {fileID: 114099213283322324}
172 | m_Layer: 5
173 | m_Name: Image
174 | m_TagString: Untagged
175 | m_Icon: {fileID: 0}
176 | m_NavMeshLayer: 0
177 | m_StaticEditorFlags: 0
178 | m_IsActive: 1
179 | --- !u!224 &224010535245120874
180 | RectTransform:
181 | m_ObjectHideFlags: 0
182 | m_CorrespondingSourceObject: {fileID: 0}
183 | m_PrefabInstance: {fileID: 0}
184 | m_PrefabAsset: {fileID: 0}
185 | m_GameObject: {fileID: 1488438940785088}
186 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
187 | m_LocalPosition: {x: 0, y: 0, z: 0}
188 | m_LocalScale: {x: 1, y: 1, z: 1}
189 | m_Children: []
190 | m_Father: {fileID: 224160872783295448}
191 | m_RootOrder: 3
192 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
193 | m_AnchorMin: {x: 0, y: 0.5}
194 | m_AnchorMax: {x: 1, y: 0.5}
195 | m_AnchoredPosition: {x: 0, y: 5.13}
196 | m_SizeDelta: {x: 0, y: 2}
197 | m_Pivot: {x: 0.5, y: 0.5}
198 | --- !u!222 &222500172355218160
199 | CanvasRenderer:
200 | m_ObjectHideFlags: 0
201 | m_CorrespondingSourceObject: {fileID: 0}
202 | m_PrefabInstance: {fileID: 0}
203 | m_PrefabAsset: {fileID: 0}
204 | m_GameObject: {fileID: 1488438940785088}
205 | m_CullTransparentMesh: 0
206 | --- !u!114 &114099213283322324
207 | MonoBehaviour:
208 | m_ObjectHideFlags: 0
209 | m_CorrespondingSourceObject: {fileID: 0}
210 | m_PrefabInstance: {fileID: 0}
211 | m_PrefabAsset: {fileID: 0}
212 | m_GameObject: {fileID: 1488438940785088}
213 | m_Enabled: 1
214 | m_EditorHideFlags: 0
215 | m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
216 | m_Name:
217 | m_EditorClassIdentifier:
218 | m_Material: {fileID: 0}
219 | m_Color: {r: 0, g: 0, b: 0, a: 0.203}
220 | m_RaycastTarget: 1
221 | m_OnCullStateChanged:
222 | m_PersistentCalls:
223 | m_Calls: []
224 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
225 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
226 | m_Sprite: {fileID: 0}
227 | m_Type: 0
228 | m_PreserveAspect: 0
229 | m_FillCenter: 1
230 | m_FillMethod: 4
231 | m_FillAmount: 1
232 | m_FillClockwise: 1
233 | m_FillOrigin: 0
234 | m_UseSpriteMesh: 0
235 | --- !u!1 &1600269140053624
236 | GameObject:
237 | m_ObjectHideFlags: 0
238 | m_CorrespondingSourceObject: {fileID: 0}
239 | m_PrefabInstance: {fileID: 0}
240 | m_PrefabAsset: {fileID: 0}
241 | serializedVersion: 6
242 | m_Component:
243 | - component: {fileID: 224367270219441932}
244 | - component: {fileID: 222296114578165220}
245 | - component: {fileID: 114772967228215230}
246 | m_Layer: 5
247 | m_Name: PostId
248 | m_TagString: Untagged
249 | m_Icon: {fileID: 0}
250 | m_NavMeshLayer: 0
251 | m_StaticEditorFlags: 0
252 | m_IsActive: 1
253 | --- !u!224 &224367270219441932
254 | RectTransform:
255 | m_ObjectHideFlags: 0
256 | m_CorrespondingSourceObject: {fileID: 0}
257 | m_PrefabInstance: {fileID: 0}
258 | m_PrefabAsset: {fileID: 0}
259 | m_GameObject: {fileID: 1600269140053624}
260 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
261 | m_LocalPosition: {x: 0, y: 0, z: 0}
262 | m_LocalScale: {x: 1, y: 1, z: 1}
263 | m_Children: []
264 | m_Father: {fileID: 224160872783295448}
265 | m_RootOrder: 0
266 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
267 | m_AnchorMin: {x: 0, y: 0.8}
268 | m_AnchorMax: {x: 1, y: 1}
269 | m_AnchoredPosition: {x: 10, y: 0}
270 | m_SizeDelta: {x: -10, y: 0}
271 | m_Pivot: {x: 0, y: 1}
272 | --- !u!222 &222296114578165220
273 | CanvasRenderer:
274 | m_ObjectHideFlags: 0
275 | m_CorrespondingSourceObject: {fileID: 0}
276 | m_PrefabInstance: {fileID: 0}
277 | m_PrefabAsset: {fileID: 0}
278 | m_GameObject: {fileID: 1600269140053624}
279 | m_CullTransparentMesh: 0
280 | --- !u!114 &114772967228215230
281 | MonoBehaviour:
282 | m_ObjectHideFlags: 0
283 | m_CorrespondingSourceObject: {fileID: 0}
284 | m_PrefabInstance: {fileID: 0}
285 | m_PrefabAsset: {fileID: 0}
286 | m_GameObject: {fileID: 1600269140053624}
287 | m_Enabled: 1
288 | m_EditorHideFlags: 0
289 | m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
290 | m_Name:
291 | m_EditorClassIdentifier:
292 | m_Material: {fileID: 0}
293 | m_Color: {r: 0, g: 0, b: 0, a: 1}
294 | m_RaycastTarget: 0
295 | m_OnCullStateChanged:
296 | m_PersistentCalls:
297 | m_Calls: []
298 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
299 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
300 | m_FontData:
301 | m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
302 | m_FontSize: 14
303 | m_FontStyle: 0
304 | m_BestFit: 0
305 | m_MinSize: 10
306 | m_MaxSize: 40
307 | m_Alignment: 3
308 | m_AlignByGeometry: 1
309 | m_RichText: 0
310 | m_HorizontalOverflow: 0
311 | m_VerticalOverflow: 0
312 | m_LineSpacing: 1
313 | m_Text: 'Post Id: 1'
314 | --- !u!1 &1664755825594956
315 | GameObject:
316 | m_ObjectHideFlags: 0
317 | m_CorrespondingSourceObject: {fileID: 0}
318 | m_PrefabInstance: {fileID: 0}
319 | m_PrefabAsset: {fileID: 0}
320 | serializedVersion: 6
321 | m_Component:
322 | - component: {fileID: 224097879898709678}
323 | - component: {fileID: 222354433328536168}
324 | - component: {fileID: 114136235205940256}
325 | m_Layer: 5
326 | m_Name: NameEmail
327 | m_TagString: Untagged
328 | m_Icon: {fileID: 0}
329 | m_NavMeshLayer: 0
330 | m_StaticEditorFlags: 0
331 | m_IsActive: 1
332 | --- !u!224 &224097879898709678
333 | RectTransform:
334 | m_ObjectHideFlags: 0
335 | m_CorrespondingSourceObject: {fileID: 0}
336 | m_PrefabInstance: {fileID: 0}
337 | m_PrefabAsset: {fileID: 0}
338 | m_GameObject: {fileID: 1664755825594956}
339 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
340 | m_LocalPosition: {x: 0, y: 0, z: 0}
341 | m_LocalScale: {x: 1, y: 1, z: 1}
342 | m_Children: []
343 | m_Father: {fileID: 224160872783295448}
344 | m_RootOrder: 1
345 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
346 | m_AnchorMin: {x: 0, y: 0.57000005}
347 | m_AnchorMax: {x: 1, y: 0.8}
348 | m_AnchoredPosition: {x: 10, y: 0}
349 | m_SizeDelta: {x: -20, y: 0}
350 | m_Pivot: {x: 0, y: 1}
351 | --- !u!222 &222354433328536168
352 | CanvasRenderer:
353 | m_ObjectHideFlags: 0
354 | m_CorrespondingSourceObject: {fileID: 0}
355 | m_PrefabInstance: {fileID: 0}
356 | m_PrefabAsset: {fileID: 0}
357 | m_GameObject: {fileID: 1664755825594956}
358 | m_CullTransparentMesh: 0
359 | --- !u!114 &114136235205940256
360 | MonoBehaviour:
361 | m_ObjectHideFlags: 0
362 | m_CorrespondingSourceObject: {fileID: 0}
363 | m_PrefabInstance: {fileID: 0}
364 | m_PrefabAsset: {fileID: 0}
365 | m_GameObject: {fileID: 1664755825594956}
366 | m_Enabled: 1
367 | m_EditorHideFlags: 0
368 | m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
369 | m_Name:
370 | m_EditorClassIdentifier:
371 | m_Material: {fileID: 0}
372 | m_Color: {r: 0, g: 0, b: 0, a: 1}
373 | m_RaycastTarget: 0
374 | m_OnCullStateChanged:
375 | m_PersistentCalls:
376 | m_Calls: []
377 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
378 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
379 | m_FontData:
380 | m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
381 | m_FontSize: 14
382 | m_FontStyle: 1
383 | m_BestFit: 1
384 | m_MinSize: 10
385 | m_MaxSize: 40
386 | m_Alignment: 3
387 | m_AlignByGeometry: 1
388 | m_RichText: 1
389 | m_HorizontalOverflow: 0
390 | m_VerticalOverflow: 0
391 | m_LineSpacing: 1
392 | m_Text: sdas
393 | --- !u!1 &1976114528661958460
394 | GameObject:
395 | m_ObjectHideFlags: 0
396 | m_CorrespondingSourceObject: {fileID: 0}
397 | m_PrefabInstance: {fileID: 0}
398 | m_PrefabAsset: {fileID: 0}
399 | serializedVersion: 6
400 | m_Component:
401 | - component: {fileID: 3749306795765850029}
402 | - component: {fileID: 8974046195138079829}
403 | - component: {fileID: 4534683910325577530}
404 | m_Layer: 5
405 | m_Name: Position
406 | m_TagString: Untagged
407 | m_Icon: {fileID: 0}
408 | m_NavMeshLayer: 0
409 | m_StaticEditorFlags: 0
410 | m_IsActive: 1
411 | --- !u!224 &3749306795765850029
412 | RectTransform:
413 | m_ObjectHideFlags: 0
414 | m_CorrespondingSourceObject: {fileID: 0}
415 | m_PrefabInstance: {fileID: 0}
416 | m_PrefabAsset: {fileID: 0}
417 | m_GameObject: {fileID: 1976114528661958460}
418 | m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068}
419 | m_LocalPosition: {x: 0, y: 0, z: 0}
420 | m_LocalScale: {x: 1, y: 1, z: 1}
421 | m_Children: []
422 | m_Father: {fileID: 224160872783295448}
423 | m_RootOrder: 4
424 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90}
425 | m_AnchorMin: {x: 0.89100003, y: 0}
426 | m_AnchorMax: {x: 1, y: 0.57000005}
427 | m_AnchoredPosition: {x: -17.985016, y: -29.935997}
428 | m_SizeDelta: {x: 18.16, y: -21.029999}
429 | m_Pivot: {x: 0.5, y: 1}
430 | --- !u!222 &8974046195138079829
431 | CanvasRenderer:
432 | m_ObjectHideFlags: 0
433 | m_CorrespondingSourceObject: {fileID: 0}
434 | m_PrefabInstance: {fileID: 0}
435 | m_PrefabAsset: {fileID: 0}
436 | m_GameObject: {fileID: 1976114528661958460}
437 | m_CullTransparentMesh: 0
438 | --- !u!114 &4534683910325577530
439 | MonoBehaviour:
440 | m_ObjectHideFlags: 0
441 | m_CorrespondingSourceObject: {fileID: 0}
442 | m_PrefabInstance: {fileID: 0}
443 | m_PrefabAsset: {fileID: 0}
444 | m_GameObject: {fileID: 1976114528661958460}
445 | m_Enabled: 1
446 | m_EditorHideFlags: 0
447 | m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
448 | m_Name:
449 | m_EditorClassIdentifier:
450 | m_Material: {fileID: 0}
451 | m_Color: {r: 0, g: 0, b: 0, a: 1}
452 | m_RaycastTarget: 1
453 | m_OnCullStateChanged:
454 | m_PersistentCalls:
455 | m_Calls: []
456 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
457 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
458 | m_FontData:
459 | m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
460 | m_FontSize: 14
461 | m_FontStyle: 2
462 | m_BestFit: 1
463 | m_MinSize: 10
464 | m_MaxSize: 40
465 | m_Alignment: 1
466 | m_AlignByGeometry: 0
467 | m_RichText: 1
468 | m_HorizontalOverflow: 0
469 | m_VerticalOverflow: 0
470 | m_LineSpacing: 1
471 | m_Text: New Text
472 |
--------------------------------------------------------------------------------
/Assets/Package/Tests/EditMode/Resources/ItemTest.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b5111e05b9f924f51a8ae308483aedad
3 | timeCreated: 1526737851
4 | licenseType: Pro
5 | NativeFormatImporter:
6 | externalObjects: {}
7 | mainObjectFileID: 100100000
8 | userData:
9 | assetBundleName:
10 | assetBundleVariant:
11 |
--------------------------------------------------------------------------------
/Assets/Package/Tests/EditMode/Resources/VerticalScrollViewTest.prefab:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!1 &111870188403796631
4 | GameObject:
5 | m_ObjectHideFlags: 0
6 | m_CorrespondingSourceObject: {fileID: 0}
7 | m_PrefabInstance: {fileID: 0}
8 | m_PrefabAsset: {fileID: 0}
9 | serializedVersion: 6
10 | m_Component:
11 | - component: {fileID: 9154662404507672620}
12 | - component: {fileID: 8728095768320337530}
13 | - component: {fileID: 4350087191551804967}
14 | - component: {fileID: 4058002773486775363}
15 | m_Layer: 5
16 | m_Name: Viewport
17 | m_TagString: Untagged
18 | m_Icon: {fileID: 0}
19 | m_NavMeshLayer: 0
20 | m_StaticEditorFlags: 0
21 | m_IsActive: 1
22 | --- !u!224 &9154662404507672620
23 | RectTransform:
24 | m_ObjectHideFlags: 0
25 | m_CorrespondingSourceObject: {fileID: 0}
26 | m_PrefabInstance: {fileID: 0}
27 | m_PrefabAsset: {fileID: 0}
28 | m_GameObject: {fileID: 111870188403796631}
29 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
30 | m_LocalPosition: {x: 0, y: 0, z: 0}
31 | m_LocalScale: {x: 1, y: 1, z: 1}
32 | m_Children:
33 | - {fileID: 7365092373963534415}
34 | - {fileID: 1094057087104961597}
35 | m_Father: {fileID: 5410800989402061637}
36 | m_RootOrder: 0
37 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
38 | m_AnchorMin: {x: 0, y: 0}
39 | m_AnchorMax: {x: 1, y: 1}
40 | m_AnchoredPosition: {x: 0, y: 0}
41 | m_SizeDelta: {x: 0, y: 0}
42 | m_Pivot: {x: 0, y: 1}
43 | --- !u!114 &8728095768320337530
44 | MonoBehaviour:
45 | m_ObjectHideFlags: 0
46 | m_CorrespondingSourceObject: {fileID: 0}
47 | m_PrefabInstance: {fileID: 0}
48 | m_PrefabAsset: {fileID: 0}
49 | m_GameObject: {fileID: 111870188403796631}
50 | m_Enabled: 1
51 | m_EditorHideFlags: 0
52 | m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3}
53 | m_Name:
54 | m_EditorClassIdentifier:
55 | m_ShowMaskGraphic: 0
56 | --- !u!222 &4350087191551804967
57 | CanvasRenderer:
58 | m_ObjectHideFlags: 0
59 | m_CorrespondingSourceObject: {fileID: 0}
60 | m_PrefabInstance: {fileID: 0}
61 | m_PrefabAsset: {fileID: 0}
62 | m_GameObject: {fileID: 111870188403796631}
63 | m_CullTransparentMesh: 0
64 | --- !u!114 &4058002773486775363
65 | MonoBehaviour:
66 | m_ObjectHideFlags: 0
67 | m_CorrespondingSourceObject: {fileID: 0}
68 | m_PrefabInstance: {fileID: 0}
69 | m_PrefabAsset: {fileID: 0}
70 | m_GameObject: {fileID: 111870188403796631}
71 | m_Enabled: 1
72 | m_EditorHideFlags: 0
73 | m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
74 | m_Name:
75 | m_EditorClassIdentifier:
76 | m_Material: {fileID: 0}
77 | m_Color: {r: 1, g: 1, b: 1, a: 1}
78 | m_RaycastTarget: 1
79 | m_OnCullStateChanged:
80 | m_PersistentCalls:
81 | m_Calls: []
82 | m_Sprite: {fileID: 10917, guid: 0000000000000000f000000000000000, type: 0}
83 | m_Type: 1
84 | m_PreserveAspect: 0
85 | m_FillCenter: 1
86 | m_FillMethod: 4
87 | m_FillAmount: 1
88 | m_FillClockwise: 1
89 | m_FillOrigin: 0
90 | m_UseSpriteMesh: 0
91 | m_PixelsPerUnitMultiplier: 1
92 | --- !u!1 &5737290072241045928
93 | GameObject:
94 | m_ObjectHideFlags: 0
95 | m_CorrespondingSourceObject: {fileID: 0}
96 | m_PrefabInstance: {fileID: 0}
97 | m_PrefabAsset: {fileID: 0}
98 | serializedVersion: 6
99 | m_Component:
100 | - component: {fileID: 1094057087104961597}
101 | - component: {fileID: 8129646450602135852}
102 | - component: {fileID: 4361798502894573864}
103 | m_Layer: 5
104 | m_Name: Image
105 | m_TagString: Untagged
106 | m_Icon: {fileID: 0}
107 | m_NavMeshLayer: 0
108 | m_StaticEditorFlags: 0
109 | m_IsActive: 1
110 | --- !u!224 &1094057087104961597
111 | RectTransform:
112 | m_ObjectHideFlags: 0
113 | m_CorrespondingSourceObject: {fileID: 0}
114 | m_PrefabInstance: {fileID: 0}
115 | m_PrefabAsset: {fileID: 0}
116 | m_GameObject: {fileID: 5737290072241045928}
117 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
118 | m_LocalPosition: {x: 0, y: 0, z: 0}
119 | m_LocalScale: {x: 1, y: 1, z: 1}
120 | m_Children: []
121 | m_Father: {fileID: 9154662404507672620}
122 | m_RootOrder: 1
123 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
124 | m_AnchorMin: {x: 0, y: 0.5}
125 | m_AnchorMax: {x: 1, y: 0.5}
126 | m_AnchoredPosition: {x: 0, y: 0}
127 | m_SizeDelta: {x: 0, y: 2}
128 | m_Pivot: {x: 0.5, y: 0.5}
129 | --- !u!222 &8129646450602135852
130 | CanvasRenderer:
131 | m_ObjectHideFlags: 0
132 | m_CorrespondingSourceObject: {fileID: 0}
133 | m_PrefabInstance: {fileID: 0}
134 | m_PrefabAsset: {fileID: 0}
135 | m_GameObject: {fileID: 5737290072241045928}
136 | m_CullTransparentMesh: 0
137 | --- !u!114 &4361798502894573864
138 | MonoBehaviour:
139 | m_ObjectHideFlags: 0
140 | m_CorrespondingSourceObject: {fileID: 0}
141 | m_PrefabInstance: {fileID: 0}
142 | m_PrefabAsset: {fileID: 0}
143 | m_GameObject: {fileID: 5737290072241045928}
144 | m_Enabled: 1
145 | m_EditorHideFlags: 0
146 | m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
147 | m_Name:
148 | m_EditorClassIdentifier:
149 | m_Material: {fileID: 0}
150 | m_Color: {r: 1, g: 0, b: 0, a: 1}
151 | m_RaycastTarget: 1
152 | m_OnCullStateChanged:
153 | m_PersistentCalls:
154 | m_Calls: []
155 | m_Sprite: {fileID: 0}
156 | m_Type: 0
157 | m_PreserveAspect: 0
158 | m_FillCenter: 1
159 | m_FillMethod: 4
160 | m_FillAmount: 1
161 | m_FillClockwise: 1
162 | m_FillOrigin: 0
163 | m_UseSpriteMesh: 0
164 | m_PixelsPerUnitMultiplier: 1
165 | --- !u!1 &8302232487628957901
166 | GameObject:
167 | m_ObjectHideFlags: 0
168 | m_CorrespondingSourceObject: {fileID: 0}
169 | m_PrefabInstance: {fileID: 0}
170 | m_PrefabAsset: {fileID: 0}
171 | serializedVersion: 6
172 | m_Component:
173 | - component: {fileID: 5410800989402061637}
174 | - component: {fileID: 4897685042015639722}
175 | - component: {fileID: 5531687200553665693}
176 | - component: {fileID: 7420866095183077720}
177 | m_Layer: 5
178 | m_Name: VerticalScrollView (1)
179 | m_TagString: Untagged
180 | m_Icon: {fileID: 0}
181 | m_NavMeshLayer: 0
182 | m_StaticEditorFlags: 0
183 | m_IsActive: 1
184 | --- !u!224 &5410800989402061637
185 | RectTransform:
186 | m_ObjectHideFlags: 0
187 | m_CorrespondingSourceObject: {fileID: 0}
188 | m_PrefabInstance: {fileID: 0}
189 | m_PrefabAsset: {fileID: 0}
190 | m_GameObject: {fileID: 8302232487628957901}
191 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
192 | m_LocalPosition: {x: 0, y: 0, z: 0}
193 | m_LocalScale: {x: 1, y: 1, z: 1}
194 | m_Children:
195 | - {fileID: 9154662404507672620}
196 | m_Father: {fileID: 0}
197 | m_RootOrder: 0
198 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
199 | m_AnchorMin: {x: 0, y: 0}
200 | m_AnchorMax: {x: 1, y: 0.695}
201 | m_AnchoredPosition: {x: 0, y: 0}
202 | m_SizeDelta: {x: 0, y: 0}
203 | m_Pivot: {x: 0.5, y: 0.5}
204 | --- !u!222 &4897685042015639722
205 | CanvasRenderer:
206 | m_ObjectHideFlags: 0
207 | m_CorrespondingSourceObject: {fileID: 0}
208 | m_PrefabInstance: {fileID: 0}
209 | m_PrefabAsset: {fileID: 0}
210 | m_GameObject: {fileID: 8302232487628957901}
211 | m_CullTransparentMesh: 0
212 | --- !u!114 &5531687200553665693
213 | MonoBehaviour:
214 | m_ObjectHideFlags: 0
215 | m_CorrespondingSourceObject: {fileID: 0}
216 | m_PrefabInstance: {fileID: 0}
217 | m_PrefabAsset: {fileID: 0}
218 | m_GameObject: {fileID: 8302232487628957901}
219 | m_Enabled: 1
220 | m_EditorHideFlags: 0
221 | m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
222 | m_Name:
223 | m_EditorClassIdentifier:
224 | m_Material: {fileID: 0}
225 | m_Color: {r: 1, g: 1, b: 1, a: 0.392}
226 | m_RaycastTarget: 1
227 | m_OnCullStateChanged:
228 | m_PersistentCalls:
229 | m_Calls: []
230 | m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
231 | m_Type: 1
232 | m_PreserveAspect: 0
233 | m_FillCenter: 1
234 | m_FillMethod: 4
235 | m_FillAmount: 1
236 | m_FillClockwise: 1
237 | m_FillOrigin: 0
238 | m_UseSpriteMesh: 0
239 | m_PixelsPerUnitMultiplier: 1
240 | --- !u!114 &7420866095183077720
241 | MonoBehaviour:
242 | m_ObjectHideFlags: 0
243 | m_CorrespondingSourceObject: {fileID: 0}
244 | m_PrefabInstance: {fileID: 0}
245 | m_PrefabAsset: {fileID: 0}
246 | m_GameObject: {fileID: 8302232487628957901}
247 | m_Enabled: 1
248 | m_EditorHideFlags: 0
249 | m_Script: {fileID: 11500000, guid: 4b58cf81a900d4afe8b67215639eacb4, type: 3}
250 | m_Name:
251 | m_EditorClassIdentifier:
252 | m_Content: {fileID: 7365092373963534415}
253 | m_Horizontal: 0
254 | m_Vertical: 1
255 | m_MovementType: 1
256 | m_Elasticity: 0.1
257 | m_Inertia: 1
258 | m_DecelerationRate: 0.135
259 | m_ScrollSensitivity: 1
260 | m_Viewport: {fileID: 9154662404507672620}
261 | m_HorizontalScrollbar: {fileID: 0}
262 | m_VerticalScrollbar: {fileID: 0}
263 | m_HorizontalScrollbarVisibility: 0
264 | m_VerticalScrollbarVisibility: 0
265 | m_HorizontalScrollbarSpacing: 0
266 | m_VerticalScrollbarSpacing: 0
267 | m_OnValueChanged:
268 | m_PersistentCalls:
269 | m_Calls: []
270 | realMovementType: 0
271 | needElasticReturn: 0
272 | clampedPosition: {x: 0, y: 0}
273 | --- !u!1 &8918978811206954904
274 | GameObject:
275 | m_ObjectHideFlags: 0
276 | m_CorrespondingSourceObject: {fileID: 0}
277 | m_PrefabInstance: {fileID: 0}
278 | m_PrefabAsset: {fileID: 0}
279 | serializedVersion: 6
280 | m_Component:
281 | - component: {fileID: 7365092373963534415}
282 | m_Layer: 5
283 | m_Name: Content
284 | m_TagString: Untagged
285 | m_Icon: {fileID: 0}
286 | m_NavMeshLayer: 0
287 | m_StaticEditorFlags: 0
288 | m_IsActive: 1
289 | --- !u!224 &7365092373963534415
290 | RectTransform:
291 | m_ObjectHideFlags: 0
292 | m_CorrespondingSourceObject: {fileID: 0}
293 | m_PrefabInstance: {fileID: 0}
294 | m_PrefabAsset: {fileID: 0}
295 | m_GameObject: {fileID: 8918978811206954904}
296 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
297 | m_LocalPosition: {x: 0, y: 0, z: 0}
298 | m_LocalScale: {x: 1, y: 1, z: 1}
299 | m_Children: []
300 | m_Father: {fileID: 9154662404507672620}
301 | m_RootOrder: 0
302 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
303 | m_AnchorMin: {x: 0.5, y: 0.5}
304 | m_AnchorMax: {x: 0.5, y: 0.5}
305 | m_AnchoredPosition: {x: 0, y: 0}
306 | m_SizeDelta: {x: 332, y: 410}
307 | m_Pivot: {x: 0.5, y: 0.5}
308 |
--------------------------------------------------------------------------------
/Assets/Package/Tests/EditMode/Resources/VerticalScrollViewTest.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 59836a5e86bdb4806ac83bfaa4bb15d8
3 | PrefabImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/Package/Tests/EditMode/com.mukarillo.dynamicscrollrect.tests.asmdef:
--------------------------------------------------------------------------------
1 | {
2 | "name": "com.mukarillo.dynamicscrollrect.tests",
3 | "references": [
4 | "GUID:64413644274fc49f3a46e7fdb33e51ca",
5 | "GUID:27619889b8ba8c24980f49ee34dbb44a",
6 | "GUID:0acc523941302664db1f4e527237feb3"
7 | ],
8 | "includePlatforms": [
9 | "Editor"
10 | ],
11 | "excludePlatforms": [],
12 | "allowUnsafeCode": false,
13 | "overrideReferences": false,
14 | "precompiledReferences": [],
15 | "autoReferenced": true,
16 | "defineConstraints": [],
17 | "versionDefines": []
18 | }
--------------------------------------------------------------------------------
/Assets/Package/Tests/EditMode/com.mukarillo.dynamicscrollrect.tests.asmdef.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 7b4dccd3601e04faf92bea8e29ea7838
3 | AssemblyDefinitionImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/Package/Tests/PlayMode.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e8c507fc23919445baaf156b46fb489b
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Package/Tests/PlayMode/DynamicScrollRectPlayModeTests.cs:
--------------------------------------------------------------------------------
1 | using System.Collections;
2 | using System.Collections.Generic;
3 | using NUnit.Framework;
4 | using UnityEngine;
5 | using UnityEngine.TestTools;
6 |
7 | namespace dynamicscroll.tests
8 | {
9 | public class DynamicScrollRectPlayModeTests
10 | {
11 | private DynamicScroll dynamicScroll;
12 | private DynamicScrollRect scrollRect;
13 | private List data;
14 | private GameObject referenceObject;
15 |
16 | [SetUp]
17 | public void Setup() {
18 |
19 | referenceObject = GameObject.Instantiate(Resources.Load("ItemTest"));
20 | scrollRect = GameObject.Instantiate(Resources.Load("VerticalScrollViewTest"));
21 | dynamicScroll = new DynamicScroll();
22 |
23 | data = new List {
24 | new MockData("0x12345"),
25 | new MockData("0x22345"),
26 | new MockData("0x32345"),
27 | new MockData("0x42345")
28 | };
29 |
30 | }
31 |
32 | [UnityTest]
33 | public IEnumerator MoveToIndex_Success()
34 | {
35 | var destinyIndex = 3;
36 | dynamicScroll.Initiate(scrollRect, data,0, referenceObject);
37 |
38 | dynamicScroll.MoveToIndex(destinyIndex, 0.2f);
39 |
40 | yield return new WaitForSeconds(1);
41 |
42 | Assert.AreEqual(dynamicScroll.CentralizedObject.CurrentIndex,destinyIndex);
43 | }
44 |
45 | [Test]
46 | public void MoveToIndex_Failed() {
47 | var destinyIndex = 1000;
48 | dynamicScroll.Initiate(scrollRect, data,0, referenceObject);
49 |
50 | Assert.That(() => dynamicScroll.MoveToIndex(destinyIndex, 0.2f),
51 | Throws.TypeOf());
52 | }
53 |
54 | }
55 |
56 | public class MockObject : DynamicScrollObject {
57 |
58 | }
59 |
60 | [System.Serializable]
61 | public class MockData {
62 | public string dataId;
63 |
64 | public MockData(string dataId) {
65 | dataId = this.dataId;
66 | }
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/Assets/Package/Tests/PlayMode/DynamicScrollRectPlayModeTests.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c065b47ffaaee472a9d9f0883ec70662
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Package/Tests/PlayMode/Resources.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b816d341999e34a2e8f1a96ceecd4b06
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Package/Tests/PlayMode/Resources/ItemTest.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2a8f56788cbbf4146adde5c018c7cb06
3 | timeCreated: 1526737851
4 | licenseType: Pro
5 | NativeFormatImporter:
6 | externalObjects: {}
7 | mainObjectFileID: 100100000
8 | userData:
9 | assetBundleName:
10 | assetBundleVariant:
11 |
--------------------------------------------------------------------------------
/Assets/Package/Tests/PlayMode/Resources/VerticalScrollViewTest.prefab:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!1 &111870188403796631
4 | GameObject:
5 | m_ObjectHideFlags: 0
6 | m_CorrespondingSourceObject: {fileID: 0}
7 | m_PrefabInstance: {fileID: 0}
8 | m_PrefabAsset: {fileID: 0}
9 | serializedVersion: 6
10 | m_Component:
11 | - component: {fileID: 9154662404507672620}
12 | - component: {fileID: 8728095768320337530}
13 | - component: {fileID: 4350087191551804967}
14 | - component: {fileID: 4058002773486775363}
15 | m_Layer: 5
16 | m_Name: Viewport
17 | m_TagString: Untagged
18 | m_Icon: {fileID: 0}
19 | m_NavMeshLayer: 0
20 | m_StaticEditorFlags: 0
21 | m_IsActive: 1
22 | --- !u!224 &9154662404507672620
23 | RectTransform:
24 | m_ObjectHideFlags: 0
25 | m_CorrespondingSourceObject: {fileID: 0}
26 | m_PrefabInstance: {fileID: 0}
27 | m_PrefabAsset: {fileID: 0}
28 | m_GameObject: {fileID: 111870188403796631}
29 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
30 | m_LocalPosition: {x: 0, y: 0, z: 0}
31 | m_LocalScale: {x: 1, y: 1, z: 1}
32 | m_Children:
33 | - {fileID: 7365092373963534415}
34 | - {fileID: 1094057087104961597}
35 | m_Father: {fileID: 5410800989402061637}
36 | m_RootOrder: 0
37 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
38 | m_AnchorMin: {x: 0, y: 0}
39 | m_AnchorMax: {x: 1, y: 1}
40 | m_AnchoredPosition: {x: 0, y: 0}
41 | m_SizeDelta: {x: 0, y: 0}
42 | m_Pivot: {x: 0, y: 1}
43 | --- !u!114 &8728095768320337530
44 | MonoBehaviour:
45 | m_ObjectHideFlags: 0
46 | m_CorrespondingSourceObject: {fileID: 0}
47 | m_PrefabInstance: {fileID: 0}
48 | m_PrefabAsset: {fileID: 0}
49 | m_GameObject: {fileID: 111870188403796631}
50 | m_Enabled: 1
51 | m_EditorHideFlags: 0
52 | m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3}
53 | m_Name:
54 | m_EditorClassIdentifier:
55 | m_ShowMaskGraphic: 0
56 | --- !u!222 &4350087191551804967
57 | CanvasRenderer:
58 | m_ObjectHideFlags: 0
59 | m_CorrespondingSourceObject: {fileID: 0}
60 | m_PrefabInstance: {fileID: 0}
61 | m_PrefabAsset: {fileID: 0}
62 | m_GameObject: {fileID: 111870188403796631}
63 | m_CullTransparentMesh: 0
64 | --- !u!114 &4058002773486775363
65 | MonoBehaviour:
66 | m_ObjectHideFlags: 0
67 | m_CorrespondingSourceObject: {fileID: 0}
68 | m_PrefabInstance: {fileID: 0}
69 | m_PrefabAsset: {fileID: 0}
70 | m_GameObject: {fileID: 111870188403796631}
71 | m_Enabled: 1
72 | m_EditorHideFlags: 0
73 | m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
74 | m_Name:
75 | m_EditorClassIdentifier:
76 | m_Material: {fileID: 0}
77 | m_Color: {r: 1, g: 1, b: 1, a: 1}
78 | m_RaycastTarget: 1
79 | m_OnCullStateChanged:
80 | m_PersistentCalls:
81 | m_Calls: []
82 | m_Sprite: {fileID: 10917, guid: 0000000000000000f000000000000000, type: 0}
83 | m_Type: 1
84 | m_PreserveAspect: 0
85 | m_FillCenter: 1
86 | m_FillMethod: 4
87 | m_FillAmount: 1
88 | m_FillClockwise: 1
89 | m_FillOrigin: 0
90 | m_UseSpriteMesh: 0
91 | m_PixelsPerUnitMultiplier: 1
92 | --- !u!1 &5737290072241045928
93 | GameObject:
94 | m_ObjectHideFlags: 0
95 | m_CorrespondingSourceObject: {fileID: 0}
96 | m_PrefabInstance: {fileID: 0}
97 | m_PrefabAsset: {fileID: 0}
98 | serializedVersion: 6
99 | m_Component:
100 | - component: {fileID: 1094057087104961597}
101 | - component: {fileID: 8129646450602135852}
102 | - component: {fileID: 4361798502894573864}
103 | m_Layer: 5
104 | m_Name: Image
105 | m_TagString: Untagged
106 | m_Icon: {fileID: 0}
107 | m_NavMeshLayer: 0
108 | m_StaticEditorFlags: 0
109 | m_IsActive: 1
110 | --- !u!224 &1094057087104961597
111 | RectTransform:
112 | m_ObjectHideFlags: 0
113 | m_CorrespondingSourceObject: {fileID: 0}
114 | m_PrefabInstance: {fileID: 0}
115 | m_PrefabAsset: {fileID: 0}
116 | m_GameObject: {fileID: 5737290072241045928}
117 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
118 | m_LocalPosition: {x: 0, y: 0, z: 0}
119 | m_LocalScale: {x: 1, y: 1, z: 1}
120 | m_Children: []
121 | m_Father: {fileID: 9154662404507672620}
122 | m_RootOrder: 1
123 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
124 | m_AnchorMin: {x: 0, y: 0.5}
125 | m_AnchorMax: {x: 1, y: 0.5}
126 | m_AnchoredPosition: {x: 0, y: 0}
127 | m_SizeDelta: {x: 0, y: 2}
128 | m_Pivot: {x: 0.5, y: 0.5}
129 | --- !u!222 &8129646450602135852
130 | CanvasRenderer:
131 | m_ObjectHideFlags: 0
132 | m_CorrespondingSourceObject: {fileID: 0}
133 | m_PrefabInstance: {fileID: 0}
134 | m_PrefabAsset: {fileID: 0}
135 | m_GameObject: {fileID: 5737290072241045928}
136 | m_CullTransparentMesh: 0
137 | --- !u!114 &4361798502894573864
138 | MonoBehaviour:
139 | m_ObjectHideFlags: 0
140 | m_CorrespondingSourceObject: {fileID: 0}
141 | m_PrefabInstance: {fileID: 0}
142 | m_PrefabAsset: {fileID: 0}
143 | m_GameObject: {fileID: 5737290072241045928}
144 | m_Enabled: 1
145 | m_EditorHideFlags: 0
146 | m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
147 | m_Name:
148 | m_EditorClassIdentifier:
149 | m_Material: {fileID: 0}
150 | m_Color: {r: 1, g: 0, b: 0, a: 1}
151 | m_RaycastTarget: 1
152 | m_OnCullStateChanged:
153 | m_PersistentCalls:
154 | m_Calls: []
155 | m_Sprite: {fileID: 0}
156 | m_Type: 0
157 | m_PreserveAspect: 0
158 | m_FillCenter: 1
159 | m_FillMethod: 4
160 | m_FillAmount: 1
161 | m_FillClockwise: 1
162 | m_FillOrigin: 0
163 | m_UseSpriteMesh: 0
164 | m_PixelsPerUnitMultiplier: 1
165 | --- !u!1 &8302232487628957901
166 | GameObject:
167 | m_ObjectHideFlags: 0
168 | m_CorrespondingSourceObject: {fileID: 0}
169 | m_PrefabInstance: {fileID: 0}
170 | m_PrefabAsset: {fileID: 0}
171 | serializedVersion: 6
172 | m_Component:
173 | - component: {fileID: 5410800989402061637}
174 | - component: {fileID: 4897685042015639722}
175 | - component: {fileID: 5531687200553665693}
176 | - component: {fileID: 7420866095183077720}
177 | m_Layer: 5
178 | m_Name: VerticalScrollView (1)
179 | m_TagString: Untagged
180 | m_Icon: {fileID: 0}
181 | m_NavMeshLayer: 0
182 | m_StaticEditorFlags: 0
183 | m_IsActive: 1
184 | --- !u!224 &5410800989402061637
185 | RectTransform:
186 | m_ObjectHideFlags: 0
187 | m_CorrespondingSourceObject: {fileID: 0}
188 | m_PrefabInstance: {fileID: 0}
189 | m_PrefabAsset: {fileID: 0}
190 | m_GameObject: {fileID: 8302232487628957901}
191 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
192 | m_LocalPosition: {x: 0, y: 0, z: 0}
193 | m_LocalScale: {x: 1, y: 1, z: 1}
194 | m_Children:
195 | - {fileID: 9154662404507672620}
196 | m_Father: {fileID: 0}
197 | m_RootOrder: 0
198 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
199 | m_AnchorMin: {x: 0, y: 0}
200 | m_AnchorMax: {x: 1, y: 0.695}
201 | m_AnchoredPosition: {x: 0, y: 0}
202 | m_SizeDelta: {x: 0, y: 0}
203 | m_Pivot: {x: 0.5, y: 0.5}
204 | --- !u!222 &4897685042015639722
205 | CanvasRenderer:
206 | m_ObjectHideFlags: 0
207 | m_CorrespondingSourceObject: {fileID: 0}
208 | m_PrefabInstance: {fileID: 0}
209 | m_PrefabAsset: {fileID: 0}
210 | m_GameObject: {fileID: 8302232487628957901}
211 | m_CullTransparentMesh: 0
212 | --- !u!114 &5531687200553665693
213 | MonoBehaviour:
214 | m_ObjectHideFlags: 0
215 | m_CorrespondingSourceObject: {fileID: 0}
216 | m_PrefabInstance: {fileID: 0}
217 | m_PrefabAsset: {fileID: 0}
218 | m_GameObject: {fileID: 8302232487628957901}
219 | m_Enabled: 1
220 | m_EditorHideFlags: 0
221 | m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
222 | m_Name:
223 | m_EditorClassIdentifier:
224 | m_Material: {fileID: 0}
225 | m_Color: {r: 1, g: 1, b: 1, a: 0.392}
226 | m_RaycastTarget: 1
227 | m_OnCullStateChanged:
228 | m_PersistentCalls:
229 | m_Calls: []
230 | m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
231 | m_Type: 1
232 | m_PreserveAspect: 0
233 | m_FillCenter: 1
234 | m_FillMethod: 4
235 | m_FillAmount: 1
236 | m_FillClockwise: 1
237 | m_FillOrigin: 0
238 | m_UseSpriteMesh: 0
239 | m_PixelsPerUnitMultiplier: 1
240 | --- !u!114 &7420866095183077720
241 | MonoBehaviour:
242 | m_ObjectHideFlags: 0
243 | m_CorrespondingSourceObject: {fileID: 0}
244 | m_PrefabInstance: {fileID: 0}
245 | m_PrefabAsset: {fileID: 0}
246 | m_GameObject: {fileID: 8302232487628957901}
247 | m_Enabled: 1
248 | m_EditorHideFlags: 0
249 | m_Script: {fileID: 11500000, guid: 4b58cf81a900d4afe8b67215639eacb4, type: 3}
250 | m_Name:
251 | m_EditorClassIdentifier:
252 | m_Content: {fileID: 7365092373963534415}
253 | m_Horizontal: 0
254 | m_Vertical: 1
255 | m_MovementType: 1
256 | m_Elasticity: 0.1
257 | m_Inertia: 1
258 | m_DecelerationRate: 0.135
259 | m_ScrollSensitivity: 1
260 | m_Viewport: {fileID: 9154662404507672620}
261 | m_HorizontalScrollbar: {fileID: 0}
262 | m_VerticalScrollbar: {fileID: 0}
263 | m_HorizontalScrollbarVisibility: 0
264 | m_VerticalScrollbarVisibility: 0
265 | m_HorizontalScrollbarSpacing: 0
266 | m_VerticalScrollbarSpacing: 0
267 | m_OnValueChanged:
268 | m_PersistentCalls:
269 | m_Calls: []
270 | realMovementType: 0
271 | needElasticReturn: 0
272 | clampedPosition: {x: 0, y: 0}
273 | --- !u!1 &8918978811206954904
274 | GameObject:
275 | m_ObjectHideFlags: 0
276 | m_CorrespondingSourceObject: {fileID: 0}
277 | m_PrefabInstance: {fileID: 0}
278 | m_PrefabAsset: {fileID: 0}
279 | serializedVersion: 6
280 | m_Component:
281 | - component: {fileID: 7365092373963534415}
282 | m_Layer: 5
283 | m_Name: Content
284 | m_TagString: Untagged
285 | m_Icon: {fileID: 0}
286 | m_NavMeshLayer: 0
287 | m_StaticEditorFlags: 0
288 | m_IsActive: 1
289 | --- !u!224 &7365092373963534415
290 | RectTransform:
291 | m_ObjectHideFlags: 0
292 | m_CorrespondingSourceObject: {fileID: 0}
293 | m_PrefabInstance: {fileID: 0}
294 | m_PrefabAsset: {fileID: 0}
295 | m_GameObject: {fileID: 8918978811206954904}
296 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
297 | m_LocalPosition: {x: 0, y: 0, z: 0}
298 | m_LocalScale: {x: 1, y: 1, z: 1}
299 | m_Children: []
300 | m_Father: {fileID: 9154662404507672620}
301 | m_RootOrder: 0
302 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
303 | m_AnchorMin: {x: 0.5, y: 0.5}
304 | m_AnchorMax: {x: 0.5, y: 0.5}
305 | m_AnchoredPosition: {x: 0, y: 0}
306 | m_SizeDelta: {x: 332, y: 410}
307 | m_Pivot: {x: 0.5, y: 0.5}
308 |
--------------------------------------------------------------------------------
/Assets/Package/Tests/PlayMode/Resources/VerticalScrollViewTest.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ff9514b4cdcef4504aa59e1fef3140f0
3 | PrefabImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/Package/Tests/PlayMode/com.mukarillo.dynamicscrollrect.playmodetests.asmdef:
--------------------------------------------------------------------------------
1 | {
2 | "name": "com.mukarillo.dynamicscrollrect.playmodetests",
3 | "references": [
4 | "UnityEngine.TestRunner",
5 | "UnityEditor.TestRunner",
6 | "com.mukarillo.dynamicscrollrect"
7 | ],
8 | "includePlatforms": [],
9 | "excludePlatforms": [],
10 | "allowUnsafeCode": false,
11 | "overrideReferences": true,
12 | "precompiledReferences": [
13 | "nunit.framework.dll"
14 | ],
15 | "autoReferenced": false,
16 | "defineConstraints": [
17 | "UNITY_INCLUDE_TESTS"
18 | ],
19 | "versionDefines": []
20 | }
--------------------------------------------------------------------------------
/Assets/Package/Tests/PlayMode/com.mukarillo.dynamicscrollrect.playmodetests.asmdef.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 72959f4169510438ca940f408dcb3ce3
3 | AssemblyDefinitionImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/Package/com.mukarillo.dynamicscrollrect.asmdef:
--------------------------------------------------------------------------------
1 | {
2 | "name": "com.mukarillo.dynamicscrollrect",
3 | "references": [],
4 | "includePlatforms": [
5 | "Android",
6 | "Editor",
7 | "iOS"
8 | ],
9 | "excludePlatforms": [],
10 | "allowUnsafeCode": false,
11 | "overrideReferences": false,
12 | "precompiledReferences": [],
13 | "autoReferenced": true,
14 | "defineConstraints": [],
15 | "versionDefines": []
16 | }
--------------------------------------------------------------------------------
/Assets/Package/com.mukarillo.dynamicscrollrect.asmdef.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 64413644274fc49f3a46e7fdb33e51ca
3 | AssemblyDefinitionImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/Package/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "com.mukarillo.dynamicscrollrect",
3 | "version": "1.0.0",
4 | "displayName": "Unity Dynamic ScrollRect",
5 | "description": "An optimized approach to lists with dozens of elements and a Pooling system",
6 | "unity": "2019.2",
7 | "license": "",
8 | "dependencies": {
9 | },
10 | "keywords": [
11 | "Scroll"
12 | ],
13 | "samples": [
14 | {
15 | "displayName": "How to use sample",
16 | "description": "Showcase of how to use Dynamic ScrollRect",
17 | "path": "Samples~/HowToUse"
18 | }
19 | ],
20 | "author": {
21 | "name": "Mukarillo",
22 | "url": "https://github.com/Mukarillo"
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Assets/Package/package.json.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 5a3ae8398c0ba43a695d8c82d91058e4
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Murillo Pugliesi Lopes
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.
22 |
--------------------------------------------------------------------------------
/Logs/Packages-Update.log:
--------------------------------------------------------------------------------
1 |
2 | === Mon Jun 10 21:56:49 2019
3 |
4 | Packages were changed.
5 | Update Mode: updateDependencies
6 |
7 | The following packages were added:
8 | com.unity.analytics@3.3.2
9 | com.unity.purchasing@2.0.6
10 | com.unity.ads@2.0.8
11 | com.unity.textmeshpro@2.0.0
12 | com.unity.package-manager-ui@2.1.2
13 | com.unity.collab-proxy@1.2.16
14 | com.unity.timeline@1.0.0
15 | com.unity.modules.ai@1.0.0
16 | com.unity.modules.animation@1.0.0
17 | com.unity.modules.assetbundle@1.0.0
18 | com.unity.modules.audio@1.0.0
19 | com.unity.modules.cloth@1.0.0
20 | com.unity.modules.director@1.0.0
21 | com.unity.modules.imageconversion@1.0.0
22 | com.unity.modules.imgui@1.0.0
23 | com.unity.modules.jsonserialize@1.0.0
24 | com.unity.modules.particlesystem@1.0.0
25 | com.unity.modules.physics@1.0.0
26 | com.unity.modules.physics2d@1.0.0
27 | com.unity.modules.screencapture@1.0.0
28 | com.unity.modules.terrain@1.0.0
29 | com.unity.modules.terrainphysics@1.0.0
30 | com.unity.modules.tilemap@1.0.0
31 | com.unity.modules.ui@1.0.0
32 | com.unity.modules.uielements@1.0.0
33 | com.unity.modules.umbra@1.0.0
34 | com.unity.modules.unityanalytics@1.0.0
35 | com.unity.modules.unitywebrequest@1.0.0
36 | com.unity.modules.unitywebrequestassetbundle@1.0.0
37 | com.unity.modules.unitywebrequestaudio@1.0.0
38 | com.unity.modules.unitywebrequesttexture@1.0.0
39 | com.unity.modules.unitywebrequestwww@1.0.0
40 | com.unity.modules.vehicles@1.0.0
41 | com.unity.modules.video@1.0.0
42 | com.unity.modules.vr@1.0.0
43 | com.unity.modules.wind@1.0.0
44 | com.unity.modules.xr@1.0.0
45 | com.unity.multiplayer-hlapi@1.0.2
46 | com.unity.xr.legacyinputhelpers@2.0.2
47 |
--------------------------------------------------------------------------------
/Packages/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "dependencies": {
3 | "com.unity.ads": "2.0.8",
4 | "com.unity.analytics": "3.3.2",
5 | "com.unity.collab-proxy": "1.2.16",
6 | "com.unity.multiplayer-hlapi": "1.0.2",
7 | "com.unity.package-manager-ui": "2.1.2",
8 | "com.unity.purchasing": "2.0.6",
9 | "com.unity.textmeshpro": "2.0.0",
10 | "com.unity.timeline": "1.0.0",
11 | "com.unity.xr.legacyinputhelpers": "2.0.2",
12 | "com.unity.modules.ai": "1.0.0",
13 | "com.unity.modules.animation": "1.0.0",
14 | "com.unity.modules.assetbundle": "1.0.0",
15 | "com.unity.modules.audio": "1.0.0",
16 | "com.unity.modules.cloth": "1.0.0",
17 | "com.unity.modules.director": "1.0.0",
18 | "com.unity.modules.imageconversion": "1.0.0",
19 | "com.unity.modules.imgui": "1.0.0",
20 | "com.unity.modules.jsonserialize": "1.0.0",
21 | "com.unity.modules.particlesystem": "1.0.0",
22 | "com.unity.modules.physics": "1.0.0",
23 | "com.unity.modules.physics2d": "1.0.0",
24 | "com.unity.modules.screencapture": "1.0.0",
25 | "com.unity.modules.terrain": "1.0.0",
26 | "com.unity.modules.terrainphysics": "1.0.0",
27 | "com.unity.modules.tilemap": "1.0.0",
28 | "com.unity.modules.ui": "1.0.0",
29 | "com.unity.modules.uielements": "1.0.0",
30 | "com.unity.modules.umbra": "1.0.0",
31 | "com.unity.modules.unityanalytics": "1.0.0",
32 | "com.unity.modules.unitywebrequest": "1.0.0",
33 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
34 | "com.unity.modules.unitywebrequestaudio": "1.0.0",
35 | "com.unity.modules.unitywebrequesttexture": "1.0.0",
36 | "com.unity.modules.unitywebrequestwww": "1.0.0",
37 | "com.unity.modules.vehicles": "1.0.0",
38 | "com.unity.modules.video": "1.0.0",
39 | "com.unity.modules.vr": "1.0.0",
40 | "com.unity.modules.wind": "1.0.0",
41 | "com.unity.modules.xr": "1.0.0"
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/ProjectSettings/AudioManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!11 &1
4 | AudioManager:
5 | m_ObjectHideFlags: 0
6 | m_Volume: 1
7 | Rolloff Scale: 1
8 | Doppler Factor: 1
9 | Default Speaker Mode: 2
10 | m_SampleRate: 0
11 | m_DSPBufferSize: 0
12 | m_VirtualVoiceCount: 512
13 | m_RealVoiceCount: 32
14 | m_SpatializerPlugin:
15 | m_AmbisonicDecoderPlugin:
16 | m_DisableAudio: 0
17 | m_VirtualizeEffects: 1
18 |
--------------------------------------------------------------------------------
/ProjectSettings/ClusterInputManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!236 &1
4 | ClusterInputManager:
5 | m_ObjectHideFlags: 0
6 | m_Inputs: []
7 |
--------------------------------------------------------------------------------
/ProjectSettings/DynamicsManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!55 &1
4 | PhysicsManager:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 3
7 | m_Gravity: {x: 0, y: -9.81, z: 0}
8 | m_DefaultMaterial: {fileID: 0}
9 | m_BounceThreshold: 2
10 | m_SleepThreshold: 0.005
11 | m_DefaultContactOffset: 0.01
12 | m_DefaultSolverIterations: 6
13 | m_DefaultSolverVelocityIterations: 1
14 | m_QueriesHitBackfaces: 0
15 | m_QueriesHitTriggers: 1
16 | m_EnableAdaptiveForce: 0
17 | m_EnablePCM: 1
18 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
19 | m_AutoSimulation: 1
20 | m_AutoSyncTransforms: 1
21 |
--------------------------------------------------------------------------------
/ProjectSettings/EditorBuildSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!1045 &1
4 | EditorBuildSettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 2
7 | m_Scenes: []
8 |
--------------------------------------------------------------------------------
/ProjectSettings/EditorSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!159 &1
4 | EditorSettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 5
7 | m_ExternalVersionControlSupport: Hidden Meta Files
8 | m_SerializationMode: 2
9 | m_DefaultBehaviorMode: 1
10 | m_SpritePackerMode: 4
11 | m_SpritePackerPaddingPower: 1
12 | m_EtcTextureCompressorBehavior: 1
13 | m_EtcTextureFastCompressor: 1
14 | m_EtcTextureNormalCompressor: 2
15 | m_EtcTextureBestCompressor: 4
16 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd
17 | m_ProjectGenerationRootNamespace:
18 | m_UserGeneratedProjectSuffix:
19 | m_CollabEditorSettings:
20 | inProgressEnabled: 1
21 |
--------------------------------------------------------------------------------
/ProjectSettings/GraphicsSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!30 &1
4 | GraphicsSettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 12
7 | m_Deferred:
8 | m_Mode: 1
9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0}
10 | m_DeferredReflections:
11 | m_Mode: 1
12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0}
13 | m_ScreenSpaceShadows:
14 | m_Mode: 1
15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0}
16 | m_LegacyDeferred:
17 | m_Mode: 1
18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0}
19 | m_DepthNormals:
20 | m_Mode: 1
21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0}
22 | m_MotionVectors:
23 | m_Mode: 1
24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0}
25 | m_LightHalo:
26 | m_Mode: 1
27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0}
28 | m_LensFlare:
29 | m_Mode: 1
30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0}
31 | m_AlwaysIncludedShaders:
32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0}
33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0}
34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0}
35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0}
36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}
38 | m_PreloadedShaders: []
39 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
40 | type: 0}
41 | m_CustomRenderPipeline: {fileID: 0}
42 | m_TransparencySortMode: 0
43 | m_TransparencySortAxis: {x: 0, y: 0, z: 1}
44 | m_DefaultRenderingPath: 1
45 | m_DefaultMobileRenderingPath: 1
46 | m_TierSettings: []
47 | m_LightmapStripping: 0
48 | m_FogStripping: 0
49 | m_InstancingStripping: 0
50 | m_LightmapKeepPlain: 1
51 | m_LightmapKeepDirCombined: 1
52 | m_LightmapKeepDynamicPlain: 1
53 | m_LightmapKeepDynamicDirCombined: 1
54 | m_LightmapKeepShadowMask: 1
55 | m_LightmapKeepSubtractive: 1
56 | m_FogKeepLinear: 1
57 | m_FogKeepExp: 1
58 | m_FogKeepExp2: 1
59 | m_AlbedoSwatchInfos: []
60 | m_LightsUseLinearIntensity: 0
61 | m_LightsUseColorTemperature: 0
62 |
--------------------------------------------------------------------------------
/ProjectSettings/InputManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!13 &1
4 | InputManager:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 2
7 | m_Axes:
8 | - serializedVersion: 3
9 | m_Name: Horizontal
10 | descriptiveName:
11 | descriptiveNegativeName:
12 | negativeButton: left
13 | positiveButton: right
14 | altNegativeButton: a
15 | altPositiveButton: d
16 | gravity: 3
17 | dead: 0.001
18 | sensitivity: 3
19 | snap: 1
20 | invert: 0
21 | type: 0
22 | axis: 0
23 | joyNum: 0
24 | - serializedVersion: 3
25 | m_Name: Vertical
26 | descriptiveName:
27 | descriptiveNegativeName:
28 | negativeButton: down
29 | positiveButton: up
30 | altNegativeButton: s
31 | altPositiveButton: w
32 | gravity: 3
33 | dead: 0.001
34 | sensitivity: 3
35 | snap: 1
36 | invert: 0
37 | type: 0
38 | axis: 0
39 | joyNum: 0
40 | - serializedVersion: 3
41 | m_Name: Fire1
42 | descriptiveName:
43 | descriptiveNegativeName:
44 | negativeButton:
45 | positiveButton: left ctrl
46 | altNegativeButton:
47 | altPositiveButton: mouse 0
48 | gravity: 1000
49 | dead: 0.001
50 | sensitivity: 1000
51 | snap: 0
52 | invert: 0
53 | type: 0
54 | axis: 0
55 | joyNum: 0
56 | - serializedVersion: 3
57 | m_Name: Fire2
58 | descriptiveName:
59 | descriptiveNegativeName:
60 | negativeButton:
61 | positiveButton: left alt
62 | altNegativeButton:
63 | altPositiveButton: mouse 1
64 | gravity: 1000
65 | dead: 0.001
66 | sensitivity: 1000
67 | snap: 0
68 | invert: 0
69 | type: 0
70 | axis: 0
71 | joyNum: 0
72 | - serializedVersion: 3
73 | m_Name: Fire3
74 | descriptiveName:
75 | descriptiveNegativeName:
76 | negativeButton:
77 | positiveButton: left shift
78 | altNegativeButton:
79 | altPositiveButton: mouse 2
80 | gravity: 1000
81 | dead: 0.001
82 | sensitivity: 1000
83 | snap: 0
84 | invert: 0
85 | type: 0
86 | axis: 0
87 | joyNum: 0
88 | - serializedVersion: 3
89 | m_Name: Jump
90 | descriptiveName:
91 | descriptiveNegativeName:
92 | negativeButton:
93 | positiveButton: space
94 | altNegativeButton:
95 | altPositiveButton:
96 | gravity: 1000
97 | dead: 0.001
98 | sensitivity: 1000
99 | snap: 0
100 | invert: 0
101 | type: 0
102 | axis: 0
103 | joyNum: 0
104 | - serializedVersion: 3
105 | m_Name: Mouse X
106 | descriptiveName:
107 | descriptiveNegativeName:
108 | negativeButton:
109 | positiveButton:
110 | altNegativeButton:
111 | altPositiveButton:
112 | gravity: 0
113 | dead: 0
114 | sensitivity: 0.1
115 | snap: 0
116 | invert: 0
117 | type: 1
118 | axis: 0
119 | joyNum: 0
120 | - serializedVersion: 3
121 | m_Name: Mouse Y
122 | descriptiveName:
123 | descriptiveNegativeName:
124 | negativeButton:
125 | positiveButton:
126 | altNegativeButton:
127 | altPositiveButton:
128 | gravity: 0
129 | dead: 0
130 | sensitivity: 0.1
131 | snap: 0
132 | invert: 0
133 | type: 1
134 | axis: 1
135 | joyNum: 0
136 | - serializedVersion: 3
137 | m_Name: Mouse ScrollWheel
138 | descriptiveName:
139 | descriptiveNegativeName:
140 | negativeButton:
141 | positiveButton:
142 | altNegativeButton:
143 | altPositiveButton:
144 | gravity: 0
145 | dead: 0
146 | sensitivity: 0.1
147 | snap: 0
148 | invert: 0
149 | type: 1
150 | axis: 2
151 | joyNum: 0
152 | - serializedVersion: 3
153 | m_Name: Horizontal
154 | descriptiveName:
155 | descriptiveNegativeName:
156 | negativeButton:
157 | positiveButton:
158 | altNegativeButton:
159 | altPositiveButton:
160 | gravity: 0
161 | dead: 0.19
162 | sensitivity: 1
163 | snap: 0
164 | invert: 0
165 | type: 2
166 | axis: 0
167 | joyNum: 0
168 | - serializedVersion: 3
169 | m_Name: Vertical
170 | descriptiveName:
171 | descriptiveNegativeName:
172 | negativeButton:
173 | positiveButton:
174 | altNegativeButton:
175 | altPositiveButton:
176 | gravity: 0
177 | dead: 0.19
178 | sensitivity: 1
179 | snap: 0
180 | invert: 1
181 | type: 2
182 | axis: 1
183 | joyNum: 0
184 | - serializedVersion: 3
185 | m_Name: Fire1
186 | descriptiveName:
187 | descriptiveNegativeName:
188 | negativeButton:
189 | positiveButton: joystick button 0
190 | altNegativeButton:
191 | altPositiveButton:
192 | gravity: 1000
193 | dead: 0.001
194 | sensitivity: 1000
195 | snap: 0
196 | invert: 0
197 | type: 0
198 | axis: 0
199 | joyNum: 0
200 | - serializedVersion: 3
201 | m_Name: Fire2
202 | descriptiveName:
203 | descriptiveNegativeName:
204 | negativeButton:
205 | positiveButton: joystick button 1
206 | altNegativeButton:
207 | altPositiveButton:
208 | gravity: 1000
209 | dead: 0.001
210 | sensitivity: 1000
211 | snap: 0
212 | invert: 0
213 | type: 0
214 | axis: 0
215 | joyNum: 0
216 | - serializedVersion: 3
217 | m_Name: Fire3
218 | descriptiveName:
219 | descriptiveNegativeName:
220 | negativeButton:
221 | positiveButton: joystick button 2
222 | altNegativeButton:
223 | altPositiveButton:
224 | gravity: 1000
225 | dead: 0.001
226 | sensitivity: 1000
227 | snap: 0
228 | invert: 0
229 | type: 0
230 | axis: 0
231 | joyNum: 0
232 | - serializedVersion: 3
233 | m_Name: Jump
234 | descriptiveName:
235 | descriptiveNegativeName:
236 | negativeButton:
237 | positiveButton: joystick button 3
238 | altNegativeButton:
239 | altPositiveButton:
240 | gravity: 1000
241 | dead: 0.001
242 | sensitivity: 1000
243 | snap: 0
244 | invert: 0
245 | type: 0
246 | axis: 0
247 | joyNum: 0
248 | - serializedVersion: 3
249 | m_Name: Submit
250 | descriptiveName:
251 | descriptiveNegativeName:
252 | negativeButton:
253 | positiveButton: return
254 | altNegativeButton:
255 | altPositiveButton: joystick button 0
256 | gravity: 1000
257 | dead: 0.001
258 | sensitivity: 1000
259 | snap: 0
260 | invert: 0
261 | type: 0
262 | axis: 0
263 | joyNum: 0
264 | - serializedVersion: 3
265 | m_Name: Submit
266 | descriptiveName:
267 | descriptiveNegativeName:
268 | negativeButton:
269 | positiveButton: enter
270 | altNegativeButton:
271 | altPositiveButton: space
272 | gravity: 1000
273 | dead: 0.001
274 | sensitivity: 1000
275 | snap: 0
276 | invert: 0
277 | type: 0
278 | axis: 0
279 | joyNum: 0
280 | - serializedVersion: 3
281 | m_Name: Cancel
282 | descriptiveName:
283 | descriptiveNegativeName:
284 | negativeButton:
285 | positiveButton: escape
286 | altNegativeButton:
287 | altPositiveButton: joystick button 1
288 | gravity: 1000
289 | dead: 0.001
290 | sensitivity: 1000
291 | snap: 0
292 | invert: 0
293 | type: 0
294 | axis: 0
295 | joyNum: 0
296 |
--------------------------------------------------------------------------------
/ProjectSettings/NavMeshAreas.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!126 &1
4 | NavMeshProjectSettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 2
7 | areas:
8 | - name: Walkable
9 | cost: 1
10 | - name: Not Walkable
11 | cost: 1
12 | - name: Jump
13 | cost: 2
14 | - name:
15 | cost: 1
16 | - name:
17 | cost: 1
18 | - name:
19 | cost: 1
20 | - name:
21 | cost: 1
22 | - name:
23 | cost: 1
24 | - name:
25 | cost: 1
26 | - name:
27 | cost: 1
28 | - name:
29 | cost: 1
30 | - name:
31 | cost: 1
32 | - name:
33 | cost: 1
34 | - name:
35 | cost: 1
36 | - name:
37 | cost: 1
38 | - name:
39 | cost: 1
40 | - name:
41 | cost: 1
42 | - name:
43 | cost: 1
44 | - name:
45 | cost: 1
46 | - name:
47 | cost: 1
48 | - name:
49 | cost: 1
50 | - name:
51 | cost: 1
52 | - name:
53 | cost: 1
54 | - name:
55 | cost: 1
56 | - name:
57 | cost: 1
58 | - name:
59 | cost: 1
60 | - name:
61 | cost: 1
62 | - name:
63 | cost: 1
64 | - name:
65 | cost: 1
66 | - name:
67 | cost: 1
68 | - name:
69 | cost: 1
70 | - name:
71 | cost: 1
72 | m_LastAgentTypeID: -887442657
73 | m_Settings:
74 | - serializedVersion: 2
75 | agentTypeID: 0
76 | agentRadius: 0.5
77 | agentHeight: 2
78 | agentSlope: 45
79 | agentClimb: 0.75
80 | ledgeDropHeight: 0
81 | maxJumpAcrossDistance: 0
82 | minRegionArea: 2
83 | manualCellSize: 0
84 | cellSize: 0.16666667
85 | manualTileSize: 0
86 | tileSize: 256
87 | accuratePlacement: 0
88 | debug:
89 | m_Flags: 0
90 | m_SettingNames:
91 | - Humanoid
92 |
--------------------------------------------------------------------------------
/ProjectSettings/NetworkManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!149 &1
4 | NetworkManager:
5 | m_ObjectHideFlags: 0
6 | m_DebugLevel: 0
7 | m_Sendrate: 15
8 | m_AssetToPrefab: {}
9 |
--------------------------------------------------------------------------------
/ProjectSettings/Physics2DSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!19 &1
4 | Physics2DSettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 3
7 | m_Gravity: {x: 0, y: -9.81}
8 | m_DefaultMaterial: {fileID: 0}
9 | m_VelocityIterations: 8
10 | m_PositionIterations: 3
11 | m_VelocityThreshold: 1
12 | m_MaxLinearCorrection: 0.2
13 | m_MaxAngularCorrection: 8
14 | m_MaxTranslationSpeed: 100
15 | m_MaxRotationSpeed: 360
16 | m_BaumgarteScale: 0.2
17 | m_BaumgarteTimeOfImpactScale: 0.75
18 | m_TimeToSleep: 0.5
19 | m_LinearSleepTolerance: 0.01
20 | m_AngularSleepTolerance: 2
21 | m_DefaultContactOffset: 0.01
22 | m_AutoSimulation: 1
23 | m_QueriesHitTriggers: 1
24 | m_QueriesStartInColliders: 1
25 | m_ChangeStopsCallbacks: 0
26 | m_CallbacksOnDisable: 1
27 | m_AutoSyncTransforms: 1
28 | m_AlwaysShowColliders: 0
29 | m_ShowColliderSleep: 1
30 | m_ShowColliderContacts: 0
31 | m_ShowColliderAABB: 0
32 | m_ContactArrowScale: 0.2
33 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412}
34 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432}
35 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745}
36 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804}
37 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
38 |
--------------------------------------------------------------------------------
/ProjectSettings/PresetManager.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mukarillo/UnityDynamicScrollRect/fe744ee56614f7a44e4bbd8e13d1bb2cae45edc4/ProjectSettings/PresetManager.asset
--------------------------------------------------------------------------------
/ProjectSettings/ProjectVersion.txt:
--------------------------------------------------------------------------------
1 | m_EditorVersion: 2019.1.1f1
2 | m_EditorVersionWithRevision: 2019.1.1f1 (fef62e97e63b)
3 |
--------------------------------------------------------------------------------
/ProjectSettings/QualitySettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!47 &1
4 | QualitySettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 5
7 | m_CurrentQuality: 5
8 | m_QualitySettings:
9 | - serializedVersion: 2
10 | name: Very Low
11 | pixelLightCount: 0
12 | shadows: 0
13 | shadowResolution: 0
14 | shadowProjection: 1
15 | shadowCascades: 1
16 | shadowDistance: 15
17 | shadowNearPlaneOffset: 3
18 | shadowCascade2Split: 0.33333334
19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
20 | shadowmaskMode: 0
21 | blendWeights: 1
22 | textureQuality: 1
23 | anisotropicTextures: 0
24 | antiAliasing: 0
25 | softParticles: 0
26 | softVegetation: 0
27 | realtimeReflectionProbes: 0
28 | billboardsFaceCameraPosition: 0
29 | vSyncCount: 0
30 | lodBias: 0.3
31 | maximumLODLevel: 0
32 | particleRaycastBudget: 4
33 | asyncUploadTimeSlice: 2
34 | asyncUploadBufferSize: 4
35 | resolutionScalingFixedDPIFactor: 1
36 | excludedTargetPlatforms: []
37 | - serializedVersion: 2
38 | name: Low
39 | pixelLightCount: 0
40 | shadows: 0
41 | shadowResolution: 0
42 | shadowProjection: 1
43 | shadowCascades: 1
44 | shadowDistance: 20
45 | shadowNearPlaneOffset: 3
46 | shadowCascade2Split: 0.33333334
47 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
48 | shadowmaskMode: 0
49 | blendWeights: 2
50 | textureQuality: 0
51 | anisotropicTextures: 0
52 | antiAliasing: 0
53 | softParticles: 0
54 | softVegetation: 0
55 | realtimeReflectionProbes: 0
56 | billboardsFaceCameraPosition: 0
57 | vSyncCount: 0
58 | lodBias: 0.4
59 | maximumLODLevel: 0
60 | particleRaycastBudget: 16
61 | asyncUploadTimeSlice: 2
62 | asyncUploadBufferSize: 4
63 | resolutionScalingFixedDPIFactor: 1
64 | excludedTargetPlatforms: []
65 | - serializedVersion: 2
66 | name: Medium
67 | pixelLightCount: 1
68 | shadows: 1
69 | shadowResolution: 0
70 | shadowProjection: 1
71 | shadowCascades: 1
72 | shadowDistance: 20
73 | shadowNearPlaneOffset: 3
74 | shadowCascade2Split: 0.33333334
75 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
76 | shadowmaskMode: 0
77 | blendWeights: 2
78 | textureQuality: 0
79 | anisotropicTextures: 1
80 | antiAliasing: 0
81 | softParticles: 0
82 | softVegetation: 0
83 | realtimeReflectionProbes: 0
84 | billboardsFaceCameraPosition: 0
85 | vSyncCount: 1
86 | lodBias: 0.7
87 | maximumLODLevel: 0
88 | particleRaycastBudget: 64
89 | asyncUploadTimeSlice: 2
90 | asyncUploadBufferSize: 4
91 | resolutionScalingFixedDPIFactor: 1
92 | excludedTargetPlatforms: []
93 | - serializedVersion: 2
94 | name: High
95 | pixelLightCount: 2
96 | shadows: 2
97 | shadowResolution: 1
98 | shadowProjection: 1
99 | shadowCascades: 2
100 | shadowDistance: 40
101 | shadowNearPlaneOffset: 3
102 | shadowCascade2Split: 0.33333334
103 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
104 | shadowmaskMode: 1
105 | blendWeights: 2
106 | textureQuality: 0
107 | anisotropicTextures: 1
108 | antiAliasing: 0
109 | softParticles: 0
110 | softVegetation: 1
111 | realtimeReflectionProbes: 1
112 | billboardsFaceCameraPosition: 1
113 | vSyncCount: 1
114 | lodBias: 1
115 | maximumLODLevel: 0
116 | particleRaycastBudget: 256
117 | asyncUploadTimeSlice: 2
118 | asyncUploadBufferSize: 4
119 | resolutionScalingFixedDPIFactor: 1
120 | excludedTargetPlatforms: []
121 | - serializedVersion: 2
122 | name: Very High
123 | pixelLightCount: 3
124 | shadows: 2
125 | shadowResolution: 2
126 | shadowProjection: 1
127 | shadowCascades: 2
128 | shadowDistance: 70
129 | shadowNearPlaneOffset: 3
130 | shadowCascade2Split: 0.33333334
131 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
132 | shadowmaskMode: 1
133 | blendWeights: 4
134 | textureQuality: 0
135 | anisotropicTextures: 2
136 | antiAliasing: 2
137 | softParticles: 1
138 | softVegetation: 1
139 | realtimeReflectionProbes: 1
140 | billboardsFaceCameraPosition: 1
141 | vSyncCount: 1
142 | lodBias: 1.5
143 | maximumLODLevel: 0
144 | particleRaycastBudget: 1024
145 | asyncUploadTimeSlice: 2
146 | asyncUploadBufferSize: 4
147 | resolutionScalingFixedDPIFactor: 1
148 | excludedTargetPlatforms: []
149 | - serializedVersion: 2
150 | name: Ultra
151 | pixelLightCount: 4
152 | shadows: 2
153 | shadowResolution: 2
154 | shadowProjection: 1
155 | shadowCascades: 4
156 | shadowDistance: 150
157 | shadowNearPlaneOffset: 3
158 | shadowCascade2Split: 0.33333334
159 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
160 | shadowmaskMode: 1
161 | blendWeights: 4
162 | textureQuality: 0
163 | anisotropicTextures: 2
164 | antiAliasing: 2
165 | softParticles: 1
166 | softVegetation: 1
167 | realtimeReflectionProbes: 1
168 | billboardsFaceCameraPosition: 1
169 | vSyncCount: 1
170 | lodBias: 2
171 | maximumLODLevel: 0
172 | particleRaycastBudget: 4096
173 | asyncUploadTimeSlice: 2
174 | asyncUploadBufferSize: 4
175 | resolutionScalingFixedDPIFactor: 1
176 | excludedTargetPlatforms: []
177 | m_PerPlatformDefaultQuality:
178 | Android: 2
179 | Nintendo 3DS: 5
180 | Nintendo Switch: 5
181 | PS4: 5
182 | PSM: 5
183 | PSP2: 2
184 | Samsung TV: 2
185 | Standalone: 5
186 | Tizen: 2
187 | WebGL: 3
188 | WiiU: 5
189 | Windows Store Apps: 5
190 | XboxOne: 5
191 | iPhone: 2
192 | tvOS: 2
193 |
--------------------------------------------------------------------------------
/ProjectSettings/TagManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!78 &1
4 | TagManager:
5 | serializedVersion: 2
6 | tags: []
7 | layers:
8 | - Default
9 | - TransparentFX
10 | - Ignore Raycast
11 | -
12 | - Water
13 | - UI
14 | -
15 | -
16 | -
17 | -
18 | -
19 | -
20 | -
21 | -
22 | -
23 | -
24 | -
25 | -
26 | -
27 | -
28 | -
29 | -
30 | -
31 | -
32 | -
33 | -
34 | -
35 | -
36 | -
37 | -
38 | -
39 | -
40 | m_SortingLayers:
41 | - name: Default
42 | uniqueID: 0
43 | locked: 0
44 |
--------------------------------------------------------------------------------
/ProjectSettings/TimeManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!5 &1
4 | TimeManager:
5 | m_ObjectHideFlags: 0
6 | Fixed Timestep: 0.02
7 | Maximum Allowed Timestep: 0.33333334
8 | m_TimeScale: 1
9 | Maximum Particle Timestep: 0.03
10 |
--------------------------------------------------------------------------------
/ProjectSettings/UnityConnectSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!310 &1
4 | UnityConnectSettings:
5 | m_ObjectHideFlags: 0
6 | m_Enabled: 0
7 | m_TestMode: 0
8 | m_TestEventUrl:
9 | m_TestConfigUrl:
10 | m_TestInitMode: 0
11 | CrashReportingSettings:
12 | m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes
13 | m_NativeEventUrl: https://perf-events.cloud.unity3d.com/symbolicate
14 | m_Enabled: 0
15 | m_CaptureEditorExceptions: 1
16 | UnityPurchasingSettings:
17 | m_Enabled: 0
18 | m_TestMode: 0
19 | UnityAnalyticsSettings:
20 | m_Enabled: 0
21 | m_InitializeOnStartup: 1
22 | m_TestMode: 0
23 | m_TestEventUrl:
24 | m_TestConfigUrl:
25 | UnityAdsSettings:
26 | m_Enabled: 0
27 | m_InitializeOnStartup: 1
28 | m_TestMode: 0
29 | m_IosGameId:
30 | m_AndroidGameId:
31 | m_GameIds: {}
32 | m_GameId:
33 | PerformanceReportingSettings:
34 | m_Enabled: 0
35 |
--------------------------------------------------------------------------------
/ProjectSettings/VFXManager.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mukarillo/UnityDynamicScrollRect/fe744ee56614f7a44e4bbd8e13d1bb2cae45edc4/ProjectSettings/VFXManager.asset
--------------------------------------------------------------------------------
/ProjectSettings/XRSettings.asset:
--------------------------------------------------------------------------------
1 | {
2 | "m_SettingKeys": [
3 | "VR Device Disabled",
4 | "VR Device User Alert"
5 | ],
6 | "m_SettingValues": [
7 | "False",
8 | "False"
9 | ]
10 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # UnityDynamicScrollRect
2 | An optimized approach to lists with dozens of elements.
3 |
4 |
5 |
6 |
7 |
8 | ## How to use
9 | *you can find a pratical example inside this repository in DynamicScrollScene scene*
10 |
11 | ### 1 - Create a class to store all the information that each element of the list will need.
12 | ```c#
13 | public class ExampleData
14 | {
15 | public int postId;
16 | public int id;
17 | public string name;
18 | public string email;
19 | public string body;
20 | }
21 | ```
22 | ### 2 - Create a class that extends `DynamicScrollObject` and implement its abstract members (make sure to call `base.updateScrollObject(item, index);`) and set the object width and height in `currentWidth` and `currentHeight`.
23 | ```c#
24 | public class ExampleDynamicObject : DynamicScrollObject
25 | {
26 | public override float currentHeight { get; set; }
27 | public override float currentWidth { get; set; }
28 |
29 | private Text idText;
30 | private Text nameEmailText;
31 | private Text bodyText;
32 |
33 | public void Awake()
34 | {
35 | currentHeight = GetComponent().rect.height;
36 | currentWidth = GetComponent().rect.width;
37 |
38 | idText = transform.Find("PostId").GetComponent();
39 | nameEmailText = transform.Find("NameEmail").GetComponent();
40 | bodyText = transform.Find("Body").GetComponent();
41 | }
42 |
43 | public override void updateScrollObject(ExampleData item, int index)
44 | {
45 | base.updateScrollObject(item, index);
46 |
47 | idText.text = item.id.ToString();
48 | nameEmailText.text = string.Format("{0} ({1})", item.name, item.email);
49 | bodyText.text = item.body;
50 | }
51 | }
52 | ```
53 | ### 3 - Create a class to initiate the DynamicList (use DynamicScrollRect instead of ScrollRect)
54 | ```c#
55 | public class ExampleScroll : MonoBehaviour
56 | {
57 | public DynamicScrollRect verticalScroll;
58 | public GameObject referenceObject;
59 |
60 | private DynamicScroll mVerticalDynamicScroll = new DynamicScroll();
61 |
62 | public IEnumerator Start()
63 | {
64 | WWW www = new WWW(@"https://jsonplaceholder.typicode.com/comments");
65 | yield return www;
66 | var data = JsonHelper.getJsonArray(www.text);
67 |
68 | mVerticalDynamicScroll.spacing = 5f;
69 | mVerticalDynamicScroll.Initiate(verticalScroll, data, 0, referenceObject);
70 | }
71 | }
72 | ```
73 |
74 | ## DynamicScroll `public` overview
75 | ### Properties
76 | |name |type |description |
77 | |--|--|--|
78 | |`spacing` |**float** |*Value that represent the spacing between elements of the list* |
79 | |`centralizeOnStop` |**bool** |*If the list should centralize the closest element to the center of the viewport after stop moving* |
80 | |`objectPool` |**readonly Pooling < T1 >** |*The elements of the list* |
81 | |`OnDragEvent` |**Action < Vector2 >** |*Event that triggers whenever the user scrolls the list, the parameter represent the velocity of the drag* |
82 | |`OnBeginDragEvent` |**UnityEvent < PointerEventData >** |*Event that triggers in the first frame of dragging* |
83 | |`OnEndDragEvent` |**UnityEvent < PointerEventData >** |*Event that triggers in the last frame of dragging* |
84 |
85 | ### Methods
86 |
87 | > `dynamicScroll.Initiate`
88 | - *Description*: Initiate the scroll rect with `objReference` objects applying `infoList` data.
89 |
90 | - *Parameters*:
91 |
92 | |name |type |description |
93 | |--|--|--|
94 | |`scrollRect` |**ScrollRect** |*a reference to the scroll rect* |
95 | |`infoList` |**T[]** |*the list with the data information* |
96 | |`startIndex` |**int** |*the item of index `startindex` will be the first element of the list* |
97 | |`objReference` |**GameObject** |*a reference of the object that will be inside the list* |
98 | |`createMoreIfNeeded` |**bool** |*if the list needs more itens, it will create more if `createMoreIfNeeded` == true* |
99 | |`forceAmount` |**int?** |*if setted, it will force `forceAmount` objects to be created at start* |
100 |
101 |
102 | > `dynamicScroll.ChangeList`
103 | - *Description*:
104 | Change the current list of the scroll rect.
105 |
106 | - *Parameters* :
107 |
108 | |name |type |description |
109 | |--|--|--|
110 | |`infoList` |**T[]** |*the list with the data information* |
111 | |`startIndex` |**int** |*the item of index `startindex` will be the first element of the list. If -1, the current index will be setted.* |
112 | |`resetContentPosition` |**bool** |*reset list position* |
113 |
114 |
115 | > `dynamicScroll.RefreshPosition`
116 | - *Description*: Repaint the whole scroll rect. This is useful if any item inside the scroll rect changes the size (`currentWidth` and `currentHeight`).
117 |
118 |
119 | > `dynamicScroll.ToggleScroll`
120 | - *Description*: Enable or Disable the ability to scroll the list.
121 |
122 | - *Parameters* :
123 |
124 | |name |type |description |
125 | |--|--|--|
126 | |`active` |**bool** |*enable or Disable the ability to scroll the list* |
127 |
128 |
129 | > `dynamicScroll.CanMove`
130 | - *Description*: Returns true if all directions send thro parameter are available.
131 |
132 | - *Parameters* :
133 |
134 | |name |type |description |
135 | |--|--|--|
136 | |`directions` |**ScrollDirection** |*Enum flag with all the directions you want to know if are available* |
137 |
138 |
139 | > `dynamicScroll.MoveToIndex`
140 | - *Description*: Tweens the content to centralize the object of index specified in the parameters.
141 |
142 | - *Parameters* :
143 |
144 | |name |type |description |
145 | |--|--|--|
146 | |`i` |**int** |*Index of the element to be centralized* |
147 | |`totalTime` |**float?** |*Total time to the animation happen (if you choose to input this value, the next one will be ignored)* |
148 | |`timePerElement` |**float?** |*This value will be multiplied by the difference between the current centralized element and the target element to get the totalTime* |
149 |
150 | > `dynamicScroll.GetCentralizedObject`
151 | - *Description*: Returns the closest element to the center of the viewport.
152 |
153 | > `dynamicScroll.GetLowest`
154 | - *Description*: Returns the most left (if horizontal scroll) or most bottom (if vertical scroll) T1 object.
155 |
156 | > `dynamicScroll.GetHighest`
157 | - *Description*: Returns the most right (if horizontal scroll) or most upper (if vertical scroll) T1 object.
158 |
--------------------------------------------------------------------------------
/ReadmeAssets/dynamic_list_example.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mukarillo/UnityDynamicScrollRect/fe744ee56614f7a44e4bbd8e13d1bb2cae45edc4/ReadmeAssets/dynamic_list_example.gif
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "com.mukarillo.dynamicscroll",
3 | "displayName": "Unity Dynamic Scroll",
4 | "version": "0.0.1",
5 | "unity": "2019.1",
6 | "description": "An optimized approach to lists with dozens of elements.",
7 | "keywords": ["scrollview", "ui components", "ui"],
8 | "category": "Scroll View",
9 | "dependencies": {}
10 | }
--------------------------------------------------------------------------------